From 18925965b55c103283a2fcbb161cceed41139ec6 Mon Sep 17 00:00:00 2001
From: 陈昶聿 <chychen@nbjetron.com>
Date: 星期四, 12 十一月 2026 17:14:20 +0800
Subject: [PATCH] /system/user/list 增加hospInfoCode\deptInfoCode 匹配
---
ruoyi-system/src/main/resources/mapper/system/SysUserMapper.xml | 99 +++++++++++++++++++++++++++++++++++++++++--------
1 files changed, 83 insertions(+), 16 deletions(-)
diff --git a/ruoyi-system/src/main/resources/mapper/system/SysUserMapper.xml b/ruoyi-system/src/main/resources/mapper/system/SysUserMapper.xml
index 20ff6a8..9075330 100644
--- a/ruoyi-system/src/main/resources/mapper/system/SysUserMapper.xml
+++ b/ruoyi-system/src/main/resources/mapper/system/SysUserMapper.xml
@@ -36,6 +36,7 @@
<result property="searchscope" column="searchscope"/>
<result property="guid" column="guid"/>
<result property="orgid" column="orgid"/>
+ <result property="campusid" column="campusid"/>
<association property="dept" column="dept_id" javaType="com.ruoyi.common.core.domain.entity.SysDept"
resultMap="deptResult"/>
<collection property="roles" javaType="java.util.List" resultMap="RoleResult"/>
@@ -90,6 +91,7 @@
u.remark,
u.guid,
u.orgid,
+ u.campusid,
d.dept_id,
d.parent_id,
d.ancestors,
@@ -119,15 +121,14 @@
u.birthday,
u.job_phone,
u.phonenumber, u.sex, u.status,
- u.del_flag, u.login_ip, u.login_date, u.create_by, u.create_time, u.remark, d.dept_name from sys_user
- u
+ u.del_flag, u.login_ip, u.login_date, u.create_by, u.create_time, u.remark,
+ u.orgid,u.campusid,
+ d.dept_name
+ from sys_user u
left join sys_user_dept d on u.user_id = d.user_id
where u.del_flag = '0'
<if test="userId != null">
AND u.user_id = #{userId}
- </if>
- <if test="orgid != null and orgid != ''">
- AND u.orgid = #{orgid}
</if>
<if test="userName != null and userName != ''">
AND u.user_name like concat('%', #{userName}, '%')
@@ -171,6 +172,22 @@
<if test="deptId != null and deptId != 0">
AND (u.dept_id = #{deptId} OR u.dept_id IN ( SELECT t.dept_id FROM sys_dept t WHERE find_in_set(#{deptId},
ancestors) ))
+ </if>
+ <if test="hospInfoCodeList != null and hospInfoCodeList.size() > 0">
+ <!-- 绉戝澶� Code 浠讳竴鍖归厤锛欴001,D003 绛変环浜� D001 鎴� D003锛岄『搴忔棤鍏� -->
+ AND (
+ <foreach collection="hospInfoCodeList" item="code" separator=" OR ">
+ u.hosp_info LIKE concat('%"', #{code}, '"%')
+ </foreach>
+ )
+ </if>
+ <if test="deptInfoCodeList != null and deptInfoCodeList.size() > 0">
+ <!-- 鐥呭尯澶� Code 浠讳竴鍖归厤锛歐001,W003 绛変环浜� W001 鎴� W003锛岄『搴忔棤鍏� -->
+ AND (
+ <foreach collection="deptInfoCodeList" item="code" separator=" OR ">
+ u.dept_info LIKE concat('%"', #{code}, '"%')
+ </foreach>
+ )
</if>
<!-- 鏁版嵁鑼冨洿杩囨护 -->
${params.dataScope}
@@ -185,13 +202,18 @@
u.birthday,
u.job_phone,
u.phonenumber, u.sex, u.status,
- u.del_flag, u.login_ip, u.login_date, u.create_by, u.create_time, u.remark from sys_user u
+ u.del_flag, u.login_ip, u.login_date, u.create_by, u.create_time, u.remark,
+ u.orgid, u.campusid
+ from sys_user u
where u.del_flag = '0'
+ <if test="orgid != null">
+ AND u.orgid = #{orgid}
+ </if>
<if test="userId != null">
AND u.user_id = #{userId}
</if>
- <if test="orgid != null and orgid != ''">
- AND u.orgid = #{orgid}
+ <if test="userCode != null">
+ AND u.user_code = #{userCode}
</if>
<if test="userName != null and userName != ''">
AND u.user_name like concat('%', #{userName}, '%')
@@ -236,7 +258,43 @@
AND (u.dept_id = #{deptId} OR u.dept_id IN ( SELECT t.dept_id FROM sys_dept t WHERE find_in_set(#{deptId},
ancestors) ))
</if>
+ <if test="hospInfoCodeList != null and hospInfoCodeList.size() > 0">
+ <!-- 绉戝澶� Code 浠讳竴鍖归厤锛欴001,D003 绛変环浜� D001 鎴� D003锛岄『搴忔棤鍏� -->
+ AND (
+ <foreach collection="hospInfoCodeList" item="code" separator=" OR ">
+ u.hosp_info LIKE concat('%"', #{code}, '"%')
+ </foreach>
+ )
+ </if>
+ <if test="deptInfoCodeList != null and deptInfoCodeList.size() > 0">
+ <!-- 鐥呭尯澶� Code 浠讳竴鍖归厤锛歐001,W003 绛変环浜� W001 鎴� W003锛岄『搴忔棤鍏� -->
+ AND (
+ <foreach collection="deptInfoCodeList" item="code" separator=" OR ">
+ u.dept_info LIKE concat('%"', #{code}, '"%')
+ </foreach>
+ )
+ </if>
<if test="pageSize != null and pageNum != null">limit ${pageSize} OFFSET ${pageNum}</if>
+ </select>
+
+ <select id="selectUsersForRepairUserDept" resultMap="SysUserResult">
+ select u.user_id,
+ u.user_name,
+ u.orgid,
+ u.campusid,
+ u.hosp_info,
+ u.dept_info
+ from sys_user u
+ where u.del_flag = '0'
+ and ((u.hosp_info is not null and u.hosp_info != '' and u.hosp_info != '[]')
+ or (u.dept_info is not null and u.dept_info != '' and u.dept_info != '[]'))
+ <if test="orgid != null and orgid != ''">
+ AND u.orgid = #{orgid}
+ </if>
+ <if test="userId != null">
+ AND u.user_id = #{userId}
+ </if>
+ order by u.user_id
</select>
<select id="selectAllocatedList" parameterType="com.ruoyi.common.core.domain.entity.SysUser"
@@ -309,8 +367,8 @@
<select id="selectUserByUserNameByCondition" parameterType="String" resultMap="SysUserResult">
<include refid="selectUserVo"/>
- <where>
- u.del_flag = '0'
+ where 1=1
+ AND u.del_flag = '0'
<if test="userName != null and userName != ''">
AND u.user_name = #{userName}
</if>
@@ -320,7 +378,6 @@
<if test="deptId != null and deptId != ''">
AND u.dept_id = #{deptId}
</if>
- </where>
</select>
<select id="selectUserById" parameterType="Long" resultMap="SysUserResult">
@@ -328,11 +385,18 @@
where u.user_id = #{userId}
</select>
- <select id="checkUserNameUnique" parameterType="String" resultMap="SysUserResult">
+ <select id="checkUserNameUnique" parameterType="com.ruoyi.common.core.domain.entity.SysUser" resultMap="SysUserResult">
select user_id, user_name
from sys_user
where user_name = #{userName}
- and del_flag = '0' limit 1
+ and del_flag = '0'
+ <if test="orgid != null and orgid != ''">
+ and orgid = #{orgid}
+ </if>
+ <if test="campusid != null and campusid != ''">
+ and campusid = #{campusid}
+ </if>
+ limit 1
</select>
<select id="checkPhoneUnique" parameterType="String" resultMap="SysUserResult">
@@ -374,9 +438,10 @@
<if test="jobPhone != null and jobPhone != ''">job_phone,</if>
<if test="birthday != null ">birthday,</if>
<if test="hisUserId != null and hisUserId != ''">his_user_id,</if>
- <if test="orgid != null and orgid != ''">orgid,</if>
<if test="deptCode != null and deptCode != ''">dept_code,</if>
<if test="deptName != null and deptName != ''">dept_name,</if>
+ <if test="orgid != null and orgid != ''">orgid,</if>
+ <if test="campusid != null and campusid != ''">campusid,</if>
create_time
)values(
<if test="userId != null and userId != ''">#{userId},</if>
@@ -400,9 +465,10 @@
<if test="jobPhone != null and jobPhone != ''">#{jobPhone},</if>
<if test="birthday != null and birthday != ''">#{birthday},</if>
<if test="hisUserId != null and hisUserId != ''">#{hisUserId},</if>
- <if test="orgid != null and orgid != ''">#{orgid},</if>
<if test="deptCode != null and deptCode != ''">#{deptCode},</if>
<if test="deptName != null and deptName != ''">#{deptName},</if>
+ <if test="orgid != null and orgid != ''">#{orgid},</if>
+ <if test="campusid != null and campusid != ''">#{campusid},</if>
sysdate()
)
</insert>
@@ -430,7 +496,6 @@
<if test="idCard != null and idCard != ''">id_card=#{idCard},</if>
<if test="jobPhone != null and jobPhone != ''">job_phone=#{jobPhone},</if>
<if test="birthday != null ">birthday=#{birthday},</if>
- <if test="orgid != null ">orgid=#{orgid},</if>
<if test="title != null and title != ''">
title = #{title},
</if>
@@ -439,6 +504,8 @@
</if>
<if test="deptCode != null and deptCode != ''">dept_code=#{deptCode},</if>
<if test="deptName != null and deptName != ''">dept_name=#{deptName},</if>
+ <if test="orgid != null and orgid != ''">orgid=#{orgid},</if>
+ <if test="campusid != null and campusid != ''">campusid=#{campusid},</if>
update_time = sysdate()
</set>
where user_id = #{userId}
--
Gitblit v1.9.3