| | |
| | | select * from sys_user |
| | | </select> |
| | | <select id="pageList" resultType="com.ruoyi.system.vo.SysUserVO"> |
| | | select u.user_id AS userId, u.dept_id AS deptId, u.user_name AS userName, u.nick_name AS nickName, u.email AS email, u.avatar AS avatar, |
| | | u.phonenumber AS phonenumber, u.sex AS sex, u.status AS status, u.del_flag AS delFlag, u.login_ip AS loginIp, |
| | | select u.user_id AS userId, u.dept_id AS deptId, u.user_name AS userName, u.nick_name AS nickName, u.email AS email, u.avatar AS avatar,u.disable_remark AS disableRemark, |
| | | u.phonenumber AS phonenumber, u.sex AS sex, u.status AS status, u.del_flag AS delFlag, u.login_ip AS loginIp,u.operating_time AS operatingTime,u.operating_person AS operatingPerson, |
| | | u.login_date AS loginDate, u.create_by AS createBy, u.create_time AS createTime, u.remark AS remark,u.ifBlack AS ifBlack, u.districtId AS districtId, |
| | | r.role_id AS roleId, r.role_name AS roleName, r.role_key AS roleKey, r.role_sort AS roleSort, r.data_scope AS dataScope, r.status as role_status,u.deptName as deptName |
| | | from sys_user u |
| | | 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 t_dept_to_user tdtu on u.user_id = tdtu.user_id |
| | | WHERE u.del_flag = 0 |
| | | <if test="query.nickNameAndPhone != null and query.nickNameAndPhone != ''"> |
| | | AND (u.nick_name LIKE concat('%',#{query.nickNameAndPhone},'%') |
| | | OR u.phonenumber LIKE concat('%',#{query.nickNameAndPhone},'%')) |
| | | </if> |
| | | <if test="query.roleId != null"> |
| | | AND r.role_id = #{query.roleId} |
| | | <if test="query.nickNameOrPhone != null and query.nickNameOrPhone != ''"> |
| | | AND (u.nick_name LIKE concat('%',#{query.nickNameOrPhone},'%') |
| | | OR u.phonenumber LIKE concat('%',#{query.nickNameOrPhone},'%')) |
| | | </if> |
| | | <if test="query.status != null and query.status != ''"> |
| | | AND u.status = #{query.status} |
| | |
| | | <foreach collection="query.deptIds" close=")" open="(" item="deptId" separator=","> |
| | | #{deptId} |
| | | </foreach>) |
| | | </if> |
| | | <if test="query.roleIds != null and query.roleIds.size()>0"> |
| | | AND r.role_id IN |
| | | <foreach collection="query.roleIds" close=")" open="(" item="roleId" separator=","> |
| | | #{roleId} |
| | | </foreach> |
| | | </if> |
| | | ORDER BY u.create_time DESC |
| | | </select> |
| | |
| | | <if test="remark != null">remark = #{remark},</if> |
| | | <if test="ifBlack != null">ifBlack = #{ifBlack},</if> |
| | | <if test="districtId != null">districtId = #{districtId},</if> |
| | | <if test="disableRemark != null">disable_remark = #{disableRemark},</if> |
| | | <if test="operatingTime != null">operating_time = #{operatingTime},</if> |
| | | <if test="operatingPerson != null">operating_person = #{operatingPerson},</if> |
| | | update_time = sysdate() |
| | | </set> |
| | | where user_id = #{userId} |