|
|
@@ -13,6 +13,10 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
|
<result property="userType" column="user_type" />
|
|
|
<result property="email" column="email" />
|
|
|
<result property="phonenumber" column="phonenumber" />
|
|
|
+ <result property="deptName" column="dept_name" />
|
|
|
+ <result property="roleName" column="role_name" />
|
|
|
+ <result property="roleId" column="role_id" />
|
|
|
+
|
|
|
<result property="sex" column="sex" />
|
|
|
<result property="avatar" column="avatar" />
|
|
|
<result property="password" column="password" />
|
|
|
@@ -50,7 +54,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
|
|
|
|
<select id="selectUserList" parameterType="SysUser" resultMap="SysUserResult">
|
|
|
select u.user_id, u.dept_id, u.nick_name,u.post_name,u.user_type, u.user_name, u.email, u.avatar, u.phonenumber, u.sex, u.status, u.del_flag, u.login_ip, u.login_date, u.create_by, u.create_time, u.remark, d.dept_name, d.leader,
|
|
|
- r.role_id, r.role_name, r.role_key, r.role_sort, r.data_scope, r.status as role_status
|
|
|
+ r.role_id, r.role_name, r.role_key, r.role_sort, r.data_scope, r.status as role_status,u.dept_name,u.role_name,u.role_id
|
|
|
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
|
|
|
@@ -91,7 +95,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
|
<sql id="selectUserVo">
|
|
|
select u.user_id, u.dept_id, u.user_name, u.nick_name,u.post_name,u.user_type, u.email, u.avatar, u.phonenumber, u.password, u.sex, u.status, u.del_flag, u.login_ip, u.login_date, u.create_by, u.create_time, u.remark,
|
|
|
d.dept_id, d.parent_id, d.ancestors, 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
|
|
|
+ r.role_id, r.role_name, r.role_key, r.role_sort, r.data_scope, r.status as role_status,u.dept_name,u.role_name,u.role_id
|
|
|
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
|
|
|
@@ -100,7 +104,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
|
|
|
|
|
|
|
<select id="selectUserListBaseOrg" parameterType="SysUser" resultMap="SysUserResult">
|
|
|
- select u.user_id, u.dept_id, u.nick_name,u.post_name,u.user_type, u.user_name, u.email, u.avatar, u.phonenumber, u.sex, u.status, u.del_flag, u.login_ip, u.login_date, u.create_by, u.create_time, u.remark, d.dept_name, d.leader from sys_user u
|
|
|
+ select u.user_id, u.dept_id, u.nick_name,u.post_name,u.user_type, u.user_name, u.email, u.avatar, u.phonenumber, u.sex, u.status, u.del_flag, u.login_ip, u.login_date, u.create_by, u.create_time, u.remark, d.dept_name, d.leader,,u.dept_name,u.role_name,u.role_id from sys_user u
|
|
|
inner join sys_user_dep ud on u.user_id=ud.user_id
|
|
|
inner join sys_user_dep ud2 on u.user_id=ud2.user_id
|
|
|
inner join sys_dept d on ud2.dep_id = d.dept_id and d.dep_type='base'
|
|
|
@@ -152,7 +156,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
|
|
|
|
|
|
|
<select id="selectAllocatedList" parameterType="SysUser" resultMap="SysUserResult">
|
|
|
- select distinct u.user_id, u.dept_id, u.user_name,u.post_name,u.user_type, u.nick_name, u.email, u.phonenumber, u.status, u.create_time
|
|
|
+ select distinct u.user_id, u.dept_id, u.user_name,u.post_name,u.user_type, u.nick_name, u.email, u.phonenumber, u.status, u.create_time,u.dept_name,u.role_name,u.role_id
|
|
|
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
|
|
|
@@ -169,7 +173,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
|
</select>
|
|
|
|
|
|
<select id="selectUnallocatedList" parameterType="SysUser" resultMap="SysUserResult">
|
|
|
- select distinct u.user_id, u.dept_id, u.user_name, u.nick_name,u.post_name,u.user_type, u.email, u.phonenumber, u.status, u.create_time
|
|
|
+ select distinct u.user_id, u.dept_id, u.user_name, u.nick_name,u.post_name,u.user_type, u.email, u.phonenumber, u.status, u.create_time,u.dept_name,u.role_name,u.role_id
|
|
|
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
|
|
|
@@ -219,6 +223,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
|
<if test="email != null and email != ''">email,</if>
|
|
|
<if test="avatar != null and avatar != ''">avatar,</if>
|
|
|
<if test="phonenumber != null and phonenumber != ''">phonenumber,</if>
|
|
|
+ <if test="deptName != null and deptName != ''">dept_name,</if>
|
|
|
+ <if test="roleName != null and roleName != ''">role_name,</if>
|
|
|
<if test="sex != null and sex != ''">sex,</if>
|
|
|
<if test="password != null and password != ''">password,</if>
|
|
|
<if test="status != null and status != ''">status,</if>
|
|
|
@@ -235,6 +241,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
|
<if test="email != null and email != ''">#{email},</if>
|
|
|
<if test="avatar != null and avatar != ''">#{avatar},</if>
|
|
|
<if test="phonenumber != null and phonenumber != ''">#{phonenumber},</if>
|
|
|
+ <if test="deptName != null and deptName != ''">#{deptName},</if>
|
|
|
+ <if test="roleName != null and roleName != ''">#{roleName},</if>
|
|
|
<if test="sex != null and sex != ''">#{sex},</if>
|
|
|
<if test="password != null and password != ''">#{password},</if>
|
|
|
<if test="status != null and status != ''">#{status},</if>
|
|
|
@@ -253,13 +261,16 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
|
<if test="userType != null and userType != ''">user_type = #{userType},</if>
|
|
|
<if test="email != null ">email = #{email},</if>
|
|
|
<if test="phonenumber != null ">phonenumber = #{phonenumber},</if>
|
|
|
+ <if test="deptName != null and deptName != ''">dept_name=#{deptName},</if>
|
|
|
+ <if test="roleName != null and roleName != ''">role_name=#{roleName},</if>
|
|
|
<if test="sex != null and sex != ''">sex = #{sex},</if>
|
|
|
<if test="avatar != null and avatar != ''">avatar = #{avatar},</if>
|
|
|
<if test="password != null and password != ''">password = #{password},</if>
|
|
|
<if test="status != null and status != ''">status = #{status},</if>
|
|
|
<if test="loginIp != null and loginIp != ''">login_ip = #{loginIp},</if>
|
|
|
<if test="loginDate != null">login_date = #{loginDate},</if>
|
|
|
- <if test="updateBy != null and updateBy != ''">update_by = #{updateBy},</if>
|
|
|
+ <if test="roleId != null and roleId != ''">role_id = #{roleId},</if>
|
|
|
+ <if test="updateBy != null and updateBy != ''">update_by = #{updateBy},</if>
|
|
|
<if test="remark != null">remark = #{remark},</if>
|
|
|
update_time = sysdate()
|
|
|
</set>
|