Commit 1c065726 authored by KeYong's avatar KeYong

Merge remote-tracking branch 'origin/develop_dl_plan6' into develop_dl_plan6

parents c056f165 437fc800
...@@ -12,4 +12,5 @@ public class FireFightingSystemDto { ...@@ -12,4 +12,5 @@ public class FireFightingSystemDto {
private Integer alarmEquipTotal = 0; private Integer alarmEquipTotal = 0;
private Integer status = 0; private Integer status = 0;
private String image; private String image;
private Long sort;
} }
...@@ -2082,15 +2082,15 @@ public class FireFightingSystemServiceImpl extends ServiceImpl<FireFightingSyste ...@@ -2082,15 +2082,15 @@ public class FireFightingSystemServiceImpl extends ServiceImpl<FireFightingSyste
if (!CollectionUtils.isEmpty(records)) { if (!CollectionUtils.isEmpty(records)) {
List<Long> idList = records.stream().map(FireFightingSystemDto::getId).collect(Collectors.toList()); List<Long> idList = records.stream().map(FireFightingSystemDto::getId).collect(Collectors.toList());
List<FireFightingSystemDto> list = equipmentSpecificSerivce.fireSysIotEquipAlarmCount(new Date(), bizOrgCode); List<FireFightingSystemDto> list = equipmentSpecificSerivce.fireSysIotEquipAlarmCount(new Date(), bizOrgCode);
//使用stream流把list1和list2根据属性userId合并一个list集合 if (!CollectionUtils.isEmpty(list)) {
List<FireFightingSystemDto> collect = records.stream().map(m -> { //使用stream流把list1和list2根据属性userId合并一个list集合,并根据状态倒序、系统排序升序
list.stream().filter(m2-> Objects.equals(m.getId(),m2.getId())).forEach(m2-> { List<FireFightingSystemDto> collect = records.stream().peek(m -> list.stream().filter(m2 -> Objects.equals(m.getId(), m2.getId())).forEach(m2 -> {
m.setAlarmEquipTotal(m2.getAlarmEquipTotal()); m.setAlarmEquipTotal(m2.getAlarmEquipTotal());
m.setStatus(m2.getStatus()); m.setStatus(m2.getStatus());
}); })).sorted(Comparator.comparing(FireFightingSystemDto::getStatus, Comparator.reverseOrder())
return m; .thenComparing(FireFightingSystemDto::getSort)).collect(Collectors.toList());
}).collect(Collectors.toList()); pages.setRecords(collect);
pages.setRecords(collect); }
} }
return pages; return pages;
} }
......
...@@ -2016,7 +2016,8 @@ ...@@ -2016,7 +2016,8 @@
fs.id, fs.id,
fs.`code`, fs.`code`,
fs.`name`, fs.`name`,
count( 1 ) AS equipTotal, fs.`sort`,
SUM(IF(e.is_iot = 1,1,0)) AS equipTotal,
ec.image ec.image
FROM FROM
f_fire_fighting_system fs f_fire_fighting_system fs
...@@ -2024,11 +2025,11 @@ ...@@ -2024,11 +2025,11 @@
LEFT JOIN wl_equipment_detail wed ON wed.id = wes.equipment_detail_id LEFT JOIN wl_equipment_detail wed ON wed.id = wes.equipment_detail_id
LEFT JOIN wl_equipment e ON wed.`equipment_id` = e.`id` LEFT JOIN wl_equipment e ON wed.`equipment_id` = e.`id`
LEFT JOIN wl_equipment_category ec ON ec.id = fs.system_type LEFT JOIN wl_equipment_category ec ON ec.id = fs.system_type
WHERE <where>
e.is_iot = 1
<if test="bizOrgCode!=null and bizOrgCode!=''"> <if test="bizOrgCode!=null and bizOrgCode!=''">
and fs.biz_org_code like concat(#{bizOrgCode}, '%') fs.biz_org_code like concat(#{bizOrgCode}, '%')
</if> </if>
</where>
GROUP BY GROUP BY
fs.id fs.id
ORDER BY ORDER BY
...@@ -2039,22 +2040,14 @@ ...@@ -2039,22 +2040,14 @@
s.id, s.id,
s.`name`, s.`name`,
IFNULL(s.alarmEquipTotal, 0) AS alarmEquipTotal, IFNULL(s.alarmEquipTotal, 0) AS alarmEquipTotal,
<choose> IF(s.alarmEquipTotal > 0,1,0) AS `status`
<when test="date != null">
IF(s.total > 0,1,0) AS `status`
</when>
<otherwise>
IF(s.alarmEquipTotal > 0,1,0) AS `status`
</otherwise>
</choose>
FROM FROM
(SELECT (SELECT
fs.id, fs.id,
fs.`name`, fs.`name`,
count( 1 ) AS total,
<choose> <choose>
<when test="date != null"> <when test="date != null">
SUM(IF(TO_DAYS(esi.create_date) = TO_DAYS(#{date}),1,0)) AS alarmEquipTotal SUM(IF(TO_DAYS(esi.update_date) = TO_DAYS(#{date}),1,0)) AS alarmEquipTotal
</when> </when>
<otherwise> <otherwise>
COUNT( 1 ) AS alarmEquipTotal COUNT( 1 ) AS alarmEquipTotal
......
...@@ -51,4 +51,7 @@ public class SubmitRecord { ...@@ -51,4 +51,7 @@ public class SubmitRecord {
@TableField(exist = false) @TableField(exist = false)
private String examineName; private String examineName;
@TableField(exist = false)
private String fileName;
} }
...@@ -17,7 +17,7 @@ ...@@ -17,7 +17,7 @@
SELECT SELECT
sequence_nbr,submit_people,submit_time,amos_org_name,file_id,examine, sequence_nbr,submit_people,submit_time,amos_org_name,file_id,examine,
"消防设计文件" as fileName,
case examine when 0 then "未审核" when 1 then "已审核" end examineName case examine when 0 then "未审核" when 1 then "已审核" end examineName
FROM FROM
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment