|
|
@ -286,6 +286,22 @@ |
|
|
|
where sdd1.DEL_FLAG='0' |
|
|
|
and scg.DEL_FLAG='0' |
|
|
|
and sdd1.ORG_TYPE='grid' |
|
|
|
<if test="areaCode != null and areaCode != ''"> |
|
|
|
and sdd1.AREA_CODE like concat(#{areaCode},'%') |
|
|
|
</if> |
|
|
|
<if test="areaCode == null || areaCode == ''"> |
|
|
|
<choose> |
|
|
|
<when test="orgType != null and orgType == 'grid'"> |
|
|
|
AND sdd1.ORG_ID = #{agencyId,jdbcType=VARCHAR} |
|
|
|
</when> |
|
|
|
<otherwise> |
|
|
|
AND sdd1.ALL_PARENT_IDS LIKE CONCAT('%',#{agencyId},'%') |
|
|
|
</otherwise> |
|
|
|
</choose> |
|
|
|
</if> |
|
|
|
<if test="status!= null and status != ''"> |
|
|
|
AND sdd1.EVENT_STATUS_CODE = #{status} |
|
|
|
</if> |
|
|
|
union |
|
|
|
select sca.AREA_CODE,sdd2.* from screen_difficulty_data sdd2 |
|
|
|
left join screen_customer_agency sca |
|
|
@ -293,25 +309,23 @@ |
|
|
|
where sdd2.DEL_FLAG='0' |
|
|
|
and sca.DEL_FLAG='0' |
|
|
|
and sdd2.ORG_TYPE='agency' |
|
|
|
<if test="areaCode != null and areaCode != ''"> |
|
|
|
and sdd2.AREA_CODE like concat(#{areaCode},'%') |
|
|
|
</if> |
|
|
|
<if test="areaCode == null || areaCode == ''"> |
|
|
|
<choose> |
|
|
|
<when test="orgType != null and orgType == 'grid'"> |
|
|
|
AND sdd2.ORG_ID = #{agencyId,jdbcType=VARCHAR} |
|
|
|
</when> |
|
|
|
<otherwise> |
|
|
|
AND sdd2.ALL_PARENT_IDS LIKE CONCAT('%',#{agencyId},'%') |
|
|
|
</otherwise> |
|
|
|
</choose> |
|
|
|
</if> |
|
|
|
<if test="status!= null and status != ''"> |
|
|
|
AND sdd2.EVENT_STATUS_CODE = #{status} |
|
|
|
</if> |
|
|
|
) diff |
|
|
|
WHERE |
|
|
|
diff.DEL_FLAG = '0' |
|
|
|
<if test="areaCode != null and areaCode != ''"> |
|
|
|
and diff.AREA_CODE like concat(#{areaCode},'%') |
|
|
|
</if> |
|
|
|
<if test="areaCode == null || areaCode == ''"> |
|
|
|
<choose> |
|
|
|
<when test="orgType != null and orgType == 'grid'"> |
|
|
|
AND diff.ORG_ID = #{agencyId,jdbcType=VARCHAR} |
|
|
|
</when> |
|
|
|
<otherwise> |
|
|
|
AND diff.ALL_PARENT_IDS LIKE CONCAT('%',#{agencyId},'%') |
|
|
|
</otherwise> |
|
|
|
</choose> |
|
|
|
</if> |
|
|
|
<if test="status!= null and status != ''"> |
|
|
|
AND diff.EVENT_STATUS_CODE = #{status} |
|
|
|
</if> |
|
|
|
ORDER BY |
|
|
|
CASE #{type} WHEN 'timelongest' THEN diff.EVENT_COST_TIME |
|
|
|
WHEN 'mosthandled' THEN diff.EVENT_HANDLED_COUNT |
|
|
|