From 37a84e66917d6e22e03e31b0a115e2c16d23ed21 Mon Sep 17 00:00:00 2001
From: 朱俊杰 <502612493@qq.com>
Date: 星期四, 10 二月 2022 14:45:33 +0800
Subject: [PATCH] 新增实时监控功能

---
 src/main/java/com/genersoft/iot/vmp/storager/dao/PlatformGbStreamMapper.java |   11 +++++++++--
 1 files changed, 9 insertions(+), 2 deletions(-)

diff --git a/src/main/java/com/genersoft/iot/vmp/storager/dao/PlatformGbStreamMapper.java b/src/main/java/com/genersoft/iot/vmp/storager/dao/PlatformGbStreamMapper.java
index a9f8510..e4639e7 100644
--- a/src/main/java/com/genersoft/iot/vmp/storager/dao/PlatformGbStreamMapper.java
+++ b/src/main/java/com/genersoft/iot/vmp/storager/dao/PlatformGbStreamMapper.java
@@ -32,8 +32,7 @@
             "LEFT JOIN parent_platform pp ON pp.serverGBId = pgs.platformId " +
             "WHERE " +
             "pgs.app =#{app} " +
-            "AND pgs.stream =#{stream} " +
-            "GROUP BY pp.serverGBId")
+            "AND pgs.stream =#{stream} ")
     List<ParentPlatform> selectByAppAndStream(String app, String stream);
 
     @Select("SELECT pgs.*, gs.gbId  FROM platform_gb_stream pgs " +
@@ -75,4 +74,12 @@
 
     @Delete("DELETE FROM platform_gb_stream WHERE app=#{app} AND stream=#{stream} AND platformId=#{platformId}")
     int delByAppAndStreamAndPlatform(String app, String stream, String platformId);
+
+    @Delete("<script> "+
+            "DELETE FROM platform_gb_stream where " +
+            "<foreach collection='gbStreams' item='item' separator='or'>" +
+            "(app=#{item.app} and stream=#{item.stream}) " +
+            "</foreach>" +
+            "</script>")
+    void delByGbStreams(List<GbStream> gbStreams);
 }

--
Gitblit v1.8.0