| | |
| | | <sql id="where-part-all"> |
| | | <if test="terms != null"> |
| | | <where> |
| | | and delete_status = 0 |
| | | <if test="terms.status != null and terms.status !=''"> |
| | | and a.status = #{terms.status} |
| | | </if> |
| | |
| | | <!-- 统计分析(区域) --> |
| | | <select id="statisticsArea" resultType="cn.huge.module.cases.domain.dto.CaseStatisticsAreaDTO"> |
| | | SELECT |
| | | a.que_area as areaCode,a.que_area_name as areaName,count(1) as caseNum, |
| | | <if test="terms.areaType == null or terms.areaType ==''"> |
| | | a.que_area as areaCode,a.que_area_name as areaName, |
| | | </if> |
| | | <if test='terms.areaType != null and terms.areaType =="1"'> |
| | | a.que_area as areaCode,a.que_area_name as areaName, |
| | | </if> |
| | | <if test='terms.areaType != null and terms.areaType =="2"'> |
| | | a.que_road as areaCode,a.que_road_name as areaName, |
| | | </if> |
| | | count(1) as caseNum, |
| | | sum(case when b.medi_result = '22_00025-1' then 1 else 0 end) as resolveNum, |
| | | sum(case when b.medi_result is null and a.info_process <![CDATA[ < ]]> 4 then 1 else 0 end) as resolveingNum, |
| | | sum(case when b.medi_result = '22_00025-2' then 1 else 0 end) as unResolveNum |
| | | 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.que_area |
| | | <if test="terms.areaType == null or terms.areaType ==''"> |
| | | group by a.que_area |
| | | </if> |
| | | <if test='terms.areaType != null and terms.areaType =="1"'> |
| | | group by a.que_area |
| | | </if> |
| | | <if test='terms.areaType != null and terms.areaType =="2"'> |
| | | group by a.que_road |
| | | </if> |
| | | |
| | | </select> |
| | | <!-- 统计分析(基础) --> |
| | | <select id="statisticsBase" resultType="cn.huge.module.cases.domain.dto.CaseStatisticsBaseDTO"> |