From 7d888274150e9415ae0fc16e67fefd1cdb4a69cc Mon Sep 17 00:00:00 2001
From: 648540858 <648540858@qq.com>
Date: 星期四, 20 一月 2022 16:48:30 +0800
Subject: [PATCH] 处理服务重启或设备重新上线时的订阅,优化通道导入重复的处理

---
 src/main/java/com/genersoft/iot/vmp/storager/dao/StreamProxyMapper.java |   16 ++++++++++++++++
 1 files changed, 16 insertions(+), 0 deletions(-)

diff --git a/src/main/java/com/genersoft/iot/vmp/storager/dao/StreamProxyMapper.java b/src/main/java/com/genersoft/iot/vmp/storager/dao/StreamProxyMapper.java
index 11753f7..b6e1ba1 100644
--- a/src/main/java/com/genersoft/iot/vmp/storager/dao/StreamProxyMapper.java
+++ b/src/main/java/com/genersoft/iot/vmp/storager/dao/StreamProxyMapper.java
@@ -51,4 +51,20 @@
             "LEFT JOIN gb_stream pgs on st.app = pgs.app AND st.stream = pgs.stream " +
             "WHERE st.enable=${enable} and st.mediaServerId = '${id}' order by st.createTime desc")
     List<StreamProxyItem> selectForEnableInMediaServer(String id, boolean enable);
+
+    @Select("SELECT st.*, pgs.gbId, pgs.name, pgs.longitude, pgs.latitude FROM stream_proxy st " +
+            "LEFT JOIN gb_stream pgs on st.app = pgs.app AND st.stream = pgs.stream " +
+            "WHERE st.mediaServerId = '${id}' order by st.createTime desc")
+    List<StreamProxyItem> selectInMediaServer(String id);
+
+    @Update("UPDATE stream_proxy " +
+            "SET enable=#{status} " +
+            "WHERE mediaServerId=#{mediaServerId}")
+    void updateStatus(boolean status, String mediaServerId);
+
+    @Delete("DELETE FROM stream_proxy WHERE enable_remove_none_reader=true AND mediaServerId=#{mediaServerId}")
+    void deleteAutoRemoveItemByMediaServerId(String mediaServerId);
+
+    @Select("SELECT st.*, pgs.gbId, pgs.name, pgs.longitude, pgs.latitude FROM stream_proxy st LEFT JOIN gb_stream pgs on st.app = pgs.app AND st.stream = pgs.stream WHERE st.enable_remove_none_reader=true AND st.mediaServerId=#{mediaServerId} order by st.createTime desc")
+    List<StreamProxyItem> selecAutoRemoveItemByMediaServerId(String mediaServerId);
 }

--
Gitblit v1.8.0