From 56e76b12172aa483ea15792028137a38fba71755 Mon Sep 17 00:00:00 2001
From: 陈昶聿 <chychen@nbjetron.com>
Date: 星期四, 05 二月 2026 14:37:27 +0800
Subject: [PATCH] 【丽水】报错处理

---
 ruoyi-quartz/src/main/resources/mapper/quartz/CollectHISMapper.xml |   59 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++-
 1 files changed, 58 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 7975eb9..5c0653a 100644
--- a/ruoyi-quartz/src/main/resources/mapper/quartz/CollectHISMapper.xml
+++ b/ruoyi-quartz/src/main/resources/mapper/quartz/CollectHISMapper.xml
@@ -17,6 +17,13 @@
         <result property="updateTime" column="update_time"/>
     </resultMap>
 
+    <resultMap type="com.smartor.domain.SysUserOrg" id="SysUserOrgResult">
+        <result property="id" column="id"/>
+        <result property="userId" column="user_id"/>
+        <result property="campusid" column="campusid"/>
+        <result property="orgid" column="orgid"/>
+        <result property="delFlag" column="del_flag"/>
+    </resultMap>
 
     <resultMap type="com.ruoyi.common.core.domain.entity.SysUserRole" id="SysUserRoleResult">
         <result property="userId" column="user_id"/>
@@ -378,12 +385,62 @@
         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>
+        <if test="hisUserId != null ">and user_id = #{hisUserId}</if>
+    </select>
+
+    <select id="yhyyqxx" parameterType="com.ruoyi.common.core.domain.entity.SysUser" resultMap="SysUserOrgResult">
+        select
+            d.orgid as campusid,
+            ud.user_id as user_id,
+            ud.orgid as orgid
+        FROM healthy_dept d
+        JOIN healthy_user_dept ud ON d.his_dept_id = ud.dept_code
+        where 1=1
+        and ud.user_id != 'admin'
+        <if test="orgid != null and orgid != ''">
+            AND ud.orgid = #{orgid}
+        </if>
+        <if test="hisUserId != null ">
+            AND ud.user_id = #{hisUserId}
+        </if>
+        <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">
         <include refid="selectPatArchiveVo"/>
@@ -603,7 +660,7 @@
         from healthy_user u
         where 1=1
             <if test="orgid != null and orgid != ''">
-                AND orgid = #{orgid}
+                AND u.orgid = #{orgid}
             </if>
             <if test="userId != null and userId != 0">
                 AND u.user_id = #{userId}

--
Gitblit v1.9.3