From 3add1f8ab325dff968d5c2b94985700419ea1ccb Mon Sep 17 00:00:00 2001
From: zxl <763096477@qq.com>
Date: 星期三, 19 二月 2025 09:46:32 +0800
Subject: [PATCH] 运维监控报表接口统计sql重新编写
---
ycl-server/src/main/java/com/ycl/platform/service/impl/TMonitorServiceImpl.java | 9 +++++++--
1 files changed, 7 insertions(+), 2 deletions(-)
diff --git a/ycl-server/src/main/java/com/ycl/platform/service/impl/TMonitorServiceImpl.java b/ycl-server/src/main/java/com/ycl/platform/service/impl/TMonitorServiceImpl.java
index 3cc7abe..55976c3 100644
--- a/ycl-server/src/main/java/com/ycl/platform/service/impl/TMonitorServiceImpl.java
+++ b/ycl-server/src/main/java/com/ycl/platform/service/impl/TMonitorServiceImpl.java
@@ -372,16 +372,21 @@
*/
@Override
public Map<String, Object> home(HomeQuery monitorQuery) {
-
+ System.out.println(monitorQuery + "~~~~~~~~~~~~~鎵撳嵃");
Map<String, Object> dataMap = new HashMap<>();
Map<String, Object> monthMap1 = new HashMap<>();
Map<String, Object> monthMap2 = new HashMap<>();
List<Map<String, Object>> home = baseMapper.home(monitorQuery);
if (ObjectUtils.isNotEmpty(home)) {
+ //鎷垮埌鏁版嵁搴� 寰幆鏌ヨ
+ System.out.println(home + "~~~~~~~~~~~~~鎵撳嵃");
for (Map<String, Object> map : home) {
+ //寰楀埌map鐨� months閿殑鍊� num1閿殑鍊� 缁勮涓烘柊瀵硅薄
monthMap1.put(map.get("months").toString(), map.get("num1"));
+ //寰楀埌map鐨� months閿殑鍊� num2閿殑鍊� 缁勮涓烘柊瀵硅薄
monthMap2.put(map.get("months").toString(), map.get("num2"));
}
+ //home 鐨勪笅鏍�0鐨� map鐨� name閿殑鍊�
dataMap.put("name", home.get(0).get("name"));
dataMap.put("state", monthMap1);
dataMap.put("state2", monthMap2);
@@ -965,7 +970,7 @@
))
.append("loseCount", new Document("$sum",
new Document("$cond", Arrays.asList(
- new Document("$eq", Arrays.asList("$recordStatus", -1)),
+ new Document("$in", Arrays.asList("$recordStatus", Arrays.asList(-1, 0))),
1,
0
))
--
Gitblit v1.8.0