xubh 4 years ago
parent
commit
479377544e

+ 1 - 0
src/main/java/com/minpay/common/service/impl/LogServiceImpl.java

@@ -99,6 +99,7 @@ public class LogServiceImpl implements ILogService {
 			imLog.setDatetime(dateTime);
 			imLog.setResult(errorCode);
 			imLog.setInfo(logInfo);
+			imLog.setBranch(user.getBranchId());
 			imLog.setIp(userIp);
 			db.insertSelective(ImLogMapper.class, imLog);
 		}

+ 32 - 0
src/main/java/com/minpay/db/table/model/ImBranch.java

@@ -116,6 +116,14 @@ public class ImBranch extends AbstractMINBean {
     private String shortname;
 
     /**
+     * This field was generated by MyBatis Generator.
+     * This field corresponds to the database column im_branch.BRH_CHANNEL
+     *
+     * @mbggenerated
+     */
+    private String channel;
+
+    /**
      * This method was generated by MyBatis Generator.
      * This method returns the value of the database column im_branch.BRH_ID
      *
@@ -450,4 +458,28 @@ public class ImBranch extends AbstractMINBean {
     public void setShortname(String shortname) {
         this.shortname = shortname == null ? null : shortname.trim();
     }
+
+    /**
+     * This method was generated by MyBatis Generator.
+     * This method returns the value of the database column im_branch.BRH_CHANNEL
+     *
+     * @return the value of im_branch.BRH_CHANNEL
+     *
+     * @mbggenerated
+     */
+    public String getChannel() {
+        return channel;
+    }
+
+    /**
+     * This method was generated by MyBatis Generator.
+     * This method sets the value of the database column im_branch.BRH_CHANNEL
+     *
+     * @param channel the value for im_branch.BRH_CHANNEL
+     *
+     * @mbggenerated
+     */
+    public void setChannel(String channel) {
+        this.channel = channel == null ? null : channel.trim();
+    }
 }

+ 78 - 0
src/main/java/com/minpay/db/table/model/ImBranchExample.java

@@ -1271,6 +1271,84 @@ public class ImBranchExample {
             addCriterion("BRH_SHORTNAME not between", value1, value2, "shortname");
             return (Criteria) this;
         }
+
+        public Criteria andChannelIsNull() {
+            addCriterion("BRH_CHANNEL is null");
+            return (Criteria) this;
+        }
+
+        public Criteria andChannelIsNotNull() {
+            addCriterion("BRH_CHANNEL is not null");
+            return (Criteria) this;
+        }
+
+        public Criteria andChannelEqualTo(String value) {
+            if(value == null ){
+                andChannelIsNull();
+            } else {
+                addCriterion("BRH_CHANNEL =", value, "channel");
+            }
+            return (Criteria) this;
+        }
+
+        public Criteria andChannelNotEqualTo(String value) {
+            if(value == null ){
+                andChannelIsNotNull();
+            } else {
+                addCriterion("BRH_CHANNEL <>", value, "channel");
+            }
+            return (Criteria) this;
+        }
+
+        public Criteria andChannelGreaterThan(String value) {
+            addCriterion("BRH_CHANNEL >", value, "channel");
+            return (Criteria) this;
+        }
+
+        public Criteria andChannelGreaterThanOrEqualTo(String value) {
+            addCriterion("BRH_CHANNEL >=", value, "channel");
+            return (Criteria) this;
+        }
+
+        public Criteria andChannelLessThan(String value) {
+            addCriterion("BRH_CHANNEL <", value, "channel");
+            return (Criteria) this;
+        }
+
+        public Criteria andChannelLessThanOrEqualTo(String value) {
+            addCriterion("BRH_CHANNEL <=", value, "channel");
+            return (Criteria) this;
+        }
+
+        public Criteria andChannelLike(String value) {
+            addCriterion("BRH_CHANNEL like", value, "channel");
+            return (Criteria) this;
+        }
+
+        public Criteria andChannelNotLike(String value) {
+            addCriterion("BRH_CHANNEL not like", value, "channel");
+            return (Criteria) this;
+        }
+
+        public Criteria andChannelIn(List<String> values) {
+            addCriterion("BRH_CHANNEL in", values, "channel");
+            return (Criteria) this;
+        }
+
+        public Criteria andChannelNotIn(List<String> values) {
+            addCriterion("BRH_CHANNEL not in", values, "channel");
+            return (Criteria) this;
+        }
+
+        public Criteria andChannelBetween(String value1, String value2) {
+            addCriterion("BRH_CHANNEL between", value1, value2, "channel");
+            return (Criteria) this;
+        }
+
+        public Criteria andChannelNotBetween(String value1, String value2) {
+            addCriterion("BRH_CHANNEL not between", value1, value2, "channel");
+            return (Criteria) this;
+        }
     }
 
     /**

+ 32 - 0
src/main/java/com/minpay/db/table/model/ImLog.java

@@ -76,6 +76,14 @@ public class ImLog extends AbstractMINBean {
     private String state;
 
     /**
+     * This field was generated by MyBatis Generator.
+     * This field corresponds to the database column im_log.LOG_BRANCH
+     *
+     * @mbggenerated
+     */
+    private String branch;
+
+    /**
      * This method was generated by MyBatis Generator.
      * This method returns the value of the database column im_log.LOG_LOGNO
      *
@@ -290,4 +298,28 @@ public class ImLog extends AbstractMINBean {
     public void setState(String state) {
         this.state = state == null ? null : state.trim();
     }
+
+    /**
+     * This method was generated by MyBatis Generator.
+     * This method returns the value of the database column im_log.LOG_BRANCH
+     *
+     * @return the value of im_log.LOG_BRANCH
+     *
+     * @mbggenerated
+     */
+    public String getBranch() {
+        return branch;
+    }
+
+    /**
+     * This method was generated by MyBatis Generator.
+     * This method sets the value of the database column im_log.LOG_BRANCH
+     *
+     * @param branch the value for im_log.LOG_BRANCH
+     *
+     * @mbggenerated
+     */
+    public void setBranch(String branch) {
+        this.branch = branch == null ? null : branch.trim();
+    }
 }

+ 78 - 0
src/main/java/com/minpay/db/table/model/ImLogExample.java

@@ -891,6 +891,84 @@ public class ImLogExample {
             addCriterion("LOG_STATE not between", value1, value2, "state");
             return (Criteria) this;
         }
+
+        public Criteria andBranchIsNull() {
+            addCriterion("LOG_BRANCH is null");
+            return (Criteria) this;
+        }
+
+        public Criteria andBranchIsNotNull() {
+            addCriterion("LOG_BRANCH is not null");
+            return (Criteria) this;
+        }
+
+        public Criteria andBranchEqualTo(String value) {
+            if(value == null ){
+                andBranchIsNull();
+            } else {
+                addCriterion("LOG_BRANCH =", value, "branch");
+            }
+            return (Criteria) this;
+        }
+
+        public Criteria andBranchNotEqualTo(String value) {
+            if(value == null ){
+                andBranchIsNotNull();
+            } else {
+                addCriterion("LOG_BRANCH <>", value, "branch");
+            }
+            return (Criteria) this;
+        }
+
+        public Criteria andBranchGreaterThan(String value) {
+            addCriterion("LOG_BRANCH >", value, "branch");
+            return (Criteria) this;
+        }
+
+        public Criteria andBranchGreaterThanOrEqualTo(String value) {
+            addCriterion("LOG_BRANCH >=", value, "branch");
+            return (Criteria) this;
+        }
+
+        public Criteria andBranchLessThan(String value) {
+            addCriterion("LOG_BRANCH <", value, "branch");
+            return (Criteria) this;
+        }
+
+        public Criteria andBranchLessThanOrEqualTo(String value) {
+            addCriterion("LOG_BRANCH <=", value, "branch");
+            return (Criteria) this;
+        }
+
+        public Criteria andBranchLike(String value) {
+            addCriterion("LOG_BRANCH like", value, "branch");
+            return (Criteria) this;
+        }
+
+        public Criteria andBranchNotLike(String value) {
+            addCriterion("LOG_BRANCH not like", value, "branch");
+            return (Criteria) this;
+        }
+
+        public Criteria andBranchIn(List<String> values) {
+            addCriterion("LOG_BRANCH in", values, "branch");
+            return (Criteria) this;
+        }
+
+        public Criteria andBranchNotIn(List<String> values) {
+            addCriterion("LOG_BRANCH not in", values, "branch");
+            return (Criteria) this;
+        }
+
+        public Criteria andBranchBetween(String value1, String value2) {
+            addCriterion("LOG_BRANCH between", value1, value2, "branch");
+            return (Criteria) this;
+        }
+
+        public Criteria andBranchNotBetween(String value1, String value2) {
+            addCriterion("LOG_BRANCH not between", value1, value2, "branch");
+            return (Criteria) this;
+        }
     }
 
     /**

+ 11 - 2
src/main/java/com/minpay/huicai/personmanage/action/LogManageAction.java

@@ -1,6 +1,8 @@
 package com.minpay.huicai.personmanage.action;
 
+import com.min.util.CommonUtil;
 import com.minpay.common.bean.User;
+import com.minpay.common.constant.Constant;
 import com.minpay.common.format.IFormatService;
 import com.minpay.db.table.mapper.ImLogMapper;
 import com.minpay.db.table.model.ImLog;
@@ -73,8 +75,15 @@ public class LogManageAction implements IMINAction {
 		// 创建查询条件
 		Map<String, String> p = new HashMap<String, String>();
 		//设置所属机构筛选条件
-		//String branchId = "";
-		p.put("branchid", branchid);
+		if(CommonUtil.isEmpty(branchid)){
+			if(Constant.ADMINISTRATION_SYSTEM_NUMBER.equals(user.getBranchId())){
+
+			}else{
+				p.put("branchid", user.getBranchId());
+			}
+		}else{
+			p.put("branchid", branchid);
+		}
 		//p.put("date", date);
 		if(!Str.isEmptyMaskNull(date)) {
 			String [] datas = date.split("-");

+ 20 - 5
src/main/resources/com/minpay/db/table/mapper/ImBranchMapper.xml

@@ -20,6 +20,7 @@
     <result column="BRH_PERSON" jdbcType="VARCHAR" property="person" />
     <result column="BRH_PHONE" jdbcType="VARCHAR" property="phone" />
     <result column="BRH_SHORTNAME" jdbcType="VARCHAR" property="shortname" />
+    <result column="BRH_CHANNEL" jdbcType="VARCHAR" property="channel" />
   </resultMap>
   <sql id="Example_Where_Clause">
     <!--
@@ -93,7 +94,7 @@
       This element is automatically generated by MyBatis Generator, do not modify.
     -->
     BRH_ID, BRH_NAME, BRH_CORE_ID, BRH_LEVEL, BRH_PARENTID, BRH_REGIONID, BRH_DESC, BRH_ADDRESS, 
-    BRH_DEALBRANCH, BRH_CORBRH, BRH_STT, BRH_PERSON, BRH_PHONE, BRH_SHORTNAME
+    BRH_DEALBRANCH, BRH_CORBRH, BRH_STT, BRH_PERSON, BRH_PHONE, BRH_SHORTNAME, BRH_CHANNEL
   </sql>
   <select id="selectByExample" parameterType="com.minpay.db.table.model.ImBranchExample" resultMap="BaseResultMap">
     <!--
@@ -150,12 +151,12 @@
       BRH_LEVEL, BRH_PARENTID, BRH_REGIONID, 
       BRH_DESC, BRH_ADDRESS, BRH_DEALBRANCH, 
       BRH_CORBRH, BRH_STT, BRH_PERSON, BRH_PHONE, 
-      BRH_SHORTNAME)
+      BRH_SHORTNAME, BRH_CHANNEL)
     values (#{id,jdbcType=VARCHAR}, #{name,jdbcType=VARCHAR}, #{coreId,jdbcType=VARCHAR}, 
       #{level,jdbcType=INTEGER}, #{parentid,jdbcType=VARCHAR}, #{regionid,jdbcType=VARCHAR}, 
       #{desc,jdbcType=VARCHAR}, #{address,jdbcType=VARCHAR}, #{dealbranch,jdbcType=VARCHAR}, 
       #{corbrh,jdbcType=VARCHAR}, #{stt,jdbcType=CHAR}, #{person,jdbcType=VARCHAR}, #{phone,jdbcType=VARCHAR}, 
-      #{shortname,jdbcType=VARCHAR})
+      #{shortname,jdbcType=VARCHAR}, #{channel,jdbcType=VARCHAR})
   </insert>
   <insert id="insertSelective" parameterType="com.minpay.db.table.model.ImBranch">
     <!--
@@ -206,6 +207,9 @@
       <if test="shortname != null">
         BRH_SHORTNAME,
       </if>
+      <if test="channel != null">
+        BRH_CHANNEL,
+      </if>
     </trim>
     <trim prefix="values (" suffix=")" suffixOverrides=",">
       <if test="id != null">
@@ -250,6 +254,9 @@
       <if test="shortname != null">
         #{shortname,jdbcType=VARCHAR},
       </if>
+      <if test="channel != null">
+        #{channel,jdbcType=VARCHAR},
+      </if>
     </trim>
   </insert>
   <select id="countByExample" parameterType="com.minpay.db.table.model.ImBranchExample" resultType="java.lang.Integer">
@@ -311,6 +318,9 @@
       <if test="record.shortname != null">
         BRH_SHORTNAME = #{record.shortname,jdbcType=VARCHAR},
       </if>
+      <if test="record.channel != null">
+        BRH_CHANNEL = #{record.channel,jdbcType=VARCHAR},
+      </if>
     </set>
     <if test="_parameter != null">
       <include refid="Update_By_Example_Where_Clause" />
@@ -335,7 +345,8 @@
       BRH_STT = #{record.stt,jdbcType=CHAR},
       BRH_PERSON = #{record.person,jdbcType=VARCHAR},
       BRH_PHONE = #{record.phone,jdbcType=VARCHAR},
-      BRH_SHORTNAME = #{record.shortname,jdbcType=VARCHAR}
+      BRH_SHORTNAME = #{record.shortname,jdbcType=VARCHAR},
+      BRH_CHANNEL = #{record.channel,jdbcType=VARCHAR}
     <if test="_parameter != null">
       <include refid="Update_By_Example_Where_Clause" />
     </if>
@@ -386,6 +397,9 @@
       <if test="shortname != null">
         BRH_SHORTNAME = #{shortname,jdbcType=VARCHAR},
       </if>
+      <if test="channel != null">
+        BRH_CHANNEL = #{channel,jdbcType=VARCHAR},
+      </if>
     </set>
     where BRH_ID = #{id,jdbcType=VARCHAR}
   </update>
@@ -407,7 +421,8 @@
       BRH_STT = #{stt,jdbcType=CHAR},
       BRH_PERSON = #{person,jdbcType=VARCHAR},
       BRH_PHONE = #{phone,jdbcType=VARCHAR},
-      BRH_SHORTNAME = #{shortname,jdbcType=VARCHAR}
+      BRH_SHORTNAME = #{shortname,jdbcType=VARCHAR},
+      BRH_CHANNEL = #{channel,jdbcType=VARCHAR}
     where BRH_ID = #{id,jdbcType=VARCHAR}
   </update>
 </mapper>

+ 22 - 5
src/main/resources/com/minpay/db/table/mapper/ImLogMapper.xml

@@ -15,6 +15,7 @@
     <result column="LOG_INFO" jdbcType="VARCHAR" property="info" />
     <result column="LOG_IP" jdbcType="VARCHAR" property="ip" />
     <result column="LOG_STATE" jdbcType="VARCHAR" property="state" />
+    <result column="LOG_BRANCH" jdbcType="VARCHAR" property="branch" />
   </resultMap>
   <sql id="Example_Where_Clause">
     <!--
@@ -88,7 +89,7 @@
       This element is automatically generated by MyBatis Generator, do not modify.
     -->
     LOG_LOGNO, LOG_DATETIME, LOG_USERID, LOG_BSNCODE, LOG_RESULT, LOG_CONTEXTID, LOG_INFO, 
-    LOG_IP, LOG_STATE
+    LOG_IP, LOG_STATE, LOG_BRANCH
   </sql>
   <select id="selectByExample" parameterType="com.minpay.db.table.model.ImLogExample" resultMap="BaseResultMap">
     <!--
@@ -143,10 +144,12 @@
     -->
     insert into im_log (LOG_LOGNO, LOG_DATETIME, LOG_USERID, 
       LOG_BSNCODE, LOG_RESULT, LOG_CONTEXTID, 
-      LOG_INFO, LOG_IP, LOG_STATE)
+      LOG_INFO, LOG_IP, LOG_STATE, LOG_BRANCH
+      )
     values (#{logno,jdbcType=CHAR}, #{datetime,jdbcType=CHAR}, #{userid,jdbcType=VARCHAR}, 
       #{bsncode,jdbcType=VARCHAR}, #{result,jdbcType=CHAR}, #{contextid,jdbcType=VARCHAR}, 
-      #{info,jdbcType=VARCHAR}, #{ip,jdbcType=VARCHAR}, #{state,jdbcType=VARCHAR})
+      #{info,jdbcType=VARCHAR}, #{ip,jdbcType=VARCHAR}, #{state,jdbcType=VARCHAR}, #{branch,jdbcType=VARCHAR}
+      )
   </insert>
   <insert id="insertSelective" parameterType="com.minpay.db.table.model.ImLog">
     <!--
@@ -182,6 +185,9 @@
       <if test="state != null">
         LOG_STATE,
       </if>
+      <if test="branch != null">
+        LOG_BRANCH,
+      </if>
     </trim>
     <trim prefix="values (" suffix=")" suffixOverrides=",">
       <if test="logno != null">
@@ -211,6 +217,9 @@
       <if test="state != null">
         #{state,jdbcType=VARCHAR},
       </if>
+      <if test="branch != null">
+        #{branch,jdbcType=VARCHAR},
+      </if>
     </trim>
   </insert>
   <select id="countByExample" parameterType="com.minpay.db.table.model.ImLogExample" resultType="java.lang.Integer">
@@ -257,6 +266,9 @@
       <if test="record.state != null">
         LOG_STATE = #{record.state,jdbcType=VARCHAR},
       </if>
+      <if test="record.branch != null">
+        LOG_BRANCH = #{record.branch,jdbcType=VARCHAR},
+      </if>
     </set>
     <if test="_parameter != null">
       <include refid="Update_By_Example_Where_Clause" />
@@ -276,7 +288,8 @@
       LOG_CONTEXTID = #{record.contextid,jdbcType=VARCHAR},
       LOG_INFO = #{record.info,jdbcType=VARCHAR},
       LOG_IP = #{record.ip,jdbcType=VARCHAR},
-      LOG_STATE = #{record.state,jdbcType=VARCHAR}
+      LOG_STATE = #{record.state,jdbcType=VARCHAR},
+      LOG_BRANCH = #{record.branch,jdbcType=VARCHAR}
     <if test="_parameter != null">
       <include refid="Update_By_Example_Where_Clause" />
     </if>
@@ -312,6 +325,9 @@
       <if test="state != null">
         LOG_STATE = #{state,jdbcType=VARCHAR},
       </if>
+      <if test="branch != null">
+        LOG_BRANCH = #{branch,jdbcType=VARCHAR},
+      </if>
     </set>
     where LOG_LOGNO = #{logno,jdbcType=CHAR}
   </update>
@@ -328,7 +344,8 @@
       LOG_CONTEXTID = #{contextid,jdbcType=VARCHAR},
       LOG_INFO = #{info,jdbcType=VARCHAR},
       LOG_IP = #{ip,jdbcType=VARCHAR},
-      LOG_STATE = #{state,jdbcType=VARCHAR}
+      LOG_STATE = #{state,jdbcType=VARCHAR},
+      LOG_BRANCH = #{branch,jdbcType=VARCHAR}
     where LOG_LOGNO = #{logno,jdbcType=CHAR}
   </update>
 </mapper>

+ 2 - 2
src/main/resources/com/minpay/db/table/own/mapper/UserMapper.xml

@@ -211,7 +211,7 @@
 			LEFT JOIN im_user u ON u.USR_ID=w.LOG_USERID
 			LEFT JOIN im_user_role_rel d ON u.usr_id=d.urr_userid 
 			LEFT JOIN im_role r ON d.urr_roleid=r.rol_id
-			LEFT JOIN im_branch b ON u.usr_branchid=b.brh_id
+			LEFT JOIN im_branch b ON w.LOG_BRANCH=b.brh_id
 
 		WHERE 1=1
 		and w.LOG_STATE = 0
@@ -219,7 +219,7 @@
 			and r.rol_id = #{roleid,jdbcType=VARCHAR}
 		</if>
 		<if test="branchid != null and branchid != ''">
-			and u.usr_branchid = #{branchid,jdbcType=VARCHAR}
+			and w.LOG_BRANCH = #{branchid,jdbcType=VARCHAR}
 		</if>
 		<if test="bId != null and bId != ''">
 			and a.usr_branchid in(SELECT BRH_ID  FROM im_branch WHERE BRH_ID = #{bId,jdbcType=VARCHAR} OR BRH_PARENTID = #{bId,jdbcType=VARCHAR})