Commit d3c8435c authored by 赵啸非's avatar 赵啸非

添加更新基础区域

parent d126e74e
...@@ -78,6 +78,11 @@ public class UserEntity extends UserVo implements IUser { ...@@ -78,6 +78,11 @@ public class UserEntity extends UserVo implements IUser {
*/ */
private String lastLoginAddress; private String lastLoginAddress;
/**
* 代办员工id
*/
private Long customerId;
public void setSiteId(Long siteId) { public void setSiteId(Long siteId) {
this.siteId = siteId; this.siteId = siteId;
} }
...@@ -238,7 +243,7 @@ public class UserEntity extends UserVo implements IUser { ...@@ -238,7 +243,7 @@ public class UserEntity extends UserVo implements IUser {
@Override @Override
public Long getCustomerId() { public Long getCustomerId() {
return null; return this.customerId;
} }
@Override @Override
...@@ -343,7 +348,10 @@ public class UserEntity extends UserVo implements IUser { ...@@ -343,7 +348,10 @@ public class UserEntity extends UserVo implements IUser {
} }
@Override
public void setCustomerId(Long customerId) {
this.customerId = customerId;
}
@Override @Override
public int hashCode() { public int hashCode() {
......
<?xml version="1.0" encoding="UTF-8"?> <?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"mybatis-3-mapper.dtd"> "mybatis-3-mapper.dtd">
<mapper namespace="com.mortals.xhx.base.system.user.dao.ibatis.UserDaoImpl"> <mapper namespace="com.mortals.xhx.module.user.dao.ibatis.UserDaoImpl">
<!-- 字段和属性映射 --> <!-- 字段和属性映射 -->
<resultMap type="UserEntity" id="UserEntity-Map"> <resultMap type="UserEntity" id="UserEntity-Map">
...@@ -25,6 +25,7 @@ ...@@ -25,6 +25,7 @@
<result property="createUserName" column="createUserName" /> <result property="createUserName" column="createUserName" />
<result property="lastLoginTime" column="lastLoginTime" /> <result property="lastLoginTime" column="lastLoginTime" />
<result property="lastLoginAddress" column="lastLoginAddress" /> <result property="lastLoginAddress" column="lastLoginAddress" />
<result property="customerId" column="customerId" />
</resultMap> </resultMap>
<!-- 表所有列 --> <!-- 表所有列 -->
...@@ -90,23 +91,26 @@ ...@@ -90,23 +91,26 @@
<if test="(data == null) or (data != null and ( colPickMode == 0 and !data.containsKey('lastLoginAddress') or colPickMode == 1 and data.containsKey('lastLoginAddress')))"> <if test="(data == null) or (data != null and ( colPickMode == 0 and !data.containsKey('lastLoginAddress') or colPickMode == 1 and data.containsKey('lastLoginAddress')))">
a.lastLoginAddress, a.lastLoginAddress,
</if> </if>
<if test="(data == null) or (data != null and ( colPickMode == 0 and !data.containsKey('customerId') or colPickMode == 1 and data.containsKey('customerId')))">
a.customerId,
</if>
</trim> </trim>
</sql> </sql>
<!-- 新增 区分主键自增加还是业务插入 --> <!-- 新增 区分主键自增加还是业务插入 -->
<insert id="insert" parameterType="UserEntity" useGeneratedKeys="true" keyProperty="id"> <insert id="insert" parameterType="UserEntity" useGeneratedKeys="true" keyProperty="id">
insert into mortals_agent_user insert into mortals_agent_user
(loginName,loginPwd,loginLimitAddress,realName,mobile,phone,email,qq,open_id,company_id,userType,siteIds,areaCodes,status,createTime,createUserId,createUserName,lastLoginTime,lastLoginAddress) (loginName,loginPwd,loginLimitAddress,realName,mobile,phone,email,qq,open_id,company_id,userType,siteIds,areaCodes,status,createTime,createUserId,createUserName,lastLoginTime,lastLoginAddress,customerId)
VALUES VALUES
(#{loginName},#{loginPwd},#{loginLimitAddress},#{realName},#{mobile},#{phone},#{email},#{qq},#{openId},#{companyId},#{userType},#{siteIds},#{areaCodes},#{status},#{createTime},#{createUserId},#{createUserName},#{lastLoginTime},#{lastLoginAddress}) (#{loginName},#{loginPwd},#{loginLimitAddress},#{realName},#{mobile},#{phone},#{email},#{qq},#{openId},#{companyId},#{userType},#{siteIds},#{areaCodes},#{status},#{createTime},#{createUserId},#{createUserName},#{lastLoginTime},#{lastLoginAddress},#{customerId})
</insert> </insert>
<!-- 批量新增 --> <!-- 批量新增 -->
<insert id="insertBatch" parameterType="paramDto"> <insert id="insertBatch" parameterType="paramDto">
insert into mortals_agent_user insert into mortals_agent_user
(loginName,loginPwd,loginLimitAddress,realName,mobile,phone,email,qq,open_id,company_id,userType,siteIds,areaCodes,status,createTime,createUserId,createUserName,lastLoginTime,lastLoginAddress) (loginName,loginPwd,loginLimitAddress,realName,mobile,phone,email,qq,open_id,company_id,userType,siteIds,areaCodes,status,createTime,createUserId,createUserName,lastLoginTime,lastLoginAddress,customerId)
VALUES VALUES
<foreach collection="data.dataList" item="item" index="index" separator="," > <foreach collection="data.dataList" item="item" index="index" separator="," >
(#{item.loginName},#{item.loginPwd},#{item.loginLimitAddress},#{item.realName},#{item.mobile},#{item.phone},#{item.email},#{item.qq},#{item.openId},#{item.companyId},#{item.userType},#{item.siteIds},#{item.areaCodes},#{item.status},#{item.createTime},#{item.createUserId},#{item.createUserName},#{item.lastLoginTime},#{item.lastLoginAddress}) (#{item.loginName},#{item.loginPwd},#{item.loginLimitAddress},#{item.realName},#{item.mobile},#{item.phone},#{item.email},#{item.qq},#{item.openId},#{item.companyId},#{item.userType},#{item.siteIds},#{item.areaCodes},#{item.status},#{item.createTime},#{item.createUserId},#{item.createUserName},#{item.lastLoginTime},#{item.lastLoginAddress},#{item.customerId})
</foreach> </foreach>
</insert> </insert>
...@@ -185,6 +189,12 @@ ...@@ -185,6 +189,12 @@
<if test="(colPickMode==0 and data.containsKey('lastLoginAddress')) or (colPickMode==1 and !data.containsKey('lastLoginAddress'))"> <if test="(colPickMode==0 and data.containsKey('lastLoginAddress')) or (colPickMode==1 and !data.containsKey('lastLoginAddress'))">
a.lastLoginAddress=#{data.lastLoginAddress}, a.lastLoginAddress=#{data.lastLoginAddress},
</if> </if>
<if test="(colPickMode==0 and data.containsKey('customerId')) or (colPickMode==1 and !data.containsKey('customerId'))">
a.customerId=#{data.customerId},
</if>
<if test="(colPickMode==0 and data.containsKey('customerIdIncrement')) or (colPickMode==1 and !data.containsKey('customerIdIncrement'))">
a.customerId=ifnull(a.customerId,0) + #{data.customerIdIncrement},
</if>
</trim> </trim>
<trim suffixOverrides="where" suffix=""> <trim suffixOverrides="where" suffix="">
where where
...@@ -350,6 +360,18 @@ ...@@ -350,6 +360,18 @@
</if> </if>
</foreach> </foreach>
</trim> </trim>
<trim prefix="customerId=(case" suffix="ELSE customerId end),">
<foreach collection="data.dataList" item="item" index="index" separator="" >
<choose>
<when test="(colPickMode==0 and item.containsKey('customerId')) or (colPickMode==1 and !item.containsKey('customerId'))">
when a.id=#{item.id} then #{item.customerId}
</when>
<when test="(colPickMode==0 and item.containsKey('customerIdIncrement')) or (colPickMode==1 and !item.containsKey('customerIdIncrement'))">
when a.id=#{item.id} then ifnull(a.customerId,0) + #{item.customerIdIncrement}
</when>
</choose>
</foreach>
</trim>
</trim> </trim>
where id in where id in
<foreach collection="data.dataList" item="item" index="index" open="(" separator="," close=")"> <foreach collection="data.dataList" item="item" index="index" open="(" separator="," close=")">
...@@ -908,6 +930,33 @@ ...@@ -908,6 +930,33 @@
#{item} #{item}
</foreach> </foreach>
</if> </if>
<if test="conditionParamRef.containsKey('customerId')">
<if test="conditionParamRef.customerId != null ">
${_conditionType_} a.customerId = #{${_conditionParam_}.customerId}
</if>
<if test="conditionParamRef.customerId == null">
${_conditionType_} a.customerId is null
</if>
</if>
<if test="conditionParamRef.containsKey('customerIdList') and conditionParamRef.customerIdList.size() > 0">
${_conditionType_} a.customerId in
<foreach collection="conditionParamRef.customerIdList" open="(" close=")" index="index" item="item" separator=",">
#{item}
</foreach>
</if>
<if test="conditionParamRef.containsKey('customerIdNotList') and conditionParamRef.customerIdNotList.size() > 0">
${_conditionType_} a.customerId not in
<foreach collection="conditionParamRef.customerIdNotList" open="(" close=")" index="index" item="item" separator=",">
#{item}
</foreach>
</if>
<if test="conditionParamRef.containsKey('customerIdStart') and conditionParamRef.customerIdStart != null">
${_conditionType_} a.customerId <![CDATA[ >= ]]> #{${_conditionParam_}.customerIdStart}
</if>
<if test="conditionParamRef.containsKey('customerIdEnd') and conditionParamRef.customerIdEnd != null">
${_conditionType_} a.customerId <![CDATA[ <= ]]> #{${_conditionParam_}.customerIdEnd}
</if>
</sql> </sql>
<sql id="_orderCols_"> <sql id="_orderCols_">
<if test="orderColList != null and !orderColList.isEmpty()"> <if test="orderColList != null and !orderColList.isEmpty()">
...@@ -947,6 +996,13 @@ ...@@ -947,6 +996,13 @@
</foreach> </foreach>
, ,
</if> </if>
<if test="conditionParamRef.containsKey('customerIdList') and conditionParamRef.customerIdList.size() > 0">
field(a.customerId,
<foreach collection="conditionParamRef.customerIdList" open="" close=")" index="index" item="item" separator=",">
#{item}
</foreach>
,
</if>
<trim suffixOverrides="," suffix=""> <trim suffixOverrides="," suffix="">
<foreach collection="orderColList" open="" close="" index="index" item="item" separator=","> <foreach collection="orderColList" open="" close="" index="index" item="item" separator=",">
a.${item.colName} ${item.sortKind} a.${item.colName} ${item.sortKind}
...@@ -991,6 +1047,13 @@ ...@@ -991,6 +1047,13 @@
</foreach> </foreach>
, ,
</if> </if>
<if test="conditionParamRef.containsKey('customerIdList') and conditionParamRef.customerIdList.size() > 0">
field(a.customerId,
<foreach collection="conditionParamRef.customerIdList" open="" close=")" index="index" item="item" separator=",">
#{item}
</foreach>
,
</if>
<trim suffixOverrides="," suffix=""> <trim suffixOverrides="," suffix="">
<if test="orderCol.containsKey('id')"> <if test="orderCol.containsKey('id')">
a.id a.id
...@@ -1092,6 +1155,11 @@ ...@@ -1092,6 +1155,11 @@
<if test='orderCol.lastLoginAddress != null and "DESC".equalsIgnoreCase(orderCol.lastLoginAddress)'>DESC</if> <if test='orderCol.lastLoginAddress != null and "DESC".equalsIgnoreCase(orderCol.lastLoginAddress)'>DESC</if>
, ,
</if> </if>
<if test="orderCol.containsKey('customerId')">
a.customerId
<if test='orderCol.customerId != null and "DESC".equalsIgnoreCase(orderCol.customerId)'>DESC</if>
,
</if>
</trim> </trim>
</if> </if>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment