Commit bf846749 authored by 廖旭伟's avatar 廖旭伟

用户表增加昵称属性

parent f0578d8f
......@@ -83,6 +83,7 @@ PRIMARY KEY (`id`)
ALTER TABLE `mortals_xhx_user` ADD COLUMN `photoPath` varchar(255) COMMENT '头像地址';
ALTER TABLE `mortals_xhx_user` ADD COLUMN `companyAdress` varchar(512) COMMENT '单位地址';
ALTER TABLE `mortals_xhx_user` ADD COLUMN `nickName` varchar(128) COMMENT '昵称';
INSERT INTO `mortals_xhx_task` (`name`, `taskKey`, `status`, `excuteService`, `excuteParam`, `excuteHost`, `excuteStrategy`, `excuteDate`, `excuteTime`, `remark`, `lastExcuteHost`, `lastExcuteTime`, `interimExcuteStatus`, `createTime`, `createUserId`, `createUserName`) VALUES ('员工名片日访问数初始化', 'StaffViewsByDayInit', '0', 'StaffViewsByDayInit', NULL, NULL, '1', '0', '00:00', NULL, NULL, NULL, '0', NULL, '1', '系统管理员');
......
......@@ -113,6 +113,10 @@ public class UserEntity extends UserVo implements IUser {
* 单位地址
*/
private String companyAdress;
/**
* 昵称
*/
private String nickName;
public UserEntity(){}
......@@ -431,6 +435,14 @@ public class UserEntity extends UserVo implements IUser {
this.companyAdress = companyAdress;
}
public String getNickName() {
return nickName;
}
public void setNickName(String nickName) {
this.nickName = nickName;
}
@Override
public int hashCode() {
return this.getId().hashCode();
......@@ -502,5 +514,6 @@ public class UserEntity extends UserVo implements IUser {
this.photoPath = "";
this.companyAdress = "";
this.nickName = "";
}
}
\ No newline at end of file
......@@ -207,6 +207,11 @@ public class UserQuery extends UserEntity {
/** 单位地址排除列表 */
private List <String> companyAdressNotList;
/** 昵称 */
private List<String> nickNameList;
/** 昵称排除列表 */
private List <String> nickNameNotList;
/** OR条件集合,列表项之间是OR,项内容之间是AND,如:(list[0].1 and list[0].2) or (list[1].3 and list[1].4) */
private List<UserQuery> orConditionList;
......@@ -1294,6 +1299,30 @@ public class UserQuery extends UserEntity {
this.companyAdressNotList = companyAdressNotList;
}
public List<String> getCompanyAdressList() {
return companyAdressList;
}
public void setCompanyAdressList(List<String> companyAdressList) {
this.companyAdressList = companyAdressList;
}
public List<String> getNickNameList() {
return nickNameList;
}
public void setNickNameList(List<String> nickNameList) {
this.nickNameList = nickNameList;
}
public List<String> getNickNameNotList() {
return nickNameNotList;
}
public void setNickNameNotList(List<String> nickNameNotList) {
this.nickNameNotList = nickNameNotList;
}
/**
* 设置 用户ID,主键,自增长
* @param id
......
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"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">
......@@ -30,6 +30,7 @@
<result property="openId" column="openId" />
<result property="photoPath" column="photoPath" />
<result property="companyAdress" column="companyAdress" />
<result property="nickName" column="nickName" />
</resultMap>
<!-- 表所有列 -->
......@@ -110,23 +111,26 @@
<if test="(data == null) or (data != null and ( colPickMode == 0 and !data.containsKey('companyAdress') or colPickMode == 1 and data.containsKey('companyAdress')))">
a.companyAdress,
</if>
<if test="(data == null) or (data != null and ( colPickMode == 0 and !data.containsKey('nickName') or colPickMode == 1 and data.containsKey('nickName')))">
a.nickName,
</if>
</trim>
</sql>
<!-- 新增 区分主键自增加还是业务插入 -->
<insert id="insert" parameterType="UserEntity" useGeneratedKeys="true" keyProperty="id">
insert into mortals_xhx_user
(loginName,loginPwd,loginLimitAddress,realName,mobile,phone,email,qq,userType,status,customerId,createTime,createUserId,createUserName,lastLoginTime,lastLoginAddress,deptId,deptName,siteIds,areaCodes,staffId,openId,photoPath,companyAdress)
(loginName,loginPwd,loginLimitAddress,realName,mobile,phone,email,qq,userType,status,customerId,createTime,createUserId,createUserName,lastLoginTime,lastLoginAddress,deptId,deptName,siteIds,areaCodes,staffId,openId,photoPath,companyAdress,nickName)
VALUES
(#{loginName},#{loginPwd},#{loginLimitAddress},#{realName},#{mobile},#{phone},#{email},#{qq},#{userType},#{status},#{customerId},#{createTime},#{createUserId},#{createUserName},#{lastLoginTime},#{lastLoginAddress},#{deptId},#{deptName},#{siteIds},#{areaCodes},#{staffId},#{openId},#{photoPath},#{companyAdress})
(#{loginName},#{loginPwd},#{loginLimitAddress},#{realName},#{mobile},#{phone},#{email},#{qq},#{userType},#{status},#{customerId},#{createTime},#{createUserId},#{createUserName},#{lastLoginTime},#{lastLoginAddress},#{deptId},#{deptName},#{siteIds},#{areaCodes},#{staffId},#{openId},#{photoPath},#{companyAdress},#{nickName})
</insert>
<!-- 批量新增 -->
<insert id="insertBatch" parameterType="paramDto">
insert into mortals_xhx_user
(loginName,loginPwd,loginLimitAddress,realName,mobile,phone,email,qq,userType,status,customerId,createTime,createUserId,createUserName,lastLoginTime,lastLoginAddress,deptId,deptName,siteIds,areaCodes,staffId,openId,photoPath,companyAdress)
(loginName,loginPwd,loginLimitAddress,realName,mobile,phone,email,qq,userType,status,customerId,createTime,createUserId,createUserName,lastLoginTime,lastLoginAddress,deptId,deptName,siteIds,areaCodes,staffId,openId,photoPath,companyAdress,nickName)
VALUES
<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.userType},#{item.status},#{item.customerId},#{item.createTime},#{item.createUserId},#{item.createUserName},#{item.lastLoginTime},#{item.lastLoginAddress},#{item.deptId},#{item.deptName},#{item.siteIds},#{item.areaCodes},#{item.staffId},#{item.openId},#{item.photoPath},#{item.companyAdress})
(#{item.loginName},#{item.loginPwd},#{item.loginLimitAddress},#{item.realName},#{item.mobile},#{item.phone},#{item.email},#{item.qq},#{item.userType},#{item.status},#{item.customerId},#{item.createTime},#{item.createUserId},#{item.createUserName},#{item.lastLoginTime},#{item.lastLoginAddress},#{item.deptId},#{item.deptName},#{item.siteIds},#{item.areaCodes},#{item.staffId},#{item.openId},#{item.photoPath},#{item.companyAdress},#{item.nickName})
</foreach>
</insert>
......@@ -226,6 +230,9 @@
<if test="(colPickMode==0 and data.containsKey('companyAdress')) or (colPickMode==1 and !data.containsKey('companyAdress'))">
a.companyAdress=#{data.companyAdress},
</if>
<if test="(colPickMode==0 and data.containsKey('nickName')) or (colPickMode==1 and !data.containsKey('nickName'))">
a.nickName=#{data.nickName},
</if>
</trim>
<trim suffixOverrides="where" suffix="">
where
......@@ -436,6 +443,13 @@
</if>
</foreach>
</trim>
<trim prefix="nickName=(case" suffix="ELSE nickName end),">
<foreach collection="data.dataList" item="item" index="index" separator="" >
<if test="(colPickMode==0 and item.containsKey('nickName')) or (colPickMode==1 and !item.containsKey('nickName'))">
when a.id=#{item.id} then #{item.nickName}
</if>
</foreach>
</trim>
</trim>
where id in
<foreach collection="data.dataList" item="item" index="index" open="(" separator="," close=")">
......@@ -1111,6 +1125,27 @@
#{item}
</foreach>
</if>
<if test="conditionParamRef.containsKey('nickName')">
<if test="conditionParamRef.nickName != null and conditionParamRef.nickName != ''">
${_conditionType_} a.nickName like #{${_conditionParam_}.nickName}
</if>
<if test="conditionParamRef.nickName == null">
${_conditionType_} a.nickName is null
</if>
</if>
<if test="conditionParamRef.containsKey('nickNameList') and conditionParamRef.nickNameList.size() > 0">
${_conditionType_} a.nickName in
<foreach collection="conditionParamRef.nickNameList" open="(" close=")" index="index" item="item" separator=",">
#{item}
</foreach>
</if>
<if test="conditionParamRef.containsKey('nickNameNotList') and conditionParamRef.nickNameNotList.size() > 0">
${_conditionType_} a.nickName not in
<foreach collection="conditionParamRef.nickNameNotList" open="(" close=")" index="index" item="item" separator=",">
#{item}
</foreach>
</if>
</sql>
<sql id="_orderCols_">
<if test="orderColList != null and !orderColList.isEmpty()">
......@@ -1347,6 +1382,11 @@
<if test='orderCol.companyAdress != null and "DESC".equalsIgnoreCase(orderCol.companyAdress)'>DESC</if>
,
</if>
<if test="orderCol.containsKey('nickName')">
a.nickName
<if test='orderCol.nickName != null and "DESC".equalsIgnoreCase(orderCol.nickName)'>DESC</if>
,
</if>
</trim>
</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