广州市综治平台后端
xusd
2 days ago e62c34674edf949c3759b19f5e578cdd2a43c21b
fix:超时办件优化
6 files modified
361 ■■■■ changed files
dyh-service/dyh-disp/src/main/resources/config/application.yml 4 ●●●● patch | view | raw | blame | history
dyh-service/dyh-mediate/src/main/java/cn/huge/module/analysis/controller/AnalysisWebController.java 5 ●●●●● patch | view | raw | blame | history
dyh-service/dyh-mediate/src/main/java/cn/huge/module/analysis/dao/mapper/xml/AnalysisMapper.xml 323 ●●●● patch | view | raw | blame | history
dyh-service/dyh-mediate/src/main/resources/config/application.yml 4 ●●●● patch | view | raw | blame | history
dyh-service/dyh-sys/src/main/java/cn/huge/module/timer/GridCityCaseTimer.java 21 ●●●●● patch | view | raw | blame | history
dyh-service/dyh-sys/src/main/resources/config/application.yml 4 ●●●● patch | view | raw | blame | history
dyh-service/dyh-disp/src/main/resources/config/application.yml
@@ -3,8 +3,8 @@
  profiles:
    active:
#      - dev
#      - test
      - prod
      - test
#      - prod
  devtools:
    restart:
dyh-service/dyh-mediate/src/main/java/cn/huge/module/analysis/controller/AnalysisWebController.java
@@ -205,6 +205,11 @@
        if (StringUtils.isNotBlank(assistUnitId)){
            terms.put("assistUnitId", assistUnitId);
        }
        //任务是否完成
        String taskStatus = request.getParameter("taskStatus");
        if (StringUtils.isNotBlank(taskStatus)){
            terms.put("taskStatus", taskStatus);
        }
        return terms;
    }
    /**
dyh-service/dyh-mediate/src/main/java/cn/huge/module/analysis/dao/mapper/xml/AnalysisMapper.xml
@@ -29,7 +29,8 @@
                t1.road,
            </if>
            <if test="terms.queRoad != null and terms.queRoad !=''">
                (case when t1.village_name = '' or t1.village_name is null then '本级' else t1.village_name end)as groupName,
                (case when t1.village_name = '' or t1.village_name is null then '本级' else t1.village_name end)as
                groupName,
                t1.village as groupCode,
                t1.village,
            </if>
@@ -101,14 +102,18 @@
            <if test="terms.unitIds != null and terms.unitIds !=''">
                and t1.id in(${terms.unitIds})
            </if>
        </if>
    </sql>
    <!--  统计任务平均时长  -->
    <select id="statisticsAVG" resultType="cn.huge.module.analysis.domain.dto.AvgDurationDTO">
        select AVG(case when (t2.node_id = 'ZJ_DFP' or t2.node_id = 'QJ_DFP' or t2.node_id = 'SJ_DFP' or t2.node_id = 'DFP') and t2.status = 2 then ROUND(DATEDIFF(SECOND, t2.create_time, t2.handle_time) / 3600.0, 2) end) as fp,
            AVG(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.status = 2 then ROUND(DATEDIFF(SECOND, t2.create_time, t2.handle_time) / 3600.0, 2) end) as sl,
            AVG(case when (t2.node_id = 'BLFK' and t2.status = '2') and t2.status = 2 then ROUND(DATEDIFF(SECOND, t2.create_time, t2.handle_time) / 3600.0, 2) end) as blz
        select AVG(case when (t2.node_id = 'ZJ_DFP' or t2.node_id = 'QJ_DFP' or t2.node_id = 'SJ_DFP' or t2.node_id =
        'DFP') and t2.status = 2 then ROUND(DATEDIFF(SECOND, t2.create_time, t2.handle_time) / 3600.0, 2) end) as fp,
        AVG(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.status = 2 then ROUND(DATEDIFF(SECOND, t2.create_time, t2.handle_time) / 3600.0, 2) end) as sl,
        AVG(case when (t2.node_id = 'BLFK' and t2.status = '2') and t2.status = 2 then ROUND(DATEDIFF(SECOND,
        t2.create_time, t2.handle_time) / 3600.0, 2) end) as blz
            from dyh_ct_unit t1 left join dyh_case_task t2 on t1.id = t2.handle_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
@@ -122,11 +127,16 @@
    <select id="statisticsGroupAVG" resultType="cn.huge.module.analysis.domain.dto.AvgDurationGroupDTO">
        select
        <include refid="selectPart"/>
        AVG(case when (t2.node_id = 'ZJ_DFP' or t2.node_id = 'QJ_DFP' or t2.node_id = 'SJ_DFP' or t2.node_id = 'DFP') and t2.status = 2 then ROUND(DATEDIFF(SECOND, t2.create_time, t2.handle_time) / 3600.0, 2) end) as fp,
        count(case when (t2.node_id = 'ZJ_DFP' or t2.node_id = 'QJ_DFP' or t2.node_id = 'SJ_DFP' or t2.node_id = 'DFP') and t2.status = 2 then t2.id end) as fps,
        AVG(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.status = 2 then ROUND(DATEDIFF(SECOND, t2.create_time, t2.handle_time) / 3600.0, 2) end) as sl,
        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.status = 2 then t2.id end) as sls,
        AVG(case when (t2.node_id = 'BLFK' and t2.status = '2') and t2.status = 2 then ROUND(DATEDIFF(SECOND, t2.create_time, t2.handle_time) / 3600.0, 2) end) as blz,
        AVG(case when (t2.node_id = 'ZJ_DFP' or t2.node_id = 'QJ_DFP' or t2.node_id = 'SJ_DFP' or t2.node_id = 'DFP')
        and t2.status = 2 then ROUND(DATEDIFF(SECOND, t2.create_time, t2.handle_time) / 3600.0, 2) end) as fp,
        count(case when (t2.node_id = 'ZJ_DFP' or t2.node_id = 'QJ_DFP' or t2.node_id = 'SJ_DFP' or t2.node_id = 'DFP')
        and t2.status = 2 then t2.id end) as fps,
        AVG(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.status = 2 then ROUND(DATEDIFF(SECOND, t2.create_time, t2.handle_time) / 3600.0, 2) end) as sl,
        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.status = 2 then t2.id end) as sls,
        AVG(case when (t2.node_id = 'BLFK' and t2.status = '2') and t2.status = 2 then ROUND(DATEDIFF(SECOND,
        t2.create_time, t2.handle_time) / 3600.0, 2) end) as blz,
        count(case when (t2.node_id = 'BLFK' and t2.status = '2') and t2.status = 2 then t2.id end) as bls
        from dyh_ct_unit t1 left join dyh_case_task t2 on t1.id = t2.handle_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
@@ -135,14 +145,39 @@
        and t2.delete_status = 0
        and t3.delete_status = 0
        <include refid="statisticsAVG-wherePart"/>
        group by <include refid="groupPart"/>
        group by
        <include refid="groupPart"/>
    </select>
    <!--  分组统计任务  -->
    <select id="statisticsQuantity" resultType="cn.huge.module.analysis.domain.dto.StatisticsGroupDTO">
        select
        count(case when (t2.node_id = 'ZJ_DFP' or t2.node_id = 'QJ_DFP' or t2.node_id = 'SJ_DFP' or t2.node_id = 'DFP') and ((t2.overtime_status = 1 and t2.status = 2) or (sysdate > expire_time and t2.status = 1)) then t2.id end) as 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
        <if test="terms.taskStatus != null and terms.taskStatus == 1 ">
            count(case when (t2.node_id = 'ZJ_DFP' or t2.node_id = 'QJ_DFP' or t2.node_id = 'SJ_DFP' or t2.node_id = 'DFP')
            and ((t2.overtime_status = 1 and t2.status = 2)) then t2.id end) as
            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
        </if>
        <if test="terms.taskStatus != null and terms.taskStatus == 0">
            count(case when (t2.node_id = 'ZJ_DFP' or t2.node_id = 'QJ_DFP' or t2.node_id = 'SJ_DFP' or t2.node_id = 'DFP')
            and ((sysdate > expire_time and t2.status = 1)) then t2.id end) as
            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
        </if>
        <if test="terms.taskStatus == null or terms.taskStatus ==''">
            count(case when (t2.node_id = 'ZJ_DFP' or t2.node_id = 'QJ_DFP' or t2.node_id = 'SJ_DFP' or t2.node_id = 'DFP')
            and ((t2.overtime_status = 1 and t2.status = 2) or (sysdate > expire_time and t2.status = 1)) then t2.id end) as
            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
        </if>
        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
@@ -155,8 +190,12 @@
    <!--  首页-统计超时任务  -->
    <select id="homeStatisticsQuantity" resultType="cn.huge.module.analysis.domain.dto.StatisticsGroupDTO">
        select
        count(case when (t2.node_id = 'ZJ_DFP' or t2.node_id = 'QJ_DFP' or t2.node_id = 'SJ_DFP' or t2.node_id = 'DFP') and ((t2.overtime_status = 1 and t2.status = 2) or (sysdate > expire_time and t2.status = 1)) then t2.id end) as 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
        count(case when (t2.node_id = 'ZJ_DFP' or t2.node_id = 'QJ_DFP' or t2.node_id = 'SJ_DFP' or t2.node_id = 'DFP')
        and ((t2.overtime_status = 1 and t2.status = 2) or (sysdate > expire_time and t2.status = 1)) then t2.id end) as
        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
        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
@@ -212,7 +251,8 @@
        from
        (
        select ROUND(DATEDIFF(SECOND, t2.appear_time, t2.audit_time) / 3600.0, 2) as usetime_hour
        from dyh_ct_unit t1 left join dyh_case_appear t2 on t1.id = t2.audit_unit_id left join dyh_case_info t3 on t2.case_id = t3.id
        from dyh_ct_unit t1 left join dyh_case_appear t2 on t1.id = t2.audit_unit_id left join dyh_case_info t3 on
        t2.case_id = t3.id
        where t2.apply_status = 1
        <if test="terms != null">
            <if test="terms.closeStart != null and terms.closeStart !='' and terms.closeEnd != null and terms.closeEnd !=''">
@@ -223,7 +263,8 @@
        </if>
        union all
        select ROUND(DATEDIFF(SECOND, t2.apply_time, t2.audit_time) / 3600.0, 2) as usetime_hour
        from dyh_ct_unit t1 left join dyh_case_assist_apply t2 on t1.id = t2.audit_unit_id left join dyh_case_info t3 on t2.case_id = t3.id
        from dyh_ct_unit t1 left join dyh_case_assist_apply t2 on t1.id = t2.audit_unit_id left join dyh_case_info t3 on
        t2.case_id = t3.id
        where t2.apply_status = 1
        <if test="terms != null">
            <if test="terms.closeStart != null and terms.closeStart !='' and terms.closeEnd != null and terms.closeEnd !=''">
@@ -234,7 +275,8 @@
        </if>
        union all
        select ROUND(DATEDIFF(SECOND, t2.return_time, t2.audit_time) / 3600.0, 2) as usetime_hour
        from dyh_ct_unit t1 left join dyh_case_return t2 on t1.id = t2.audit_unit_id left join dyh_case_info t3 on t2.case_id = t3.id
        from dyh_ct_unit t1 left join dyh_case_return t2 on t1.id = t2.audit_unit_id left join dyh_case_info t3 on
        t2.case_id = t3.id
        where t2.return_status = 1
        <if test="terms != null">
            <if test="terms.closeStart != null and terms.closeStart !='' and terms.closeEnd != null and terms.closeEnd !=''">
@@ -245,7 +287,8 @@
        </if>
        union all
        select ROUND(DATEDIFF(SECOND, t2.apply_time, t2.audit_time) / 3600.0, 2) as usetime_hour
        from dyh_ct_unit t1 left join dyh_case_windup_apply t2 on t1.id = t2.audit_unit_id left join dyh_case_info t3 on t2.case_id = t3.id
        from dyh_ct_unit t1 left join dyh_case_windup_apply t2 on t1.id = t2.audit_unit_id left join dyh_case_info t3 on
        t2.case_id = t3.id
        where t2.apply_status = 1
        <if test="terms != null">
            <if test="terms.closeStart != null and terms.closeStart !='' and terms.closeEnd != null and terms.closeEnd !=''">
@@ -265,8 +308,10 @@
                count(distinct ownerId) as sps
        from
        (
        select ROUND(DATEDIFF(SECOND, t2.appear_time, t2.audit_time) / 3600.0, 2) as usetime_hour, t2.id as ownerId, t1.*
        from dyh_ct_unit t1 left join dyh_case_appear t2 on t1.id = t2.audit_unit_id left join dyh_case_info t3 on t2.case_id = t3.id
        select ROUND(DATEDIFF(SECOND, t2.appear_time, t2.audit_time) / 3600.0, 2) as usetime_hour, t2.id as ownerId,
        t1.*
        from dyh_ct_unit t1 left join dyh_case_appear t2 on t1.id = t2.audit_unit_id left join dyh_case_info t3 on
        t2.case_id = t3.id
        where t2.apply_status = 1 and t2.audit_time != t2.appear_time
        <if test="terms != null">
            <if test="terms.closeStart != null and terms.closeStart !='' and terms.closeEnd != null and terms.closeEnd !=''">
@@ -277,7 +322,8 @@
        </if>
        union all
        select ROUND(DATEDIFF(SECOND, t2.apply_time, t2.audit_time) / 3600.0, 2) as usetime_hour, t2.id as ownerId, t1.*
        from dyh_ct_unit t1 left join dyh_case_assist_apply t2 on t1.id = t2.audit_unit_id left join dyh_case_info t3 on t2.case_id = t3.id
        from dyh_ct_unit t1 left join dyh_case_assist_apply t2 on t1.id = t2.audit_unit_id left join dyh_case_info t3 on
        t2.case_id = t3.id
        where t2.apply_status = 1 and t2.audit_time != t2.apply_time
        <if test="terms != null">
            <if test="terms.closeStart != null and terms.closeStart !='' and terms.closeEnd != null and terms.closeEnd !=''">
@@ -287,8 +333,10 @@
            <include refid="statisticsApplyAVG-wherePart"/>
        </if>
        union all
        select ROUND(DATEDIFF(SECOND, t2.return_time, t2.audit_time) / 3600.0, 2) as usetime_hour, t2.id as ownerId, t1.*
        from dyh_ct_unit t1 left join dyh_case_return t2 on t1.id = t2.audit_unit_id left join dyh_case_info t3 on t2.case_id = t3.id
        select ROUND(DATEDIFF(SECOND, t2.return_time, t2.audit_time) / 3600.0, 2) as usetime_hour, t2.id as ownerId,
        t1.*
        from dyh_ct_unit t1 left join dyh_case_return t2 on t1.id = t2.audit_unit_id left join dyh_case_info t3 on
        t2.case_id = t3.id
        where t2.return_status = 1 and t2.audit_time!= t2.return_time
        <if test="terms != null">
            <if test="terms.closeStart != null and terms.closeStart !='' and terms.closeEnd != null and terms.closeEnd !=''">
@@ -299,7 +347,8 @@
        </if>
        union all
        select ROUND(DATEDIFF(SECOND, t2.apply_time, t2.audit_time) / 3600.0, 2) as usetime_hour, t2.id as ownerId, t1.*
        from dyh_ct_unit t1 left join dyh_case_windup_apply t2 on t1.id = t2.audit_unit_id left join dyh_case_info t3 on t2.case_id = t3.id
        from dyh_ct_unit t1 left join dyh_case_windup_apply t2 on t1.id = t2.audit_unit_id left join dyh_case_info t3 on
        t2.case_id = t3.id
        where t2.apply_status = 1 and t2.audit_time != t2.apply_time
        <if test="terms != null">
            <if test="terms.closeStart != null and terms.closeStart !='' and terms.closeEnd != null and terms.closeEnd !=''">
@@ -309,7 +358,8 @@
            <include refid="statisticsApplyAVG-wherePart"/>
        </if>
        ) t1
        group by <include refid="groupPart"/>
        group by
        <include refid="groupPart"/>
    </select>
    <!-- 条件 -->
@@ -354,12 +404,14 @@
        <if test="terms.unitIds != null and terms.unitIds !=''">
            and t1.id in(${terms.unitIds})
        </if>
    </sql>
    <!--  统计督办平均时长  -->
    <select id="statisticsSuperviseAVG" resultType="cn.huge.module.analysis.domain.dto.AvgDurationDTO">
        select AVG(ROUND(DATEDIFF(SECOND, t2.sup_time, t2.reply_time) / 3600.0, 2)) as db
        from dyh_ct_unit t1 left join dyh_case_supervise t2 on t1.id = t2.quilt_unit_id left join dyh_case_info t3 on t2.case_id = t3.id
        from dyh_ct_unit t1 left join dyh_case_supervise t2 on t1.id = t2.quilt_unit_id left join dyh_case_info t3 on
        t2.case_id = t3.id
        where
        <include refid="statisticsSuperviseAVG-wherePart"/>
        and t2.sup_status = 1
@@ -367,20 +419,34 @@
    <!--  分组统计督办平均时长  -->
    <select id="statisticsSuperviseGroup" resultType="cn.huge.module.analysis.domain.dto.AvgDurationGroupDTO">
        select <include refid="selectPart"/>
               AVG(ROUND(DATEDIFF(SECOND, t2.sup_time, t2.reply_time) / 3600.0, 2)) as db, count(case when sup_status = 1 then t2.id end ) as hfs
        from dyh_ct_unit t1 left join dyh_case_supervise t2 on t1.id = t2.quilt_unit_id left join dyh_case_info t3 on t2.case_id = t3.id
        select
        <include refid="selectPart"/>
        AVG(ROUND(DATEDIFF(SECOND, t2.sup_time, t2.reply_time) / 3600.0, 2)) as db, count(case when sup_status = 1 then
        t2.id end ) as hfs
        from dyh_ct_unit t1 left join dyh_case_supervise t2 on t1.id = t2.quilt_unit_id left join dyh_case_info t3 on
        t2.case_id = t3.id
        where
        <include refid="statisticsSuperviseAVG-wherePart"/>
        and t2.sup_status = 1
        group by <include refid="groupPart"/>
        group by
        <include refid="groupPart"/>
    </select>
    <!--  分组查询超时数量  -->
    <select id="statisticsSuperviseQuantity" resultType="cn.huge.module.analysis.domain.dto.StatisticsGroupDTO">
        select
            count(case when ((sysdate > DATEADD(hour, t2.reply_term, t2.sup_time) and t2.sup_status = 0) or (t2.overtime_status = '1')) then t2.id end) as dbcs
        from dyh_ct_unit t1 left join dyh_case_supervise t2 on t1.id = t2.quilt_unit_id left join dyh_case_info t3 on t2.case_id = t3.id
        <if test="terms.taskStatus != null and terms.taskStatus == 1 ">
            count(case when (t2.overtime_status = '1') then t2.id end) as dbcs
        </if>
        <if test="terms.taskStatus != null and terms.taskStatus == 0">
            count(case when (sysdate > DATEADD(hour, t2.reply_term, t2.sup_time) and t2.sup_status = 0) then t2.id end) as dbcs
        </if>
        <if test="terms.taskStatus == null or terms.taskStatus ==''">
            count(case when ((sysdate > DATEADD(hour, t2.reply_term, t2.sup_time) and t2.sup_status = 0) or
            (t2.overtime_status = '1')) then t2.id end) as dbcs
        </if>
        from dyh_ct_unit t1 left join dyh_case_supervise t2 on t1.id = t2.quilt_unit_id left join dyh_case_info t3 on
        t2.case_id = t3.id
        where
        <include refid="statisticsSuperviseAVG-wherePart"/>
    </select>
@@ -388,14 +454,17 @@
    <!--  首页-查询超时数量  -->
    <select id="homeStatisticsSuperviseQuantity" resultType="cn.huge.module.analysis.domain.dto.StatisticsGroupDTO">
        select
        count(case when ((sysdate > DATEADD(hour, t2.reply_term, t2.sup_time) and t2.sup_status = 0) or (t2.overtime_status = '1')) then t2.id end) as dbcs
        from dyh_ct_unit t1 left join dyh_case_supervise t2 on t1.id = t2.quilt_unit_id left join dyh_case_info t3 on t2.case_id = t3.id
        count(case when ((sysdate > DATEADD(hour, t2.reply_term, t2.sup_time) and t2.sup_status = 0) or
        (t2.overtime_status = '1')) then t2.id end) as dbcs
        from dyh_ct_unit t1 left join dyh_case_supervise t2 on t1.id = t2.quilt_unit_id left join dyh_case_info t3 on
        t2.case_id = t3.id
        where
        <include refid="statisticsSuperviseAVG-wherePart"/>
    </select>
    <!--  统计重复来访案件数量  -->
    <select id="countRepeatedCases" resultType="cn.huge.module.analysis.domain.dto.CountRepeateDto" parameterType="cn.huge.module.analysis.domain.vo.CountRepeateVo">
    <select id="countRepeatedCases" resultType="cn.huge.module.analysis.domain.dto.CountRepeateDto"
            parameterType="cn.huge.module.analysis.domain.vo.CountRepeateVo">
        WITH RepeatedPersons AS (
        SELECT true_name, mobile, certi_no
        FROM gzdyh_test.dyh_case_person
@@ -408,7 +477,8 @@
        MinCaseIds AS (
        SELECT rp.true_name, rp.mobile, rp.certi_no, MIN(p.case_id) as min_case_id
        FROM RepeatedPersons rp
        JOIN gzdyh_test.dyh_case_person p ON rp.true_name = p.true_name AND rp.mobile = p.mobile AND rp.certi_no = p.certi_no
        JOIN gzdyh_test.dyh_case_person p ON rp.true_name = p.true_name AND rp.mobile = p.mobile AND rp.certi_no =
        p.certi_no
        GROUP BY rp.true_name, rp.mobile, rp.certi_no
        ),
        FilteredCases AS (
@@ -501,13 +571,24 @@
        and t2.delete_status = 0
        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') and ((t2.overtime_status = 1 and t2.status = 2) or (sysdate > expire_time and t2.status = 1))
        and (t2.node_id = 'ZJ_DFP' or t2.node_id = 'QJ_DFP' or t2.node_id = 'SJ_DFP' or t2.node_id = 'DFP')
        <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="listFPQuantity" 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,
        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,
@@ -519,7 +600,16 @@
        and t2.delete_status = 0
        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') and ((t2.overtime_status = 1 and t2.status = 2) or (sysdate > expire_time and t2.status = 1))
        and (t2.node_id = 'ZJ_DFP' or t2.node_id = 'QJ_DFP' or t2.node_id = 'SJ_DFP' or t2.node_id = 'DFP')
        <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}
@@ -544,13 +634,23 @@
        <include refid="statisticsAVG-wherePart"/>
        and
        (t2.node_id = 'ZJ_DSL' or t2.node_id = 'QJ_DSL' or t2.node_id = 'SJ_DSL' or t2.node_id = 'DSL')
        <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="listSLQuantity" 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,
        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,
@@ -564,7 +664,15 @@
        <include refid="statisticsAVG-wherePart"/>
        and
        (t2.node_id = 'ZJ_DSL' or t2.node_id = 'QJ_DSL' or t2.node_id = 'SJ_DSL' or t2.node_id = 'DSL')
        <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}
@@ -584,13 +692,22 @@
            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
        <include refid="statisticsSuperviseAVG-wherePart"/>
        <if test="terms.taskStatus != null and terms.taskStatus == 1 ">
            and  (t2.overtime_status = '1')
        </if>
        <if test="terms.taskStatus != null and terms.taskStatus == 0">
            and (sysdate > DATEADD(hour, t2.reply_term, t2.sup_time) and t2.sup_status = 0)
        </if>
        <if test="terms.taskStatus == null or terms.taskStatus ==''">
        and ((sysdate > DATEADD(hour, t2.reply_term, t2.sup_time) and t2.sup_status = 0) or (t2.overtime_status = '1'))
        </if>
    </select>
    <!--  查询督办超时案件  -->
    <select id="listDBQuantity" resultType="cn.huge.module.analysis.domain.dto.TimeoutTaskInfoDTO">
        select t2.case_id as caseId, t2.sup_time as turnaroundTime, '督办回复' as nodeName, t2.sup_status as taskStatus,
        (case t2.sup_status when 1 then t2.overtime_hour when 0 then DATEDIFF(hh, DATEADD(hour, t2.reply_term, t2.sup_time), sysdate) end) as timeLimit,
        (case t2.sup_status when 1 then t2.overtime_hour when 0 then DATEDIFF(hh, DATEADD(hour, t2.reply_term,
        t2.sup_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.quilt_unit_name as candeUnitName,
@@ -599,7 +716,15 @@
            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
        <include refid="statisticsSuperviseAVG-wherePart"/>
        <if test="terms.taskStatus != null and terms.taskStatus == 1 ">
            and  (t2.overtime_status = '1')
        </if>
        <if test="terms.taskStatus != null and terms.taskStatus == 0">
            and (sysdate > DATEADD(hour, t2.reply_term, t2.sup_time) and t2.sup_status = 0)
        </if>
        <if test="terms.taskStatus == null or terms.taskStatus ==''">
        and ((sysdate > DATEADD(hour, t2.reply_term, t2.sup_time) and t2.sup_status = 0) or (t2.overtime_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}
@@ -626,7 +751,15 @@
                <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'))
        <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>
            union
            select
                COUNT(1) as zs
@@ -634,15 +767,25 @@
                                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
        <include refid="statisticsSuperviseAVG-wherePart"/>
            and ((sysdate > DATEADD(hour, t2.reply_term, t2.sup_time) and t2.sup_status = 0) or (t2.overtime_status = '1'))
        )
        <if test="terms.taskStatus != null and terms.taskStatus == 1 ">
            and (t2.overtime_status = '1')
        </if>
        <if test="terms.taskStatus != null and terms.taskStatus == 0">
            and (sysdate > DATEADD(hour, t2.reply_term, t2.sup_time) and t2.sup_status = 0)
        </if>
        <if test="terms.taskStatus == null or terms.taskStatus ==''">
            and ((sysdate > DATEADD(hour, t2.reply_term, t2.sup_time) and t2.sup_status = 0) or (t2.overtime_status =
            '1'))
        </if>)
    </select>
    <!--  查询督办超时案件  -->
    <select id="listAllQuantity" resultType="cn.huge.module.analysis.domain.dto.TimeoutTaskInfoDTO">
        select * from(
            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,
        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,
@@ -656,10 +799,20 @@
            <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'))
        <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>
            union all
            select t2.case_id as caseId, null as caseTaskId, t2.sup_time as turnaroundTime, '督办回复' as nodeName, t2.sup_status as taskStatus,
            (case t2.sup_status when 1 then t2.overtime_hour when 0 then DATEDIFF(hh, DATEADD(hour, t2.reply_term, t2.sup_time), sysdate) end) as timeLimit,
        select t2.case_id as caseId, null as caseTaskId, t2.sup_time as turnaroundTime, '督办回复' as nodeName,
        t2.sup_status as taskStatus,
        (case t2.sup_status when 1 then t2.overtime_hour when 0 then DATEDIFF(hh, DATEADD(hour, t2.reply_term,
        t2.sup_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.quilt_unit_name as candeUnitName,
@@ -668,7 +821,16 @@
                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
            <include refid="statisticsSuperviseAVG-wherePart"/>
            and ((sysdate > DATEADD(hour, t2.reply_term, t2.sup_time) and t2.sup_status = 0) or (t2.overtime_status = '1'))
        <if test="terms.taskStatus != null and terms.taskStatus == 1 ">
            and (t2.overtime_status = '1')
        </if>
        <if test="terms.taskStatus != null and terms.taskStatus == 0">
            and (sysdate > DATEADD(hour, t2.reply_term, t2.sup_time) and t2.sup_status = 0)
        </if>
        <if test="terms.taskStatus == null or terms.taskStatus ==''">
            and ((sysdate > DATEADD(hour, t2.reply_term, t2.sup_time) and t2.sup_status = 0) or (t2.overtime_status =
            '1'))
        </if>
        )
        <if test="page.sort != null">
            <foreach collection="page.sort" item="s" index="index" separator="," open="order by ">
@@ -679,6 +841,7 @@
            order by isnull(t2.sup_time), t2.sup_time desc
        </if>
        limit #{page.offset}, #{page.size}
    </select>
    <sql id="statisticsCirculation-wherePart">
@@ -741,7 +904,8 @@
        or t4.node_id = 'SJ_DFP' or t4.node_id = 'DFP' or t4.node_id = 'QJ_DSL' or t4.node_id = 'SJ_DSL'
        or t4.node_id = 'DSL' or t4.node_id = 'ZJ_DSL')and t4.handle_result =3) then t4.id end) as bysl
        from
        dyh_ct_unit t1 left join dyh_case_info_unfold t2 on t2.belong_unit_id = t1.id left join dyh_case_info t3 on t2.id = t3.id
        dyh_ct_unit t1 left join dyh_case_info_unfold t2 on t2.belong_unit_id = t1.id left join dyh_case_info t3 on
        t2.id = t3.id
        left join(SELECT case_id, node_id, create_time, cande_unit_id, id, status,handle_result
        FROM (
        SELECT case_id, node_id, create_time, cande_unit_id, id, status,handle_result,
@@ -752,7 +916,8 @@
        group by s.case_id) t4 on t2.id = t4.case_id
        where t1.delete_status = 0 and t3.delete_status = 0
        <include refid="statisticsCirculation-wherePart"/>
        group by <include refid="groupPart"/>
        group by
        <include refid="groupPart"/>
    </select>
    <!-- 分组查询字段 -->
@@ -863,12 +1028,14 @@
        <if test="terms.unitIds != null and terms.unitIds !=''">
            and id in(${terms.unitIds})
        </if>
        group by <include refid="groupALLPart"/>
        group by
        <include refid="groupALLPart"/>
    </select>
    <!--  查询下属所有属地  -->
    <select id="listSubordinateTerritory" resultType="string">
        select <include refid="selectALLPart"/>
        select
        <include refid="selectALLPart"/>
        from dyh_ct_unit
        where
        delete_status = 0
@@ -898,22 +1065,21 @@
        <if test="terms.unitIds != null and terms.unitIds !=''">
            and id in(${terms.unitIds})
        </if>
        group by <include refid="groupALLPart"/>
        group by
        <include refid="groupALLPart"/>
    </select>
    <!--  获取所有下属组织包括自己  -->
    <select id="getAllParentUnit" resultType="string">
        SELECT id
        FROM dyh_ct_unit
        START WITH id = #{unitId}
        FROM dyh_ct_unit START WITH id = #{unitId}
        CONNECT BY PRIOR id = parent_id;
    </select>
    <!--  获取所有下属组织包括自己  -->
    <select id="getAllDeptParentUnit" resultType="string">
        SELECT id
        FROM dyh_ct_unit
                 START WITH id = #{unitId}
        FROM dyh_ct_unit START WITH id = #{unitId}
        CONNECT BY PRIOR id = parent_id and unit_type != 101 and unit_type != 103;
    </select>
@@ -1110,8 +1276,10 @@
        and t2.delete_status = 0
        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') and ((t2.overtime_status = 1 and t2.status = 2) or (sysdate > expire_time and t2.status = 1))
        group by <include refid="groupPart"/>
        and (t2.node_id = 'ZJ_DFP' or t2.node_id = 'QJ_DFP' or t2.node_id = 'SJ_DFP' or t2.node_id = 'DFP') 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>
@@ -1128,8 +1296,10 @@
        and t3.delete_status = 0
        <include refid="statisticsAVG-wherePart"/>
        and
        (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) )
        group by <include refid="groupPart"/>
        (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) )
        group by
        <include refid="groupPart"/>
        order by quantity asc
    </select>
@@ -1143,7 +1313,8 @@
        where
        <include refid="statisticsSuperviseAVG-wherePart"/>
        and ((sysdate > DATEADD(hour, t2.reply_term, t2.sup_time) and t2.sup_status = 0) or (t2.overtime_status = '1'))
        group by <include refid="groupPart"/>
        group by
        <include refid="groupPart"/>
        order by quantity asc
    </select>
@@ -1167,7 +1338,8 @@
        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'))
        and ((t2.overtime_status = 1 and t2.status = 2) or (sysdate > expire_time and t2.status = 1))
        group by <include refid="groupPart"/>
        group by
        <include refid="groupPart"/>
        union all
        select
        <include refid="selectPart"/>
@@ -1177,8 +1349,10 @@
        where
        <include refid="statisticsSuperviseAVG-wherePart"/>
        and ((sysdate > DATEADD(hour, t2.reply_term, t2.sup_time) and t2.sup_status = 0) or (t2.overtime_status = '1'))
        group by <include refid="groupPart"/>
        )t1 group by <include refid="groupPart"/>
        group by
        <include refid="groupPart"/>
        )t1 group by
        <include refid="groupPart"/>
        order by quantity asc
    </select>
@@ -1249,7 +1423,8 @@
        select
        count(1)
        from
        dyh_ct_unit t1 left join dyh_case_info_unfold t2 on t2.belong_unit_id = t1.id left join dyh_case_info t3 on t2.id = t3.id
        dyh_ct_unit t1 left join dyh_case_info_unfold t2 on t2.belong_unit_id = t1.id left join dyh_case_info t3 on
        t2.id = t3.id
        left join(SELECT case_id, node_id, create_time, cande_unit_id, id, status,handle_result
        FROM (
        SELECT case_id, node_id, create_time, cande_unit_id, id, status,handle_result,
@@ -1268,7 +1443,8 @@
        <if test="terms.caseStatus != null and terms.caseStatus == 3">
            and t3.zxsl_status = 0
            and ((t4.node_id in ('ZJ_DFP', 'QJ_DFP', 'SJ_DFP', 'DFP', 'QJ_DSL', 'SJ_DSL', 'DSL', 'ZJ_DSL')
            and t4.handle_result !=3) or t4.node_id in ('SJ_SBSH', 'SJ_HTSH', 'QJ_HTSH', 'QJ_SBSH', 'ZJ_HTSH', 'JASQ', 'HTSH'))
            and t4.handle_result !=3) or t4.node_id in ('SJ_SBSH', 'SJ_HTSH', 'QJ_HTSH', 'QJ_SBSH', 'ZJ_HTSH', 'JASQ',
            'HTSH'))
        </if>
        <if test="terms.caseStatus != null and terms.caseStatus == 4">
            and t3.zxsl_status = 0
@@ -1280,7 +1456,8 @@
    <select id="listStatisticsCirculation" resultMap="dataResult-CasePageDTO">
        select
        t3.id, t3.status,t3.status_name,t3.canal,t3.canal_name,t3.canal_second,t3.canal_second_name,t3.case_level,t3.case_type,
        t3.id,
        t3.status,t3.status_name,t3.canal,t3.canal_name,t3.canal_second,t3.canal_second_name,t3.case_level,t3.case_type,
        t3.case_type_name,t3.case_type_first_name,t3.input_unit_id,t3.input_unit_name,t3.create_time,t3.plaintiffs,t3.defendants,
        IF(t1.city_name is null,t3.que_city_name,t1.city_name) as que_city_name,
        IF(t1.area_name is null,t3.que_area_name,t1.area_name) as que_area_name,
@@ -1292,7 +1469,8 @@
        t2.assist_unit_name,t2.close_time,t2.agree_type,t2.agree_type_name,t2.agree_content,t2.windup_content,
        t4.id
        from
        dyh_ct_unit t1 left join dyh_case_info_unfold t2 on t2.belong_unit_id = t1.id left join dyh_case_info t3 on t2.id = t3.id
        dyh_ct_unit t1 left join dyh_case_info_unfold t2 on t2.belong_unit_id = t1.id left join dyh_case_info t3 on
        t2.id = t3.id
        left join(SELECT case_id, node_id, create_time, cande_unit_id, id, status,handle_result
        FROM (
        SELECT case_id, node_id, create_time, cande_unit_id, id, status,handle_result,
@@ -1311,7 +1489,8 @@
        <if test="terms.caseStatus != null and terms.caseStatus == 3">
            and t3.zxsl_status = 0
            and ((t4.node_id in ('ZJ_DFP', 'QJ_DFP', 'SJ_DFP', 'DFP', 'QJ_DSL', 'SJ_DSL', 'DSL', 'ZJ_DSL')
            and t4.handle_result !=3) or t4.node_id in ('SJ_SBSH', 'SJ_HTSH', 'QJ_HTSH', 'QJ_SBSH', 'ZJ_HTSH', 'JASQ', 'HTSH'))
            and t4.handle_result !=3) or t4.node_id in ('SJ_SBSH', 'SJ_HTSH', 'QJ_HTSH', 'QJ_SBSH', 'ZJ_HTSH', 'JASQ',
            'HTSH'))
        </if>
        <if test="terms.caseStatus != null and terms.caseStatus == 4">
            and t3.zxsl_status = 0
dyh-service/dyh-mediate/src/main/resources/config/application.yml
@@ -3,8 +3,8 @@
  profiles:
    active:
#      - dev
#        - test
        - prod
        - test
#        - prod
  devtools:
    restart:
dyh-service/dyh-sys/src/main/java/cn/huge/module/timer/GridCityCaseTimer.java
@@ -155,14 +155,7 @@
                                String certiNo = "";
                                String plaintiffs = "";
                                String phone = "";
                                if ("07".equals(canalSecond)) {
                                    if (StringUtils.isNotBlank(gridCaseInfoDTO.getLinkman())) {
                                        uploadPolice = AesUtils.decrypt(gridCaseInfoDTO.getLinkman(), "W90akz7tA7tyMn5tNTynG69YM2E8jGfF");
                                    }
                                    if (StringUtils.isNotBlank(gridCaseInfoDTO.getContactTel())) {
                                        uploadPolicePhone = AesUtils.decrypt(gridCaseInfoDTO.getContactTel(), "W90akz7tA7tyMn5tNTynG69YM2E8jGfF");
                                    }
                                } else if ("12".equals(canalSecond) || "13".equals(canalSecond)) {
                                    if (StringUtils.isNotBlank(gridCaseInfoDTO.getLinkman())) {
                                        uploadPolice = AesUtils.decrypt(gridCaseInfoDTO.getLinkman(), "W90akz7tA7tyMn5tNTynG69YM2E8jGfF");
                                    }
@@ -246,7 +239,6 @@
                                    } catch (Exception e) {
                                        log.error("解析extInfo失败,事件id:{" + gridCaseInfoDTO.getId() + "}; 解析内容:" + gridCaseInfoDTO.getExtInfo() + "失败原因:" + e.getMessage());
                                    }
                                }
                                registerSaveDTO.setId(IdUtils.getNewTimeId());
                                BeanUtils.copyProperties(gridCaseInfoDTO, gridEvent);
                                registerSaveDTO.setCreateTime(DateUtils.StringToDate(gridCaseInfoDTO.getCreateTime(), "yyyy-MM-dd HH:mm:ss"));
@@ -329,7 +321,6 @@
                                registerSaveDTO.setPhone(phone);
                                String dyhUnitId = gridCaseTaskService.getGridUnitIdByUnitId(gridCode);
                                if (StringUtils.isNotBlank(dyhUnitId)) {
                                    registerSaveDTO.setWantUnitId(dyhUnitId);
                                } else {
                                    log.info("网格组织查询不到对应组织:" + gridCode);
                                }
@@ -447,14 +438,7 @@
                                String certiNo = "";
                                String plaintiffs = "";
                                String phone = "";
                                if ("07".equals(canalSecond)) {
                                    if (StringUtils.isNotBlank(gridCaseInfoDTO.getLinkman())) {
                                        uploadPolice = AesUtils.decrypt(gridCaseInfoDTO.getLinkman(), "W90akz7tA7tyMn5tNTynG69YM2E8jGfF");
                                    }
                                    if (StringUtils.isNotBlank(gridCaseInfoDTO.getContactTel())) {
                                        uploadPolicePhone = AesUtils.decrypt(gridCaseInfoDTO.getContactTel(), "W90akz7tA7tyMn5tNTynG69YM2E8jGfF");
                                    }
                                } else if ("12".equals(canalSecond) || "13".equals(canalSecond)) {
                                    if (StringUtils.isNotBlank(gridCaseInfoDTO.getLinkman())) {
                                        uploadPolice = AesUtils.decrypt(gridCaseInfoDTO.getLinkman(), "W90akz7tA7tyMn5tNTynG69YM2E8jGfF");
                                    }
@@ -537,7 +521,6 @@
                                        }
                                    } catch (Exception e) {
                                        log.error("解析extInfo失败,事件id:{" + gridCaseInfoDTO.getId() + "}; 解析内容:" + gridCaseInfoDTO.getExtInfo() + "失败原因:" + e.getMessage());
                                    }
                                }
                                registerSaveDTO.setId(IdUtils.getNewTimeId());
                                registerSaveDTO.setCreateTime(DateUtils.StringToDate(gridCaseInfoDTO.getCreateTime(), "yyyy-MM-dd HH:mm:ss"));
dyh-service/dyh-sys/src/main/resources/config/application.yml
@@ -3,8 +3,8 @@
  profiles:
    active:
#      - dev
#        - test
        - prod
        - test
#        - prod
  devtools:
    restart: