From 195190571e567602d5e4e8ae3c7c490a515719ef Mon Sep 17 00:00:00 2001 From: liusheng <337615773@qq.com> Date: 星期二, 08 十月 2024 15:43:04 +0800 Subject: [PATCH] 代码提交 --- smartor/src/main/resources/mapper/smartor/PatMedInhospMapper.xml | 22 ++++++++++++++++++---- 1 files changed, 18 insertions(+), 4 deletions(-) diff --git a/smartor/src/main/resources/mapper/smartor/PatMedInhospMapper.xml b/smartor/src/main/resources/mapper/smartor/PatMedInhospMapper.xml index 52c1d4a..997a089 100644 --- a/smartor/src/main/resources/mapper/smartor/PatMedInhospMapper.xml +++ b/smartor/src/main/resources/mapper/smartor/PatMedInhospMapper.xml @@ -170,6 +170,20 @@ and b.del_flag=0 and a.id = b.patid AND a.idcardno != '' + <if test="startOutHospTime != null"> + AND date_format(b.endtime,'%y%m%d') >= date_format(#{startOutHospTime},'%y%m%d') + </if> + <if test="endOutHospTime != null"> + AND date_format(b.endtime,'%y%m%d') <= date_format(#{endOutHospTime},'%y%m%d') + </if> + + + <if test="startInHospTime != null"> + AND date_format(b.starttime,'%y%m%d') >= date_format(#{startInHospTime},'%y%m%d') + </if> + <if test="endInHospTime != null"> + AND date_format(b.starttime,'%y%m%d') <= date_format(#{endInHospTime},'%y%m%d') + </if> <if test="hospitalname != null and hospitalname != ''">and hospitalname like concat('%', #{hospitalname}, '%') </if> @@ -204,14 +218,14 @@ b.leavehospitaldistrictname like concat('%', #{leavehospitaldistrictname}, '%') </if> - <if test="leavehospitaldistrictcodes != null"> + <if test="leavehospitaldistrictcodes != null and leavehospitaldistrictcodes.size()>0"> AND b.leavehospitaldistrictcode IN <foreach collection="leavehospitaldistrictcodes" item="leavehospitaldistrictcode" open="(" separator="," close=")"> #{leavehospitaldistrictcode} </foreach> </if> - <if test="leaveldeptcodes != null"> + <if test="leaveldeptcodes != null and leaveldeptcodes.size()>0"> AND b.leaveldeptcode IN <foreach collection="leaveldeptcodes" item="leaveldeptcode" open="(" separator="," close=")"> @@ -300,14 +314,14 @@ #{leavediagname}, '%') </if> <if test="drname != null and drname != ''">and b.drname like concat('%', #{drname}, '%')</if> - <if test="leavehospitaldistrictcodes != null "> + <if test="leavehospitaldistrictcodes != null and leavehospitaldistrictcodes.size()>0"> AND b.leavehospitaldistrictcode IN <foreach collection="leavehospitaldistrictcodes" item="leavehospitaldistrictcode" open="(" separator="," close=")"> #{leavehospitaldistrictcode} </foreach> </if> - <if test="leaveldeptcodes != null"> + <if test="leaveldeptcodes != null and leaveldeptcodes.size()>0"> AND b.leaveldeptcode IN <foreach collection="leaveldeptcodes" item="leaveldeptcode" open="(" separator="," close=")"> -- Gitblit v1.9.3