| | |
| | | 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' |
| | | <if test="user.userId != null and user.userId != 0"> |
| | | AND u.user_id = #{user.userId} |
| | | </if> |
| | | <if test="user.userName != null and user.userName != ''"> |
| | | AND u.user_name like concat('%', #{user.userName}, '%') |
| | | </if> |
| | | <if test="user.status != null and user.status != ''"> |
| | | AND u.status = #{user.status} |
| | | </if> |
| | | <if test="user.phonenumber != null and user.phonenumber != ''"> |
| | | AND u.phonenumber like concat('%', #{user.phonenumber}, '%') |
| | | </if> |
| | | <if test="user.params.beginTime != null and user.params.endTime != null"> |
| | | AND u.create_time between #{user.params.beginTime} and #{user.params.endTime} |
| | | </if> |
| | | <if test="user.deptId != null and user.deptId != 0"> |
| | | AND (u.dept_id = #{user.deptId} OR u.dept_id IN ( SELECT t.dept_id FROM sys_dept t WHERE find_in_set(#{user.deptId}, |
| | | ancestors) )) |
| | | </if> |
| | | ${ew.getCustomSqlSegment} |
| | | </select> |
| | | |
| | | <select id="selectUserList" parameterType="SysUser" resultMap="SysUserResult"> |
| | |
| | | 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' |
| | | <if test="userId != null and userId != 0"> |
| | | AND u.user_id = #{userId} |
| | | </if> |
| | | <if test="userName != null and userName != ''"> |
| | | AND u.user_name like concat('%', #{userName}, '%') |
| | | </if> |
| | | <if test="status != null and status != ''"> |
| | | AND u.status = #{status} |
| | | </if> |
| | | <if test="phonenumber != null and phonenumber != ''"> |
| | | AND u.phonenumber like concat('%', #{phonenumber}, '%') |
| | | </if> |
| | | <if test="params.beginTime != null and params.endTime != null"> |
| | | AND u.create_time between #{params.beginTime} and #{params.endTime} |
| | | </if> |
| | | <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) )) |
| | | </if> |
| | | ${ew.getCustomSqlSegment} |
| | | </select> |
| | | |
| | | <select id="selectAllocatedList" parameterType="SysUser" resultMap="SysUserResult"> |
| | |
| | | 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 |
| | | where u.del_flag = '0' and r.role_id = #{user.roleId} |
| | | <if test="user.userName != null and user.userName != ''"> |
| | | AND u.user_name like concat('%', #{user.userName}, '%') |
| | | </if> |
| | | <if test="user.phonenumber != null and user.phonenumber != ''"> |
| | | AND u.phonenumber like concat('%', #{user.phonenumber}, '%') |
| | | </if> |
| | | ${ew.getCustomSqlSegment} |
| | | </select> |
| | | |
| | | <select id="selectUnallocatedList" parameterType="SysUser" resultMap="SysUserResult"> |
| | |
| | | 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 |
| | | where u.del_flag = '0' and (r.role_id != #{user.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 = #{user.roleId}) |
| | | <if test="user.userName != null and user.userName != ''"> |
| | | AND u.user_name like concat('%', #{user.userName}, '%') |
| | | </if> |
| | | <if test="user.phonenumber != null and user.phonenumber != ''"> |
| | | AND u.phonenumber like concat('%', #{user.phonenumber}, '%') |
| | | </if> |
| | | ${ew.getCustomSqlSegment} |
| | | </select> |
| | | |
| | | <select id="selectUserByUserName" parameterType="String" resultMap="SysUserResult"> |