| | |
| | | ), '%y%m%d' ) ) |
| | | THEN 1 ELSE 0 END ) finished,1 AS tasknumber FROM service_subtask |
| | | WHERE del_flag=0 |
| | | <if test="starttime == null and endtime==null"> |
| | | <!-- 只有未指定任何时间范围时才默认只统计已到期任务; |
| | | 只按出院时间查询时不能再排除未来 visit_time,否则及时率分母与主表不一致。 --> |
| | | <if test="starttime == null and endtime == null and startOutHospTime == null and endOutHospTime == null"> |
| | | AND visit_time < NOW() |
| | | </if> |
| | | <if test="starttime != null and endtime!=null"> |
| | |
| | | WHERE ss.del_flag = 0 |
| | | AND ss.visit_time IS NOT NULL |
| | | AND ss.sendstate != 4 |
| | | <if test="starttime == null and endtime==null"> |
| | | <!-- 只有未指定任何时间范围时才默认只统计已到期任务; |
| | | 只按出院时间查询时不能再排除未来 visit_time,否则及时率分母与主表不一致。 --> |
| | | <if test="starttime == null and endtime == null and startOutHospTime == null and endOutHospTime == null"> |
| | | AND DATE(ss.visit_time) < DATE(NOW()) |
| | | </if> |
| | | <if test="starttime != null and endtime!=null"> |
| | |
| | | where 1=1 |
| | | and a.del_flag = '0' |
| | | and b.del_flag = '0' |
| | | and a.appltype = '3' |
| | | <!-- 专病统计:单病种任务(appltype=3) + 专病任务组(appltype=5) --> |
| | | and ( |
| | | a.appltype = '3' |
| | | or ( |
| | | a.appltype = '5' |
| | | and ( |
| | | a.hosp_type = '3' |
| | | or (a.diag_type is not null and a.diag_type <> '') |
| | | or exists ( |
| | | select 1 |
| | | from service_task_schedule s |
| | | where s.taskid = a.taskid |
| | | and s.del_flag = '0' |
| | | and s.icd10_codes is not null |
| | | and s.icd10_codes <> '' |
| | | ) |
| | | ) |
| | | ) |
| | | ) |
| | | <if test="orgid != null and orgid != ''">and a.orgid = #{orgid}</if> |
| | | <if test="campusid != null and campusid != ''">and b.campusid = #{campusid}</if> |
| | | <if test="taskId != null">and a.task_id = #{taskId}</if> |
| | | <if test="taskId != null">and a.taskid = #{taskId}</if> |
| | | <if test="taskName != null and taskName != ''"> |
| | | and a.task_name like concat('%', #{taskName}, '%') |
| | | </if> |
| | |
| | | and a.diag_type = #{diagType} |
| | | </if> |
| | | <if test="taskIds != null and taskIds.size() > 0"> |
| | | AND a.task_id IN |
| | | AND a.taskid IN |
| | | <foreach collection="taskIds" item="taskIdItem" open="(" separator="," |
| | | close=")"> |
| | | #{taskIdItem} |