| | |
| | | </if> |
| | | <if test="patid != null and patid != ''">AND a.id = #{patid}</if> |
| | | <if test="telcode != null and telcode != ''">AND a.telcode LIKE concat('%', #{telcode}, '%')</if> |
| | | <if test="notrequiredFlag != null and notrequiredFlag != ''">AND a.notrequired_flag = #{notrequiredFlag}</if> |
| | | <if test="notrequiredFlag != null and notrequiredFlag != ''">AND a.notrequired_flag = #{notrequiredFlag} |
| | | </if> |
| | | <if test="hospitalname != null and hospitalname != ''">AND d.hospitalname = #{hospitalname}</if> |
| | | <if test="hospitaldistrictname != null and hospitaldistrictname != ''">AND d.hospitaldistrictname LIKE concat('%',#{hospitaldistrictname}, '%')</if> |
| | | <if test="leaveicd10code != null and leaveicd10code != ''">AND d.leaveicd10code LIKE concat('%',#{leaveicd10code}, '%')</if> |
| | | <if test="hospitaldistrictname != null and hospitaldistrictname != ''">AND d.hospitaldistrictname LIKE |
| | | concat('%',#{hospitaldistrictname}, '%') |
| | | </if> |
| | | <if test="leaveicd10code != null and leaveicd10code != ''">AND d.leaveicd10code LIKE |
| | | concat('%',#{leaveicd10code}, '%') |
| | | </if> |
| | | <if test="endtime != null">AND d.endtime = #{endtime}</if> |
| | | <if test="cry != null and cry == 0 ">AND d.endtime IS NULL</if> |
| | | <if test="cry != null and cry == 1 ">AND d.endtime IS NOT NULL</if> |
| | |
| | | <if test="diagname != null and diagname != ''">AND d.diagname LIKE concat('%',#{diagname}, '%')</if> |
| | | <if test="leavehospitaldistrictcodes != null and leavehospitaldistrictcodes.size()>0"> |
| | | AND d.leavehospitaldistrictcode IN |
| | | <foreach collection="leavehospitaldistrictcodes" item="leavehospitaldistrictcode" open="(" separator="," close=")"> |
| | | <foreach collection="leavehospitaldistrictcodes" item="leavehospitaldistrictcode" open="(" separator="," |
| | | close=")"> |
| | | #{leavehospitaldistrictcode} |
| | | </foreach> |
| | | </if> |
| | | <if test="leaveldeptcodes != null and leaveldeptcodes.size() > 0"> |
| | | <if test="leaveldeptcodes != null and leaveldeptcodes.size() > 0 and leavehospitaldistrictcodes != null and leavehospitaldistrictcodes.size()>0"> |
| | | OR d.leaveldeptcode IN |
| | | <foreach collection="leaveldeptcodes" item="leaveldeptcode" open="(" separator="," close=")"> |
| | | #{leaveldeptcode} |
| | | </foreach> |
| | | </if> |
| | | <if test="leaveldeptcodes != null and leaveldeptcodes.size() > 0 and leavehospitaldistrictcodes == null"> |
| | | AND d.leaveldeptcode IN |
| | | <foreach collection="leaveldeptcodes" item="leaveldeptcode" open="(" separator="," close=")"> |
| | | #{leaveldeptcode} |
| | |
| | | </if> |
| | | <if test="hospitaldistrictcodes != null and hospitaldistrictcodes.size()>0"> |
| | | AND d.hospitaldistrictcode IN |
| | | <foreach collection="hospitaldistrictcodes" item="hospitaldistrictcode" open="(" separator="," close=")"> |
| | | <foreach collection="hospitaldistrictcodes" item="hospitaldistrictcode" open="(" separator="," |
| | | close=")"> |
| | | #{hospitaldistrictcode} |
| | | </foreach> |
| | | </if> |