From 5d1d54e83546ba9fc85c69b32287883d04f4a475 Mon Sep 17 00:00:00 2001
From: liusheng <337615773@qq.com>
Date: 星期五, 01 十一月 2024 18:56:13 +0800
Subject: [PATCH] 代码提交

---
 smartor/src/main/resources/mapper/smartor/PatArchiveMapper.xml |   16 ++--------------
 1 files changed, 2 insertions(+), 14 deletions(-)

diff --git a/smartor/src/main/resources/mapper/smartor/PatArchiveMapper.xml b/smartor/src/main/resources/mapper/smartor/PatArchiveMapper.xml
index 766679f..1349cf4 100644
--- a/smartor/src/main/resources/mapper/smartor/PatArchiveMapper.xml
+++ b/smartor/src/main/resources/mapper/smartor/PatArchiveMapper.xml
@@ -500,26 +500,14 @@
             <if test="deptname != null and deptname != ''">
                 AND d.deptname LIKE concat('%',#{deptname}, '%')
             </if>
-            <if test="leavehospitaldistrictcodes != null and leaveldeptcodes != null">
-                AND (d.leavehospitaldistrictcode IN
-                <foreach collection="leavehospitaldistrictcodes" item="leavehospitaldistrictcode" open="(" separator=","
-                         close=")">
-                    #{leavehospitaldistrictcode}
-                </foreach>
-                OR d.leaveldeptcode IN
-                <foreach collection="leaveldeptcodes" item="leaveldeptcode" open="(" separator=","
-                         close="))">
-                    #{leaveldeptcode}
-                </foreach>
-            </if>
-            <if test="leavehospitaldistrictcodes != null and leaveldeptcodes == null">
+            <if test="leavehospitaldistrictcodes != null and leavehospitaldistrictcodes.size()>0">
                 AND d.leavehospitaldistrictcode IN
                 <foreach collection="leavehospitaldistrictcodes" item="leavehospitaldistrictcode" open="(" separator=","
                          close=")">
                     #{leavehospitaldistrictcode}
                 </foreach>
             </if>
-            <if test="leavehospitaldistrictcodes == null and leaveldeptcodes != null">
+            <if test="leaveldeptcodes != null and leaveldeptcodes.size() > 0">
                 AND d.leaveldeptcode IN
                 <foreach collection="leaveldeptcodes" item="leaveldeptcode" open="(" separator=","
                          close=")">

--
Gitblit v1.9.3