From 4171a21a5efd4124f2106a2ce867a6dfbdd4fb4b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E4=B8=8D=E7=88=B1=E5=AD=A6=E4=B9=A0=E7=9A=84=E7=9F=B3?= =?UTF-8?q?=E5=90=8C=E5=AD=A6?= <2936013465@qq.com> Date: Thu, 14 Nov 2024 21:08:38 +0800 Subject: [PATCH] =?UTF-8?q?=E9=A6=96=E9=A1=B5=E5=A4=A7=E5=B1=8F1.5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../controller/datav/DataGobalController.java | 4 +--- .../biutag/supervision/mapper/NegativeMapper.java | 2 +- .../mapper/NegativeProblemRelationMapper.java | 14 ++++++-------- .../supervision/service/DataGobalService.java | 3 +++ 4 files changed, 11 insertions(+), 12 deletions(-) diff --git a/src/main/java/com/biutag/supervision/controller/datav/DataGobalController.java b/src/main/java/com/biutag/supervision/controller/datav/DataGobalController.java index cf3244c..b8d21fe 100644 --- a/src/main/java/com/biutag/supervision/controller/datav/DataGobalController.java +++ b/src/main/java/com/biutag/supervision/controller/datav/DataGobalController.java @@ -119,15 +119,13 @@ public class DataGobalController { /** - * 数据大屏问题趋势统计(按月) - * + * 数据大屏问题趋势统计(按月展示) * @param year * @return */ @Operation(summary = "数据大屏问题趋势统计(按月)") @GetMapping("/getGobalRecentlyTrendByMonth") public Result getGobalRecentlyTrendByMonth(@RequestParam Integer year) { - List recentTrendVoList = dataGobalService.getGobalRecentlyTrendByMonth(String.valueOf(year)); ArrayList monthList = new ArrayList<>(); ArrayList totalList = new ArrayList<>(); diff --git a/src/main/java/com/biutag/supervision/mapper/NegativeMapper.java b/src/main/java/com/biutag/supervision/mapper/NegativeMapper.java index 7997c9d..750a8a4 100644 --- a/src/main/java/com/biutag/supervision/mapper/NegativeMapper.java +++ b/src/main/java/com/biutag/supervision/mapper/NegativeMapper.java @@ -36,7 +36,7 @@ public interface NegativeMapper extends BaseMapper { List selectBusinessRate(Date beginTime,Date endTime); - @Select("SELECT DATE_FORMAT(ng.crtTime, '%Y-%m') AS monthTime, COUNT(*) total FROM negative ng " + + @Select("SELECT DATE_FORMAT(ng.discoveryTime, '%Y-%m') AS monthTime, COUNT(*) total FROM negative ng " + "WHERE YEAR(ng.discoveryTime)=#{year} and checkStatus=1 " + "GROUP BY monthTime " + "order BY monthTime asc") diff --git a/src/main/java/com/biutag/supervision/mapper/NegativeProblemRelationMapper.java b/src/main/java/com/biutag/supervision/mapper/NegativeProblemRelationMapper.java index 7097cde..2d20b21 100644 --- a/src/main/java/com/biutag/supervision/mapper/NegativeProblemRelationMapper.java +++ b/src/main/java/com/biutag/supervision/mapper/NegativeProblemRelationMapper.java @@ -19,14 +19,12 @@ public interface NegativeProblemRelationMapper extends BaseMapper selectProblemRate(Date beginTime, Date endTime); - @Select("SELECT (@row_number := @row_number + 1) AS sort, sorted_results.label, sorted_results.value " + - "FROM " + - "(SELECT npr.threeLevelContent AS label, COUNT(*) AS value " + - "FROM negative_problem_relation npr " + - "WHERE npr.threeLevelContent IS NOT NULL " + - "GROUP BY label " + - "ORDER BY value DESC) " + - "AS sorted_results, (SELECT @row_number := 0) AS t;") + @Select("SELECT threeLevelContent as name, count(*) as `value` " + + "FROM negative_problem_relation " + + "WHERE negativeId " + + "in ( SELECT id FROM negative WHERE discoveryTime BETWEEN #{beginTime} AND #{endTime}) " + + "GROUP BY threeLevelContent " + + "ORDER BY VALUE DESC ") List selectStrongProblemRank(Date beginTime, Date endTime); @Select("SELECT sd1.short_name, count(*) value " + diff --git a/src/main/java/com/biutag/supervision/service/DataGobalService.java b/src/main/java/com/biutag/supervision/service/DataGobalService.java index 740b102..4641512 100644 --- a/src/main/java/com/biutag/supervision/service/DataGobalService.java +++ b/src/main/java/com/biutag/supervision/service/DataGobalService.java @@ -132,6 +132,9 @@ public class DataGobalService { * @return */ public List getStrongProblemRank(Date beginTime, Date endTime) { + // 1.获取这段时间的negative id + // + List res= negativeProblemRelationMapper.selectStrongProblemRank(beginTime, endTime); return res; }