| | |
| | | <if test="isVisitAgain != null">and is_visit_again = #{isVisitAgain}</if> |
| | | <if test="visitCount != null and visitCount > 1 and visitDeptCodes != null and visitDeptCodes.size() > 0"> |
| | | AND visit_dept_code IN |
| | | <foreach collection="visitDeptCodes" item="visitDeptCodes" open="(" |
| | | <foreach collection="visitDeptCodes" item="visitDeptCode" open="(" |
| | | separator="," |
| | | close=")"> |
| | | #{visitDeptCodes} |
| | | #{visitDeptCode} |
| | | </foreach> |
| | | </if> |
| | | <if test="sort != null and sort==0">order by endtime asc</if> |
| | |
| | | </if> |
| | | </if> |
| | | <if test="deptOrDistrict==2"> |
| | | AND (1=1 |
| | | <if test="leavehospitaldistrictcodes != null and leavehospitaldistrictcodes.size() > 0"> |
| | | AND (leavehospitaldistrictcode IN |
| | | AND leavehospitaldistrictcode IN |
| | | <foreach collection="leavehospitaldistrictcodes" item="leavehospitaldistrictcode" open="(" |
| | | separator="," |
| | | close=")"> |
| | |
| | | <if test=" leaveldeptcodes != null and leaveldeptcodes.size()>0"> |
| | | OR deptcode IN |
| | | <foreach collection="leaveldeptcodes" item="leaveldeptcode" open="(" separator="," |
| | | close="))"> |
| | | close=")"> |
| | | #{leaveldeptcode} |
| | | </foreach> |
| | | </if> |
| | | ) |
| | | </if> |
| | | <if test="visitCount != null and visitCount > 1 and visitDeptCodes != null and visitDeptCodes.size() > 0"> |
| | | AND visit_dept_code IN |
| | | <foreach collection="visitDeptCodes" item="visitDeptCodes" open="(" |
| | | <foreach collection="visitDeptCodes" item="visitDeptCode" open="(" |
| | | separator="," |
| | | close=")"> |
| | | #{visitDeptCodes} |
| | | #{visitDeptCode} |
| | | </foreach> |
| | | </if> |
| | | <if test="leavehospitaldistrictname != null and leavehospitaldistrictname != ''"> |