From 2ad97245d64b65132507cab36ad89d968edb7705 Mon Sep 17 00:00:00 2001 From: 无关风月 <443237572@qq.com> Date: 星期四, 20 三月 2025 09:50:09 +0800 Subject: [PATCH] sql文件 --- guns-management/src/main/java/com/stylefeng/guns/modular/system/dao/mapping/UserMapper.xml | 21 ++++++++++++++++++++- 1 files changed, 20 insertions(+), 1 deletions(-) diff --git a/guns-management/src/main/java/com/stylefeng/guns/modular/system/dao/mapping/UserMapper.xml b/guns-management/src/main/java/com/stylefeng/guns/modular/system/dao/mapping/UserMapper.xml index 53d4db1..23ae3c9 100644 --- a/guns-management/src/main/java/com/stylefeng/guns/modular/system/dao/mapping/UserMapper.xml +++ b/guns-management/src/main/java/com/stylefeng/guns/modular/system/dao/mapping/UserMapper.xml @@ -49,7 +49,7 @@ <if test="deptid != null and deptid != 0"> and (deptid = #{deptid} or deptid in ( select id from sys_dept where pids like CONCAT('%[', #{deptid}, ']%') )) </if> - <if test="beginTime != null and beginTime != '' and endTime != null and endTime != ''"> + <if test="beginTime != null and endTime != null"> and (createTime between CONCAT(#{beginTime},' 00:00:00') and CONCAT(#{endTime},' 23:59:59')) </if> </select> @@ -78,4 +78,23 @@ <select id="getSysUserDetails" resultType="map"> select * ,IF( sex = 1, '男', '女' ) sexName FROM sys_user where id=#{id} </select> + <select id="getUsers" resultType="java.util.Map"> + SELECT us.id,us.createtime,us.account,us.`name`,us.sex,sr.`name` as roleName,sd.simplename as deptName,us.email,us.phone,us.`status` + from sys_user us + LEFT JOIN sys_role sr ON us.roleid = sr.id + LEFT JOIN sys_dept sd on us.deptid = sd.id + <where> + us.status != 3 + <if test="null != phone and '' != phone"> + and us.phone like CONCAT('%', #{phone}, '%') + </if> + <if test="null != name and '' != name"> + and us.name like CONCAT('%', #{name}, '%') + </if> + <if test="null != deptName and '' != deptName"> + and sd.simplename like CONCAT('%', #{deptName}, '%') + </if> + </where> + order by us.createtime desc + </select> </mapper> -- Gitblit v1.7.1