From 22311d8b024f0414cc60a2c408211fdfb9c2f1d3 Mon Sep 17 00:00:00 2001
From: aijinhui <aijinhui>
Date: 星期六, 07 十月 2023 17:11:24 +0800
Subject: [PATCH] 报警数量统计月
---
ard-work/src/main/resources/mapper/alarm/ArdAlarmRadarMoveMapper.xml | 9 +
ard-work/src/main/java/com/ruoyi/statistical/service/StatisticalService.java | 11 ++
ard-work/src/main/resources/mapper/alarm/ArdAlarmAccessMapper.xml | 9 +
ard-work/src/main/java/com/ruoyi/statistical/controller/StatisticalController.java | 72 ++++++++++++++
ard-work/src/main/java/com/ruoyi/statistical/param/MonthParam.java | 9 +
ard-work/src/main/java/com/ruoyi/alarm/digitization3/mapper/ArdAlarmDigitization3Mapper.java | 2
ard-work/src/main/resources/mapper/alarm/ArdAlarmDigitization3Mapper.xml | 9 +
ard-work/src/main/java/com/ruoyi/alarm/tube/mapper/ArdAlarmTubeMapper.java | 2
ard-work/src/main/java/com/ruoyi/alarm/access/mapper/ArdAlarmAccessMapper.java | 2
ard-work/src/main/java/com/ruoyi/alarm/steal/mapper/ArdAlarmStealelecMapper.java | 2
ard-work/src/main/java/com/ruoyi/alarm/wall/mapper/ArdAlarmWallMapper.java | 2
ard-work/src/main/resources/mapper/alarm/ArdAlarmExternalMapper.xml | 10 +
ard-work/src/main/resources/mapper/alarm/ArdAlarmCameraMapper.xml | 9 +
ard-work/src/main/resources/mapper/alarm/ArdAlarmStealelecMapper.xml | 9 +
ard-work/src/main/resources/mapper/alarm/ArdAlarmWallMapper.xml | 9 +
ard-work/src/main/java/com/ruoyi/alarm/apponekey/mapper/ArdAlarmApponekeyMapper.java | 2
ard-work/src/main/resources/mapper/alarm/ArdAlarmTubeMapper.xml | 9 +
ard-work/src/main/java/com/ruoyi/alarm/radar/mapper/ArdAlarmRadarMoveMapper.java | 2
ard-work/src/main/java/com/ruoyi/alarm/radar/mapper/ArdAlarmRadarFireMapper.java | 2
ard-work/src/main/java/com/ruoyi/statistical/service/impl/StatisticalServiceImpl.java | 94 ++++++++++++++++++
ard-work/src/main/resources/mapper/alarm/ArdAlarmRadarFireMapper.xml | 9 +
ard-work/src/main/resources/mapper/alarm/ArdAlarmApponekeyMapper.xml | 9 +
ard-work/src/main/java/com/ruoyi/alarm/camera/mapper/ArdAlarmCameraMapper.java | 2
ard-work/src/main/java/com/ruoyi/alarm/external/mapper/ArdAlarmExternalMapper.java | 2
ard-work/src/main/java/com/ruoyi/statistical/vo/CountVo.java | 2
25 files changed, 274 insertions(+), 25 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 95d60a6..ded7625 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
@@ -71,4 +71,6 @@
//鏍规嵁鏈堜唤缁熻鏁伴噺
List<CountVo> accessYear(ESParam esParam);
+ //鏍规嵁澶╃粺璁℃暟閲�
+ List<CountVo> accessMonth(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 10250b3..c6f512c 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
@@ -72,4 +72,6 @@
//鏍规嵁鏈堜唤缁熻鏁伴噺
List<CountVo> apponekeyYear(ESParam esParam);
+ //鏍规嵁澶╃粺璁℃暟閲�
+ List<CountVo> apponekeyMonth(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 f462889..93249a6 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
@@ -71,4 +71,6 @@
//鏍规嵁鏈堜唤缁熻鏁伴噺
List<CountVo> cameraYear(ESParam esParam);
+ //鏍规嵁澶╃粺璁℃暟閲�
+ List<CountVo> cameraMonth(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 94a16c9..07131e8 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
@@ -70,4 +70,6 @@
//鏍规嵁鏈堜唤缁熻鏁伴噺
List<CountVo> digitizationYear(ESParam esParam);
+ //鏍规嵁鏈堜唤缁熻鏁伴噺
+ List<CountVo> digitizationMonth(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 d66c1d6..45a5b03 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
@@ -70,5 +70,7 @@
//鏍规嵁鏈堜唤缁熻鏁伴噺
List<CountVo> externalYear(ESParam esParam);
+ //鏍规嵁澶╃粺璁℃暟閲�
+ List<CountVo> externalMonth(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 b1f1c6f..91b9530 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
@@ -73,4 +73,6 @@
//鏍规嵁鏈堜唤缁熻鏁伴噺
List<CountVo> fileYear(ESParam esParam);
+ //鏍规嵁澶╃粺璁℃暟閲�
+ List<CountVo> fileMonth(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 0b24084..bbc54f0 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
@@ -72,4 +72,6 @@
//鏍规嵁鏈堜唤缁熻鏁伴噺
List<CountVo> moveYear(ESParam esParam);
+ //鏍规嵁澶╀唤缁熻鏁伴噺
+ List<CountVo> moveMonth(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 52a84d5..fa7b796 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
@@ -33,4 +33,6 @@
//鏍规嵁鏈堜唤缁熻鏁伴噺
List<CountVo> stealelecYear(ESParam esParam);
+ //鏍规嵁澶╃粺璁℃暟閲�
+ List<CountVo> stealelecMonth(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 fddad28..04ab2bf 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
@@ -70,4 +70,6 @@
//鏍规嵁鏈堜唤缁熻鏁伴噺
List<CountVo> tubeYear(ESParam esParam);
+ //鏍规嵁鏈堜唤缁熻鏁伴噺
+ List<CountVo> tubeMonth(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 9633b12..970b5c1 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
@@ -73,4 +73,6 @@
//鏍规嵁鏈堜唤缁熻鏁伴噺
List<CountVo> wallYear(ESParam esParam);
+ //鏍规嵁澶╃粺璁℃暟閲�
+ List<CountVo> wallMonth(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 3000f6d..628ac8e 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,15 +1,16 @@
package com.ruoyi.statistical.controller;
import com.ruoyi.statistical.param.ESParam;
+import com.ruoyi.statistical.param.MonthParam;
import com.ruoyi.statistical.service.StatisticalService;
import com.ruoyi.utils.result.Results;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
-import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.web.bind.annotation.*;
import javax.annotation.Resource;
import java.time.LocalDate;
+import java.util.Calendar;
import java.util.Map;
/**
@@ -86,4 +87,73 @@
return Results.succeed();
}
+ /**
+ * 鎶ヨ鏁伴噺鍒嗘瀽鏈�
+ */
+ @ApiOperation("鎶ヨ鏁伴噺鍒嗘瀽鏈�")
+ @GetMapping("alarm/month")
+ public Results alarmMonth(String month,String type){
+ LocalDate today = LocalDate.now();
+ int year = today.getYear();
+ int day = getDaysInMonth(Integer.valueOf(month),year);
+ ESParam esParam = new ESParam();
+ esParam.setStart(year+"-"+month+"-01");
+ esParam.setEnd(year+"-"+month+"-"+day);
+ if("1001".equals(type)){
+ //鐩楃數鎶ヨ
+ return Results.succeed(statisticalService.stealelecMonth(esParam));
+ }else if("1002".equals(type)){
+ //閫氱敤鍏夌數
+ return Results.succeed(statisticalService.cameraMonth(esParam));
+ }else if("1003".equals(type)){
+ //闆疯揪鎶ヨ
+ return Results.succeed(statisticalService.moveMonth(esParam));
+ }else if("1004".equals(type)){
+ //闃茬伀鎶ヨ
+ return Results.succeed(statisticalService.fireMonth(esParam));
+ }else if("1005".equals(type)){
+ //澶栬仈鎶ヨ
+ return Results.succeed(statisticalService.externalMonth(esParam));
+ }else if("1006".equals(type)){
+ //闂ㄧ鎶ヨ
+ return Results.succeed(statisticalService.accessMonth(esParam));
+ }else if("1007".equals(type)){
+ //绉诲姩缁堢
+ return Results.succeed(statisticalService.apponekeyMonth(esParam));
+ }else if("1010".equals(type)){
+ //鐢靛瓙鍥存爮
+ return Results.succeed(statisticalService.wallMonth(esParam));
+ }else if("1012".equals(type)){
+ //棰勮鍛婅
+ return Results.succeed(statisticalService.digitizationMonth(esParam));
+ }else if("1014".equals(type)){
+ //绠$嚎娉勬紡
+ return Results.succeed(statisticalService.tubeMonth(esParam));
+ }
+ return Results.succeed();
+ }
+
+ //杩斿洖姣忔湀澶╂暟
+ public int getDaysInMonth(int month, int year) {
+ switch (month) {
+ case Calendar.JANUARY:
+ case Calendar.MARCH:
+ case Calendar.MAY:
+ case Calendar.JULY:
+ case Calendar.AUGUST:
+ case Calendar.OCTOBER:
+ case Calendar.DECEMBER:
+ return 31;
+ case Calendar.APRIL:
+ case Calendar.JUNE:
+ case Calendar.SEPTEMBER:
+ case Calendar.NOVEMBER:
+ return 30;
+ case Calendar.FEBRUARY:
+ return ((year % 4 == 0 && year % 100 != 0) || (year % 400 == 0)) ? 29 : 28;
+ default:
+ throw new IllegalArgumentException("Invalid Month");
+ }
+ }
+
}
diff --git a/ard-work/src/main/java/com/ruoyi/statistical/param/MonthParam.java b/ard-work/src/main/java/com/ruoyi/statistical/param/MonthParam.java
new file mode 100644
index 0000000..dd654a7
--- /dev/null
+++ b/ard-work/src/main/java/com/ruoyi/statistical/param/MonthParam.java
@@ -0,0 +1,9 @@
+package com.ruoyi.statistical.param;
+
+import lombok.Data;
+
+@Data
+public class MonthParam {
+ private String type;
+ private String month;
+}
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 2818f91..4646d95 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
@@ -28,4 +28,15 @@
List<CountVo> wallYear(ESParam esParam);
List<CountVo> digitizationYear(ESParam esParam);
List<CountVo> tubeYear(ESParam esParam);
+
+ List<CountVo> stealelecMonth(ESParam esParam);
+ List<CountVo> cameraMonth(ESParam esParam);
+ List<CountVo> moveMonth(ESParam esParam);
+ List<CountVo> fireMonth(ESParam esParam);
+ List<CountVo> externalMonth(ESParam esParam);
+ List<CountVo> accessMonth(ESParam esParam);
+ List<CountVo> apponekeyMonth(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 45ac8cc..ae8e724 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
@@ -24,6 +24,7 @@
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
+import java.util.Calendar;
import java.util.List;
import java.util.Map;
@@ -185,9 +186,69 @@
return es(list);
}
+ @Override
+ public List<CountVo> stealelecMonth(ESParam esParam) {
+ List<CountVo> list = stealelecMapper.stealelecMonth(esParam);
+ return esMonth(list,esParam.getEnd());
+ }
+
+ @Override
+ public List<CountVo> cameraMonth(ESParam esParam) {
+ List<CountVo> list = cameraMapper.cameraMonth(esParam);
+ return esMonth(list,esParam.getEnd());
+ }
+
+ @Override
+ public List<CountVo> moveMonth(ESParam esParam) {
+ List<CountVo> list = moveMapper.moveMonth(esParam);
+ return esMonth(list,esParam.getEnd());
+ }
+
+ @Override
+ public List<CountVo> fireMonth(ESParam esParam) {
+ List<CountVo> list = fireMapper.fileMonth(esParam);
+ return esMonth(list,esParam.getEnd());
+ }
+
+ @Override
+ public List<CountVo> externalMonth(ESParam esParam) {
+ List<CountVo> list = externalMapper.externalMonth(esParam);
+ return esMonth(list,esParam.getEnd());
+ }
+
+ @Override
+ public List<CountVo> accessMonth(ESParam esParam) {
+ List<CountVo> list = accessMapper.accessMonth(esParam);
+ return esMonth(list,esParam.getEnd());
+ }
+
+ @Override
+ public List<CountVo> apponekeyMonth(ESParam esParam) {
+ List<CountVo> list = apponekeyMapper.apponekeyMonth(esParam);
+ return esMonth(list,esParam.getEnd());
+ }
+
+ @Override
+ public List<CountVo> wallMonth(ESParam esParam) {
+ List<CountVo> list = wallMapper.wallMonth(esParam);
+ return esMonth(list,esParam.getEnd());
+ }
+
+ @Override
+ public List<CountVo> digitizationMonth(ESParam esParam) {
+ List<CountVo> list = digitization3Mapper.digitizationMonth(esParam);
+ return esMonth(list,esParam.getEnd());
+ }
+
+ @Override
+ public List<CountVo> tubeMonth(ESParam esParam) {
+ List<CountVo> list = tubeMapper.tubeMonth(esParam);
+ return esMonth(list,esParam.getEnd());
+ }
+
public List<CountVo> es(List<CountVo> list){
for (int i = 1; i <= 12 ; i++) {
- String month = null;
+ String month;
if(i<=10){
month = "0"+i;
}else {
@@ -196,14 +257,41 @@
Boolean bo = false;
for (int j = 0; j < list.size(); j++) {
CountVo countVo = list.get(j);
- String mon = countVo.getMonth();
+ String mon = countVo.getDate();
if(mon.equals(month)){
bo = true;
}
}
if(!bo){
CountVo countVo = new CountVo();
- countVo.setMonth(month);
+ countVo.setDate(month);
+ countVo.setCount(0);
+ list.add(countVo);
+ }
+ }
+ return list;
+ }
+
+ public List<CountVo> esMonth(List<CountVo> list,String end){
+ Integer day = Integer.valueOf(end.substring(end.length() - 2));
+ for (int i = 1; i <= day ; i++) {
+ String d;
+ if(i<=10){
+ d = "0"+i;
+ }else {
+ d = String.valueOf(i);
+ }
+ Boolean bo = false;
+ for (int j = 0; j < list.size(); j++) {
+ CountVo countVo = list.get(j);
+ String mon = countVo.getDate();
+ if(mon.equals(d)){
+ bo = true;
+ }
+ }
+ if(!bo){
+ CountVo countVo = new CountVo();
+ countVo.setDate(d);
countVo.setCount(0);
list.add(countVo);
}
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
index a3b425f..77d4668 100644
--- a/ard-work/src/main/java/com/ruoyi/statistical/vo/CountVo.java
+++ b/ard-work/src/main/java/com/ruoyi/statistical/vo/CountVo.java
@@ -4,6 +4,6 @@
@Data
public class CountVo {
- private String month;
+ private String date;
private Integer count;
}
diff --git a/ard-work/src/main/resources/mapper/alarm/ArdAlarmAccessMapper.xml b/ard-work/src/main/resources/mapper/alarm/ArdAlarmAccessMapper.xml
index b70d798..5bcf387 100644
--- a/ard-work/src/main/resources/mapper/alarm/ArdAlarmAccessMapper.xml
+++ b/ard-work/src/main/resources/mapper/alarm/ArdAlarmAccessMapper.xml
@@ -171,8 +171,13 @@
</update>
<select id="accessYear" resultType="com.ruoyi.statistical.vo.CountVo">
- select to_char(alarm_time::DATE, 'MM') as month,count(id)
+ select to_char(alarm_time::DATE, 'MM') as date,count(id)
from ard_alarm_access
- where alarm_time >= #{start} and alarm_time <= #{end} group by month order by month
+ where alarm_time >= #{start} and alarm_time <= #{end} group by date order by date
+ </select>
+ <select id="accessMonth" resultType="com.ruoyi.statistical.vo.CountVo">
+ select to_char(alarm_time::DATE, 'dd') as date,count(id)
+ from ard_alarm_access
+ where alarm_time >= #{start} and alarm_time <= #{end} group by date order by date
</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 888768f..b7cfb6e 100644
--- a/ard-work/src/main/resources/mapper/alarm/ArdAlarmApponekeyMapper.xml
+++ b/ard-work/src/main/resources/mapper/alarm/ArdAlarmApponekeyMapper.xml
@@ -130,8 +130,13 @@
</update>
<select id="apponekeyYear" resultType="com.ruoyi.statistical.vo.CountVo">
- select to_char(create_time::DATE, 'MM') as month,count(id)
+ select to_char(create_time::DATE, 'MM') as date,count(id)
from ard_alarm_apponekey
- where create_time >= #{start} and create_time <= #{end} group by month order by month
+ where create_time >= #{start} and create_time <= #{end} group by date order by date
+ </select>
+ <select id="apponekeyMonth" resultType="com.ruoyi.statistical.vo.CountVo">
+ select to_char(create_time::DATE, 'dd') as date,count(id)
+ from ard_alarm_apponekey
+ where create_time >= #{start} and create_time <= #{end} group by date order by date
</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 2f919b5..14d86a8 100644
--- a/ard-work/src/main/resources/mapper/alarm/ArdAlarmCameraMapper.xml
+++ b/ard-work/src/main/resources/mapper/alarm/ArdAlarmCameraMapper.xml
@@ -168,8 +168,13 @@
</update>
<select id="cameraYear" resultType="com.ruoyi.statistical.vo.CountVo">
- select to_char(alarm_time::DATE, 'MM') as month,count(id)
+ select to_char(alarm_time::DATE, 'MM') as date,count(id)
from ard_alarm_camera
- where alarm_time >= #{start} and alarm_time <= #{end} group by month order by month
+ where alarm_time >= #{start} and alarm_time <= #{end} group by date order by date
+ </select>
+ <select id="cameraMonth" resultType="com.ruoyi.statistical.vo.CountVo">
+ select to_char(alarm_time::DATE, 'dd') as date,count(id)
+ from ard_alarm_camera
+ where alarm_time >= #{start} and alarm_time <= #{end} group by date order by date
</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 ac9ba20..b299239 100644
--- a/ard-work/src/main/resources/mapper/alarm/ArdAlarmDigitization3Mapper.xml
+++ b/ard-work/src/main/resources/mapper/alarm/ArdAlarmDigitization3Mapper.xml
@@ -151,8 +151,13 @@
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)
+ select to_char(alarm_time::DATE, 'MM') as date,count(id)
from ard_alarm_digitization3
- where alarm_time >= #{start} and alarm_time <= #{end} group by month order by month
+ where alarm_time >= #{start} and alarm_time <= #{end} group by date order by date
+ </select>
+ <select id="digitizationMonth" resultType="com.ruoyi.statistical.vo.CountVo">
+ select to_char(alarm_time::DATE, 'dd') as date,count(id)
+ from ard_alarm_digitization3
+ where alarm_time >= #{start} and alarm_time <= #{end} group by date order by date
</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 3ae4483..e3cad25 100644
--- a/ard-work/src/main/resources/mapper/alarm/ArdAlarmExternalMapper.xml
+++ b/ard-work/src/main/resources/mapper/alarm/ArdAlarmExternalMapper.xml
@@ -185,8 +185,14 @@
</update>
<select id="externalYear" resultType="com.ruoyi.statistical.vo.CountVo">
- select to_char(alarm_time::DATE, 'MM') as month,count(id)
+ select to_char(alarm_time::DATE, 'MM') as date,count(id)
from ard_alarm_external
- where alarm_time >= #{start} and alarm_time <= #{end} group by month order by month
+ where alarm_time >= #{start} and alarm_time <= #{end} group by date order by date
</select>
+ <select id="externalMonth" resultType="com.ruoyi.statistical.vo.CountVo">
+ select to_char(alarm_time::DATE, 'dd') as date,count(id)
+ from ard_alarm_external
+ where alarm_time >= #{start} and alarm_time <= #{end} group by date order by date
+ </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 6964d83..e349f24 100644
--- a/ard-work/src/main/resources/mapper/alarm/ArdAlarmRadarFireMapper.xml
+++ b/ard-work/src/main/resources/mapper/alarm/ArdAlarmRadarFireMapper.xml
@@ -164,8 +164,13 @@
</select>
<select id="fileYear" resultType="com.ruoyi.statistical.vo.CountVo">
- select to_char(alarm_time::DATE, 'MM') as month,count(id)
+ select to_char(alarm_time::DATE, 'MM') as date,count(id)
from ard_alarm_radar_fire
- where alarm_time >= #{start} and alarm_time <= #{end} group by month order by month
+ where alarm_time >= #{start} and alarm_time <= #{end} group by date order by date
+ </select>
+ <select id="fileMonth" resultType="com.ruoyi.statistical.vo.CountVo">
+ select to_char(alarm_time::DATE, 'dd') as date,count(id)
+ from ard_alarm_radar_fire
+ where alarm_time >= #{start} and alarm_time <= #{end} group by date order by date
</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 e97b734..b2cd359 100644
--- a/ard-work/src/main/resources/mapper/alarm/ArdAlarmRadarMoveMapper.xml
+++ b/ard-work/src/main/resources/mapper/alarm/ArdAlarmRadarMoveMapper.xml
@@ -169,8 +169,13 @@
</select>
<select id="moveYear" resultType="com.ruoyi.statistical.vo.CountVo">
- select to_char(alarm_time::DATE, 'MM') as month,count(id)
+ select to_char(alarm_time::DATE, 'MM') as date,count(id)
from ard_alarm_radar_move
- where alarm_time >= #{start} and alarm_time <= #{end} group by month order by month
+ where alarm_time >= #{start} and alarm_time <= #{end} group by date order by date
+ </select>
+ <select id="moveMonth" resultType="com.ruoyi.statistical.vo.CountVo">
+ select to_char(alarm_time::DATE, 'dd') as date,count(id)
+ from ard_alarm_radar_move
+ where alarm_time >= #{start} and alarm_time <= #{end} group by date order by date
</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 c5b241c..19a7e29 100644
--- a/ard-work/src/main/resources/mapper/alarm/ArdAlarmStealelecMapper.xml
+++ b/ard-work/src/main/resources/mapper/alarm/ArdAlarmStealelecMapper.xml
@@ -130,9 +130,14 @@
</insert>
<select id="stealelecYear" resultType="com.ruoyi.statistical.vo.CountVo">
- select to_char(start_time::DATE, 'MM') as month,count(id)
+ select to_char(start_time::DATE, 'MM') as date,count(id)
from ard_alarm_stealelec
- where start_time >= #{start} and start_time <= #{end} group by month order by month
+ where start_time >= #{start} and start_time <= #{end} group by date order by date
</select>
+ <select id="stealelecMonth" resultType="com.ruoyi.statistical.vo.CountVo">
+ select to_char(start_time::DATE, 'dd') as date,count(id)
+ from ard_alarm_stealelec
+ where start_time >= #{start} and start_time <= #{end} group by date order by date
+ </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 195196a..5546e76 100644
--- a/ard-work/src/main/resources/mapper/alarm/ArdAlarmTubeMapper.xml
+++ b/ard-work/src/main/resources/mapper/alarm/ArdAlarmTubeMapper.xml
@@ -196,8 +196,13 @@
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)
+ select to_char(create_time::DATE, 'MM') as date,count(id)
from ard_alarm_tube
- where create_time >= #{start} and create_time <= #{end} group by month order by month
+ where create_time >= #{start} and create_time <= #{end} group by date order by date
+ </select>
+ <select id="tubeMonth" resultType="com.ruoyi.statistical.vo.CountVo">
+ select to_char(create_time::DATE, 'dd') as date,count(id)
+ from ard_alarm_tube
+ where create_time >= #{start} and create_time <= #{end} group by date order by date
</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 e467b0e..99e112e 100644
--- a/ard-work/src/main/resources/mapper/alarm/ArdAlarmWallMapper.xml
+++ b/ard-work/src/main/resources/mapper/alarm/ArdAlarmWallMapper.xml
@@ -163,8 +163,13 @@
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)
+ select to_char(alarm_time::DATE, 'MM') as date,count(id)
from ard_alarm_wall
- where alarm_time >= #{start} and alarm_time <= #{end} group by month order by month
+ where alarm_time >= #{start} and alarm_time <= #{end} group by date order by date
+ </select>
+ <select id="wallMonth" resultType="com.ruoyi.statistical.vo.CountVo">
+ select to_char(alarm_time::DATE, 'dd') as date,count(id)
+ from ard_alarm_wall
+ 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