From 203acef84d19ffc01bc8d5dd8ef85f90ba400f5c Mon Sep 17 00:00:00 2001 From: xiangpei <xiangpei@timesnew.cn> Date: 星期日, 09 三月 2025 11:49:58 +0800 Subject: [PATCH] 容缺查询 --- system/src/main/resources/mapper/system/SysUserMapper.xml | 14 +++++++++++++- 1 files changed, 13 insertions(+), 1 deletions(-) diff --git a/system/src/main/resources/mapper/system/SysUserMapper.xml b/system/src/main/resources/mapper/system/SysUserMapper.xml index 0130fef..1eb7d74 100644 --- a/system/src/main/resources/mapper/system/SysUserMapper.xml +++ b/system/src/main/resources/mapper/system/SysUserMapper.xml @@ -34,6 +34,7 @@ <result property="ancestors" column="ancestors" /> <result property="orderNum" column="order_num" /> <result property="leader" column="leader" /> + <result property="phone" column="phone" /> <result property="status" column="dept_status" /> </resultMap> @@ -48,7 +49,7 @@ <sql id="selectUserVo"> select u.user_id, u.dept_id, u.user_name, u.nick_name, u.email, u.avatar, u.phonenumber, 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, + d.dept_id, d.parent_id, d.ancestors, d.dept_name, d.order_num, d.leader, d.phone, 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 sys_user u left join sys_dept d on u.dept_id = d.dept_id @@ -65,6 +66,9 @@ </if> <if test="userName != null and userName != ''"> AND u.user_name like concat('%', #{userName}, '%') + </if> + <if test="nickName != null and nickName != ''"> + AND u.nick_name like concat('%', #{nickName}, '%') </if> <if test="status != null and status != ''"> AND u.status = #{status} @@ -128,6 +132,11 @@ <select id="selectUserById" parameterType="Long" resultMap="SysUserResult"> <include refid="selectUserVo"/> where u.user_id = #{userId} + </select> + + <select id="selectUserByIds" parameterType="Long" resultMap="SysUserResult"> + <include refid="selectUserVo"/> + where u.user_id in <foreach collection="userIds" open="(" separator="," close=")" item="userId">#{userId}</foreach> </select> <select id="checkUserNameUnique" parameterType="String" resultMap="SysUserResult"> @@ -218,4 +227,7 @@ </foreach> </delete> + <select id="getByDept" resultMap="SysUserResult"> + select * from sys_user where dept_id = #{deptId} and del_flag = '0' + </select> </mapper> -- Gitblit v1.8.0