From 2fad5b9483d3e6fec4b8bd1e6f8c578e270b4688 Mon Sep 17 00:00:00 2001
From: aijinhui <aijinhui>
Date: 星期日, 08 十月 2023 13:33:50 +0800
Subject: [PATCH] 报警数量统计
---
ard-work/src/main/java/com/ruoyi/statistical/service/StatisticalService.java | 2 ++
ard-work/src/main/java/com/ruoyi/alarm/radar/mapper/ArdAlarmRadarPumpMapper.java | 7 +++++++
ard-work/src/main/java/com/ruoyi/statistical/controller/StatisticalController.java | 6 ++++++
ard-work/src/main/resources/mapper/alarm/ArdAlarmRadarPumpMapper.xml | 10 ++++++++++
ard-work/src/main/java/com/ruoyi/statistical/service/impl/StatisticalServiceImpl.java | 15 +++++++++++++++
5 files changed, 40 insertions(+), 0 deletions(-)
diff --git a/ard-work/src/main/java/com/ruoyi/alarm/radar/mapper/ArdAlarmRadarPumpMapper.java b/ard-work/src/main/java/com/ruoyi/alarm/radar/mapper/ArdAlarmRadarPumpMapper.java
index 576a8c9..df950c2 100644
--- a/ard-work/src/main/java/com/ruoyi/alarm/radar/mapper/ArdAlarmRadarPumpMapper.java
+++ b/ard-work/src/main/java/com/ruoyi/alarm/radar/mapper/ArdAlarmRadarPumpMapper.java
@@ -3,6 +3,8 @@
import java.util.List;
import com.ruoyi.alarm.radar.domain.ArdAlarmRadarPump;
+import com.ruoyi.statistical.param.ESParam;
+import com.ruoyi.statistical.vo.CountVo;
import org.apache.ibatis.annotations.Param;
/**
@@ -68,4 +70,9 @@
public int updateViewTimeByCondition(@Param("name")String name,@Param("alarmTime") String alarmTime,@Param("viewTime") String viewTime);
ArdAlarmRadarPump selectArdAlarmRadarLastData(String name);
+
+ //鏍规嵁鏈堜唤缁熻鏁伴噺
+ List<CountVo> pumpYear(ESParam esParam);
+ //鏍规嵁澶╃粺璁℃暟閲�
+ List<CountVo> pumpMonth(ESParam esParam);
}
diff --git a/ard-work/src/main/java/com/ruoyi/statistical/controller/StatisticalController.java b/ard-work/src/main/java/com/ruoyi/statistical/controller/StatisticalController.java
index 628ac8e..66a5d7c 100644
--- a/ard-work/src/main/java/com/ruoyi/statistical/controller/StatisticalController.java
+++ b/ard-work/src/main/java/com/ruoyi/statistical/controller/StatisticalController.java
@@ -74,6 +74,9 @@
}else if("1007".equals(type)){
//绉诲姩缁堢
return Results.succeed(statisticalService.apponekeyYear(esParam));
+ }else if("1008".equals(type)){
+ //绉诲姩缁堢
+ return Results.succeed(statisticalService.pumpYear(esParam));
}else if("1010".equals(type)){
//鐢靛瓙鍥存爮
return Results.succeed(statisticalService.wallYear(esParam));
@@ -120,6 +123,9 @@
}else if("1007".equals(type)){
//绉诲姩缁堢
return Results.succeed(statisticalService.apponekeyMonth(esParam));
+ }else if("1008".equals(type)){
+ //闆疯揪鍋滄満
+ return Results.succeed(statisticalService.pumpMonth(esParam));
}else if("1010".equals(type)){
//鐢靛瓙鍥存爮
return Results.succeed(statisticalService.wallMonth(esParam));
diff --git a/ard-work/src/main/java/com/ruoyi/statistical/service/StatisticalService.java b/ard-work/src/main/java/com/ruoyi/statistical/service/StatisticalService.java
index 4646d95..0520c43 100644
--- a/ard-work/src/main/java/com/ruoyi/statistical/service/StatisticalService.java
+++ b/ard-work/src/main/java/com/ruoyi/statistical/service/StatisticalService.java
@@ -25,6 +25,7 @@
List<CountVo> externalYear(ESParam esParam);
List<CountVo> accessYear(ESParam esParam);
List<CountVo> apponekeyYear(ESParam esParam);
+ List<CountVo> pumpYear(ESParam esParam);
List<CountVo> wallYear(ESParam esParam);
List<CountVo> digitizationYear(ESParam esParam);
List<CountVo> tubeYear(ESParam esParam);
@@ -36,6 +37,7 @@
List<CountVo> externalMonth(ESParam esParam);
List<CountVo> accessMonth(ESParam esParam);
List<CountVo> apponekeyMonth(ESParam esParam);
+ List<CountVo> pumpMonth(ESParam esParam);
List<CountVo> wallMonth(ESParam esParam);
List<CountVo> digitizationMonth(ESParam esParam);
List<CountVo> tubeMonth(ESParam esParam);
diff --git a/ard-work/src/main/java/com/ruoyi/statistical/service/impl/StatisticalServiceImpl.java b/ard-work/src/main/java/com/ruoyi/statistical/service/impl/StatisticalServiceImpl.java
index ae8e724..c65b702 100644
--- a/ard-work/src/main/java/com/ruoyi/statistical/service/impl/StatisticalServiceImpl.java
+++ b/ard-work/src/main/java/com/ruoyi/statistical/service/impl/StatisticalServiceImpl.java
@@ -9,6 +9,7 @@
import com.ruoyi.alarm.external.mapper.ArdAlarmExternalMapper;
import com.ruoyi.alarm.radar.mapper.ArdAlarmRadarFireMapper;
import com.ruoyi.alarm.radar.mapper.ArdAlarmRadarMoveMapper;
+import com.ruoyi.alarm.radar.mapper.ArdAlarmRadarPumpMapper;
import com.ruoyi.alarm.steal.mapper.ArdAlarmStealelecMapper;
import com.ruoyi.alarm.tube.mapper.ArdAlarmTubeMapper;
import com.ruoyi.alarm.wall.mapper.ArdAlarmWallMapper;
@@ -52,6 +53,8 @@
private ArdAlarmAccessMapper accessMapper;
@Autowired
private ArdAlarmApponekeyMapper apponekeyMapper;
+ @Autowired
+ private ArdAlarmRadarPumpMapper pumpMapper;
@Autowired
private ArdAlarmWallMapper wallMapper;
@Autowired
@@ -169,6 +172,12 @@
}
@Override
+ public List<CountVo> pumpYear(ESParam esParam) {
+ List<CountVo> list = pumpMapper.pumpYear(esParam);
+ return es(list);
+ }
+
+ @Override
public List<CountVo> wallYear(ESParam esParam) {
List<CountVo> list = wallMapper.wallYear(esParam);
return es(list);
@@ -229,6 +238,12 @@
}
@Override
+ public List<CountVo> pumpMonth(ESParam esParam) {
+ List<CountVo> list = pumpMapper.pumpMonth(esParam);
+ return esMonth(list,esParam.getEnd());
+ }
+
+ @Override
public List<CountVo> wallMonth(ESParam esParam) {
List<CountVo> list = wallMapper.wallMonth(esParam);
return esMonth(list,esParam.getEnd());
diff --git a/ard-work/src/main/resources/mapper/alarm/ArdAlarmRadarPumpMapper.xml b/ard-work/src/main/resources/mapper/alarm/ArdAlarmRadarPumpMapper.xml
index 11410d0..a11bd19 100644
--- a/ard-work/src/main/resources/mapper/alarm/ArdAlarmRadarPumpMapper.xml
+++ b/ard-work/src/main/resources/mapper/alarm/ArdAlarmRadarPumpMapper.xml
@@ -162,4 +162,14 @@
<select id="selectArdAlarmRadarLastData" parameterType="String" resultMap="ArdAlarmRadarPumpResult">
select * from ard_alarm_radar_pump where name=#{name} order by update_time desc LIMIT 1
</select>
+ <select id="pumpYear" resultType="com.ruoyi.statistical.vo.CountVo">
+ select to_char(alarm_time::DATE, 'MM') as date,count(id)
+ from ard_alarm_radar_pump
+ where alarm_time >= #{start} and alarm_time <= #{end} group by date order by date
+ </select>
+ <select id="pumpMonth" resultType="com.ruoyi.statistical.vo.CountVo">
+ select to_char(alarm_time::DATE, 'dd') as date,count(id)
+ from ard_alarm_radar_pump
+ where alarm_time >= #{start} and alarm_time <= #{end} group by date order by date
+ </select>
</mapper>
\ No newline at end of file
--
Gitblit v1.9.3