Commit 83506979 authored by litengwei's avatar litengwei

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

parents 6fe4d7b8 4e0995e3
...@@ -454,7 +454,7 @@ public class ConfigureController extends AbstractBaseController { ...@@ -454,7 +454,7 @@ public class ConfigureController extends AbstractBaseController {
@TycloudOperation(ApiLevel = UserType.AGENCY) @TycloudOperation(ApiLevel = UserType.AGENCY)
@ApiOperation(value = "物联监控大屏3大-获取某站下装备数量、摄像头数量") @ApiOperation(value = "物联监控大屏3大-获取某站下装备数量、摄像头数量")
@GetMapping("/statisticsByStation") @GetMapping("/statisticsByStation")
public ResponseModel getEquipmentState(@RequestParam(required = false) String bizOrgCode) { public ResponseModel statisticsByStation(@RequestParam(required = false) String bizOrgCode) {
if (ObjectUtils.isEmpty(bizOrgCode)) { if (ObjectUtils.isEmpty(bizOrgCode)) {
ReginParams reginParams = getSelectedOrgInfo(); ReginParams reginParams = getSelectedOrgInfo();
......
...@@ -480,7 +480,7 @@ public interface FireFightingSystemMapper extends BaseMapper<FireFightingSystemE ...@@ -480,7 +480,7 @@ public interface FireFightingSystemMapper extends BaseMapper<FireFightingSystemE
List<Map<String, Object>> selectMonthPolyline(@Param("systemCode") String sysCode, @Param("startDate") String startDate, @Param("endDate") String endDate, @Param("indicator") List<String> indicator); List<Map<String, Object>> selectMonthPolyline(@Param("systemCode") String sysCode, @Param("startDate") String startDate, @Param("endDate") String endDate, @Param("indicator") List<String> indicator);
List<Map<String, Object>> selectWeekReportList(@Param("systemId") String systemId,@Param("startDate") String startDate, @Param("endDate") String endDate, @Param("indicator") List<String> indicator); List<Map<String, Object>> selectWeekReportList(@Param("systemId") String systemId,@Param("startDate") String startDate, @Param("endDate") String endDate);
Integer selectAlarms(@Param("systemId") String systemId, Integer selectAlarms(@Param("systemId") String systemId,
@Param("indexType") String indexType, @Param("indexType") String indexType,
...@@ -494,7 +494,8 @@ public interface FireFightingSystemMapper extends BaseMapper<FireFightingSystemE ...@@ -494,7 +494,8 @@ public interface FireFightingSystemMapper extends BaseMapper<FireFightingSystemE
List<Map<String, Object>> selectWeekEquipEchart(@Param("systemCode") String systemCode, List<Map<String, Object>> selectWeekEquipEchart(@Param("systemCode") String systemCode,
@Param("startDate") String startDate, @Param("startDate") String startDate,
@Param("endDate") String endDate); @Param("endDate") String endDate,
@Param("indicator") List<String> indicator);
List<Map<String, Object>> selectWeekEchart(@Param("systemCode") String systemCode, List<Map<String, Object>> selectWeekEchart(@Param("systemCode") String systemCode,
@Param("startDate") String startDate, @Param("startDate") String startDate,
...@@ -502,7 +503,8 @@ public interface FireFightingSystemMapper extends BaseMapper<FireFightingSystemE ...@@ -502,7 +503,8 @@ public interface FireFightingSystemMapper extends BaseMapper<FireFightingSystemE
List<Map<String, Object>> selectWeekLinesEchart(@Param("systemCode") String systemCode, List<Map<String, Object>> selectWeekLinesEchart(@Param("systemCode") String systemCode,
@Param("startDate") String startDate, @Param("startDate") String startDate,
@Param("endDate") String endDate); @Param("endDate") String endDate,
@Param("indicator") List<String> indicator);
Map<String, Object> selectDaySummarize(@Param("systemId") String systemId, Map<String, Object> selectDaySummarize(@Param("systemId") String systemId,
@Param("startDate") String startDate, @Param("startDate") String startDate,
...@@ -514,5 +516,6 @@ public interface FireFightingSystemMapper extends BaseMapper<FireFightingSystemE ...@@ -514,5 +516,6 @@ public interface FireFightingSystemMapper extends BaseMapper<FireFightingSystemE
List<Map<String, Object>> selectDayEchart(@Param("systemCode") String systemCode, List<Map<String, Object>> selectDayEchart(@Param("systemCode") String systemCode,
@Param("startDate") String startDate, @Param("startDate") String startDate,
@Param("endDate") String endDate); @Param("endDate") String endDate,
@Param("indicator") List<String> indicator);
} }
...@@ -1477,7 +1477,7 @@ public class FireFightingSystemServiceImpl extends ServiceImpl<FireFightingSyste ...@@ -1477,7 +1477,7 @@ public class FireFightingSystemServiceImpl extends ServiceImpl<FireFightingSyste
map.put("station", ""); map.put("station", "");
} }
map.put("time", startDate+"-"+endDate); map.put("time", startDate.substring(0,7));
// 单个系统数据 // 单个系统数据
for (Map<String, Object> sys : system) { for (Map<String, Object> sys : system) {
HashMap<String, Object> systemData = new HashMap<>(); HashMap<String, Object> systemData = new HashMap<>();
...@@ -1553,10 +1553,10 @@ public class FireFightingSystemServiceImpl extends ServiceImpl<FireFightingSyste ...@@ -1553,10 +1553,10 @@ public class FireFightingSystemServiceImpl extends ServiceImpl<FireFightingSyste
List<Map<String, Object>> selectMonthPolyline = fireFightingSystemMapper.selectMonthPolyline(String.valueOf(sys.get("code")), startDate, endDate, indicatorList); List<Map<String, Object>> selectMonthPolyline = fireFightingSystemMapper.selectMonthPolyline(String.valueOf(sys.get("code")), startDate, endDate, indicatorList);
String pieChart = ChartsUtils.pieChart(pieChartList, "设备告警统计"); String pieChart = ChartsUtils.pieChart(pieChartList, "故障设备类型占比");
systemData.put("bing1", pieChart); systemData.put("bing1", pieChart);
if (!CollectionUtils.isEmpty(pieChartListTwo)) { if (!CollectionUtils.isEmpty(pieChartListTwo)) {
String pieChart1 = ChartsUtils.pieChart(pieChartListTwo, "告警类别统计"); String pieChart1 = ChartsUtils.pieChart(pieChartListTwo, "告警信息占比");
systemData.put("bing2", pieChart1); systemData.put("bing2", pieChart1);
} else { } else {
List<Map<String, Object>> data = new ArrayList<>(); List<Map<String, Object>> data = new ArrayList<>();
...@@ -1564,13 +1564,13 @@ public class FireFightingSystemServiceImpl extends ServiceImpl<FireFightingSyste ...@@ -1564,13 +1564,13 @@ public class FireFightingSystemServiceImpl extends ServiceImpl<FireFightingSyste
dataMap.put("type", "火警"); dataMap.put("type", "火警");
dataMap.put("value", 0); dataMap.put("value", 0);
data.add(dataMap); data.add(dataMap);
String pieChart1 = ChartsUtils.pieChart(data, "告警类别统计"); String pieChart1 = ChartsUtils.pieChart(data, "报警趋势");
systemData.put("bing2", pieChart1); systemData.put("bing2", pieChart1);
} }
if (!CollectionUtils.isEmpty(selectMonthPolyline)) { if (!CollectionUtils.isEmpty(selectMonthPolyline)) {
String pieChart2 = ChartsUtils.manyLineChart(selectMonthPolyline, "月告警信息", "日期", "告警数量"); String pieChart2 = ChartsUtils.manyLineChart(selectMonthPolyline, "报警趋势", "日期", "报警数量");
systemData.put("bing3", pieChart2); systemData.put("bing3", pieChart2);
} else { } else {
systemData.put("bing3", ""); systemData.put("bing3", "");
...@@ -1651,7 +1651,7 @@ public class FireFightingSystemServiceImpl extends ServiceImpl<FireFightingSyste ...@@ -1651,7 +1651,7 @@ public class FireFightingSystemServiceImpl extends ServiceImpl<FireFightingSyste
} else { } else {
map.put("station", ""); map.put("station", "");
} }
map.put("time", startDate + "-" + endDate); map.put("time", startDate + "" + endDate);
// 系统循环数据填充 // 系统循环数据填充
ArrayList<Map<String, Object>> dataList = new ArrayList<>(); ArrayList<Map<String, Object>> dataList = new ArrayList<>();
for (Map<String, Object> system : systemList) { for (Map<String, Object> system : systemList) {
...@@ -1667,7 +1667,7 @@ public class FireFightingSystemServiceImpl extends ServiceImpl<FireFightingSyste ...@@ -1667,7 +1667,7 @@ public class FireFightingSystemServiceImpl extends ServiceImpl<FireFightingSyste
String indicator = String.valueOf(collect.get(0).get("index")); String indicator = String.valueOf(collect.get(0).get("index"));
String[] split = indicator.split(","); String[] split = indicator.split(",");
List<String> indicatorList = Arrays.asList(split); List<String> indicatorList = Arrays.asList(split);
List<Map<String, Object>> weekReportList = fireFightingSystemMapper.selectWeekReportList(String.valueOf(system.get("id")), startDate, endDate, indicatorList); List<Map<String, Object>> weekReportList = fireFightingSystemMapper.selectWeekReportList(String.valueOf(system.get("id")), startDate, endDate);
ArrayList<Map<String, Object>> list = new ArrayList<>(); ArrayList<Map<String, Object>> list = new ArrayList<>();
if (!CollectionUtils.isEmpty(weekReportList)) { if (!CollectionUtils.isEmpty(weekReportList)) {
for (Map<String, Object> weekItem : weekReportList) { for (Map<String, Object> weekItem : weekReportList) {
...@@ -1722,16 +1722,16 @@ public class FireFightingSystemServiceImpl extends ServiceImpl<FireFightingSyste ...@@ -1722,16 +1722,16 @@ public class FireFightingSystemServiceImpl extends ServiceImpl<FireFightingSyste
} }
// echarts 图表 // echarts 图表
List<Map<String, Object>> mapList = fireFightingSystemMapper.selectWeekEquipEchart(valueOf(system.get("code")), startDate, endDate); List<Map<String, Object>> mapList = fireFightingSystemMapper.selectWeekEquipEchart(valueOf(system.get("code")), startDate, endDate, indicatorList);
String pieChart1 = ChartsUtils.pieChart(mapList, "告警类别统计"); String pieChart1 = ChartsUtils.pieChart(mapList, "故障设备类型占比");
systemData.put("pictureLeft", pieChart1); systemData.put("pictureLeft", pieChart1);
List<Map<String, Object>> weekEchart = fireFightingSystemMapper.selectWeekEchart(valueOf(system.get("code")), startDate, endDate); List<Map<String, Object>> weekEchart = fireFightingSystemMapper.selectWeekEchart(valueOf(system.get("code")), startDate, endDate);
String pieChart2 = ChartsUtils.pieChart(weekEchart, "设备告警统计"); String pieChart2 = ChartsUtils.pieChart(weekEchart, "告警信息占比");
systemData.put("pictureCenter", pieChart2); systemData.put("pictureCenter", pieChart2);
List<Map<String, Object>> linesEchart = fireFightingSystemMapper.selectWeekLinesEchart(valueOf(system.get("code")), startDate, endDate); List<Map<String, Object>> linesEchart = fireFightingSystemMapper.selectWeekLinesEchart(valueOf(system.get("code")), startDate, endDate, indicatorList);
String lines = ChartsUtils.manyLineChart(linesEchart, "周告警信息", "日期", "告警数量"); String lines = ChartsUtils.manyLineChart(linesEchart, "报警趋势", "日期", "报警数量");
systemData.put("lines", lines); systemData.put("lines", lines);
systemData.put("sysData", list); systemData.put("sysData", list);
...@@ -1794,7 +1794,7 @@ public class FireFightingSystemServiceImpl extends ServiceImpl<FireFightingSyste ...@@ -1794,7 +1794,7 @@ public class FireFightingSystemServiceImpl extends ServiceImpl<FireFightingSyste
} else { } else {
map.put("station", ""); map.put("station", "");
} }
map.put("time", startDate + "-" + endDate); map.put("time", startDate);
// 系统循环数据填充 // 系统循环数据填充
ArrayList<Map<String, Object>> dataList = new ArrayList<>(); ArrayList<Map<String, Object>> dataList = new ArrayList<>();
for (Map<String, Object> system : systemList) { for (Map<String, Object> system : systemList) {
...@@ -1810,7 +1810,7 @@ public class FireFightingSystemServiceImpl extends ServiceImpl<FireFightingSyste ...@@ -1810,7 +1810,7 @@ public class FireFightingSystemServiceImpl extends ServiceImpl<FireFightingSyste
String indicator = String.valueOf(collect.get(0).get("index")); String indicator = String.valueOf(collect.get(0).get("index"));
String[] split = indicator.split(","); String[] split = indicator.split(",");
List<String> indicatorList = Arrays.asList(split); List<String> indicatorList = Arrays.asList(split);
List<Map<String, Object>> weekReportList = fireFightingSystemMapper.selectWeekReportList(String.valueOf(system.get("id")), startDate, endDate, indicatorList); List<Map<String, Object>> weekReportList = fireFightingSystemMapper.selectWeekReportList(String.valueOf(system.get("id")), startDate, endDate);
ArrayList<Map<String, Object>> list = new ArrayList<>(); ArrayList<Map<String, Object>> list = new ArrayList<>();
if (!CollectionUtils.isEmpty(weekReportList)) { if (!CollectionUtils.isEmpty(weekReportList)) {
for (Map<String, Object> weekItem : weekReportList) { for (Map<String, Object> weekItem : weekReportList) {
...@@ -1864,11 +1864,11 @@ public class FireFightingSystemServiceImpl extends ServiceImpl<FireFightingSyste ...@@ -1864,11 +1864,11 @@ public class FireFightingSystemServiceImpl extends ServiceImpl<FireFightingSyste
// echarts 图表 // echarts 图表
List<Map<String, Object>> mapList = fireFightingSystemMapper.selectDayEquipEchart(valueOf(system.get("code")), startDate, endDate); List<Map<String, Object>> mapList = fireFightingSystemMapper.selectDayEquipEchart(valueOf(system.get("code")), startDate, endDate);
String pieChart1 = ChartsUtils.pieChart(mapList, "设备类别类别统计"); String pieChart1 = ChartsUtils.pieChart(mapList, "故障设备类型占比");
systemData.put("pictureLeft", pieChart1); systemData.put("pictureLeft", pieChart1);
List<Map<String, Object>> weekEchart = fireFightingSystemMapper.selectDayEchart(valueOf(system.get("code")), startDate, endDate); List<Map<String, Object>> dayEchart = fireFightingSystemMapper.selectDayEchart(valueOf(system.get("code")), startDate, endDate, indicatorList);
String pieChart2 = ChartsUtils.pieChart(weekEchart, "设备告警统计"); String pieChart2 = ChartsUtils.pieChart(dayEchart, "告警信息占比");
systemData.put("pictureRight", pieChart2); systemData.put("pictureRight", pieChart2);
......
...@@ -1179,7 +1179,7 @@ public class ExcelServiceImpl { ...@@ -1179,7 +1179,7 @@ public class ExcelServiceImpl {
excelDtoList.forEach(item -> { excelDtoList.forEach(item -> {
if (StringUtils.isEmpty(item.getCompanyName()) || StringUtils.isEmpty(item.getName()) || if (StringUtils.isEmpty(item.getCompanyName()) || StringUtils.isEmpty(item.getName()) ||
StringUtils.isEmpty(item.getTypeCode()) || StringUtils.isEmpty(item.getAddress())) { StringUtils.isEmpty(item.getType()) || StringUtils.isEmpty(item.getAddress())) {
throw new BadRequest("请检查必填项是否为空"); throw new BadRequest("请检查必填项是否为空");
} }
FireTeam fireTeam = new FireTeam(); FireTeam fireTeam = new FireTeam();
......
...@@ -8,7 +8,28 @@ ...@@ -8,7 +8,28 @@
{ {
"code": "92990000", "code": "92990000",
"index": "OilLeak,Open,Fault"
}
,
{
"code": "92110000",
"index": "Alarm,Fault,Abnormal,State"
}
,
{
"code": "92010000",
"index": "FireAlarm,Fault,Shield" "index": "FireAlarm,Fault,Shield"
} }
,
{
"code": "92030000",
"index": "Alarm,Fault,Abnormal"
}
] ]
\ No newline at end of file
...@@ -2225,6 +2225,9 @@ ...@@ -2225,6 +2225,9 @@
<if test="bizOrgCode!=null and bizOrgCode!=''"> <if test="bizOrgCode!=null and bizOrgCode!=''">
and es.biz_org_code like concat(#{bizOrgCode}, '%') and es.biz_org_code like concat(#{bizOrgCode}, '%')
</if> </if>
<if test="systemCode!=null and systemCode!=''">
and FIND_IN_SET( #{systemCode,jdbcType=VARCHAR}, log.system_codes )
</if>
</where> </where>
) AS unConfirmInfoNum ) AS unConfirmInfoNum
</select> </select>
...@@ -2507,37 +2510,69 @@ ...@@ -2507,37 +2510,69 @@
</select> </select>
<select id="equipmentState" resultType="java.util.Map"> <select id="equipmentState" resultType="java.util.Map">
<!-- SELECT-->
<!-- b.equipName,-->
<!-- (CASE WHEN-->
<!-- b.totalNum > 0 THEN-->
<!-- '异常' ELSE '正常' END) `status`,-->
<!-- b.totalNum AS totalNum,-->
<!-- b.`code` AS equipDetailCode-->
<!-- FROM-->
<!-- (-->
<!-- SELECT-->
<!-- a.equipName,-->
<!-- count( wesl.id ) AS totalNum,-->
<!-- a.`code`-->
<!-- FROM-->
<!-- (-->
<!-- SELECT-->
<!-- wes.`name` AS equipName,-->
<!-- wed.equipment_id AS equipmentId,-->
<!-- wed.`code` AS code-->
<!-- FROM-->
<!-- wl_equipment_specific wes-->
<!-- LEFT JOIN wl_equipment_detail wed ON wed.id = wes.equipment_detail_id-->
<!-- WHERE-->
<!-- FIND_IN_SET( #{id}, wes.system_id ) > 0-->
<!-- GROUP BY-->
<!-- wed.equipment_id-->
<!-- ) a-->
<!-- LEFT JOIN wl_equipment_specific_alarm_log wesl ON wesl.equipment_id = a.equipmentId-->
<!-- GROUP BY-->
<!-- a.equipmentId-->
<!-- ) b-->
SELECT SELECT
b.equipName, b.equipName,
(CASE WHEN ( CASE WHEN b.totalNum > 0 THEN '异常' ELSE '正常' END ) `status`,
b.totalNum > 0 THEN
'异常' ELSE '正常' END) `status`,
b.totalNum AS totalNum, b.totalNum AS totalNum,
b.`code` AS equipDetailCode b.`code` AS equipDetailCode
FROM FROM
( (
SELECT SELECT
a.equipName, a.equipName,
count( wesl.id ) AS totalNum, count( DISTINCT wesa.equipment_specific_id ) AS totalNum,
a.`code` a.`code`
FROM FROM
( (
SELECT SELECT
wes.`name` AS equipName, wed.`name` AS equipName,
wed.equipment_id AS equipmentId, wed.equipment_id AS equipmentId,
wed.`code` AS code wed.`code` AS `code`
FROM FROM
wl_equipment_specific wes wl_equipment_detail wed
LEFT JOIN wl_equipment_detail wed ON wed.id = wes.equipment_detail_id LEFT JOIN wl_equipment_specific wes ON wed.id = wes.equipment_detail_id
WHERE WHERE
FIND_IN_SET( #{id}, wes.system_id ) > 0 FIND_IN_SET( #{id}, wes.system_id ) > 0
GROUP BY GROUP BY
wed.equipment_id wed.equipment_id
) a ) a
LEFT JOIN wl_equipment_specific_alarm_log wesl ON wesl.equipment_id = a.equipmentId LEFT JOIN wl_equipment_specific_alarm wesa ON wesa.equipment_id = a.equipmentId
AND wesa.`status` = 1
GROUP BY GROUP BY
a.equipmentId a.equipmentId
) b ) b
</select> </select>
<select id="getPressurePumpInfo" resultType="java.util.Map"> <select id="getPressurePumpInfo" resultType="java.util.Map">
...@@ -3719,11 +3754,11 @@ ...@@ -3719,11 +3754,11 @@
</select> </select>
<select id="selectWeekReportList" resultType="java.util.Map"> <select id="selectWeekReportList" resultType="java.util.Map">
SELECT temp.name,temp.num,temp.normalNum, temp1.type_name , temp1.monitoringData,temp1.acquisition,temp1.normal,
SELECT temp.name,temp.num,temp.normalNum,temp1.type_name , temp1.monitoringData,temp1.acquisition,temp1.normal,
IFNULL(temp1.alarmEquipNum,0) AS alarmEquipNum, temp1.type_code,temp.code IFNULL(temp1.alarmEquipNum,0) AS alarmEquipNum, temp1.type_code,temp.code
FROM FROM
( (
select select
a1.*, a1.*,
(a1.num - a1.exepctionNum) as normalNum (a1.num - a1.exepctionNum) as normalNum
...@@ -3737,10 +3772,13 @@ ...@@ -3737,10 +3772,13 @@
FROM wl_equipment_alarm_report_day report FROM wl_equipment_alarm_report_day report
where report.equipment_code = a.code where report.equipment_code = a.code
and FIND_IN_SET(a.system_id,report.system_ids) and FIND_IN_SET(a.system_id,report.system_ids)
<foreach collection="indicator" item="index" open="AND(" separator="or" close=")"> and( report.index_type LIKE CONCAT('%','FireAlarm','%')
report.index_type like concat ('%', #{index}, '%') or report.index_type LIKE CONCAT('%','Fault','%')
</foreach> or report.index_type LIKE CONCAT('%','Shield','%')
and report.index_true_num > 0 and report.report_date >= #{startDate} and report.report_date &lt;= #{endDate} ) as exepctionNum or report.index_type LIKE CONCAT('%','Open','%')
or report.index_type LIKE CONCAT('%','OilLeak','%')
or report.index_type LIKE CONCAT('%','Alarm','%') )
and report.index_true_num > 0 and report.report_date = '2022-08-01' ) as exepctionNum
FROM( FROM(
SELECT SELECT
s.id as system_id, s.id as system_id,
...@@ -3752,15 +3790,20 @@ ...@@ -3752,15 +3790,20 @@
LEFT JOIN wl_equipment_detail detail ON spec.equipment_detail_id = detail.id LEFT JOIN wl_equipment_detail detail ON spec.equipment_detail_id = detail.id
LEFT JOIN wl_equipment equipment ON equipment.id =detail.equipment_id LEFT JOIN wl_equipment equipment ON equipment.id =detail.equipment_id
left join f_fire_fighting_system s on FIND_IN_SET(s.id,spec.system_id) left join f_fire_fighting_system s on FIND_IN_SET(s.id,spec.system_id)
where spec.system_id is not null where spec.system_id = #{systemId}
GROUP BY code,s.id, name ORDER BY system_id, code ) a) as a1 GROUP BY code,s.id, name ORDER BY system_id, code ) a) as a1
) temp ) temp
LEFT JOIN LEFT JOIN
( (
SELECT temp.*, SELECT temp.*,
CASE CASE
WHEN wei.is_trend = 0 then "遥信" WHEN wei.is_trend = 0 then "遥信"
...@@ -3778,9 +3821,9 @@ ...@@ -3778,9 +3821,9 @@
'自动获取' AS acquisition, '自动获取' AS acquisition,
CASE CASE
WHEN spec_index.equipment_index_key LIKE CONCAT('%', 'fault') THEN WHEN spec_index.equipment_index_key LIKE CONCAT('%', 'Fault') THEN
'无故障' '无故障'
WHEN spec_index.equipment_index_key LIKE CONCAT('%', 'SHIELD') THEN WHEN spec_index.equipment_index_key LIKE CONCAT('%', 'Shield') THEN
'无屏蔽' '无屏蔽'
ELSE ELSE
'/' '/'
...@@ -3793,7 +3836,7 @@ ...@@ -3793,7 +3836,7 @@
wl_equipment_alarm_equip_day e wl_equipment_alarm_equip_day e
WHERE WHERE
e.system_id is not null e.system_id is not null
and e.system_id = s.id and e.system_id = #{systemId}
AND e.equipment_code = spec.equipment_code AND e.equipment_code = spec.equipment_code
AND e.index_key = spec_index.equipment_index_key AND e.index_key = spec_index.equipment_index_key
AND e.report_date >= DATE_FORMAT(#{startDate},'%y-%m-%d') AND e.report_date >= DATE_FORMAT(#{startDate},'%y-%m-%d')
...@@ -3804,15 +3847,16 @@ ...@@ -3804,15 +3847,16 @@
FROM FROM
wl_equipment_specific_index spec_index wl_equipment_specific_index spec_index
JOIN wl_equipment_specific spec ON spec_index.equipment_specific_id = spec.id JOIN wl_equipment_specific spec ON spec_index.equipment_specific_id = spec.id
join f_fire_fighting_system s on FIND_IN_SET(s.id,spec.system_id) join f_fire_fighting_system s on FIND_IN_SET(s.id,spec.system_id)
WHERE WHERE s.id = #{systemId}
spec.system_id is not null
GROUP BY systemId,code,type_code GROUP BY systemId,code,type_code
)temp LEFT JOIN wl_equipment_index wei on temp.equipment_index_id = wei.id )temp LEFT JOIN wl_equipment_index wei on temp.equipment_index_id = wei.id
)temp1 on temp.system_id = temp1.systemId and temp.code = temp1.code )temp1 on temp.system_id = temp1.systemId and temp.code = temp1.code
where temp.system_id = #{systemId}
</select> </select>
<select id="selectAlarms" resultType="java.lang.Integer"> <select id="selectAlarms" resultType="java.lang.Integer">
...@@ -3823,9 +3867,12 @@ ...@@ -3823,9 +3867,12 @@
LEFT JOIN f_fire_fighting_system s ON FIND_IN_SET( s.id, report.system_ids ) LEFT JOIN f_fire_fighting_system s ON FIND_IN_SET( s.id, report.system_ids )
LEFT JOIN wl_equipment_specific spec on report.equipment_specific_id = spec.id LEFT JOIN wl_equipment_specific spec on report.equipment_specific_id = spec.id
where report.system_ids is not null and report.index_true_num > 0 where report.system_ids is not null and report.index_true_num > 0
<foreach collection="indicator" item="index" open="AND(" separator="or" close=")"> and( report.index_type LIKE CONCAT('%','Fault','%')
report.index_type like concat ('%', #{index}) or report.index_type LIKE CONCAT('%','FireAlarm','%')
</foreach> or report.index_type LIKE CONCAT('%','Shield','%')
or report.index_type LIKE CONCAT('%','Open','%')
or report.index_type LIKE CONCAT('%','OilLeak','%')
or report.index_type LIKE CONCAT('%','Alarm','%'))
and report.report_date BETWEEN #{startDate} and #{endDate} and report.report_date BETWEEN #{startDate} and #{endDate}
and system_id = #{systemId} and system_id = #{systemId}
and index_type = #{indexType} and index_type = #{indexType}
...@@ -3873,7 +3920,7 @@ ...@@ -3873,7 +3920,7 @@
and( report.index_type LIKE CONCAT('%','Fault','%') and( report.index_type LIKE CONCAT('%','Fault','%')
or report.index_type LIKE CONCAT('%','FireAlarm','%') or report.index_type LIKE CONCAT('%','FireAlarm','%')
or report.index_type LIKE CONCAT('%','Shield','%') ) or report.index_type LIKE CONCAT('%','Shield','%') )
and report.report_date between #{startDate} and #{endDate} ) as exepctionNum, and report.report_date >= #{startDate} and report.report_date &lt;=#{endDate} ) as exepctionNum,
(SELECT IFNULL(count(distinct equipment_specific_id) ,0) (SELECT IFNULL(count(distinct equipment_specific_id) ,0)
FROM wl_equipment_alarm_report_day report FROM wl_equipment_alarm_report_day report
where report.equipment_code = a.code where report.equipment_code = a.code
...@@ -3891,14 +3938,14 @@ ...@@ -3891,14 +3938,14 @@
and( report.index_type LIKE CONCAT('%','Fault','%') and( report.index_type LIKE CONCAT('%','Fault','%')
or report.index_type LIKE CONCAT('%','FireAlarm','%') or report.index_type LIKE CONCAT('%','FireAlarm','%')
or report.index_type LIKE CONCAT('%','Shield','%') ) or report.index_type LIKE CONCAT('%','Shield','%') )
and report.report_date between #{startDate} and #{endDate} ) as alarmNum, and report.report_date >= #{startDate} and report.report_date &lt;=#{endDate} ) as alarmNum,
(SELECT IFNULL(count(distinct equipment_specific_id) ,0) (SELECT IFNULL(count(distinct equipment_specific_id) ,0)
FROM wl_equipment_alarm_report_day report FROM wl_equipment_alarm_report_day report
where report.equipment_code = a.code where report.equipment_code = a.code
and FIND_IN_SET(a.system_id,report.system_ids) and FIND_IN_SET(a.system_id,report.system_ids)
and report.index_true_num >0 and report.index_true_num >0
and( report.index_type LIKE CONCAT('%','Fault','%')) and( report.index_type LIKE CONCAT('%','Fault','%'))
and report.report_date between #{startDate} and #{endDate} ) as faultNum, and report.report_date >= #{startDate} and report.report_date &lt;=#{endDate} ) as faultNum,
(SELECT IFNULL(SUM(index_true_num ),0) (SELECT IFNULL(SUM(index_true_num ),0)
FROM wl_equipment_alarm_report_day report FROM wl_equipment_alarm_report_day report
where report.equipment_code = a.code where report.equipment_code = a.code
...@@ -3922,7 +3969,7 @@ ...@@ -3922,7 +3969,7 @@
LEFT JOIN wl_equipment_detail detail ON spec.equipment_detail_id = detail.id LEFT JOIN wl_equipment_detail detail ON spec.equipment_detail_id = detail.id
LEFT JOIN wl_equipment equipment ON equipment.id =detail.equipment_id LEFT JOIN wl_equipment equipment ON equipment.id =detail.equipment_id
left join f_fire_fighting_system s on FIND_IN_SET(s.id,spec.system_id) left join f_fire_fighting_system s on FIND_IN_SET(s.id,spec.system_id)
where spec.system_id is not null and spec.create_date &lt; #{endDate} where spec.system_id = #{systemId} and spec.create_date &lt; #{endDate}
GROUP BY code,s.id, name ORDER BY system_id, code ) a) as a1 GROUP BY code,s.id, name ORDER BY system_id, code ) a) as a1
GROUP BY a1.system_id GROUP BY a1.system_id
) as b ) as b
...@@ -3945,12 +3992,12 @@ ...@@ -3945,12 +3992,12 @@
FROM wl_equipment_alarm_report_day report FROM wl_equipment_alarm_report_day report
where report.equipment_code = a.code where report.equipment_code = a.code
and FIND_IN_SET(a.system_id,report.system_ids) and FIND_IN_SET(a.system_id,report.system_ids)
and( report.index_type LIKE CONCAT('%','FireAlarm') <foreach collection="indicator" item="index" open="AND(" separator="or" close=")">
or report.index_type LIKE CONCAT('%','Fault') report.index_type like concat ('%', #{index})
or report.index_type LIKE CONCAT('%','Shield')) </foreach>
and report.index_true_num>0 and report.index_true_num>0
and report.report_date BETWEEN #{startDate} and report.report_date >= #{startDate}
and #{endDate} ) as exepctionNum, and report.report_date &lt;= #{endDate} ) as exepctionNum,
create_date create_date
FROM( FROM(
SELECT SELECT
...@@ -3985,9 +4032,9 @@ ...@@ -3985,9 +4032,9 @@
FROM wl_equipment_alarm_report_day report FROM wl_equipment_alarm_report_day report
where report.equipment_code = a.code where report.equipment_code = a.code
and FIND_IN_SET(a.system_id,report.system_ids) and FIND_IN_SET(a.system_id,report.system_ids)
and( report.index_type LIKE CONCAT('%','FireAlarm') <foreach collection="indicator" item="index" open="AND(" separator="or" close=")">
or report.index_type LIKE CONCAT('%','Fault') report.index_type like concat ('%', #{index})
or report.index_type LIKE CONCAT('%','Shield') ) </foreach>
and report.index_true_num>0 and report.index_true_num>0
and report.report_date between #{startDate} and report.report_date between #{startDate}
and #{endDate} ) as exepctionNum and #{endDate} ) as exepctionNum
...@@ -4051,9 +4098,9 @@ ...@@ -4051,9 +4098,9 @@
wl_equipment_alarm_report_day report wl_equipment_alarm_report_day report
LEFT JOIN f_fire_fighting_system s ON FIND_IN_SET( s.id, report.system_ids) LEFT JOIN f_fire_fighting_system s ON FIND_IN_SET( s.id, report.system_ids)
WHERE report.system_ids is not null WHERE report.system_ids is not null
and( report.index_type LIKE CONCAT('%','FireAlarm') <foreach collection="indicator" item="index" open="AND(" separator="or" close=")">
or report.index_type LIKE CONCAT('%','Fault') report.index_type like concat ('%', #{index})
or report.index_type LIKE CONCAT('%','Shield')) </foreach>
and s.code = #{systemCode} and s.code = #{systemCode}
GROUP BY GROUP BY
report.report_date, report.report_date,
...@@ -4080,9 +4127,9 @@ ...@@ -4080,9 +4127,9 @@
wl_equipment_alarm_report_day report wl_equipment_alarm_report_day report
LEFT JOIN f_fire_fighting_system s ON FIND_IN_SET( s.id, report.system_ids) LEFT JOIN f_fire_fighting_system s ON FIND_IN_SET( s.id, report.system_ids)
WHERE report.system_ids is not null WHERE report.system_ids is not null
and( report.index_type LIKE CONCAT('%','FireAlarm') <foreach collection="indicator" item="index" open="AND(" separator="or" close=")">
or report.index_type LIKE CONCAT('%','Fault') report.index_type like concat ('%', #{index})
or report.index_type LIKE CONCAT('%','Shield')) </foreach>
and report.index_true_num >0 and report.index_true_num >0
and s.code = #{systemCode} and s.code = #{systemCode}
GROUP BY GROUP BY
...@@ -4093,7 +4140,7 @@ ...@@ -4093,7 +4140,7 @@
</select> </select>
<select id="selectDaySummarize" resultType="java.util.Map"> <select id="selectDaySummarize" resultType="java.util.Map">
SELECT SELECT
CONCAT_WS('', fs.name, '设备总数', b.equipNum, '台,今日告警设备为', b.equipNum - b.normalNum, '台,告警总数为', b.alarmNum, '条,正常设备', b.normalNum, '台,正常率', b.normalRate, '%' ) AS contant, CONCAT_WS('', fs.name, '设备总数', b.equipNum, '台,今日告警设备为', b.equipNum - b.normalNum, '台,告警总数为',ifnull(b.alarmNum, 0) , '条,正常设备', b.normalNum, '台,正常率', b.normalRate, '%' ) AS contant,
fs.id as system_id fs.id as system_id
FROM FROM
f_fire_fighting_system fs left join f_fire_fighting_system fs left join
...@@ -4145,7 +4192,7 @@ ...@@ -4145,7 +4192,7 @@
LEFT JOIN wl_equipment_detail detail ON spec.equipment_detail_id = detail.id LEFT JOIN wl_equipment_detail detail ON spec.equipment_detail_id = detail.id
LEFT JOIN wl_equipment equipment ON equipment.id =detail.equipment_id LEFT JOIN wl_equipment equipment ON equipment.id =detail.equipment_id
left join f_fire_fighting_system s on FIND_IN_SET(s.id,spec.system_id) left join f_fire_fighting_system s on FIND_IN_SET(s.id,spec.system_id)
where spec.system_id is not null where spec.system_id = #{systemId}
GROUP BY code,s.id, name ORDER BY system_id, code ) a) as a1 GROUP BY code,s.id, name ORDER BY system_id, code ) a) as a1
GROUP BY a1.system_id GROUP BY a1.system_id
) as b ) as b
...@@ -4190,9 +4237,9 @@ ...@@ -4190,9 +4237,9 @@
FROM wl_equipment_alarm_report_day report FROM wl_equipment_alarm_report_day report
where report.equipment_code = a.code where report.equipment_code = a.code
and FIND_IN_SET(a.system_id,report.system_ids) and FIND_IN_SET(a.system_id,report.system_ids)
and( report.index_type LIKE CONCAT('%','FireAlarm') <foreach collection="indicator" item="index" open="AND(" separator="or" close=")">
or report.index_type LIKE CONCAT('%','Fault') report.index_type like concat ('%', #{index})
or report.index_type LIKE CONCAT('%','Shield') ) </foreach>
and report.index_true_num>0 and report.index_true_num>0
and report.report_date >= #{startDate} and report.report_date >= #{startDate}
and report.report_date &lt;= #{endDate} ) as exepctionNum, and report.report_date &lt;= #{endDate} ) as exepctionNum,
...@@ -4230,9 +4277,9 @@ ...@@ -4230,9 +4277,9 @@
FROM wl_equipment_alarm_report_day report FROM wl_equipment_alarm_report_day report
where report.equipment_code = a.code where report.equipment_code = a.code
and FIND_IN_SET(a.system_id,report.system_ids) and FIND_IN_SET(a.system_id,report.system_ids)
and( report.index_type LIKE CONCAT('%','FireAlarm') <foreach collection="indicator" item="index" open="AND(" separator="or" close=")">
or report.index_type LIKE CONCAT('%','Fault') report.index_type like concat ('%', #{index})
or report.index_type LIKE CONCAT('%','Shield') ) </foreach>
and report.index_true_num>0 and report.index_true_num>0
and report.report_date >= #{startDate} and report.report_date >= #{startDate}
and report.report_date &lt;= #{endDate} ) as exepctionNum and report.report_date &lt;= #{endDate} ) as exepctionNum
......
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