From 0c621621889c90a119e2ff9e41c4f5528f395f7e Mon Sep 17 00:00:00 2001
From: liusheng <337615773@qq.com>
Date: 星期五, 16 五月 2025 16:04:18 +0800
Subject: [PATCH] 代码提交

---
 smartor/src/main/resources/mapper/smartor/PatMedInhospMapper.xml |   22 +++++++++++++---------
 1 files changed, 13 insertions(+), 9 deletions(-)

diff --git a/smartor/src/main/resources/mapper/smartor/PatMedInhospMapper.xml b/smartor/src/main/resources/mapper/smartor/PatMedInhospMapper.xml
index 36d4062..0314b0c 100644
--- a/smartor/src/main/resources/mapper/smartor/PatMedInhospMapper.xml
+++ b/smartor/src/main/resources/mapper/smartor/PatMedInhospMapper.xml
@@ -197,7 +197,8 @@
         b.futypecode,
         b.futypedesc,
         b.fuadvice,
-        b.fuspecialadvice
+        b.fuspecialadvice,
+        a.idcardno
         FROM
         pat_med_inhosp b
         JOIN
@@ -293,7 +294,12 @@
         a.telcode,
         a.id,
         a.sex
-        order by b.inhospid desc
+        <if test="cry==1">
+            order by b.endtime desc
+        </if>
+        <if test="cry==0">
+            order by b.starttime desc
+        </if>
     </select>
     <select id="selectPatMedInhospListByCondition" parameterType="com.smartor.domain.PatMedInhospVO"
             resultMap="PatMedInhospResult">
@@ -645,7 +651,7 @@
             FROM pat_med_outhosp
             <where>
                 del_flag=0
-                <if test="deptcodeList != null">
+                <if test="deptcodeList != null   and deptcodeList.size() > 0">
                     and deptcode in
                     <foreach collection="deptcodeList" item="deptcode" open="(" separator="," close=")">
                         #{deptcode}
@@ -662,7 +668,7 @@
             <where>
                 del_flag=0
                 and inhospstate=0
-                <if test="deptcodeList != null">
+                <if test="deptcodeList != null   and deptcodeList.size() > 0">
                     and deptcode in
                     <foreach collection="deptcodeList" item="deptcode" open="(" separator="," close=")">
                         #{deptcode}
@@ -677,7 +683,7 @@
             <where>
                 del_flag=0
                 and inhospstate=1
-                <if test="deptcodeList != null">
+                <if test="deptcodeList != null   and deptcodeList.size() > 0">
                     and deptcode in
                     <foreach collection="deptcodeList" item="deptcode" open="(" separator="," close=")">
                         #{deptcode}
@@ -692,7 +698,7 @@
             <where>
                 del_flag=0
                 and inhospstate=1
-                <if test="deptcodeList != null">
+                <if test="deptcodeList != null   and deptcodeList.size() > 0">
                     and deptcode in
                     <foreach collection="deptcodeList" item="deptcode" open="(" separator="," close=")">
                         #{deptcode}
@@ -702,8 +708,6 @@
         </if>
         ) AS combined
         GROUP BY deptname;
-
-
     </select>
     <select id="selectPatMedInhospCount" parameterType="com.smartor.domain.PatMedReq"
             resultType="com.smartor.domain.PatMedRes">
@@ -724,7 +728,7 @@
                 and date_format(endtime,'%y%m%d') &gt;= date_format(#{startDate},'%y%m%d')
                 and date_format(endtime,'%y%m%d') &lt;= date_format(#{endDate},'%y%m%d')
             </if>
-            <if test="deptcodeList != null">
+            <if test="deptcodeList != null   and deptcodeList.size() > 0">
                 and deptcode in
                 <foreach collection="deptcodeList" item="deptcode" open="(" separator="," close=")">
                     #{deptcode}

--
Gitblit v1.9.3