From fa27f4693363b7ca709273508d39a7209118cb99 Mon Sep 17 00:00:00 2001
From: liusheng <337615773@qq.com>
Date: 星期一, 07 七月 2025 14:14:19 +0800
Subject: [PATCH] 代码提交

---
 smartor/src/main/resources/mapper/smartor/PatMedOuthospMapper.xml |   26 ++++++++++++++++++--------
 1 files changed, 18 insertions(+), 8 deletions(-)

diff --git a/smartor/src/main/resources/mapper/smartor/PatMedOuthospMapper.xml b/smartor/src/main/resources/mapper/smartor/PatMedOuthospMapper.xml
index 71fa63d..84fedd6 100644
--- a/smartor/src/main/resources/mapper/smartor/PatMedOuthospMapper.xml
+++ b/smartor/src/main/resources/mapper/smartor/PatMedOuthospMapper.xml
@@ -122,13 +122,6 @@
             <if test="deptname != null  and deptname != ''">and pmo.deptname like concat('%', #{deptname}, '%')</if>
             <if test="drname != null  and drname != ''">and pmo.drname like concat('%', #{drname}, '%')</if>
             <if test="patname != null  and patname != ''">and pmo.patname like concat('%', #{patname}, '%')</if>
-
-            <!--<if test="beginTime != null ">and date_format(pmo.admitdate,'%Y%m%d%H%i%s') &gt;=
-                date_format(#{beginTime},'%Y%m%d%H%i%s')
-            </if>
-            <if test="endTime != null ">and date_format(pmo.admitdate,'%Y%m%d%H%i%s') &lt;=
-                date_format(#{endTime},'%Y%m%d%H%i%s')
-            </if>-->
             <if test="beginTime != null ">and date_format(pmo.admitdate,'%y%m%d') &gt;=
                 date_format(#{beginTime},'%y%m%d')
             </if>
@@ -279,7 +272,24 @@
             del_flag=0
             and date_format(admitdate,'%y%m%d') &gt;= date_format(#{startDate},'%y%m%d')
             and date_format(admitdate,'%y%m%d') &lt;= date_format(#{endDate},'%y%m%d')
-            <if test="deptcodeList != null">
+            <if test="deptcodeList != null and deptcodeList.size()>0">
+                and deptcode in
+                <foreach collection="deptcodeList" item="deptcode" open="(" separator="," close=")">
+                    #{deptcode}
+                </foreach>
+            </if>
+        </where>
+    </select>
+
+    <select id="getDeptRanking" parameterType="com.smartor.domain.PatMedReq" resultType="com.smartor.domain.PatMedRes">
+        SELECT deptname, COUNT(1) AS rc
+        FROM pat_med_outhosp
+        <where>
+            del_flag=0
+            <if test="inhospstate != inhospstate">
+                and inhospstate= #{inhospstate}
+            </if>
+            <if test="deptcodeList != null and deptcodeList.size()>0">
                 and deptcode in
                 <foreach collection="deptcodeList" item="deptcode" open="(" separator="," close=")">
                     #{deptcode}

--
Gitblit v1.9.3