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 | 52 ++++++++++++++++++++++++++++++++++++++++++++++++++++
1 files changed, 52 insertions(+), 0 deletions(-)
diff --git a/ruoyi-system/src/main/resources/mapper/system/SysUserMapper.xml b/ruoyi-system/src/main/resources/mapper/system/SysUserMapper.xml
index f85b5ab..9075330 100644
--- a/ruoyi-system/src/main/resources/mapper/system/SysUserMapper.xml
+++ b/ruoyi-system/src/main/resources/mapper/system/SysUserMapper.xml
@@ -173,6 +173,22 @@
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}
</select>
@@ -242,9 +258,45 @@
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"
resultMap="SysUserResult">
select distinct u.user_id,u.his_user_id,u.title,u.hosp_info,u.dept_info, u.searchscope, u.dept_id, u.user_name,
--
Gitblit v1.9.3