From c4f9c032d2a4fcd57d59846bc208d7d225ba5aa8 Mon Sep 17 00:00:00 2001 From: zhs <zhs18203887318@163.com> Date: 星期六, 16 八月 2025 15:28:48 +0800 Subject: [PATCH] 0816 zhs --- smartor/src/main/resources/mapper/smartor/ServiceSubtaskMapper.xml | 28 +++++++++++++++++++--------- 1 files changed, 19 insertions(+), 9 deletions(-) diff --git a/smartor/src/main/resources/mapper/smartor/ServiceSubtaskMapper.xml b/smartor/src/main/resources/mapper/smartor/ServiceSubtaskMapper.xml index c02bd2d..e1d9330 100644 --- a/smartor/src/main/resources/mapper/smartor/ServiceSubtaskMapper.xml +++ b/smartor/src/main/resources/mapper/smartor/ServiceSubtaskMapper.xml @@ -1227,8 +1227,12 @@ 0 AS pmiCount, 0 AS pmoCount FROM service_subtask - WHERE visit_time BETWEEN #{startDate} AND #{endDate} - AND del_flag = '0' + WHERE + del_flag = '0' + <if test="startDate != null and endDate != null"> + and date_format(visit_time,'%y%m%d') >= date_format(#{startDate},'%y%m%d') + and date_format(visit_time,'%y%m%d') <= date_format(#{endDate},'%y%m%d') + </if> <if test="orgid != null"> AND orgid = #{orgid} @@ -1297,12 +1301,16 @@ </choose> 0 AS dischargeFollowCount, 0 AS outpatientFollowCount, - COUNT(DISTINCT patid) AS pmiCount, + COUNT( patid) AS pmiCount, 0 AS pmoCount FROM pat_med_inhosp - WHERE endtime BETWEEN #{startDate} AND #{endDate} - AND del_flag = '0' + WHERE del_flag = '0' + <if test="startDate != null and endDate != null"> + and date_format(endtime,'%y%m%d') >= date_format(#{startDate},'%y%m%d') + and date_format(endtime,'%y%m%d') <= date_format(#{endDate},'%y%m%d') + </if> + AND inhospstate=1 <if test="orgid != null"> AND orgid = #{orgid} </if> @@ -1364,11 +1372,13 @@ 0 AS dischargeFollowCount, 0 AS outpatientFollowCount, 0 AS pmiCount, - COUNT(DISTINCT patid) AS pmoCount + COUNT( patid) AS pmoCount FROM pat_med_outhosp - WHERE admitdate BETWEEN #{startDate} AND #{endDate} - AND del_flag = '0' - + WHERE del_flag = '0' + <if test="startDate != null and endDate != null"> + and date_format(admitdate,'%y%m%d') >= date_format(#{startDate},'%y%m%d') + and date_format(admitdate,'%y%m%d') <= date_format(#{endDate},'%y%m%d') + </if> <if test="orgid != null"> AND orgid = #{orgid} </if> -- Gitblit v1.9.3