From 9b1af8ef1396de45884fe86c56844714045b82ec Mon Sep 17 00:00:00 2001
From: 648540858 <648540858@qq.com>
Date: 星期二, 07 十二月 2021 21:13:55 +0800
Subject: [PATCH] 适配zlm的hook保活

---
 src/main/java/com/genersoft/iot/vmp/storager/dao/GbStreamMapper.java |   12 ++++++++++--
 1 files changed, 10 insertions(+), 2 deletions(-)

diff --git a/src/main/java/com/genersoft/iot/vmp/storager/dao/GbStreamMapper.java b/src/main/java/com/genersoft/iot/vmp/storager/dao/GbStreamMapper.java
index 1fdc6d8..f159925 100644
--- a/src/main/java/com/genersoft/iot/vmp/storager/dao/GbStreamMapper.java
+++ b/src/main/java/com/genersoft/iot/vmp/storager/dao/GbStreamMapper.java
@@ -28,7 +28,7 @@
             "latitude=#{latitude}," +
             "mediaServerId=#{mediaServerId}," +
             "status=${status} " +
-            "WHERE app=#{app} AND stream=#{stream} AND gbId=#{gbId}")
+            "WHERE app=#{app} AND stream=#{stream}")
     int update(GbStream gbStream);
 
     @Delete("DELETE FROM gb_stream WHERE app=#{app} AND stream=#{stream}")
@@ -40,10 +40,13 @@
     @Select("SELECT * FROM gb_stream WHERE app=#{app} AND stream=#{stream}")
     StreamProxyItem selectOne(String app, String stream);
 
+    @Select("SELECT * FROM gb_stream WHERE gbId=#{gbId}")
+    List<GbStream> selectByGBId(String gbId);
+
     @Select("SELECT gs.*, pgs.platformId FROM gb_stream gs " +
             "LEFT JOIN platform_gb_stream pgs ON gs.app = pgs.app AND gs.stream = pgs.stream " +
             "WHERE gs.gbId = '${gbId}' AND pgs.platformId = '${platformId}'")
-    GbStream queryStreamInPlatform(String platformId, String gbId);
+    List<GbStream> queryStreamInPlatform(String platformId, String gbId);
 
     @Select("SELECT gs.*, pgs.platformId FROM gb_stream gs " +
             "LEFT JOIN platform_gb_stream pgs ON gs.app = pgs.app AND gs.stream = pgs.stream " +
@@ -57,4 +60,9 @@
 
     @Select("SELECT gs.*, pgs.platformId FROM gb_stream gs LEFT JOIN  platform_gb_stream pgs ON gs.app = pgs.app AND gs.stream = pgs.stream WHERE mediaServerId=#{mediaServerId} ")
     List<GbStream> selectAllByMediaServerId(String mediaServerId);
+
+    @Update("UPDATE gb_stream " +
+            "SET status=${status} " +
+            "WHERE mediaServerId=#{mediaServerId} ")
+    void updateStatusByMediaServerId(String mediaServerId, boolean status);
 }

--
Gitblit v1.8.0