|
|
@ -58,15 +58,19 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" |
|
|
</sql> |
|
|
</sql> |
|
|
|
|
|
|
|
|
<select id="selectUserList" parameterType="SysUser" resultMap="SysUserResult"> |
|
|
<select id="selectUserList" parameterType="SysUser" resultMap="SysUserResult"> |
|
|
select u.user_id, u.dept_id, u.nick_name, 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 |
|
|
|
|
|
left join sys_dept d on u.dept_id = d.dept_id |
|
|
|
|
|
where u.del_flag = '0' |
|
|
|
|
|
|
|
|
<include refid="selectUserVo"/> |
|
|
|
|
|
-- select u.user_id, u.dept_id, u.nick_name, 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 |
|
|
|
|
|
-- left join sys_dept d on u.dept_id = d.dept_id |
|
|
|
|
|
where u.del_flag = '0' and u.user_id<>1 |
|
|
<if test="userId != null and userId != 0"> |
|
|
<if test="userId != null and userId != 0"> |
|
|
AND u.user_id = #{userId} |
|
|
AND u.user_id = #{userId} |
|
|
</if> |
|
|
</if> |
|
|
<if test="userName != null and userName != ''"> |
|
|
<if test="userName != null and userName != ''"> |
|
|
AND u.user_name like concat('%', #{userName}, '%') |
|
|
AND u.user_name like concat('%', #{userName}, '%') |
|
|
</if> |
|
|
</if> |
|
|
|
|
|
<if test="nickName != null and nickName != ''"> |
|
|
|
|
|
AND u.nick_name like concat('%', #{nickName}, '%') |
|
|
|
|
|
</if> |
|
|
<if test="status != null and status != ''"> |
|
|
<if test="status != null and status != ''"> |
|
|
AND u.status = #{status} |
|
|
AND u.status = #{status} |
|
|
</if> |
|
|
</if> |
|
|
@ -82,8 +86,11 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" |
|
|
<if test="deptId != null and deptId != 0"> |
|
|
<if test="deptId != null and deptId != 0"> |
|
|
AND (u.dept_id = #{deptId} OR u.dept_id IN ( SELECT t.dept_id FROM sys_dept t WHERE find_in_set(#{deptId}, ancestors) )) |
|
|
AND (u.dept_id = #{deptId} OR u.dept_id IN ( SELECT t.dept_id FROM sys_dept t WHERE find_in_set(#{deptId}, ancestors) )) |
|
|
</if> |
|
|
</if> |
|
|
|
|
|
<if test="roleId != null and roleId != 0"> |
|
|
|
|
|
AND ur.role_id=#{roleId} |
|
|
|
|
|
</if> |
|
|
<!-- 数据范围过滤 --> |
|
|
<!-- 数据范围过滤 --> |
|
|
${params.dataScope} |
|
|
|
|
|
|
|
|
-- ${params.dataScope} |
|
|
</select> |
|
|
</select> |
|
|
|
|
|
|
|
|
<select id="selectAllocatedList" parameterType="SysUser" resultMap="SysUserResult"> |
|
|
<select id="selectAllocatedList" parameterType="SysUser" resultMap="SysUserResult"> |
|
|
@ -92,7 +99,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" |
|
|
left join sys_dept d on u.dept_id = d.dept_id |
|
|
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_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_role r on r.role_id = ur.role_id |
|
|
where u.del_flag = '0' and r.role_id = #{roleId} |
|
|
|
|
|
|
|
|
where u.del_flag = '0' and u.user_id<>1 and r.role_id = #{roleId} |
|
|
<if test="userName != null and userName != ''"> |
|
|
<if test="userName != null and userName != ''"> |
|
|
AND u.user_name like concat('%', #{userName}, '%') |
|
|
AND u.user_name like concat('%', #{userName}, '%') |
|
|
</if> |
|
|
</if> |
|
|
@ -100,7 +107,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" |
|
|
AND u.phonenumber like concat('%', #{phonenumber}, '%') |
|
|
AND u.phonenumber like concat('%', #{phonenumber}, '%') |
|
|
</if> |
|
|
</if> |
|
|
<!-- 数据范围过滤 --> |
|
|
<!-- 数据范围过滤 --> |
|
|
${params.dataScope} |
|
|
|
|
|
|
|
|
-- ${params.dataScope} |
|
|
</select> |
|
|
</select> |
|
|
|
|
|
|
|
|
<select id="selectAllocatedListSimple" resultType="java.lang.Long"> |
|
|
<select id="selectAllocatedListSimple" resultType="java.lang.Long"> |
|
|
@ -123,7 +130,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" |
|
|
left join sys_dept d on u.dept_id = d.dept_id |
|
|
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_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_role r on r.role_id = ur.role_id |
|
|
where u.del_flag = '0' and (r.role_id != #{roleId} or r.role_id IS NULL) |
|
|
|
|
|
|
|
|
where u.del_flag = '0' and u.user_id<>1 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}) |
|
|
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}) |
|
|
<if test="userName != null and userName != ''"> |
|
|
<if test="userName != null and userName != ''"> |
|
|
AND u.user_name like concat('%', #{userName}, '%') |
|
|
AND u.user_name like concat('%', #{userName}, '%') |
|
|
@ -132,7 +139,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" |
|
|
AND u.phonenumber like concat('%', #{phonenumber}, '%') |
|
|
AND u.phonenumber like concat('%', #{phonenumber}, '%') |
|
|
</if> |
|
|
</if> |
|
|
<!-- 数据范围过滤 --> |
|
|
<!-- 数据范围过滤 --> |
|
|
${params.dataScope} |
|
|
|
|
|
|
|
|
-- ${params.dataScope} |
|
|
</select> |
|
|
</select> |
|
|
|
|
|
|
|
|
<select id="selectUserByUserName" parameterType="String" resultMap="SysUserResult"> |
|
|
<select id="selectUserByUserName" parameterType="String" resultMap="SysUserResult"> |
|
|
|