liusheng
2024-10-08 195190571e567602d5e4e8ae3c7c490a515719ef
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') &gt;= date_format(#{startOutHospTime},'%y%m%d')
            </if>
            <if test="endOutHospTime != null">
                AND date_format(b.endtime,'%y%m%d') &lt;= date_format(#{endOutHospTime},'%y%m%d')
            </if>
                <if test="startInHospTime != null">
                AND date_format(b.starttime,'%y%m%d') &gt;= date_format(#{startInHospTime},'%y%m%d')
            </if>
            <if test="endInHospTime != null">
                AND date_format(b.starttime,'%y%m%d') &lt;= 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=")">