From 801b7d11f1ce9b49f35af7eec572143662c4daf4 Mon Sep 17 00:00:00 2001
From: baizonghao <1719256278@qq.com>
Date: 星期五, 24 二月 2023 21:21:19 +0800
Subject: [PATCH] 统计报警时间,查询空指针
---
ycl-platform/src/main/resources/mapper/unlawful/UnlawfulMapper.xml | 6 +++---
ycl-platform/src/main/java/com/ycl/controller/intelligentPatrol/StatisticsController.java | 8 ++++----
2 files changed, 7 insertions(+), 7 deletions(-)
diff --git a/ycl-platform/src/main/java/com/ycl/controller/intelligentPatrol/StatisticsController.java b/ycl-platform/src/main/java/com/ycl/controller/intelligentPatrol/StatisticsController.java
index fa174fb..506d508 100644
--- a/ycl-platform/src/main/java/com/ycl/controller/intelligentPatrol/StatisticsController.java
+++ b/ycl-platform/src/main/java/com/ycl/controller/intelligentPatrol/StatisticsController.java
@@ -66,7 +66,7 @@
startTime = beginTime.format(fmt);
}
if (endTime != null){
- endTime1 = beginTime.format(fmt);
+ endTime1 = endTime.format(fmt);
}
IPage<UnlawfulDto> page = new Page<>();
@@ -91,7 +91,7 @@
startTime = beginTime.format(fmt);
}
if (endTime != null){
- endTime1 = beginTime.format(fmt);
+ endTime1 = endTime.format(fmt);
}
IPage<UnlawfulDto> page = new Page<>();
List<UnlawfulDto> unlawfulByType = unlawfulService.getUnlawfulBySite((currentPage - 1) * pageSize, pageSize, startTime, endTime1);
@@ -115,7 +115,7 @@
startTime = beginTime.format(fmt);
}
if (endTime != null){
- endTime1 = beginTime.format(fmt);
+ endTime1 = endTime.format(fmt);
}
IPage<UnlawfulDto> page = new Page<>();
List<UnlawfulDto> unlawfulByType = unlawfulService.getUnlawfulByTime((currentPage - 1) * pageSize, pageSize, startTime, endTime1);
@@ -138,7 +138,7 @@
startTime = beginTime.format(fmt);
}
if (endTime != null){
- endTime1 = beginTime.format(fmt);
+ endTime1 = endTime.format(fmt);
}
IPage<UnlawfulDto> page = new Page<>();
List<UnlawfulDto> unlawfulByType = unlawfulService.getUnlawfulByStreet((currentPage - 1) * pageSize, pageSize, startTime, endTime1);
diff --git a/ycl-platform/src/main/resources/mapper/unlawful/UnlawfulMapper.xml b/ycl-platform/src/main/resources/mapper/unlawful/UnlawfulMapper.xml
index 929c16a..6f2d819 100644
--- a/ycl-platform/src/main/resources/mapper/unlawful/UnlawfulMapper.xml
+++ b/ycl-platform/src/main/resources/mapper/unlawful/UnlawfulMapper.xml
@@ -264,7 +264,7 @@
<!-- 鍒嗛〉鏁伴噺-->
<select id="getTotalByType" resultType="java.lang.Integer">
select
- SUM(num)
+ SUM( CASE WHEN num is null THEN 0 ELSE num END )
from(
SELECT
count(*) num
@@ -286,7 +286,7 @@
</select>
<select id="getTotalByStreet" resultType="java.lang.Integer">
select
- SUM(num)
+ SUM( CASE WHEN num is null THEN 1 ELSE num END )
from(
SELECT
count(*) num
@@ -330,7 +330,7 @@
</select>
<select id="getTotalByTime" resultType="java.lang.Integer">
select
- SUM(num)
+ SUM( CASE WHEN num is null THEN 1 ELSE num END )
from(
SELECT
count(*) num
--
Gitblit v1.8.0