| | |
| | | </resultMap> |
| | | |
| | | <sql id="selectUserVo"> |
| | | select u.id, u.dept_id, u.account, u.name, u.email, u.avatar, u.phone, u.password, u.sex, u.status, u.del_flag, u.login_ip, u.login_date, u.create_by, u.create_time, u.remark, |
| | | select u.id, u.dept_id, u.account, u.name, u.email, u.picture_url, u.phone, 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 |
| | | from user u |
| | | left join sys_dept d on u.dept_id = d.dept_id |
| | | left join user_role ur on u.id = ur.user_id |
| | | left join sys_user_role ur on u.id = ur.user_id |
| | | left join sys_role r on r.role_id = ur.role_id |
| | | </sql> |
| | | |
| | | <select id="selectUserList" parameterType="SysUser" resultMap="SysUserResult"> |
| | | select u.id, u.dept_id, u.name, u.account, u.email, u.avatar, u.phone, 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 user u |
| | | select u.id, u.dept_id, u.name, u.account, u.email, u.picture_url, u.phone, 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 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"> |
| | |
| | | select distinct u.id, u.dept_id, u.account, u.name, u.email, u.phone, u.status, u.create_time |
| | | from user u |
| | | left join sys_dept d on u.dept_id = d.dept_id |
| | | left join user_role ur on u.id = ur.user_id |
| | | left join sys_user_role ur on u.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 = #{roleId} |
| | | <if test="userName != null and userName != ''"> |
| | |
| | | select distinct u.id, u.dept_id, u.account, u.name, u.email, u.phone, u.status, u.create_time |
| | | from user u |
| | | left join sys_dept d on u.dept_id = d.dept_id |
| | | left join user_role ur on u.id = ur.user_id |
| | | left join sys_user_role ur on u.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 != #{roleId} or r.role_id IS NULL) |
| | | and u.id not in (select u.id from user u inner join user_role ur on u.id = ur.user_id and ur.role_id = #{roleId}) |
| | | and u.id not in (select u.id from user u inner join sys_user_role ur on u.id = ur.user_id and ur.role_id = #{roleId}) |
| | | <if test="userName != null and userName != ''"> |
| | | AND u.account like concat('%', #{userName}, '%') |
| | | </if> |