From ddb36e54bd51761138c536ccca889d3f80182334 Mon Sep 17 00:00:00 2001
From: lin <18010473990@163.com>
Date: 星期六, 08 一月 2022 16:47:20 +0800
Subject: [PATCH] 级联平台添加GPS订阅支持

---
 src/main/java/com/genersoft/iot/vmp/storager/dao/PlatformGbStreamMapper.java |   27 +++++++++++++++++++++++++--
 1 files changed, 25 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 6243f32..06486c9 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
@@ -1,5 +1,7 @@
 package com.genersoft.iot.vmp.storager.dao;
 
+import com.genersoft.iot.vmp.gb28181.bean.GbStream;
+import com.genersoft.iot.vmp.gb28181.bean.PlatformCatalog;
 import com.genersoft.iot.vmp.gb28181.bean.PlatformGbStream;
 import com.genersoft.iot.vmp.media.zlm.dto.StreamProxyItem;
 import org.apache.ibatis.annotations.*;
@@ -12,8 +14,8 @@
 @Repository
 public interface PlatformGbStreamMapper {
 
-    @Insert("INSERT INTO platform_gb_stream (app, stream, platformId) VALUES" +
-            "('${app}', '${stream}', '${platformId}')")
+    @Insert("INSERT INTO platform_gb_stream (app, stream, platformId, catalogId) VALUES" +
+            "('${app}', '${stream}', '${platformId}', '${catalogId}')")
     int add(PlatformGbStream platformGbStream);
 
     @Delete("DELETE FROM platform_gb_stream WHERE app=#{app} AND stream=#{stream}")
@@ -24,4 +26,25 @@
 
     @Select("SELECT * FROM platform_gb_stream WHERE app=#{app} AND stream=#{stream}")
     List<StreamProxyItem> selectByAppAndStream(String app, String stream);
+
+    @Select("SELECT * FROM platform_gb_stream WHERE app=#{app} AND stream=#{stream} AND platformId=#{serverGBId}")
+    StreamProxyItem selectOne(String app, String stream, String serverGBId);
+
+    @Select("select gs.* \n" +
+            "from gb_stream gs\n" +
+            "    left join platform_gb_stream pgs\n" +
+            "        on gs.app = pgs.app and gs.stream = pgs.stream\n" +
+            "where pgs.platformId=#{platformId} and pgs.catalogId=#{catalogId}")
+    List<GbStream> queryChannelInParentPlatformAndCatalog(String platformId, String catalogId);
+
+    @Select("select gs.gbId as id, gs.name as name, pgs.platformId as platformId, pgs.catalogId as catalogId , 0 as childrenCount, 2 as type\n" +
+            "from gb_stream gs\n" +
+            "    left join platform_gb_stream pgs\n" +
+            "        on gs.app = pgs.app and gs.stream = pgs.stream\n" +
+            "where pgs.platformId=#{platformId} and pgs.catalogId=#{catalogId}")
+    List<PlatformCatalog> queryChannelInParentPlatformAndCatalogForCatlog(String platformId, String catalogId);
+
+    @Delete("DELETE FROM platform_gb_stream WHERE catalogId=#{id}")
+    int delByCatalogId(String id);
+
 }

--
Gitblit v1.8.0