forked from gzzfw/backEnd/gz-dyh

xusd
2024-10-25 7b7f52e057434bf7e2edc2273e1d334d87ba65f6
dyh-service/dyh-mediate/src/main/java/cn/huge/module/cases/dao/mapper/xml/CaseInfoMapper.xml
@@ -358,16 +358,59 @@
                    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 ((b.mediate_unit_id is not null and c.city = #{terms.queCity})
                    or (b.mediate_unit_id is null and a.que_city = #{terms.queCity}))
                <if test='terms.queCity != null and terms.queCity !="" and terms.statistics != null and terms.areaType == "1"'>
                    and (b.mediate_unit_id is not null and c.city = #{terms.queCity}
                    <if test="terms.unitGrades != null and terms.unitGrades.size > 0">
                        and c.unit_grade in
                        <foreach collection="terms.unitGrades" item="unitGrade" index="index" open="(" separator="," close=")">
                            #{unitGrade}
                        </foreach>
                    </if>
                    )
                </if>
                <if test="terms.queArea != null and terms.queArea !='' and terms.statistics != null">
                    and ((b.mediate_unit_id is not null and c.area = #{terms.queArea})
                    or (b.mediate_unit_id is null and a.que_area = #{terms.queArea}))
                <if test='terms.queCity != null and terms.queCity !="" and terms.statistics != null and terms.areaType != "1"'>
                    and ((b.mediate_unit_id is not null and c.city = #{terms.queCity}
                    <if test="terms.unitGrades != null and terms.unitGrades.size > 0">
                        and c.unit_grade in
                        <foreach collection="terms.unitGrades" item="unitGrade" index="index" open="(" separator=","
                                 close=")">
                            #{unitGrade}
                        </foreach>
                    </if>)
                    or (b.mediate_unit_id is null and a.que_city = #{terms.queCity})
                    )
                </if>
                <if test='terms.queArea != null and terms.queArea !="" and terms.statistics != null and terms.areaType == "2"'>
                    and (b.mediate_unit_id is not null and c.area = #{terms.queArea}
                    <if test="terms.unitGrades != null and terms.unitGrades.size > 0">
                        and c.unit_grade in
                        <foreach collection="terms.unitGrades" item="unitGrade" index="index" open="(" separator="," close=")">
                            #{unitGrade}
                        </foreach>
                    </if>
                    )
                </if>
                <if test='terms.queArea != null and terms.queArea !="" and terms.statistics != null and terms.areaType != "2"'>
                    and ((b.mediate_unit_id is not null and c.area = #{terms.queArea}
                    <if test="terms.unitGrades != null and terms.unitGrades.size > 0">
                        and c.unit_grade in
                        <foreach collection="terms.unitGrades" item="unitGrade" index="index" open="(" separator="," close=")">
                            #{unitGrade}
                        </foreach>
                    </if>
                    )
                    or (b.mediate_unit_id is null and a.que_area = #{terms.queArea})
                    )
                </if>
                <if test="terms.queRoad != null and terms.queRoad !='' and terms.statistics != null">
                    and ((b.mediate_unit_id is not null and c.road = #{terms.queRoad})
                    and ((b.mediate_unit_id is not null and c.road = #{terms.queRoad}
                    <if test="terms.unitGrades != null and terms.unitGrades.size > 0">
                        and c.unit_grade in
                        <foreach collection="terms.unitGrades" item="unitGrade" index="index" open="(" separator="," close=")">
                            #{unitGrade}
                        </foreach>
                    </if>
                    )
                    or (b.mediate_unit_id is null and a.que_road = #{terms.queRoad}))
                </if>
                <if test="terms.isArea != null and terms.isArea !=''">
@@ -850,13 +893,16 @@
    <!--  统计分析(区域)  -->
    <select id="statisticsArea" resultType="cn.huge.module.cases.domain.dto.CaseStatisticsAreaDTO">
        SELECT
        <if test="terms.areaType == null or terms.areaType ==''">
            IF(c.area is null,a.que_area,c.area) as areaCode,IF(c.area_name is null,a.que_area_name,c.area_name) as areaName,
        </if>
        <if test='terms.areaType != null and terms.areaType =="1"'>
            IF(c.area is null,a.que_area,c.area) as areaCode,IF(c.area_name is null,a.que_area_name,c.area_name) as areaName,
        <if test='terms.areaType == null or terms.areaType =="1"'>
            IF(c.area is null,a.que_city,c.city) as areaCode,IF(c.city_name is null,a.que_city_name,c.city_name) as areaName,
        </if>
        <if test='terms.areaType != null and terms.areaType =="2"'>
            IF(c.area is null,a.que_area,c.area) as areaCode,IF(c.area_name is null,a.que_area_name,c.area_name) as areaName,
        </if>
        <if test='terms.areaType != null and terms.areaType =="3"'>
            IF(c.road is null,a.que_road,c.road) as areaCode,IF(c.road_name is null,a.que_road_name,c.road_name) as areaName,
        </if>
        <if test='terms.areaType != null and terms.areaType =="4"'>
            IF(c.road is null,a.que_road,c.road) as areaCode,IF(c.road_name is null,a.que_road_name,c.road_name) as areaName,
        </if>
        c.unit_grade as unitGrade,
@@ -871,7 +917,6 @@
        LEFT JOIN dyh_ct_unit c ON b.mediate_unit_id = c.id
        <include refid="where-part-all"/>
        group by areaCode
    </select>
    <!--  统计分析(基础)  -->
    <select id="statisticsBase" resultType="cn.huge.module.cases.domain.dto.CaseStatisticsBaseDTO">