forked from gzzfw/backEnd/gz-dyh

dyh-service/dyh-mediate/src/main/java/cn/huge/module/cases/dao/mapper/xml/CaseInfoMapper.xml
@@ -324,6 +324,15 @@
                <if test="terms.caseType != null and terms.caseType !=''">
                    and a.case_type = #{terms.caseType}
                </if>
                <if test="terms.caseTypeFirst != null and terms.caseTypeFirst !=''">
                    and a.case_type_first = #{terms.caseTypeFirst}
                </if>
                <if test="terms.caseTypeFirstList != null and terms.caseTypeFirstList.size > 0">
                    and a.case_type_first in
                    <foreach collection="terms.caseTypeFirstList" item="caseTypeFirst" index="index" open="(" separator="," close=")">
                        #{caseTypeFirst}
                    </foreach>
                </if>
                <if test="terms.caseTypeName != null and terms.caseTypeName !=''">
                    and a.case_type_name = #{terms.caseTypeName}
                </if>
@@ -349,17 +358,17 @@
                    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.queProv != null and terms.queProv !=''">
                    and a.que_prov = #{terms.queProv}
                </if>
                <if test="terms.queCity != null and terms.queCity !=''">
                    and a.que_city = #{terms.queCity}
                    and ((b.mediate_unit_id is not null and b.mediate_unit_id in (select id from "gzdyh_dev"."dyh_ct_unit" where que_city = #{terms.queCity}))
                    or (b.mediate_unit_id is null and a.que_city = #{terms.queCity}))
                </if>
                <if test="terms.queArea != null and terms.queArea !=''">
                    and a.que_area = #{terms.queArea}
                    and ((b.mediate_unit_id is not null and b.mediate_unit_id in (select id from "gzdyh_dev"."dyh_ct_unit" where que_area = #{terms.queArea}))
                    or (b.mediate_unit_id is null and a.que_area = #{terms.queArea}))
                </if>
                <if test="terms.queRoad != null and terms.queRoad !=''">
                    and a.que_road = #{terms.queRoad}
                    and ((b.mediate_unit_id is not null and b.mediate_unit_id in (select id from "gzdyh_dev"."dyh_ct_unit" where que_road = #{terms.queRoad}))
                    or (b.mediate_unit_id is null and a.que_road = #{terms.queRoad}))
                </if>
                <if test="terms.isArea != null and terms.isArea !=''">
                    and a.que_city is not null and a.que_area is not null and a.que_road is not null
@@ -881,6 +890,16 @@
        <include refid="where-part-all"/>
    </select>
    <!--  统计分析(类型)  -->
    <select id="statisticsTypeFirst" resultType="cn.huge.module.cases.domain.dto.CaseStatisticsTypeDTO">
        SELECT
        a.case_type_first as caseType,a.case_type_first_name as caseTypeName,count(1) as caseNum
        FROM
        dyh_case_info a LEFT JOIN dyh_case_info_unfold b on a.id = b.id
        <include refid="where-part-all"/>
        group by a.case_type_first
    </select>
    <!--  统计分析(类型)  -->
    <select id="statisticsType" resultType="cn.huge.module.cases.domain.dto.CaseStatisticsTypeDTO">
        SELECT
        a.case_type as caseType,a.case_type_name as caseTypeName,count(1) as caseNum