|
|
@@ -10,6 +10,8 @@
|
|
|
<result property="userName" column="user_name"/>
|
|
|
<result property="nickName" column="nick_name"/>
|
|
|
<result property="realName" column="real_name"/>
|
|
|
+ <result property="post" column="post"/>
|
|
|
+ <result property="postText" column="post_text"/>
|
|
|
<result property="email" column="email"/>
|
|
|
<result property="phone" column="phone"/>
|
|
|
<result property="wechat" column="wechat"/>
|
|
|
@@ -49,22 +51,25 @@
|
|
|
</resultMap>
|
|
|
|
|
|
<sql id="selectUserVo">
|
|
|
- select u.user_id, u.dept_id, u.user_name, u.nick_name, u.real_name, u.email, u.avatar, u.phone, u.wechat,
|
|
|
- u.password, u.sex, u.status, u.del_flag, u.login_ip, u.login_date, u.create_by, u.create_time,
|
|
|
- u.remark,u.birthday,
|
|
|
+ select u.user_id, u.dept_id, u.user_name, u.nick_name, u.real_name, u.email, u.avatar, u.phone,
|
|
|
+ u.wechat, u.password, u.sex, u.status, u.del_flag, u.login_ip, u.login_date, u.create_by,
|
|
|
+ u.create_time, u.remark,u.birthday,u.post, dict.dict_label,
|
|
|
d.dept_id, d.parent_id, d.dept_name, d.order_num, d.leader, d.status as dept_status,
|
|
|
r.role_id, r.role_name, r.role_key, r.role_sort, r.data_scope, r.status as role_status
|
|
|
from sys_user u
|
|
|
left join sys_dept d on u.dept_id = d.dept_id
|
|
|
left join sys_user_role ur on u.user_id = ur.user_id
|
|
|
left join sys_role r on r.role_id = ur.role_id
|
|
|
+ LEFT JOIN sys_dict_data dict ON (u.post = dict.dict_value AND dict.dict_type = 'postType')
|
|
|
</sql>
|
|
|
|
|
|
<select id="selectUserList" parameterType="SysUser" resultMap="SysUserResult">
|
|
|
select u.user_id, u.dept_id, u.nick_name, u.user_name, u.real_name, u.email, u.avatar, u.phone, u.wechat,
|
|
|
u.password, u.sex, u.status, u.del_flag, u.login_ip, u.login_date, u.create_by, u.create_time,
|
|
|
- u.birthday, u.remark, d.dept_name, d.leader from sys_user u
|
|
|
+ u.birthday, u.remark, d.dept_name, d.leader, u.post, dict.dict_label
|
|
|
+ from sys_user u
|
|
|
left join sys_dept d on u.dept_id = d.dept_id
|
|
|
+ LEFT JOIN sys_dict_data dict ON (u.post = dict.dict_value AND dict.dict_type = 'postType')
|
|
|
where u.del_flag = '0'
|
|
|
<if test="userId != null and userId != 0">
|
|
|
AND u.user_id = #{userId}
|
|
|
@@ -93,12 +98,13 @@
|
|
|
</select>
|
|
|
|
|
|
<select id="selectAllocatedList" parameterType="SysUser" resultMap="SysUserResult">
|
|
|
- select distinct u.user_id, u.dept_id, u.user_name, u.nick_name, u.real_name, u.email, u.phone, u.wechat,
|
|
|
- u.status, u.create_time
|
|
|
+ select distinct u.user_id, u.dept_id, u.user_name, u.nick_name, u.real_name, u.email, u.phone,
|
|
|
+ u.wechat, u.status, u.create_time, u.post, dict.dict_label
|
|
|
from sys_user u
|
|
|
left join sys_dept d on u.dept_id = d.dept_id
|
|
|
left join sys_user_role ur on u.user_id = ur.user_id
|
|
|
left join sys_role r on r.role_id = ur.role_id
|
|
|
+ LEFT JOIN sys_dict_data dict ON (u.post = dict.dict_value AND dict.dict_type = 'postType')
|
|
|
where u.del_flag = '0' and r.role_id = #{roleId}
|
|
|
<if test="userName != null and userName != ''">
|
|
|
AND u.user_name like concat('%', #{userName}, '%')
|
|
|
@@ -111,12 +117,13 @@
|
|
|
</select>
|
|
|
|
|
|
<select id="selectUnallocatedList" parameterType="SysUser" resultMap="SysUserResult">
|
|
|
- select distinct u.user_id, u.dept_id, u.user_name, u.nick_name, u.real_name, u.email, u.phone, u.wechat,
|
|
|
- u.status, u.create_time
|
|
|
+ select distinct u.user_id, u.dept_id, u.user_name, u.nick_name, u.real_name, u.email, u.phone,
|
|
|
+ u.wechat, u.status, u.create_time, u.post, dict.dict_label
|
|
|
from sys_user u
|
|
|
left join sys_dept d on u.dept_id = d.dept_id
|
|
|
left join sys_user_role ur on u.user_id = ur.user_id
|
|
|
left join sys_role r on r.role_id = ur.role_id
|
|
|
+ LEFT JOIN sys_dict_data dict ON (u.post = dict.dict_value AND dict.dict_type = 'postType')
|
|
|
where u.del_flag = '0' and (r.role_id != #{roleId} or r.role_id IS NULL)
|
|
|
and u.user_id not in (select u.user_id from sys_user u inner join sys_user_role ur on u.user_id
|
|
|
= ur.user_id and ur.role_id = #{roleId})
|
|
|
@@ -159,6 +166,7 @@
|
|
|
<if test="userName != null and userName != ''">user_name,</if>
|
|
|
<if test="nickName != null and nickName != ''">nick_name,</if>
|
|
|
<if test="realName != null and realName != ''">real_name,</if>
|
|
|
+ <if test="post != null and post != ''">post,</if>
|
|
|
<if test="email != null and email != ''">email,</if>
|
|
|
<if test="avatar != null and avatar != ''">avatar,</if>
|
|
|
<if test="phone != null and phone != ''">phone,</if>
|
|
|
@@ -176,6 +184,7 @@
|
|
|
<if test="userName != null and userName != ''">#{userName},</if>
|
|
|
<if test="nickName != null and nickName != ''">#{nickName},</if>
|
|
|
<if test="realName != null and realName != ''">#{realName},</if>
|
|
|
+ <if test="post != null and post != ''">#{post},</if>
|
|
|
<if test="email != null and email != ''">#{email},</if>
|
|
|
<if test="avatar != null and avatar != ''">#{avatar},</if>
|
|
|
<if test="phone != null and phone != ''">#{phone},</if>
|
|
|
@@ -197,6 +206,7 @@
|
|
|
<if test="userName != null and userName != ''">user_name = #{userName},</if>
|
|
|
<if test="nickName != null and nickName != ''">nick_name = #{nickName},</if>
|
|
|
<if test="realName != null and realName != ''">real_name = #{realName},</if>
|
|
|
+ <if test="post != null and post != ''">post = #{post},</if>
|
|
|
<if test="email != null ">email = #{email},</if>
|
|
|
<if test="phone != null ">phone = #{phone},</if>
|
|
|
<if test="wechat != null and wechat != ''">wechat = #{wechat},</if>
|