From 987e38327f849e1b13d8541246dde08d877db0e8 Mon Sep 17 00:00:00 2001
From: 陈昶聿 <chychen@nbjetron.com>
Date: 星期三, 07 一月 2026 14:10:43 +0800
Subject: [PATCH] 【市一】调整mapper获取ordid

---
 smartor/src/main/resources/mapper/smartor/HNGatherPatArchiveMapper.xml |   58 ++++++++++++++++++++++++++++++++++++----------------------
 1 files changed, 36 insertions(+), 22 deletions(-)

diff --git a/smartor/src/main/resources/mapper/smartor/HNGatherPatArchiveMapper.xml b/smartor/src/main/resources/mapper/smartor/HNGatherPatArchiveMapper.xml
index ac28143..c137f5b 100644
--- a/smartor/src/main/resources/mapper/smartor/HNGatherPatArchiveMapper.xml
+++ b/smartor/src/main/resources/mapper/smartor/HNGatherPatArchiveMapper.xml
@@ -367,25 +367,31 @@
     <select id="yhyjsxx" parameterType="com.ruoyi.common.core.domain.entity.SysUser" resultMap="SysUserRoleResult">
         select user_id, role_id, orgid
         FROM yhyjsxx
-        <where>
+        WHERE 1=1
+            <if test="orgid != null and orgid != ''"> and orgid = #{orgid}</if>
+
             <if test="hisUserId != null ">and user_id = #{hisUserId}</if>
-        </where>
+        
     </select>
 
     <select id="yhyksxx" parameterType="com.ruoyi.common.core.domain.entity.SysUser" resultMap="SysUserDeptResult">
         select user_id, user_code, dept_type,department_id as
         dept_id,dept_name,deptparent,del_flag,orgid,create_time,create_by,update_time,update_by
         FROM yhyksxx
-        <where>
-            user_id != 'admin'
+        WHERE 1=1
+            <if test="orgid != null and orgid != ''"> and orgid = #{orgid}</if>
+
+            AND user_id != 'admin'
             <if test="hisUserId != null ">and user_id = #{hisUserId}</if>
-        </where>
+        
     </select>
 
 
     <select id="selectPatArchiveList" parameterType="com.smartor.domain.PatArchive" resultMap="PatArchiveResult">
         <include refid="selectPatArchiveVo"/>
-        <where>
+        WHERE 1=1
+            <if test="orgid != null and orgid != ''"> and orgid = #{orgid}</if>
+
             <if test="name != null  and name != ''">and name like concat('%', #{name}, '%')</if>
             <if test="idcardno != null  and idcardno != ''">and idcardno = #{idcardno}</if>
             <if test="sourcefrom != null ">and sourcefrom = #{sourcefrom}</if>
@@ -415,7 +421,7 @@
             <if test="casePersonAge != null ">and case_person_age = #{casePersonAge}</if>
             <if test="filterDrname != null ">and filter_drname = #{filterDrname}</if>
             <if test="filterDrcode != null ">and filter_drcode = #{filterDrcode}</if>
-        </where>
+        
     </select>
 
 
@@ -494,19 +500,21 @@
         b.fuadvice
         FROM
         cryxx b
-        <where>
+        WHERE 1=1
+            <if test="orgid != null and orgid != ''"> and orgid = #{orgid}</if>
+
 
             <if test="startOutHospTime != null ">and to_char(b.endtime,'YYMMDD') &gt;=
-                to_char(#{startOutHospTime}::date,'YYMMDD')
+                AND to_char(#{startOutHospTime}::date,'YYMMDD')
             </if>
             <if test="endOutHospTime != null ">and to_char(b.endtime,'YYMMDD') &lt;=
-                to_char(#{endOutHospTime}::date,'YYMMDD')
+                AND to_char(#{endOutHospTime}::date,'YYMMDD')
             </if>
             <if test="startInHospTime != null ">and to_char(b.starttime,'YYMMDD') &gt;=
-                to_char(#{startInHospTime}::date,'%y%m%d')
+                AND to_char(#{startInHospTime}::date,'%y%m%d')
             </if>
             <if test="endInHospTime != null ">and to_char(b.starttime,'YYMMDD') &lt;=
-                to_char(#{endInHospTime}::date,'YYMMDD')
+                AND to_char(#{endInHospTime}::date,'YYMMDD')
             </if>
             <if test="inhospno != null ">and b.inhospno = #{inhospno}</if>
             <if test="fuflag != null ">and b.fuflag = #{fuflag}</if>
@@ -518,7 +526,7 @@
             <if test="outWayId != null ">and b.out_way_id = #{outWayId}</if>
             <if test="outWayName != null ">and b.out_way_name = #{outWayName}</if>
             <if test="orgid != null ">and b.orgid = #{orgid}</if>
-        </where>
+        
     </select>
 
 
@@ -552,16 +560,18 @@
         patname,
         mainsuit
         from mzxx
-        <where>
+        WHERE 1=1
+            <if test="orgid != null and orgid != ''"> and orgid = #{orgid}</if>
+
 
             <if test="beginTime != null ">and to_char( admitdate,'YYMMDD') &gt;=
-                to_char(#{beginTime}::date,'YYMMDD')
+                AND to_char(#{beginTime}::date,'YYMMDD')
             </if>
             <if test="endTime != null ">and to_char( admitdate,'YYMMDD') &lt;=
-                to_char(#{endTime}::date,'YYMMDD')
+                AND to_char(#{endTime}::date,'YYMMDD')
             </if>
 
-        </where>
+        
     </select>
 
 
@@ -574,7 +584,9 @@
         icdname,
         icdpym
         from jbxx
-        <where>
+        WHERE 1=1
+            <if test="orgid != null and orgid != ''"> and orgid = #{orgid}</if>
+
             <if test="icdcode != null  and icdcode != ''">and icdcode = #{icdcode}</if>
             <if test="lastflag != null  and lastflag != ''">and lastflag = #{lastflag}</if>
             <if test="chimedflag != null  and chimedflag != ''">and chimedflag = #{chimedflag}</if>
@@ -585,7 +597,7 @@
             <if test="pid != null ">and pid = #{pid}</if>
             <if test="guid != null  and guid != ''">and guid = #{guid}</if>
             <if test="hisIcdid != null  and hisIcdid != ''">and his_icdid = #{hisIcdid}</if>
-        </where>
+        
     </select>
 
 
@@ -596,7 +608,9 @@
         u.birthday,u.orgid,u.job_phone,u.phonenumber, u.sex, u.status,
         u.login_ip, u.login_date, u.create_by, u.create_time, u.remark
         from ryxx u
-        <where>
+        WHERE 1=1
+            <if test="orgid != null and orgid != ''"> and orgid = #{orgid}</if>
+
             <if test="userId != null and userId != 0">
                 AND u.user_id = #{userId}
             </if>
@@ -627,7 +641,7 @@
             <if test="phonenumber != null and phonenumber != ''">
                 AND u.phonenumber like concat('%', #{phonenumber}, '%')
             </if>
-        </where>
+        
     </select>
 
     <select id="selectDeptList" parameterType="com.ruoyi.common.core.domain.entity.SysDept" resultMap="SysDeptResult">
@@ -645,7 +659,7 @@
                d.create_time,
                d.his_dept_id,
                d.his_parent_id
-        FROM bmxx d
+        FROM HEALTHY_DEPT d
 
     </select>
 </mapper>

--
Gitblit v1.9.3