From fe81b5844ad478a1b909026c9a0b1da6aacfc78f Mon Sep 17 00:00:00 2001
From: aijinhui <aijinhui>
Date: 星期一, 09 十月 2023 14:52:01 +0800
Subject: [PATCH] 24小时报警兴趣点前十
---
ard-work/src/main/resources/mapper/alarm/ArdAlarmRadarMoveMapper.xml | 4 ++++
ard-work/src/main/java/com/ruoyi/statistical/service/StatisticalService.java | 3 +++
ard-work/src/main/java/com/ruoyi/statistical/controller/StatisticalController.java | 9 +++++++++
ard-work/src/main/java/com/ruoyi/alarm/radar/mapper/ArdAlarmRadarMoveMapper.java | 3 +++
ard-work/src/main/java/com/ruoyi/statistical/service/impl/StatisticalServiceImpl.java | 6 ++++++
ard-work/src/main/java/com/ruoyi/statistical/vo/TenVo.java | 9 +++++++++
6 files changed, 34 insertions(+), 0 deletions(-)
diff --git a/ard-work/src/main/java/com/ruoyi/alarm/radar/mapper/ArdAlarmRadarMoveMapper.java b/ard-work/src/main/java/com/ruoyi/alarm/radar/mapper/ArdAlarmRadarMoveMapper.java
index d944507..3ed633f 100644
--- a/ard-work/src/main/java/com/ruoyi/alarm/radar/mapper/ArdAlarmRadarMoveMapper.java
+++ b/ard-work/src/main/java/com/ruoyi/alarm/radar/mapper/ArdAlarmRadarMoveMapper.java
@@ -6,6 +6,7 @@
import com.ruoyi.alarm.radar.domain.ArdAlarmRadarMove;
import com.ruoyi.statistical.param.ESParam;
import com.ruoyi.statistical.vo.CountVo;
+import com.ruoyi.statistical.vo.TenVo;
import org.apache.ibatis.annotations.Param;
/**
@@ -75,4 +76,6 @@
List<CountVo> moveYear(ESParam esParam);
//鏍规嵁澶╀唤缁熻鏁伴噺
List<CountVo> moveMonth(ESParam esParam);
+ //24灏忔椂鎶ヨ鍏磋叮鐐瑰墠鍗�
+ List<TenVo> ten();
}
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 99d59ec..7d9a463 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
@@ -192,4 +192,13 @@
return Results.succeed(numVo);
}
+ /**
+ * 24灏忔椂鎶ヨ鍏磋叮鐐瑰墠鍗�
+ */
+ @ApiOperation("24灏忔椂鎶ヨ鍏磋叮鐐瑰墠鍗�")
+ @GetMapping("alarm/ten")
+ public Results ten(){
+ return Results.succeed(statisticalService.ten());
+ }
+
}
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 5d41e56..c857edd 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
@@ -4,6 +4,7 @@
import com.alibaba.fastjson2.JSONArray;
import com.ruoyi.statistical.param.ESParam;
import com.ruoyi.statistical.vo.CountVo;
+import com.ruoyi.statistical.vo.TenVo;
import com.ruoyi.statistical.vo.UnitVo;
import com.ruoyi.utils.result.Results;
import org.springframework.stereotype.Service;
@@ -56,4 +57,6 @@
int wallNum();
int digitizationNum();
int tubeNum();
+
+ List<TenVo> ten();
}
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 9c4d6a6..3920294 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
@@ -25,6 +25,7 @@
import com.ruoyi.statistical.param.Para;
import com.ruoyi.statistical.service.StatisticalService;
import com.ruoyi.statistical.vo.CountVo;
+import com.ruoyi.statistical.vo.TenVo;
import com.ruoyi.statistical.vo.UnitVo;
import com.ruoyi.system.mapper.SysConfigMapper;
import com.ruoyi.utils.result.Results;
@@ -367,6 +368,11 @@
return tubeMapper.selectCount(null);
}
+ @Override
+ public List<TenVo> ten() {
+ return moveMapper.ten();
+ }
+
public List<CountVo> es(List<CountVo> list){
for (int i = 1; i <= 12 ; i++) {
String month;
diff --git a/ard-work/src/main/java/com/ruoyi/statistical/vo/TenVo.java b/ard-work/src/main/java/com/ruoyi/statistical/vo/TenVo.java
new file mode 100644
index 0000000..6f92ba9
--- /dev/null
+++ b/ard-work/src/main/java/com/ruoyi/statistical/vo/TenVo.java
@@ -0,0 +1,9 @@
+package com.ruoyi.statistical.vo;
+
+import lombok.Data;
+
+@Data
+public class TenVo {
+ private String name;
+ private String num;
+}
diff --git a/ard-work/src/main/resources/mapper/alarm/ArdAlarmRadarMoveMapper.xml b/ard-work/src/main/resources/mapper/alarm/ArdAlarmRadarMoveMapper.xml
index b2cd359..53eb25c 100644
--- a/ard-work/src/main/resources/mapper/alarm/ArdAlarmRadarMoveMapper.xml
+++ b/ard-work/src/main/resources/mapper/alarm/ArdAlarmRadarMoveMapper.xml
@@ -178,4 +178,8 @@
from ard_alarm_radar_move
where alarm_time >= #{start} and alarm_time <= #{end} group by date order by date
</select>
+ <select id="ten" resultType="com.ruoyi.statistical.vo.TenVo">
+ SELECT name,count(name) num from ard_alarm_radar_move
+ where (current_timestamp - interval '1024 hour') <= alarm_time GROUP BY name ORDER BY num desc LIMIT 10
+ </select>
</mapper>
\ No newline at end of file
--
Gitblit v1.9.3