| | |
| | | </if> |
| | | </if> |
| | | <if test="deptOrDistrict==2"> |
| | | AND (1=1 |
| | | <if test="leavehospitaldistrictcodes != null"> |
| | | AND leavehospitaldistrictcode IN |
| | | AND ( |
| | | <if test="leavehospitaldistrictcodes != null and leavehospitaldistrictcodes.size() > 0"> |
| | | leavehospitaldistrictcode IN |
| | | <foreach collection="leavehospitaldistrictcodes" item="leavehospitaldistrictcode" open="(" |
| | | separator="," |
| | | close=")"> |
| | | #{leavehospitaldistrictcode} |
| | | </foreach> |
| | | </if> |
| | | <if test=" leaveldeptcodes != null"> |
| | | OR deptcode IN |
| | | <if test="(leavehospitaldistrictcodes != null and leavehospitaldistrictcodes.size() > 0) |
| | | and (leaveldeptcodes != null and leaveldeptcodes.size() > 0)"> |
| | | OR |
| | | </if> |
| | | <if test=" leaveldeptcodes != null and leaveldeptcodes.size() > 0"> |
| | | deptcode IN |
| | | <foreach collection="leaveldeptcodes" item="leaveldeptcode" open="(" separator="," |
| | | close=")"> |
| | | #{leaveldeptcode} |
| | |
| | | </if> |
| | | <if test="managementDoctorCode != null">and management_doctor_code = #{managementDoctorCode}</if> |
| | | <if test="managementDoctor != null">and management_doctor like concat('%',#{managementDoctor}, '%')</if> |
| | | <if test="startOutHospTime != null"> |
| | | AND date_format(endtime,'%y%m%d') >= date_format(#{startOutHospTime},'%y%m%d') |
| | | </if> |
| | | <if test="endOutHospTime != null"> |
| | | AND date_format(endtime,'%y%m%d') <= date_format(#{endOutHospTime},'%y%m%d') |
| | | </if> |
| | | ) a |
| | | </select> |
| | | |
| | |
| | | close=")"> |
| | | #{serviceType} |
| | | </foreach> |
| | | </if> |
| | | <if test="startOutHospTime != null"> |
| | | AND date_format(ss.endtime,'%y%m%d') >= date_format(#{startOutHospTime},'%y%m%d') |
| | | </if> |
| | | <if test="endOutHospTime != null"> |
| | | AND date_format(ss.endtime,'%y%m%d') <= date_format(#{endOutHospTime},'%y%m%d') |
| | | </if> |
| | | <if test="groupKey != null and groupKey != ''"> |
| | | AND ss.${groupKey} IN |
| | |
| | | continue_content, |
| | | continue_count, |
| | | continue_time_next, |
| | | task_situation |
| | | task_situation, |
| | | is_manually_called |
| | | from service_subtask |
| | | where 1=1 |
| | | and del_flag = 0 |
| | |
| | | continue_count, |
| | | continue_time_next, |
| | | task_situation, |
| | | remark |
| | | remark, |
| | | is_manually_called |
| | | from service_subtask |
| | | where 1=1 |
| | | and del_flag = 0 |
| | |
| | | </if> |
| | | <if test="deptcode != null and deptcode != ''"> |
| | | AND deptcode = #{deptcode} |
| | | </if> |
| | | <if test="isManuallyCalled != null"> |
| | | AND is_manually_called = #{isManuallyCalled} |
| | | </if> |
| | | order by endtime desc |
| | | <if test="pageSize != null and pageNum != null"> |
| | |
| | | SUM(CASE WHEN sendstate != 2 THEN 1 ELSE 0 END) AS yfs, |
| | | SUM(CASE WHEN sendstate = 2 THEN 1 ELSE 0 END) AS wfs, |
| | | SUM(CASE WHEN sendstate = 6 THEN 1 ELSE 0 END) AS ywc, |
| | | SUM(CASE WHEN sendstate = 7 THEN 1 ELSE 0 END) AS cs, |
| | | SUM(CASE WHEN excep IS NOT NULL AND excep = '1' THEN 1 ELSE 0 END) AS yc, |
| | | SUM(CASE WHEN excep IS NOT NULL AND excep = '2' THEN 1 ELSE 0 END) AS jg, |
| | | COUNT(1) as total |
| | |
| | | </if> |
| | | </if> |
| | | <if test="deptOrDistrict==2"> |
| | | AND (1=1 |
| | | AND ( |
| | | <if test="leavehospitaldistrictcodes != null and leavehospitaldistrictcodes.size() > 0"> |
| | | AND leavehospitaldistrictcode IN |
| | | leavehospitaldistrictcode IN |
| | | <foreach collection="leavehospitaldistrictcodes" item="leavehospitaldistrictcode" open="(" |
| | | separator="," |
| | | close=")"> |
| | | #{leavehospitaldistrictcode} |
| | | </foreach> |
| | | </if> |
| | | <if test="(leavehospitaldistrictcodes != null and leavehospitaldistrictcodes.size() > 0) |
| | | and (leaveldeptcodes != null and leaveldeptcodes.size() > 0)"> |
| | | OR |
| | | </if> |
| | | <if test=" leaveldeptcodes != null and leaveldeptcodes.size()>0"> |
| | | OR deptcode IN |
| | | deptcode IN |
| | | <foreach collection="leaveldeptcodes" item="leaveldeptcode" open="(" separator="," |
| | | close=")"> |
| | | #{leaveldeptcode} |
| | |
| | | <if test="campusid != null and campusid != ''"> |
| | | and campusid = #{campusid} |
| | | </if> |
| | | <if test="leavehospitaldistrictcodes != null and leavehospitaldistrictcodes.size() > 0"> |
| | | AND leavehospitaldistrictcode IN |
| | | <foreach collection="leavehospitaldistrictcodes" item="leavehospitaldistrictcode" open="(" |
| | | separator="," |
| | | close=")"> |
| | | #{leavehospitaldistrictcode} |
| | | </foreach> |
| | | </if> |
| | | <if test=" leaveldeptcodes != null and leaveldeptcodes.size()>0"> |
| | | AND deptcode IN |
| | | <foreach collection="leaveldeptcodes" item="leaveldeptcode" open="(" separator="," |
| | | close=")"> |
| | | #{leaveldeptcode} |
| | | </foreach> |
| | | <if test="(leavehospitaldistrictcodes != null and leavehospitaldistrictcodes.size() > 0) |
| | | or (leaveldeptcodes != null and leaveldeptcodes.size() > 0)"> |
| | | AND ( |
| | | <if test="leavehospitaldistrictcodes != null and leavehospitaldistrictcodes.size() > 0"> |
| | | leavehospitaldistrictcode IN |
| | | <foreach collection="leavehospitaldistrictcodes" item="leavehospitaldistrictcode" open="(" |
| | | separator="," |
| | | close=")"> |
| | | #{leavehospitaldistrictcode} |
| | | </foreach> |
| | | </if> |
| | | <if test="(leavehospitaldistrictcodes != null and leavehospitaldistrictcodes.size() > 0) |
| | | and (leaveldeptcodes != null and leaveldeptcodes.size() > 0)"> |
| | | OR |
| | | </if> |
| | | <if test=" leaveldeptcodes != null and leaveldeptcodes.size()>0"> |
| | | deptcode IN |
| | | <foreach collection="leaveldeptcodes" item="leaveldeptcode" open="(" separator="," |
| | | close=")"> |
| | | #{leaveldeptcode} |
| | | </foreach> |
| | | </if>) |
| | | </if> |
| | | </select> |
| | | |