| | |
| | | fpcs, |
| | | count(case when (t2.node_id = 'ZJ_DSL' or t2.node_id = 'QJ_DSL' or t2.node_id = 'SJ_DSL' or t2.node_id = 'DSL') |
| | | and ((t2.overtime_status = 1 and t2.status = 2)) then t2.id end) as |
| | | slcs |
| | | slcs, |
| | | count(case when (t2.node_id = 'BLFK') |
| | | and ((t2.overtime_status = 1 and t2.status = 2) or (sysdate > expire_time and t2.status = 1)) then t2.id end) as |
| | | and ((t2.overtime_status = 1 and t2.status = 2)) then t2.id end) as |
| | | blcs |
| | | </if> |
| | | <if test="terms.taskStatus != null and terms.taskStatus == 0"> |
| | |
| | | fpcs, |
| | | count(case when (t2.node_id = 'ZJ_DSL' or t2.node_id = 'QJ_DSL' or t2.node_id = 'SJ_DSL' or t2.node_id = 'DSL') |
| | | and ((sysdate > expire_time and t2.status = 1)) then t2.id end) as |
| | | slcs |
| | | slcs, |
| | | count(case when (t2.node_id = 'BLFK') |
| | | and ((t2.overtime_status = 1 and t2.status = 2) or (sysdate > expire_time and t2.status = 1)) then t2.id end) as |
| | | and ((sysdate > expire_time and t2.status = 1)) then t2.id end) as |
| | | blcs |
| | | </if> |
| | | <if test="terms.taskStatus == null or terms.taskStatus ==''"> |
| | |
| | | fpcs, |
| | | count(case when (t2.node_id = 'ZJ_DSL' or t2.node_id = 'QJ_DSL' or t2.node_id = 'SJ_DSL' or t2.node_id = 'DSL') |
| | | and ((t2.overtime_status = 1 and t2.status = 2) or (sysdate > expire_time and t2.status = 1)) then t2.id end) as |
| | | slcs |
| | | slcs, |
| | | count(case when (t2.node_id = 'BLFK') |
| | | and ((t2.overtime_status = 1 and t2.status = 2) or (sysdate > expire_time and t2.status = 1)) then t2.id end) as |
| | | blcs |
| | |
| | | limit #{page.offset}, #{page.size} |
| | | </select> |
| | | |
| | | <!-- 查询办理超时案件统计 --> |
| | | <select id="countBLQuantity" resultType="java.lang.Long"> |
| | | select |
| | | COUNT(1) |
| | | from dyh_ct_unit t1 left join dyh_case_task t2 on t1.id = t2.cande_unit_id |
| | | left join dyh_case_info t3 on t2.case_id = t3.id left join dyh_case_info_unfold t4 on t3.id = t4.id |
| | | where |
| | | t1.delete_status = 0 |
| | | and t2.delete_status = 0 |
| | | and t3.delete_status = 0 |
| | | <include refid="statisticsAVG-wherePart"/> |
| | | and |
| | | (t2.node_id = 'BLFK') |
| | | <if test="terms.taskStatus != null and terms.taskStatus == 1 "> |
| | | and (t2.overtime_status = 1 and t2.status = 2) |
| | | </if> |
| | | <if test="terms.taskStatus != null and terms.taskStatus == 0"> |
| | | and (sysdate > expire_time and t2.status = 1) |
| | | </if> |
| | | <if test="terms.taskStatus == null or terms.taskStatus ==''"> |
| | | and ((t2.overtime_status = 1 and t2.status = 2) or (sysdate > expire_time and t2.status = 1)) |
| | | </if> |
| | | </select> |
| | | |
| | | <!-- 查询办理超时案件 --> |
| | | <select id="listBLQuantity" resultType="cn.huge.module.analysis.domain.dto.TimeoutTaskInfoDTO"> |
| | | select t2.case_id as caseId, t2.id as caseTaskId,t2.create_time as turnaroundTime, t2.node_name as nodeName, |
| | | (case t2.status when 1 then 0 when 2 then 1 end) as taskStatus, |
| | | (case t2.status when 2 then t2.overtime_hour when 1 then DATEDIFF(hh, t2.expire_time, sysdate) end) as |
| | | timeLimit, |
| | | t3.case_level as caseGrade, t3.canal_name as caseSource, t4.mediator as mediator, t3.status_name as statusName, |
| | | concat_ws('', ifnull(t3.case_type_first_name, ''), '/' , ifnull(t3.case_type_name, '')) as caseType, |
| | | concat(t3.que_area_name, t3.que_road_name) as queAddress, t2.cande_unit_name as candeUnitName, |
| | | (select count(1) from dyh_case_supervise where case_id = t2.case_id) as superviseCount |
| | | from dyh_ct_unit t1 left join dyh_case_task t2 on t1.id = t2.cande_unit_id |
| | | left join dyh_case_info t3 on t2.case_id = t3.id left join dyh_case_info_unfold t4 on t3.id = t4.id |
| | | where |
| | | t1.delete_status = 0 |
| | | and t2.delete_status = 0 |
| | | and t3.delete_status = 0 |
| | | <include refid="statisticsAVG-wherePart"/> |
| | | and |
| | | (t2.node_id = 'BLFK') |
| | | <if test="terms.taskStatus != null and terms.taskStatus == 1 "> |
| | | and (t2.overtime_status = 1 and t2.status = 2) |
| | | </if> |
| | | <if test="terms.taskStatus != null and terms.taskStatus == 0"> |
| | | and (sysdate > expire_time and t2.status = 1) |
| | | </if> |
| | | <if test="terms.taskStatus == null or terms.taskStatus ==''"> |
| | | and ((t2.overtime_status = 1 and t2.status = 2) or (sysdate > expire_time and t2.status = 1)) |
| | | </if> |
| | | <if test="page.sort != null"> |
| | | <foreach collection="page.sort" item="s" index="index" separator="," open="order by "> |
| | | isnull(${s.property}), ${s.property} ${s.direction} |
| | | </foreach> |
| | | </if> |
| | | <if test="page.sort == null"> |
| | | order by isnull(t2.create_time), t2.create_time desc |
| | | </if> |
| | | limit #{page.offset}, #{page.size} |
| | | </select> |
| | | |
| | | <!-- 查询督办超时案件统计 --> |
| | | <select id="countAllQuantity" resultType="java.lang.Long"> |
| | | select sum(zs) |
| | |
| | | and t3.delete_status = 0 |
| | | <include refid="statisticsAVG-wherePart"/> |
| | | and((t2.node_id = 'ZJ_DFP' or t2.node_id = 'QJ_DFP' or t2.node_id = 'SJ_DFP' or t2.node_id = 'DFP') |
| | | or (t2.node_id = 'ZJ_DSL' or t2.node_id = 'QJ_DSL' or t2.node_id = 'SJ_DSL' or t2.node_id = 'DSL')) |
| | | or (t2.node_id = 'ZJ_DSL' or t2.node_id = 'QJ_DSL' or t2.node_id = 'SJ_DSL' or t2.node_id = 'DSL') |
| | | or (t2.node_id = 'BLFK')) |
| | | <if test="terms.taskStatus != null and terms.taskStatus == 1 "> |
| | | and (t2.overtime_status = 1 and t2.status = 2) |
| | | </if> |
| | |
| | | and t3.delete_status = 0 |
| | | <include refid="statisticsAVG-wherePart"/> |
| | | and ((t2.node_id = 'ZJ_DFP' or t2.node_id = 'QJ_DFP' or t2.node_id = 'SJ_DFP' or t2.node_id = 'DFP') |
| | | or (t2.node_id = 'ZJ_DSL' or t2.node_id = 'QJ_DSL' or t2.node_id = 'SJ_DSL' or t2.node_id = 'DSL')) |
| | | or (t2.node_id = 'ZJ_DSL' or t2.node_id = 'QJ_DSL' or t2.node_id = 'SJ_DSL' or t2.node_id = 'DSL') |
| | | or (t2.node_id = 'BLFK')) |
| | | <if test="terms.taskStatus != null and terms.taskStatus == 1 "> |
| | | and (t2.overtime_status = 1 and t2.status = 2) |
| | | </if> |
| | |
| | | |
| | | <sql id="statisticsCirculation-wherePart"> |
| | | and t3.sync_status = 0 |
| | | and t3.input_way = 1 |
| | | <if test="terms != null"> |
| | | <if test="terms.queProv != null and terms.queProv !=''"> |
| | | and t1.prov = #{terms.queProv} |
| | |
| | | ) s |
| | | WHERE rn = 1 |
| | | group by s.case_id) t4 on t2.id = t4.case_id |
| | | where t1.delete_status = 0 and t3.delete_status = 0 |
| | | where t3.delete_status = 0 |
| | | <include refid="statisticsCirculation-wherePart"/> |
| | | group by |
| | | <include refid="groupPart"/> |
| | |
| | | order by quantity asc |
| | | </select> |
| | | |
| | | <!-- 分组查询办理超时案件统计 --> |
| | | <select id="countBLQuantityGroup" resultType="cn.huge.module.analysis.domain.dto.TimeOutTaskGroupDTO"> |
| | | select |
| | | <include refid="selectPart"/> |
| | | COUNT(1) as quantity |
| | | from dyh_ct_unit t1 left join dyh_case_task t2 on t1.id = t2.cande_unit_id |
| | | left join dyh_case_info t3 on t2.case_id = t3.id left join dyh_case_info_unfold t4 on t3.id = t4.id |
| | | where |
| | | t1.delete_status = 0 |
| | | and t2.delete_status = 0 |
| | | and t3.delete_status = 0 |
| | | <include refid="statisticsAVG-wherePart"/> |
| | | and |
| | | (t2.node_id = 'BLFK') and |
| | | ((t2.overtime_status = 1 and t2.status = 2) or (sysdate > expire_time and t2.status = 1) ) |
| | | group by |
| | | <include refid="groupPart"/> |
| | | order by quantity asc |
| | | </select> |
| | | |
| | | <!-- 分组查询全部类型案件超时统计 --> |
| | | <select id="countAllQuantityGroup" resultType="cn.huge.module.analysis.domain.dto.TimeOutTaskGroupDTO"> |
| | | select |
| | |
| | | and t3.delete_status = 0 |
| | | <include refid="statisticsAVG-wherePart"/> |
| | | and((t2.node_id = 'ZJ_DFP' or t2.node_id = 'QJ_DFP' or t2.node_id = 'SJ_DFP' or t2.node_id = 'DFP') |
| | | or (t2.node_id = 'ZJ_DSL' or t2.node_id = 'QJ_DSL' or t2.node_id = 'SJ_DSL' or t2.node_id = 'DSL')) |
| | | or (t2.node_id = 'ZJ_DSL' or t2.node_id = 'QJ_DSL' or t2.node_id = 'SJ_DSL' or t2.node_id = 'DSL') |
| | | or (t2.node_id = 'BLFK')) |
| | | and ((t2.overtime_status = 1 and t2.status = 2) or (sysdate > expire_time and t2.status = 1)) |
| | | group by |
| | | <include refid="groupPart"/> |
| | |
| | | ) s |
| | | WHERE rn = 1 |
| | | group by s.case_id) t4 on t2.id = t4.case_id |
| | | where t1.delete_status = 0 and t3.delete_status = 0 |
| | | where t3.delete_status = 0 |
| | | <if test="terms.caseStatus != null and terms.caseStatus == 1"> |
| | | and t3.zxsl_status = 1 |
| | | </if> |