Browse Source

灵山项目:安全生产企业列表增加隐患条件;

master
luyan 2 years ago
parent
commit
1474863dc6
  1. 4
      epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/GetListPlaceOrgFormDTO.java
  2. 15
      epmet-module/gov-org/gov-org-server/src/main/resources/mapper/IcPlaceOrgDao.xml

4
epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/GetListPlaceOrgFormDTO.java

@ -56,5 +56,7 @@ public class GetListPlaceOrgFormDTO implements Serializable {
private String staffId;
//token中userId所属组织
private String agencyId;
//是否存在隐患 0 消除隐患 1 存在隐患 该参数可不传
private Integer danger;
}
}

15
epmet-module/gov-org/gov-org-server/src/main/resources/mapper/IcPlaceOrgDao.xml

@ -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>

Loading…
Cancel
Save