From 2b29a4a26019e3d1692c4b4c76746dba9fac7b22 Mon Sep 17 00:00:00 2001
From: aijinhui <aijinhui>
Date: 星期六, 07 十月 2023 14:39:16 +0800
Subject: [PATCH] 报警数量统计年
---
ard-work/src/main/resources/mapper/alarm/ArdAlarmRadarMoveMapper.xml | 6 +
ard-work/src/main/java/com/ruoyi/statistical/param/ESParam.java | 9 +
ard-work/src/main/java/com/ruoyi/statistical/service/StatisticalService.java | 16 ++
ard-work/src/main/resources/mapper/alarm/ArdAlarmAccessMapper.xml | 6 +
ard-work/src/main/java/com/ruoyi/statistical/controller/StatisticalController.java | 47 +++++++
ard-work/src/main/java/com/ruoyi/alarm/digitization3/mapper/ArdAlarmDigitization3Mapper.java | 5
ard-work/src/main/resources/mapper/alarm/ArdAlarmDigitization3Mapper.xml | 5
ard-work/src/main/java/com/ruoyi/alarm/tube/mapper/ArdAlarmTubeMapper.java | 5
ard-work/src/main/java/com/ruoyi/alarm/access/mapper/ArdAlarmAccessMapper.java | 5
ard-work/src/main/java/com/ruoyi/alarm/steal/mapper/ArdAlarmStealelecMapper.java | 5
ard-work/src/main/java/com/ruoyi/alarm/wall/mapper/ArdAlarmWallMapper.java | 5
ard-work/src/main/resources/mapper/alarm/ArdAlarmExternalMapper.xml | 6 +
ard-work/src/main/resources/mapper/alarm/ArdAlarmCameraMapper.xml | 6 +
ard-work/src/main/resources/mapper/alarm/ArdAlarmStealelecMapper.xml | 7 +
ard-work/src/main/java/com/ruoyi/utils/mqtt/MqttConsumerCallback.java | 6 +
ard-work/src/main/resources/mapper/alarm/ArdAlarmWallMapper.xml | 5
ard-work/src/main/java/com/ruoyi/alarm/apponekey/mapper/ArdAlarmApponekeyMapper.java | 5
ard-work/src/main/resources/mapper/alarm/ArdAlarmTubeMapper.xml | 6
ard-work/src/main/java/com/ruoyi/alarm/radar/mapper/ArdAlarmRadarMoveMapper.java | 5
ard-work/src/main/java/com/ruoyi/alarm/radar/mapper/ArdAlarmRadarFireMapper.java | 5
ard-work/src/main/java/com/ruoyi/statistical/service/impl/StatisticalServiceImpl.java | 119 +++++++++++++++++++
ard-work/src/main/resources/mapper/alarm/ArdAlarmRadarFireMapper.xml | 6 +
ard-work/src/main/resources/mapper/alarm/ArdAlarmApponekeyMapper.xml | 6 +
ard-work/src/main/java/com/ruoyi/alarm/camera/mapper/ArdAlarmCameraMapper.java | 5
ard-work/src/main/java/com/ruoyi/alarm/external/mapper/ArdAlarmExternalMapper.java | 6 +
ard-work/src/main/java/com/ruoyi/statistical/vo/CountVo.java | 9 +
26 files changed, 315 insertions(+), 1 deletions(-)
diff --git a/ard-work/src/main/java/com/ruoyi/alarm/access/mapper/ArdAlarmAccessMapper.java b/ard-work/src/main/java/com/ruoyi/alarm/access/mapper/ArdAlarmAccessMapper.java
index 1ff1185..95d60a6 100644
--- a/ard-work/src/main/java/com/ruoyi/alarm/access/mapper/ArdAlarmAccessMapper.java
+++ b/ard-work/src/main/java/com/ruoyi/alarm/access/mapper/ArdAlarmAccessMapper.java
@@ -2,6 +2,8 @@
import java.util.List;
import com.ruoyi.alarm.access.domain.ArdAlarmAccess;
+import com.ruoyi.statistical.param.ESParam;
+import com.ruoyi.statistical.vo.CountVo;
import org.apache.ibatis.annotations.Param;
@@ -66,4 +68,7 @@
public List<ArdAlarmAccess> selectListAllByCommand(@Param("refreshTime") String refreshTime);
public int updateViewTimeByAcsId(@Param("acsId")String acsId,@Param("alarmTime") String alarmTime,@Param("viewTime") String viewTime);
+
+ //鏍规嵁鏈堜唤缁熻鏁伴噺
+ List<CountVo> accessYear(ESParam esParam);
}
diff --git a/ard-work/src/main/java/com/ruoyi/alarm/apponekey/mapper/ArdAlarmApponekeyMapper.java b/ard-work/src/main/java/com/ruoyi/alarm/apponekey/mapper/ArdAlarmApponekeyMapper.java
index dd810ec..10250b3 100644
--- a/ard-work/src/main/java/com/ruoyi/alarm/apponekey/mapper/ArdAlarmApponekeyMapper.java
+++ b/ard-work/src/main/java/com/ruoyi/alarm/apponekey/mapper/ArdAlarmApponekeyMapper.java
@@ -4,6 +4,8 @@
import com.ruoyi.alarm.access.domain.ArdAlarmAccess;
import com.ruoyi.alarm.apponekey.domain.ArdAlarmApponekey;
+import com.ruoyi.statistical.param.ESParam;
+import com.ruoyi.statistical.vo.CountVo;
import org.apache.ibatis.annotations.Param;
/**
@@ -67,4 +69,7 @@
public List<ArdAlarmApponekey> selectListAllByCommand(@Param("refreshTime") String refreshTime);
public int updateViewTimeByUserId(@Param("userId")String userId,@Param("createTime") String createTime,@Param("viewTime") String viewTime);
+
+ //鏍规嵁鏈堜唤缁熻鏁伴噺
+ List<CountVo> apponekeyYear(ESParam esParam);
}
diff --git a/ard-work/src/main/java/com/ruoyi/alarm/camera/mapper/ArdAlarmCameraMapper.java b/ard-work/src/main/java/com/ruoyi/alarm/camera/mapper/ArdAlarmCameraMapper.java
index c125bfa..f462889 100644
--- a/ard-work/src/main/java/com/ruoyi/alarm/camera/mapper/ArdAlarmCameraMapper.java
+++ b/ard-work/src/main/java/com/ruoyi/alarm/camera/mapper/ArdAlarmCameraMapper.java
@@ -2,6 +2,8 @@
import java.util.List;
import com.ruoyi.alarm.camera.domain.ArdAlarmCamera;
+import com.ruoyi.statistical.param.ESParam;
+import com.ruoyi.statistical.vo.CountVo;
import org.apache.ibatis.annotations.Param;
@@ -66,4 +68,7 @@
int selectCountByAlarmTime(@Param("refreshTime")String refreshTime);
int updateViewTimeByCameraName(@Param("cameraName")String cameraName,@Param("alarmTime") String alarmTime,@Param("viewTime") String viewTime);
+
+ //鏍规嵁鏈堜唤缁熻鏁伴噺
+ List<CountVo> cameraYear(ESParam esParam);
}
diff --git a/ard-work/src/main/java/com/ruoyi/alarm/digitization3/mapper/ArdAlarmDigitization3Mapper.java b/ard-work/src/main/java/com/ruoyi/alarm/digitization3/mapper/ArdAlarmDigitization3Mapper.java
index 0df005a..94a16c9 100644
--- a/ard-work/src/main/java/com/ruoyi/alarm/digitization3/mapper/ArdAlarmDigitization3Mapper.java
+++ b/ard-work/src/main/java/com/ruoyi/alarm/digitization3/mapper/ArdAlarmDigitization3Mapper.java
@@ -3,6 +3,8 @@
import java.util.List;
import com.ruoyi.alarm.digitization3.domain.ArdAlarmDigitization3;
import com.ruoyi.alarm.tube.domain.ArdAlarmTube;
+import com.ruoyi.statistical.param.ESParam;
+import com.ruoyi.statistical.vo.CountVo;
import org.apache.ibatis.annotations.Param;
/**
@@ -65,4 +67,7 @@
public List<ArdAlarmDigitization3> selectListAllByCommand(@Param("refreshTime")String refreshTime);
int selectCountByAlarmTime(@Param("refreshTime")String refreshTime);
public int updateViewTimeByWellNo(@Param("wellNo")String wellNo,@Param("alarmTime") String alarmTime,@Param("viewTime") String viewTime);
+
+ //鏍规嵁鏈堜唤缁熻鏁伴噺
+ List<CountVo> digitizationYear(ESParam esParam);
}
diff --git a/ard-work/src/main/java/com/ruoyi/alarm/external/mapper/ArdAlarmExternalMapper.java b/ard-work/src/main/java/com/ruoyi/alarm/external/mapper/ArdAlarmExternalMapper.java
index b7e5973..d66c1d6 100644
--- a/ard-work/src/main/java/com/ruoyi/alarm/external/mapper/ArdAlarmExternalMapper.java
+++ b/ard-work/src/main/java/com/ruoyi/alarm/external/mapper/ArdAlarmExternalMapper.java
@@ -2,6 +2,8 @@
import java.util.List;
import com.ruoyi.alarm.external.domain.ArdAlarmExternal;
+import com.ruoyi.statistical.param.ESParam;
+import com.ruoyi.statistical.vo.CountVo;
import org.apache.ibatis.annotations.Param;
/**
@@ -65,4 +67,8 @@
public List<ArdAlarmExternal> selectListAllByCommand(@Param("refreshTime") String refreshTime, @Param("alarmType") String alarmType);
public int updateViewTimeByCondition(@Param("defenseName")String defenseName,@Param("alarmType")String alarmType,@Param("alarmTime") String alarmTime,@Param("viewTime") String viewTime);
+
+ //鏍规嵁鏈堜唤缁熻鏁伴噺
+ List<CountVo> externalYear(ESParam esParam);
+
}
diff --git a/ard-work/src/main/java/com/ruoyi/alarm/radar/mapper/ArdAlarmRadarFireMapper.java b/ard-work/src/main/java/com/ruoyi/alarm/radar/mapper/ArdAlarmRadarFireMapper.java
index cf14ee8..b1f1c6f 100644
--- a/ard-work/src/main/java/com/ruoyi/alarm/radar/mapper/ArdAlarmRadarFireMapper.java
+++ b/ard-work/src/main/java/com/ruoyi/alarm/radar/mapper/ArdAlarmRadarFireMapper.java
@@ -3,6 +3,8 @@
import java.util.List;
import com.ruoyi.alarm.radar.domain.ArdAlarmRadarFire;
+import com.ruoyi.statistical.param.ESParam;
+import com.ruoyi.statistical.vo.CountVo;
import org.apache.ibatis.annotations.Param;
/**
@@ -68,4 +70,7 @@
public int updateViewTimeByCondition(@Param("name")String name,@Param("alarmTime") String alarmTime,@Param("viewTime") String viewTime);
ArdAlarmRadarFire selectArdAlarmRadarLastData(String name);
+
+ //鏍规嵁鏈堜唤缁熻鏁伴噺
+ List<CountVo> fileYear(ESParam esParam);
}
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 5e4617e..0b24084 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
@@ -3,6 +3,8 @@
import java.util.List;
import com.ruoyi.alarm.radar.domain.ArdAlarmRadarMove;
+import com.ruoyi.statistical.param.ESParam;
+import com.ruoyi.statistical.vo.CountVo;
import org.apache.ibatis.annotations.Param;
/**
@@ -67,4 +69,7 @@
public int updateViewTimeByCondition(@Param("name")String name,@Param("alarmTime") String alarmTime,@Param("viewTime") String viewTime);
ArdAlarmRadarMove selectArdAlarmRadarLastData(String name);
+
+ //鏍规嵁鏈堜唤缁熻鏁伴噺
+ List<CountVo> moveYear(ESParam esParam);
}
diff --git a/ard-work/src/main/java/com/ruoyi/alarm/steal/mapper/ArdAlarmStealelecMapper.java b/ard-work/src/main/java/com/ruoyi/alarm/steal/mapper/ArdAlarmStealelecMapper.java
index 4ba8906..52a84d5 100644
--- a/ard-work/src/main/java/com/ruoyi/alarm/steal/mapper/ArdAlarmStealelecMapper.java
+++ b/ard-work/src/main/java/com/ruoyi/alarm/steal/mapper/ArdAlarmStealelecMapper.java
@@ -2,6 +2,8 @@
import com.ruoyi.alarm.global.domain.GlobalAlarmCondition;
import com.ruoyi.alarm.steal.domain.ArdAlarmStealelec;
+import com.ruoyi.statistical.param.ESParam;
+import com.ruoyi.statistical.vo.CountVo;
import org.apache.ibatis.annotations.Param;
import java.util.List;
@@ -28,4 +30,7 @@
* @return 缁撴灉
*/
public int updateArdAlarmStealelec(ArdAlarmStealelec ardAlarmStealelec);
+
+ //鏍规嵁鏈堜唤缁熻鏁伴噺
+ List<CountVo> stealelecYear(ESParam esParam);
}
\ No newline at end of file
diff --git a/ard-work/src/main/java/com/ruoyi/alarm/tube/mapper/ArdAlarmTubeMapper.java b/ard-work/src/main/java/com/ruoyi/alarm/tube/mapper/ArdAlarmTubeMapper.java
index fb86244..fddad28 100644
--- a/ard-work/src/main/java/com/ruoyi/alarm/tube/mapper/ArdAlarmTubeMapper.java
+++ b/ard-work/src/main/java/com/ruoyi/alarm/tube/mapper/ArdAlarmTubeMapper.java
@@ -3,6 +3,8 @@
import java.util.List;
import com.ruoyi.alarm.tube.domain.ArdAlarmTube;
+import com.ruoyi.statistical.param.ESParam;
+import com.ruoyi.statistical.vo.CountVo;
import org.apache.ibatis.annotations.Param;
@@ -65,4 +67,7 @@
public List<ArdAlarmTube> selectListAllByCommand(@Param("refreshTime")String refreshTime);
int selectCountByAlarmTime(@Param("refreshTime")String refreshTime);
public int updateViewTimeByTubeId(@Param("tubeId")String tubeId,@Param("alarmTime") String alarmTime,@Param("viewTime") String viewTime);
+
+ //鏍规嵁鏈堜唤缁熻鏁伴噺
+ List<CountVo> tubeYear(ESParam esParam);
}
diff --git a/ard-work/src/main/java/com/ruoyi/alarm/wall/mapper/ArdAlarmWallMapper.java b/ard-work/src/main/java/com/ruoyi/alarm/wall/mapper/ArdAlarmWallMapper.java
index 284d615..9633b12 100644
--- a/ard-work/src/main/java/com/ruoyi/alarm/wall/mapper/ArdAlarmWallMapper.java
+++ b/ard-work/src/main/java/com/ruoyi/alarm/wall/mapper/ArdAlarmWallMapper.java
@@ -4,6 +4,8 @@
import com.ruoyi.alarm.apponekey.domain.ArdAlarmApponekey;
import com.ruoyi.alarm.wall.domain.ArdAlarmWall;
+import com.ruoyi.statistical.param.ESParam;
+import com.ruoyi.statistical.vo.CountVo;
import org.apache.ibatis.annotations.Param;
/**
@@ -68,4 +70,7 @@
public List<ArdAlarmWall> selectListAllByCommand(@Param("refreshTime") String refreshTime);
public int updateViewTimeByUserId(@Param("userId")String userId,@Param("createTime") String createTime,@Param("viewTime") String viewTime);
+
+ //鏍规嵁鏈堜唤缁熻鏁伴噺
+ List<CountVo> wallYear(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 6e1307c..3000f6d 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
@@ -1,5 +1,6 @@
package com.ruoyi.statistical.controller;
+import com.ruoyi.statistical.param.ESParam;
import com.ruoyi.statistical.service.StatisticalService;
import com.ruoyi.utils.result.Results;
import io.swagger.annotations.Api;
@@ -8,6 +9,7 @@
import org.springframework.web.bind.annotation.*;
import javax.annotation.Resource;
+import java.time.LocalDate;
import java.util.Map;
/**
@@ -39,4 +41,49 @@
return statisticalService.factorySelect();
}
+ /**
+ * 鎶ヨ鏁伴噺鍒嗘瀽骞�
+ */
+ @ApiOperation("鎶ヨ鏁伴噺鍒嗘瀽骞�")
+ @GetMapping("alarm/year")
+ public Results alarmYear(String type){
+ LocalDate today = LocalDate.now();
+ int year = today.getYear();
+ ESParam esParam = new ESParam();
+ esParam.setStart(year+"-01-01");
+ esParam.setEnd(year+"-12-31");
+ if("1001".equals(type)){
+ //鐩楃數鎶ヨ
+ return Results.succeed(statisticalService.stealelecYear(esParam));
+ }else if("1002".equals(type)){
+ //閫氱敤鍏夌數
+ return Results.succeed(statisticalService.cameraYear(esParam));
+ }else if("1003".equals(type)){
+ //闆疯揪鎶ヨ
+ return Results.succeed(statisticalService.moveYear(esParam));
+ }else if("1004".equals(type)){
+ //闃茬伀鎶ヨ
+ return Results.succeed(statisticalService.fireYear(esParam));
+ }else if("1005".equals(type)){
+ //澶栬仈鎶ヨ
+ return Results.succeed(statisticalService.externalYear(esParam));
+ }else if("1006".equals(type)){
+ //闂ㄧ鎶ヨ
+ return Results.succeed(statisticalService.accessYear(esParam));
+ }else if("1007".equals(type)){
+ //绉诲姩缁堢
+ return Results.succeed(statisticalService.apponekeyYear(esParam));
+ }else if("1010".equals(type)){
+ //鐢靛瓙鍥存爮
+ return Results.succeed(statisticalService.wallYear(esParam));
+ }else if("1012".equals(type)){
+ //棰勮鍛婅
+ return Results.succeed(statisticalService.digitizationYear(esParam));
+ }else if("1014".equals(type)){
+ //绠$嚎娉勬紡
+ return Results.succeed(statisticalService.tubeYear(esParam));
+ }
+ return Results.succeed();
+ }
+
}
diff --git a/ard-work/src/main/java/com/ruoyi/statistical/param/ESParam.java b/ard-work/src/main/java/com/ruoyi/statistical/param/ESParam.java
new file mode 100644
index 0000000..6ac3022
--- /dev/null
+++ b/ard-work/src/main/java/com/ruoyi/statistical/param/ESParam.java
@@ -0,0 +1,9 @@
+package com.ruoyi.statistical.param;
+
+import lombok.Data;
+
+@Data
+public class ESParam {
+ private String start;
+ private String end;
+}
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 bde8b35..2818f91 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
@@ -1,8 +1,13 @@
package com.ruoyi.statistical.service;
+import com.alibaba.fastjson.JSONObject;
+import com.alibaba.fastjson2.JSONArray;
+import com.ruoyi.statistical.param.ESParam;
+import com.ruoyi.statistical.vo.CountVo;
import com.ruoyi.utils.result.Results;
import org.springframework.stereotype.Service;
+import java.util.List;
import java.util.Map;
/**
@@ -12,4 +17,15 @@
Results factorySave(Map<String,String> map);
Results factorySelect();
+
+ List<CountVo> stealelecYear(ESParam esParam);
+ List<CountVo> cameraYear(ESParam esParam);
+ List<CountVo> moveYear(ESParam esParam);
+ List<CountVo> fireYear(ESParam esParam);
+ List<CountVo> externalYear(ESParam esParam);
+ List<CountVo> accessYear(ESParam esParam);
+ List<CountVo> apponekeyYear(ESParam esParam);
+ List<CountVo> wallYear(ESParam esParam);
+ List<CountVo> digitizationYear(ESParam esParam);
+ List<CountVo> tubeYear(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 a5fd639..45ac8cc 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
@@ -2,11 +2,23 @@
import com.alibaba.fastjson.JSONObject;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
+import com.ruoyi.alarm.access.mapper.ArdAlarmAccessMapper;
+import com.ruoyi.alarm.apponekey.mapper.ArdAlarmApponekeyMapper;
+import com.ruoyi.alarm.camera.mapper.ArdAlarmCameraMapper;
+import com.ruoyi.alarm.digitization3.mapper.ArdAlarmDigitization3Mapper;
+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.steal.mapper.ArdAlarmStealelecMapper;
+import com.ruoyi.alarm.tube.mapper.ArdAlarmTubeMapper;
+import com.ruoyi.alarm.wall.mapper.ArdAlarmWallMapper;
import com.ruoyi.alarmpoints.well.domain.ArdAlarmpointsWell;
import com.ruoyi.alarmpoints.well.mapper.ArdAlarmpointsWellMapper;
import com.ruoyi.common.core.domain.entity.SysConfig;
import com.ruoyi.common.utils.SecurityUtils;
+import com.ruoyi.statistical.param.ESParam;
import com.ruoyi.statistical.service.StatisticalService;
+import com.ruoyi.statistical.vo.CountVo;
import com.ruoyi.system.mapper.SysConfigMapper;
import com.ruoyi.utils.result.Results;
import org.springframework.beans.factory.annotation.Autowired;
@@ -25,6 +37,27 @@
private SysConfigMapper sysConfigMapper;
@Autowired
private ArdAlarmpointsWellMapper wellMapper;
+ @Autowired
+ private ArdAlarmStealelecMapper stealelecMapper;
+ @Autowired
+ private ArdAlarmCameraMapper cameraMapper;
+ @Autowired
+ private ArdAlarmRadarMoveMapper moveMapper;
+ @Autowired
+ private ArdAlarmRadarFireMapper fireMapper;
+ @Autowired
+ private ArdAlarmExternalMapper externalMapper;
+ @Autowired
+ private ArdAlarmAccessMapper accessMapper;
+ @Autowired
+ private ArdAlarmApponekeyMapper apponekeyMapper;
+ @Autowired
+ private ArdAlarmWallMapper wallMapper;
+ @Autowired
+ private ArdAlarmDigitization3Mapper digitization3Mapper;
+ @Autowired
+ private ArdAlarmTubeMapper tubeMapper;
+
@Override
public Results factorySave(Map<String, String> map) {
@@ -91,4 +124,90 @@
jsonObject.put("well",String.valueOf(num));
return Results.succeed(jsonObject);
}
+
+ @Override
+ public List<CountVo> stealelecYear(ESParam esParam) {
+ List<CountVo> list = stealelecMapper.stealelecYear(esParam);
+ return es(list);
+ }
+
+ @Override
+ public List<CountVo> cameraYear(ESParam esParam) {
+ List<CountVo> list = cameraMapper.cameraYear(esParam);
+ return es(list);
+ }
+
+ @Override
+ public List<CountVo> moveYear(ESParam esParam) {
+ List<CountVo> list = moveMapper.moveYear(esParam);
+ return es(list);
+ }
+
+ @Override
+ public List<CountVo> fireYear(ESParam esParam) {
+ List<CountVo> list = fireMapper.fileYear(esParam);
+ return es(list);
+ }
+
+ @Override
+ public List<CountVo> externalYear(ESParam esParam) {
+ List<CountVo> list = externalMapper.externalYear(esParam);
+ return es(list);
+ }
+
+ @Override
+ public List<CountVo> accessYear(ESParam esParam) {
+ List<CountVo> list = accessMapper.accessYear(esParam);
+ return es(list);
+ }
+
+ @Override
+ public List<CountVo> apponekeyYear(ESParam esParam) {
+ List<CountVo> list = apponekeyMapper.apponekeyYear(esParam);
+ return es(list);
+ }
+
+ @Override
+ public List<CountVo> wallYear(ESParam esParam) {
+ List<CountVo> list = wallMapper.wallYear(esParam);
+ return es(list);
+ }
+
+ @Override
+ public List<CountVo> digitizationYear(ESParam esParam) {
+ List<CountVo> list = digitization3Mapper.digitizationYear(esParam);
+ return es(list);
+ }
+
+ @Override
+ public List<CountVo> tubeYear(ESParam esParam) {
+ List<CountVo> list = tubeMapper.tubeYear(esParam);
+ return es(list);
+ }
+
+ public List<CountVo> es(List<CountVo> list){
+ for (int i = 1; i <= 12 ; i++) {
+ String month = null;
+ if(i<=10){
+ month = "0"+i;
+ }else {
+ month = String.valueOf(i);
+ }
+ Boolean bo = false;
+ for (int j = 0; j < list.size(); j++) {
+ CountVo countVo = list.get(j);
+ String mon = countVo.getMonth();
+ if(mon.equals(month)){
+ bo = true;
+ }
+ }
+ if(!bo){
+ CountVo countVo = new CountVo();
+ countVo.setMonth(month);
+ countVo.setCount(0);
+ list.add(countVo);
+ }
+ }
+ return list;
+ }
}
diff --git a/ard-work/src/main/java/com/ruoyi/statistical/vo/CountVo.java b/ard-work/src/main/java/com/ruoyi/statistical/vo/CountVo.java
new file mode 100644
index 0000000..a3b425f
--- /dev/null
+++ b/ard-work/src/main/java/com/ruoyi/statistical/vo/CountVo.java
@@ -0,0 +1,9 @@
+package com.ruoyi.statistical.vo;
+
+import lombok.Data;
+
+@Data
+public class CountVo {
+ private String month;
+ private Integer count;
+}
diff --git a/ard-work/src/main/java/com/ruoyi/utils/mqtt/MqttConsumerCallback.java b/ard-work/src/main/java/com/ruoyi/utils/mqtt/MqttConsumerCallback.java
index 8504a14..62a2ca2 100644
--- a/ard-work/src/main/java/com/ruoyi/utils/mqtt/MqttConsumerCallback.java
+++ b/ard-work/src/main/java/com/ruoyi/utils/mqtt/MqttConsumerCallback.java
@@ -78,6 +78,12 @@
IStorageMinioEventService storageMinioEventService = SpringUtils.getBean(IStorageMinioEventService.class);
storageMinioEventService.parseStorageMinioEvent(new String(message.getPayload(), StandardCharsets.UTF_8));
}
+ if (topic.equals("radarWellData"))
+ {
+ System.out.println(new String(message.getPayload(), StandardCharsets.UTF_8));
+ IStorageMinioEventService storageMinioEventService = SpringUtils.getBean(IStorageMinioEventService.class);
+ storageMinioEventService.parseStorageMinioEvent(new String(message.getPayload(), StandardCharsets.UTF_8));
+ }
} catch (Exception e) {
log.debug("澶勭悊mqtt娑堟伅寮傚父:" + e);
}
diff --git a/ard-work/src/main/resources/mapper/alarm/ArdAlarmAccessMapper.xml b/ard-work/src/main/resources/mapper/alarm/ArdAlarmAccessMapper.xml
index 20ef5df..b70d798 100644
--- a/ard-work/src/main/resources/mapper/alarm/ArdAlarmAccessMapper.xml
+++ b/ard-work/src/main/resources/mapper/alarm/ArdAlarmAccessMapper.xml
@@ -169,4 +169,10 @@
and alarm_time <= #{alarmTime}
and view_time is null
</update>
+
+ <select id="accessYear" resultType="com.ruoyi.statistical.vo.CountVo">
+ select to_char(alarm_time::DATE, 'MM') as month,count(id)
+ from ard_alarm_access
+ where alarm_time >= #{start} and alarm_time <= #{end} group by month order by month
+ </select>
</mapper>
\ No newline at end of file
diff --git a/ard-work/src/main/resources/mapper/alarm/ArdAlarmApponekeyMapper.xml b/ard-work/src/main/resources/mapper/alarm/ArdAlarmApponekeyMapper.xml
index 8a00857..888768f 100644
--- a/ard-work/src/main/resources/mapper/alarm/ArdAlarmApponekeyMapper.xml
+++ b/ard-work/src/main/resources/mapper/alarm/ArdAlarmApponekeyMapper.xml
@@ -128,4 +128,10 @@
and create_time <= #{createTime}
and view_time is null
</update>
+
+ <select id="apponekeyYear" resultType="com.ruoyi.statistical.vo.CountVo">
+ select to_char(create_time::DATE, 'MM') as month,count(id)
+ from ard_alarm_apponekey
+ where create_time >= #{start} and create_time <= #{end} group by month order by month
+ </select>
</mapper>
\ No newline at end of file
diff --git a/ard-work/src/main/resources/mapper/alarm/ArdAlarmCameraMapper.xml b/ard-work/src/main/resources/mapper/alarm/ArdAlarmCameraMapper.xml
index d46eeaf..2f919b5 100644
--- a/ard-work/src/main/resources/mapper/alarm/ArdAlarmCameraMapper.xml
+++ b/ard-work/src/main/resources/mapper/alarm/ArdAlarmCameraMapper.xml
@@ -166,4 +166,10 @@
and alarm_time<=#{alarmTime}
and view_time is null
</update>
+
+ <select id="cameraYear" resultType="com.ruoyi.statistical.vo.CountVo">
+ select to_char(alarm_time::DATE, 'MM') as month,count(id)
+ from ard_alarm_camera
+ where alarm_time >= #{start} and alarm_time <= #{end} group by month order by month
+ </select>
</mapper>
\ No newline at end of file
diff --git a/ard-work/src/main/resources/mapper/alarm/ArdAlarmDigitization3Mapper.xml b/ard-work/src/main/resources/mapper/alarm/ArdAlarmDigitization3Mapper.xml
index 02e1c34..ac9ba20 100644
--- a/ard-work/src/main/resources/mapper/alarm/ArdAlarmDigitization3Mapper.xml
+++ b/ard-work/src/main/resources/mapper/alarm/ArdAlarmDigitization3Mapper.xml
@@ -150,4 +150,9 @@
and alarm_time <= #{alarmTime}
and view_time is null
</update>
+ <select id="digitizationYear" resultType="com.ruoyi.statistical.vo.CountVo">
+ select to_char(alarm_time::DATE, 'MM') as month,count(id)
+ from ard_alarm_digitization3
+ where alarm_time >= #{start} and alarm_time <= #{end} group by month order by month
+ </select>
</mapper>
\ No newline at end of file
diff --git a/ard-work/src/main/resources/mapper/alarm/ArdAlarmExternalMapper.xml b/ard-work/src/main/resources/mapper/alarm/ArdAlarmExternalMapper.xml
index 0325f29..3ae4483 100644
--- a/ard-work/src/main/resources/mapper/alarm/ArdAlarmExternalMapper.xml
+++ b/ard-work/src/main/resources/mapper/alarm/ArdAlarmExternalMapper.xml
@@ -183,4 +183,10 @@
and alarm_time<=#{alarmTime}
and view_time is null
</update>
+
+ <select id="externalYear" resultType="com.ruoyi.statistical.vo.CountVo">
+ select to_char(alarm_time::DATE, 'MM') as month,count(id)
+ from ard_alarm_external
+ where alarm_time >= #{start} and alarm_time <= #{end} group by month order by month
+ </select>
</mapper>
\ No newline at end of file
diff --git a/ard-work/src/main/resources/mapper/alarm/ArdAlarmRadarFireMapper.xml b/ard-work/src/main/resources/mapper/alarm/ArdAlarmRadarFireMapper.xml
index a6559a6..6964d83 100644
--- a/ard-work/src/main/resources/mapper/alarm/ArdAlarmRadarFireMapper.xml
+++ b/ard-work/src/main/resources/mapper/alarm/ArdAlarmRadarFireMapper.xml
@@ -162,4 +162,10 @@
<select id="selectArdAlarmRadarLastData" parameterType="String" resultMap="ArdAlarmRadarFireResult">
select * from ard_alarm_radar_fire where name=#{name} order by update_time desc LIMIT 1
</select>
+
+ <select id="fileYear" resultType="com.ruoyi.statistical.vo.CountVo">
+ select to_char(alarm_time::DATE, 'MM') as month,count(id)
+ from ard_alarm_radar_fire
+ where alarm_time >= #{start} and alarm_time <= #{end} group by month order by month
+ </select>
</mapper>
\ No newline at end of file
diff --git a/ard-work/src/main/resources/mapper/alarm/ArdAlarmRadarMoveMapper.xml b/ard-work/src/main/resources/mapper/alarm/ArdAlarmRadarMoveMapper.xml
index 3793ffb..e97b734 100644
--- a/ard-work/src/main/resources/mapper/alarm/ArdAlarmRadarMoveMapper.xml
+++ b/ard-work/src/main/resources/mapper/alarm/ArdAlarmRadarMoveMapper.xml
@@ -167,4 +167,10 @@
<select id="selectArdAlarmRadarLastData" parameterType="String" resultMap="ArdAlarmRadarMoveResult">
select * from ard_alarm_radar_move where name=#{name} order by update_time desc LIMIT 1
</select>
+
+ <select id="moveYear" resultType="com.ruoyi.statistical.vo.CountVo">
+ select to_char(alarm_time::DATE, 'MM') as month,count(id)
+ from ard_alarm_radar_move
+ where alarm_time >= #{start} and alarm_time <= #{end} group by month order by month
+ </select>
</mapper>
\ No newline at end of file
diff --git a/ard-work/src/main/resources/mapper/alarm/ArdAlarmStealelecMapper.xml b/ard-work/src/main/resources/mapper/alarm/ArdAlarmStealelecMapper.xml
index 36f94cf..c5b241c 100644
--- a/ard-work/src/main/resources/mapper/alarm/ArdAlarmStealelecMapper.xml
+++ b/ard-work/src/main/resources/mapper/alarm/ArdAlarmStealelecMapper.xml
@@ -128,4 +128,11 @@
values (#{id}, #{name},#{describe},#{catalogText},#{description}, #{startTime}, #{endTime},
#{viewTime},#{longitude},#{latitude},#{altitude},#{createBy},#{createTime},#{userId},#{deptId})
</insert>
+
+ <select id="stealelecYear" resultType="com.ruoyi.statistical.vo.CountVo">
+ select to_char(start_time::DATE, 'MM') as month,count(id)
+ from ard_alarm_stealelec
+ where start_time >= #{start} and start_time <= #{end} group by month order by month
+ </select>
+
</mapper>
\ No newline at end of file
diff --git a/ard-work/src/main/resources/mapper/alarm/ArdAlarmTubeMapper.xml b/ard-work/src/main/resources/mapper/alarm/ArdAlarmTubeMapper.xml
index 547d0cc..195196a 100644
--- a/ard-work/src/main/resources/mapper/alarm/ArdAlarmTubeMapper.xml
+++ b/ard-work/src/main/resources/mapper/alarm/ArdAlarmTubeMapper.xml
@@ -195,5 +195,9 @@
and alarm_time <= #{alarmTime}
and view_time is null
</update>
-
+ <select id="tubeYear" resultType="com.ruoyi.statistical.vo.CountVo">
+ select to_char(create_time::DATE, 'MM') as month,count(id)
+ from ard_alarm_tube
+ where create_time >= #{start} and create_time <= #{end} group by month order by month
+ </select>
</mapper>
\ No newline at end of file
diff --git a/ard-work/src/main/resources/mapper/alarm/ArdAlarmWallMapper.xml b/ard-work/src/main/resources/mapper/alarm/ArdAlarmWallMapper.xml
index a35adc3..e467b0e 100644
--- a/ard-work/src/main/resources/mapper/alarm/ArdAlarmWallMapper.xml
+++ b/ard-work/src/main/resources/mapper/alarm/ArdAlarmWallMapper.xml
@@ -162,4 +162,9 @@
and create_time <= #{createTime}
and view_time is null
</update>
+ <select id="wallYear" resultType="com.ruoyi.statistical.vo.CountVo">
+ select to_char(alarm_time::DATE, 'MM') as month,count(id)
+ from ard_alarm_wall
+ where alarm_time >= #{start} and alarm_time <= #{end} group by month order by month
+ </select>
</mapper>
\ No newline at end of file
--
Gitblit v1.9.3