From db7fa6a91b9534ac90e219b6f554c54c43c83a5a Mon Sep 17 00:00:00 2001 From: liujie <liujie> Date: 星期三, 16 八月 2023 09:28:15 +0800 Subject: [PATCH] update --- management/guns-admin/src/main/java/com/stylefeng/guns/modular/system/dao/mapping/UserMapper.xml | 39 ++++++++++++++++++++++++++++++++++++++- 1 files changed, 38 insertions(+), 1 deletions(-) diff --git a/management/guns-admin/src/main/java/com/stylefeng/guns/modular/system/dao/mapping/UserMapper.xml b/management/guns-admin/src/main/java/com/stylefeng/guns/modular/system/dao/mapping/UserMapper.xml index 39c0cf3..1eab19d 100644 --- a/management/guns-admin/src/main/java/com/stylefeng/guns/modular/system/dao/mapping/UserMapper.xml +++ b/management/guns-admin/src/main/java/com/stylefeng/guns/modular/system/dao/mapping/UserMapper.xml @@ -8,7 +8,7 @@ <result column="avatar" property="avatar" /> <result column="account" property="account" /> <result column="password" property="password" /> - <result column="passWordUpdate" property="passWordUpdate"/> + <result column="pass_word_update" property="passWordUpdate"/> <result column="salt" property="salt" /> <result column="name" property="name" /> <result column="birthday" property="birthday" /> @@ -20,6 +20,8 @@ <result column="status" property="status" /> <result column="createtime" property="createtime" /> <result column="version" property="version" /> + <result column="role_type" property="roleType" /> + <result column="object_id" property="objectId" /> </resultMap> <sql id="Base_Column_List"> @@ -108,4 +110,39 @@ order by o.id desc </select> + <select id="getUserListPageAgent" resultType="map" parameterType="com.baomidou.mybatisplus.plugins.Page"> + SELECT * FROM (select CASE when d2.simplename is null then d1.simplename else d2.simplename end as parentName, + case when uu.sex = 1 then '男' when uu.sex = 2 then '女' else '' end as sexName, + d1.simplename as deptName,case when uu.status = 1 then '启用' when uu.status = 2 then '冻结' when uu.status = 3 then '删除' else '' end as statusName, + rr.roleName, + uu.* from sys_user as uu + LEFT JOIN sys_dept as d1 on d1.id = uu.deptid + LEFT JOIN sys_dept as d2 on d2.id = d1.pid + LEFT JOIN (select s.id,s.name,GROUP_CONCAT(r.name) as roleName from sys_user s + left join sys_role r on find_in_set(r.id,s.roleid) group by s.id) as rr on rr.id = uu.id + ) as o + <where> + o.status != 3 + <if test="name != null and name != ''"> + and (o.phone like CONCAT('%',#{name},'%') + or o.account like CONCAT('%',#{name},'%') + or o.name like CONCAT('%',#{name},'%')) + </if> + <if test="deptid != null and deptid != 0"> + and (o.deptid = #{deptid} or o.deptid in ( select id from sys_dept where pids like CONCAT('%[', #{deptid}, ']%') )) + </if> + <if test="beginTime != null and beginTime != '' and endTime != null and endTime != ''"> + and (o.createTime between CONCAT(#{beginTime},' 00:00:00') and CONCAT(#{endTime},' 23:59:59')) + </if> + <if test="officeIds != null and officeIds.size() > 0"> + and o.object_id in + <foreach collection="officeIds" separator="," item="id" open="(" close=")"> + #{id} + </foreach> + </if> + and o.role_type = 2 + </where> + order by o.id desc + </select> + </mapper> -- Gitblit v1.7.1