648540858
2022-02-15 9442c37ce73497a66d540f035e58201b54656e49
src/main/java/com/genersoft/iot/vmp/storager/dao/GbStreamMapper.java
@@ -37,10 +37,20 @@
    @Delete("DELETE FROM gb_stream WHERE app=#{app} AND stream=#{stream}")
    int del(String app, String stream);
    @Select("SELECT gs.*, pgs.platformId AS platformId, pgs.catalogId AS catalogId FROM gb_stream gs " +
            "LEFT JOIN  platform_gb_stream pgs ON gs.app = pgs.app AND gs.stream = pgs.stream AND (pgs.platformId = #{platformId} OR pgs.platformId is null)" +
            "order by gs.id asc ")
    List<GbStream> selectAll(String platformId);
    @Select("<script> "+
            "SELECT gs.*, pgs.platformId AS platformId, pgs.catalogId AS catalogId FROM gb_stream gs " +
            "LEFT JOIN  platform_gb_stream pgs ON gs.app = pgs.app AND gs.stream = pgs.stream " +
            "WHERE " +
            "1=1 " +
            " <if test='catalogId != null'> AND pgs.platformId = #{platformId} AND pgs.catalogId = #{catalogId}</if> " +
            " <if test='catalogId == null'> AND pgs.platformId is null AND pgs.catalogId is null</if> " +
            " <if test='query != null'> AND (gs.app LIKE '%${query}%' OR gs.stream LIKE '%${query}%' OR gs.gbId LIKE '%${query}%' OR gs.name LIKE '%${query}%')</if> " +
            " <if test='pushing == true' > AND gs.status=1</if>" +
            " <if test='pushing == false' > AND gs.status=0</if>" +
            " <if test='mediaServerId != null' > AND gs.mediaServerId=#{mediaServerId} </if>" +
            " order by gs.id asc " +
            "</script>")
    List<GbStream> selectAll(String platformId, String catalogId, String query, Boolean pushing, String mediaServerId);
    @Select("SELECT * FROM gb_stream WHERE app=#{app} AND stream=#{stream}")
    StreamProxyItem selectOne(String app, String stream);