广州市综治平台后端
xusd
14 mins ago e635ea4921ba96ff9f60dbb54d17f29b99e30d9a
dyh-service/dyh-mediate/src/main/java/cn/huge/module/analysis/dao/mapper/xml/AnalysisMapper.xml
@@ -103,6 +103,10 @@
                and t1.id in(${terms.unitIds})
            </if>
            <if test="terms.infoStatus != null and terms.infoStatus !=''">
                and t3.status = #{terms.infoStatus}
            </if>
        </if>
    </sql>
@@ -158,7 +162,10 @@
            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)) then t2.id end) as
            blcs
        </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')
@@ -166,7 +173,10 @@
            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 ((sysdate > expire_time and t2.status = 1)) then t2.id end) as
            blcs
        </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')
@@ -174,7 +184,10 @@
            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
        </if>
@@ -242,6 +255,9 @@
        </if>
        <if test="terms.unitIds != null and terms.unitIds !=''">
            and t1.id in(${terms.unitIds})
        </if>
        <if test="terms.infoStatus != null and terms.infoStatus !=''">
            and t3.status = #{terms.infoStatus}
        </if>
    </sql>
@@ -403,6 +419,9 @@
        </if>
        <if test="terms.unitIds != null and terms.unitIds !=''">
            and t1.id in(${terms.unitIds})
        </if>
        <if test="terms.infoStatus != null and terms.infoStatus !=''">
            and t3.status = #{terms.infoStatus}
        </if>
    </sql>
@@ -736,6 +755,69 @@
        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)
@@ -750,7 +832,8 @@
        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>
@@ -798,7 +881,8 @@
        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>
@@ -846,7 +930,6 @@
    <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}
@@ -883,6 +966,9 @@
                and (t2.close_time <![CDATA[ >= ]]> #{terms.closeStart}
                and t2.close_time <![CDATA[ <= ]]> #{terms.closeEnd})
            </if>
            <if test="terms.infoStatus != null and terms.infoStatus !=''">
                and t3.status = #{terms.infoStatus}
            </if>
        </if>
    </sql>
@@ -914,7 +1000,7 @@
        ) 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"/>
@@ -1318,6 +1404,26 @@
        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
@@ -1336,7 +1442,8 @@
        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"/>
@@ -1367,6 +1474,10 @@
        <if test="terms.queArea != null and terms.queArea !=''">
            level = 3
            and parent_id = #{terms.queArea}
        </if>
        <if test="terms.queRoad != null and terms.queRoad !=''">
            level = 4
            and parent_id = #{terms.queRoad}
        </if>
        ORDER BY level ASC,create_time ASC
    </select>
@@ -1451,6 +1562,9 @@
            and t4.handle_result = 3
            and t4.node_id in ('ZJ_DFP', 'QJ_DFP', 'SJ_DFP', 'DFP', 'QJ_DSL', 'SJ_DSL', 'DSL', 'ZJ_DSL')
        </if>
        <if test="terms.unitGrade != null and terms.unitGrade !=''">
            and t1.unit_grade = #{terms.unitGrade}
        </if>
        <include refid="statisticsCirculation-wherePart"/>
    </select>
@@ -1479,7 +1593,7 @@
        ) 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>
@@ -1497,6 +1611,9 @@
            and t4.handle_result = 3
            and t4.node_id in ('ZJ_DFP', 'QJ_DFP', 'SJ_DFP', 'DFP', 'QJ_DSL', 'SJ_DSL', 'DSL', 'ZJ_DSL')
        </if>
        <if test="terms.unitGrade != null and terms.unitGrade !=''">
            and t1.unit_grade = #{terms.unitGrade}
        </if>
        <include refid="statisticsCirculation-wherePart"/>
        <if test="page.sort != null">
            <foreach collection="page.sort" item="s" index="index" separator="," open="order by ">