|
|
@ -26,6 +26,9 @@ |
|
|
|
FROM |
|
|
|
ic_place_org a |
|
|
|
LEFT JOIN customer_grid b ON a.GRID_ID = b.ID |
|
|
|
<if test="null != danger"> |
|
|
|
LEFT JOIN ic_place_patrol_record ppr ON ppr.PLACE_ORG_ID = a.ID |
|
|
|
</if> |
|
|
|
WHERE |
|
|
|
a.del_flag = '0' |
|
|
|
<if test="placeOrgId != null and placeOrgId.trim() != ''"> |
|
|
@ -52,6 +55,14 @@ |
|
|
|
<if test="scale != null and scale.trim() != ''"> |
|
|
|
AND a.scale = #{scale} |
|
|
|
</if> |
|
|
|
<if test="null != danger"> |
|
|
|
<if test="danger == 1"> |
|
|
|
AND ppr.FIRST_RESULT = 1 |
|
|
|
</if> |
|
|
|
<if test="danger == 0"> |
|
|
|
AND ppr.FINAL_RESULT = 0 |
|
|
|
</if> |
|
|
|
</if> |
|
|
|
ORDER BY a.created_time DESC |
|
|
|
</select> |
|
|
|
|
|
|
@ -101,8 +112,8 @@ |
|
|
|
( |
|
|
|
SELECT |
|
|
|
count(r.id) as ridCount, |
|
|
|
sum(case when r.FIRST_RESULT = 1 then 1 else 0 end) as dangerCount, |
|
|
|
sum(case when r.FINAL_RESULT = 0 then 1 else 0 end) as removeCount |
|
|
|
sum(case when r.FINAL_RESULT = 1 then 1 else 0 end) as dangerCount, |
|
|
|
sum(case when (r.FINAL_RESULT = 0 and r.FINAL_RESULT = 0) then 1 else 0 end) as removeCount |
|
|
|
FROM |
|
|
|
ic_place_patrol_record r |
|
|
|
<where> |
|
|
|