648540858
2022-01-14 ac1a4a027a7bd88efb32e9da666bdba4b5fa166f
src/main/java/com/genersoft/iot/vmp/storager/dao/PlatformGbStreamMapper.java
@@ -1,6 +1,7 @@
package com.genersoft.iot.vmp.storager.dao;
import com.genersoft.iot.vmp.gb28181.bean.GbStream;
import com.genersoft.iot.vmp.gb28181.bean.ParentPlatform;
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;
@@ -14,7 +15,7 @@
@Repository
public interface PlatformGbStreamMapper {
    @Insert("INSERT INTO platform_gb_stream (app, stream, platformId, catalogId) VALUES" +
    @Insert("REPLACE INTO platform_gb_stream (app, stream, platformId, catalogId) VALUES" +
            "('${app}', '${stream}', '${platformId}', '${catalogId}')")
    int add(PlatformGbStream platformGbStream);
@@ -24,10 +25,20 @@
    @Delete("DELETE FROM platform_gb_stream WHERE platformId=#{platformId}")
    int delByPlatformId(String platformId);
    @Select("SELECT * FROM platform_gb_stream WHERE app=#{app} AND stream=#{stream}")
    List<StreamProxyItem> selectByAppAndStream(String app, String stream);
    @Select("SELECT " +
            "pp.* " +
            "FROM " +
            "platform_gb_stream pgs " +
            "LEFT JOIN parent_platform pp ON pp.serverGBId = pgs.platformId " +
            "WHERE " +
            "pgs.app =#{app} " +
            "AND pgs.stream =#{stream} " +
            "GROUP BY pp.serverGBId")
    List<ParentPlatform> selectByAppAndStream(String app, String stream);
    @Select("SELECT * FROM platform_gb_stream WHERE app=#{app} AND stream=#{stream} AND platformId=#{serverGBId}")
    @Select("SELECT pgs.*, gs.gbId  FROM platform_gb_stream pgs " +
            "LEFT JOIN gb_stream gs ON pgs.app = gs.app AND pgs.stream = gs.stream " +
            "WHERE pgs.app=#{app} AND pgs.stream=#{stream} AND pgs.platformId=#{serverGBId}")
    StreamProxyItem selectOne(String app, String stream, String serverGBId);
    @Select("select gs.* \n" +
@@ -47,4 +58,21 @@
    @Delete("DELETE FROM platform_gb_stream WHERE catalogId=#{id}")
    int delByCatalogId(String id);
    @Select("<script> " +
            "SELECT " +
            "pp.* " +
            "FROM " +
            "parent_platform pp " +
            "left join platform_gb_stream pgs on " +
            "pp.serverGBId = pgs.platformId " +
            "WHERE " +
            "pgs.app = #{app} " +
            "AND pgs.stream = #{stream}" +
            "AND pp.serverGBId IN" +
            "<foreach collection='platforms'  item='item'  open='(' separator=',' close=')' > #{item}</foreach>" +
            "</script> ")
    List<ParentPlatform> queryPlatFormListForGBWithGBId(String app, String stream, List<String> platforms);
    @Select("SELECT * FROM platform_gb_stream WHERE app=#{app} AND stream=#{stream} AND platformId=#{platformId}")
    int delByAppAndStreamAndPlatform(String app, String streamId, String platformId);
}