From f15170964e60cd578e54fe2516f9cf086a82c75e Mon Sep 17 00:00:00 2001
From: liusheng <337615773@qq.com>
Date: 星期五, 06 二月 2026 17:16:04 +0800
Subject: [PATCH] patItem科室、病区数量不能超过10个

---
 ruoyi-quartz/src/main/resources/mapper/quartz/CollectHISMapper.xml |   32 +++++++++++++++++++++++++++++++-
 1 files changed, 31 insertions(+), 1 deletions(-)

diff --git a/ruoyi-quartz/src/main/resources/mapper/quartz/CollectHISMapper.xml b/ruoyi-quartz/src/main/resources/mapper/quartz/CollectHISMapper.xml
index dd3ebe6..5c0653a 100644
--- a/ruoyi-quartz/src/main/resources/mapper/quartz/CollectHISMapper.xml
+++ b/ruoyi-quartz/src/main/resources/mapper/quartz/CollectHISMapper.xml
@@ -385,6 +385,19 @@
         FROM healthy_user_dept
         where 1=1
         and user_id != 'admin'
+        and dept_type = '1'
+        <if test="orgid != null and orgid != ''">
+            AND orgid = #{orgid}
+        </if>
+        <if test="hisUserId != null ">and user_id = #{hisUserId}</if>
+    </select>
+
+    <select id="yhybfxx" parameterType="com.ruoyi.common.core.domain.entity.SysUser" resultMap="SysUserDeptResult">
+        select user_id , user_code , dept_type ,dept_code,dept_name,deptparent,del_flag,orgid
+        FROM healthy_user_dept
+        where 1=1
+        and user_id != 'admin'
+        and dept_type = '2'
         <if test="orgid != null and orgid != ''">
             AND orgid = #{orgid}
         </if>
@@ -394,7 +407,6 @@
     <select id="yhyyqxx" parameterType="com.ruoyi.common.core.domain.entity.SysUser" resultMap="SysUserOrgResult">
         select
             d.orgid as campusid,
-            d.del_flag,
             ud.user_id as user_id,
             ud.orgid as orgid
         FROM healthy_dept d
@@ -410,6 +422,24 @@
         <if test="campusid != null">
             AND d.orgid = #{campusid}
         </if>
+        union all
+        select
+        d.orgid as campusid,
+        udb.user_id as user_id,
+        udb.orgid as orgid
+        FROM healthy_dept d
+        JOIN healthy_user_dept_bf udb ON d.his_dept_id = udb.dept_code
+        where 1=1
+        and udb.user_id != 'admin'
+        <if test="orgid != null and orgid != ''">
+            AND udb.orgid = #{orgid}
+        </if>
+        <if test="hisUserId != null ">
+            AND udb.user_id = #{hisUserId}
+        </if>
+        <if test="campusid != null">
+            AND d.orgid = #{campusid}
+        </if>
     </select>
 
     <select id="selectPatArchiveList" parameterType="com.smartor.domain.PatArchive" resultMap="PatArchiveResult">

--
Gitblit v1.9.3