广州市综治平台后端
xusd
2 days ago c490640493f04e2ed0fc5c4c8fbc92ebdd4d5380
dyh-service/dyh-mediate/src/main/java/cn/huge/module/cases/dao/mapper/xml/CaseInfoMapper.xml
@@ -411,22 +411,6 @@
                <if test="terms.mediatorId != null and terms.mediatorId !=''">
                    and b.mediator_id = #{terms.mediatorId}
                </if>
                <if test="terms.visitTimeStart != null and terms.visitTimeStart !='' and terms.visitTimeEnd != null and terms.visitTimeEnd !=''">
                    and (DATE_FORMAT(a.visit_time,'%Y-%m-%d %H:%i:%s') <![CDATA[ >= ]]> #{terms.visitTimeStart}
                    and DATE_FORMAT(a.visit_time,'%Y-%m-%d %H:%i:%s') <![CDATA[ <= ]]> #{terms.visitTimeEnd})
                </if>
                <if test="terms.createStart != null and terms.createStart !='' and terms.createEnd != null and terms.createEnd !=''">
                    and (DATE_FORMAT(a.create_time,'%Y-%m-%d %H:%i:%s') <![CDATA[ >= ]]> #{terms.createStart}
                    and DATE_FORMAT(a.create_time,'%Y-%m-%d %H:%i:%s') <![CDATA[ <= ]]> #{terms.createEnd})
                </if>
                <if test="terms.closeStart != null and terms.closeStart !='' and terms.closeEnd != null and terms.closeEnd !=''">
                    and (DATE_FORMAT(b.close_time,'%Y-%m-%d %H:%i:%s') <![CDATA[ >= ]]> #{terms.closeStart}
                    and DATE_FORMAT(b.close_time,'%Y-%m-%d %H:%i:%s') <![CDATA[ <= ]]> #{terms.closeEnd})
                </if>
                <if test="terms.fileStart != null and terms.fileStart !='' and terms.fileEnd != null and terms.fileEnd !=''">
                    and (DATE_FORMAT(b.file_time,'%Y-%m-%d %H:%i:%s') <![CDATA[ >= ]]> #{terms.fileStart}
                    and DATE_FORMAT(b.file_time,'%Y-%m-%d %H:%i:%s') <![CDATA[ <= ]]> #{terms.fileEnd})
                </if>
                <if test='terms.queCity != null and terms.queCity !="" and terms.statistics != null and terms.areaType == "1"'>
                    and (b.belong_unit_id is not null and c.city = #{terms.queCity}
                    <if test="terms.unitGrades != null and terms.unitGrades.size > 0">
@@ -573,6 +557,25 @@
                </if>
                <if test="terms.agreeType != null and terms.agreeType !=''">
                    and b.agree_type = #{terms.agreeType}
                </if>
                <if test="terms.systemSource != null and terms.systemSource !=''">
                    and b.sys_source = #{terms.systemSource}
                </if>
                <if test="terms.visitTimeStart != null and terms.visitTimeStart !='' and terms.visitTimeEnd != null and terms.visitTimeEnd !=''">
                    and (DATE_FORMAT(a.visit_time,'%Y-%m-%d %H:%i:%s') <![CDATA[ >= ]]> #{terms.visitTimeStart}
                    and DATE_FORMAT(a.visit_time,'%Y-%m-%d %H:%i:%s') <![CDATA[ <= ]]> #{terms.visitTimeEnd})
                </if>
                <if test="terms.createStart != null and terms.createStart !='' and terms.createEnd != null and terms.createEnd !=''">
                    and (a.create_time <![CDATA[ >= ]]> #{terms.createStart}
                    and a.create_time <![CDATA[ <= ]]> #{terms.createEnd})
                </if>
                <if test="terms.closeStart != null and terms.closeStart !='' and terms.closeEnd != null and terms.closeEnd !=''">
                    and (DATE_FORMAT(b.close_time,'%Y-%m-%d %H:%i:%s') <![CDATA[ >= ]]> #{terms.closeStart}
                    and DATE_FORMAT(b.close_time,'%Y-%m-%d %H:%i:%s') <![CDATA[ <= ]]> #{terms.closeEnd})
                </if>
                <if test="terms.fileStart != null and terms.fileStart !='' and terms.fileEnd != null and terms.fileEnd !=''">
                    and (DATE_FORMAT(b.file_time,'%Y-%m-%d %H:%i:%s') <![CDATA[ >= ]]> #{terms.fileStart}
                    and DATE_FORMAT(b.file_time,'%Y-%m-%d %H:%i:%s') <![CDATA[ <= ]]> #{terms.fileEnd})
                </if>
            </where>
        </if>
@@ -1121,7 +1124,11 @@
                when a.info_process = 1 then 1   else 0 end) as processNum,
        sum(case when a.info_process = 3 and b.medi_result = '22_00025-1' then 1 else 0 end) as finishNum,
        sum(case when a.info_process = 4 then 1 else 0 end) as rejectNum,
        sum(case when a.info_process = 3 and b.medi_result = '22_00025-2' then 1 else 0 end) as failNum
        sum(case when a.info_process = 3 and b.medi_result = '22_00025-2' then 1 else 0 end) as failNum,
        sum(case when a.canal_second = '22_00003-8' then 1 else 0 end) as bmpcNum,
        sum(case when a.canal_second = '22_00003-2' then 1 else 0 end) as wgpcNum,
        sum(case when a.canal_second = '22_00003-1' then 1 else 0 end) as fjwjfNum,
        sum(case when a.canal_second = '22_00003-7' then 1 else 0 end) as zxjfNum
        FROM
        dyh_case_info a
        inner JOIN dyh_case_info_unfold b on a.id = b.id
@@ -1463,4 +1470,45 @@
            a.canal_second
    </select>
    <!--  统计分析(基础)  -->
    <select id="workStatisticsTime" resultType="cn.huge.module.cases.domain.dto.CaseWorkStatisticsTimeDTO">
        SELECT
        count(1) as totalNum,
        sum(case when b.medi_result = '22_00025-1' and a.info_process = 3 then 1 else 0 end) as resolveNum,
        sum(case when a.info_process <![CDATA[ < ]]> 3 then 1 else 0 end) as resolveingNum,
        sum(case when b.medi_result = '22_00025-2' and a.info_process = 3 then 1 else 0 end) as unResolveNum,
        sum(case when a.case_level = 1 then 1 else 0 end) as oneLevelNum,
        sum(case when a.case_level = 2 then 1 else 0 end) as twoLevelNum,
        sum(case when a.case_level = 3 then 1 else 0 end) as threeLevelNum,
        sum(case when a.info_process <![CDATA[ < ]]> 3 then 1 else 0 end) as processNum,
        sum(case when a.info_process = 3 then 1 else 0 end) as finishNum,
        <if test='terms.selectTimeType != null and terms.selectTimeType =="1"'>
            DATE_FORMAT(a.create_time, '%Y-%m-%d') AS dayStr,
            DATE_FORMAT(a.create_time, '%Y-%m') AS monthStr,
            DATE_FORMAT(a.create_time, '%Y') AS year_str,
        </if>
        <if test='terms.selectTimeType != null and terms.selectTimeType =="2"'>
            DATE_FORMAT(b.close_time, '%Y-%m-%d') AS dayStr,
            DATE_FORMAT(b.close_time, '%Y-%m') AS monthStr,
            DATE_FORMAT(b.close_time, '%Y') AS year_str,
        </if>
        sum(case when a.info_process = 4 then 1 else 0 end) as rejectNum
        FROM
        dyh_case_info a
        inner JOIN dyh_case_info_unfold b on a.id = b.id
        LEFT JOIN dyh_ct_unit c ON b.belong_unit_id = c.id
        <include refid="where-part-all"/>
        <if test='terms.timeType != null and terms.timeType =="3"'>
            GROUP BY year_str
        </if>
        <if test='terms.timeType != null and terms.timeType =="2"'>
            GROUP BY monthStr
        </if>
        <if test='terms.timeType != null and terms.timeType =="1"'>
            GROUP BY dayStr
        </if>
    </select>
</mapper>