From b97db305eb110da024e2e5c922e31f8665d65520 Mon Sep 17 00:00:00 2001 From: luoshuyue <239937404@qq.com> Date: 星期五, 25 二月 2022 15:04:47 +0800 Subject: [PATCH] 修复了拉流添加国标编码上级级联调取不到视频的bug --- src/main/java/com/genersoft/iot/vmp/storager/dao/PlatformGbStreamMapper.java | 22 +++++++++++----------- sql/mysql.sql | 2 +- src/main/java/com/genersoft/iot/vmp/storager/dao/GbStreamMapper.java | 22 +++++++++++----------- src/main/java/com/genersoft/iot/vmp/storager/impl/VideoManagerStoragerImpl.java | 4 ++-- 4 files changed, 25 insertions(+), 25 deletions(-) diff --git a/sql/mysql.sql b/sql/mysql.sql index f2e358f..b4c38a2 100644 --- a/sql/mysql.sql +++ b/sql/mysql.sql @@ -389,7 +389,7 @@ CREATE TABLE `platform_gb_stream` ( `platformId` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL, `catalogId` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL, - `gbStreamId` int NOT NULL, + `gbStreamId` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL, `id` int NOT NULL AUTO_INCREMENT, PRIMARY KEY (`id`), UNIQUE KEY `platform_gb_stream_pk` (`platformId`,`catalogId`,`gbStreamId`) 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 55b5379..593b78a 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 @@ -41,15 +41,15 @@ "SELECT gs.* FROM gb_stream gs " + "WHERE " + "1=1 " + - " <if test='catalogId != null'> AND gs.gbStreamId in" + + " <if test='catalogId != null'> AND gs.gbId in" + "(select pgs.gbStreamId from platform_gb_stream pgs where pgs.platformId = #{platformId} and pgs.catalogId=#{catalogId})</if> " + - " <if test='catalogId == null'> AND gs.gbStreamId not in" + + " <if test='catalogId == null'> AND gs.gbId not in" + "(select pgs.gbStreamId from platform_gb_stream pgs where pgs.platformId = #{platformId}) </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.gbStreamId asc " + + " order by gs.gbId asc " + "</script>") List<GbStream> selectAll(String platformId, String catalogId, String query, Boolean pushing, String mediaServerId); @@ -60,18 +60,18 @@ List<GbStream> selectByGBId(String gbId); @Select("SELECT gs.*, pgs.platformId as platformId, pgs.catalogId as catalogId FROM gb_stream gs " + - "LEFT JOIN platform_gb_stream pgs ON gs.gbStreamId = pgs.catalogId " + + "LEFT JOIN platform_gb_stream pgs ON gs.gbId = pgs.gbStreamId " + "WHERE gs.gbId = '${gbId}' AND pgs.platformId = '${platformId}'") GbStream queryStreamInPlatform(String platformId, String gbId); @Select("SELECT gs.*, pgs.platformId as platformId, pgs.catalogId as catalogId FROM gb_stream gs " + - "LEFT JOIN platform_gb_stream pgs ON gs.gbStreamId = pgs.gbStreamId " + + "LEFT JOIN platform_gb_stream pgs ON gs.gbId = pgs.gbStreamId " + "WHERE pgs.platformId = #{platformId}") List<GbStream> queryGbStreamListInPlatform(String platformId); @Select("SELECT gs.* FROM gb_stream gs LEFT JOIN platform_gb_stream pgs " + - "ON gs.gbStreamId = pgs.gbStreamId WHERE pgs.gbStreamId is NULL") + "ON gs.gbId = pgs.gbStreamId WHERE pgs.gbStreamId is NULL") List<GbStream> queryStreamNotInPlatform(); @Update("UPDATE gb_stream " + @@ -128,10 +128,10 @@ int updateStreamGPS(List<GPSMsgInfo> gpsMsgInfos); @Select("<script> "+ - "SELECT * FROM gb_stream where " + - "<foreach collection='streamPushItems' item='item' separator='or'>" + - "(app=#{item.app} and stream=#{item.stream}) " + - "</foreach>" + - "</script>") + "SELECT * FROM gb_stream where " + + "<foreach collection='streamPushItems' item='item' separator='or'>" + + "(app=#{item.app} and stream=#{item.stream}) " + + "</foreach>" + + "</script>") List<GbStream> selectAllForAppAndStream(List<StreamPushItem> streamPushItems); } 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 a495098..b411b59 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 @@ -17,7 +17,7 @@ public interface PlatformGbStreamMapper { @Insert("REPLACE INTO platform_gb_stream (gbStreamId, platformId, catalogId) VALUES" + - "( #{gbStreamId}, #{platformId}, #{catalogId})") + "( #{gbId}, #{platformId}, #{catalogId})") int add(PlatformGbStream platformGbStream); @@ -26,12 +26,12 @@ "(gbStreamId, platformId, catalogId) " + "values " + "<foreach collection='streamPushItems' index='index' item='item' separator=','> " + - "(${item.gbStreamId}, '${item.platformId}', '${item.catalogId}')" + + "(#{item.gbId}, #{item.platformId}, #{item.catalogId})" + "</foreach> " + "</script>") int batchAdd(List<StreamPushItem> streamPushItems); - @Delete("DELETE FROM platform_gb_stream WHERE gbStreamId = (select gbStreamId from gb_stream where app=#{app} AND stream=#{stream})") + @Delete("DELETE FROM platform_gb_stream WHERE gbStreamId = (select gbId from gb_stream where app=#{app} AND stream=#{stream})") int delByAppAndStream(String app, String stream); @Delete("DELETE FROM platform_gb_stream WHERE platformId=#{platformId}") @@ -42,28 +42,28 @@ "FROM " + "platform_gb_stream pgs " + "LEFT JOIN parent_platform pp ON pp.serverGBId = pgs.platformId " + - "LEFT JOIN gb_stream gs ON gs.gbStreamId = pgs.gbStreamId " + + "LEFT JOIN gb_stream gs ON gs.gbId = pgs.gbStreamId " + "WHERE " + "gs.app =#{app} " + "AND gs.stream =#{stream} ") List<ParentPlatform> selectByAppAndStream(String app, String stream); @Select("SELECT pgs.*, gs.gbId FROM platform_gb_stream pgs " + - "LEFT JOIN gb_stream gs ON pgs.gbStreamId = gs.gbStreamId " + + "LEFT JOIN gb_stream gs ON pgs.gbStreamId = gs.gbId " + "WHERE gs.app=#{app} AND gs.stream=#{stream} AND pgs.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.gbStreamId = pgs.gbStreamId\n" + + " on gs.gbId = pgs.gbStreamId\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.gbStreamId = pgs.gbStreamId\n" + + " on gs.gbId = pgs.gbStreamId\n" + "where pgs.platformId=#{platformId} and pgs.catalogId=#{catalogId}") List<PlatformCatalog> queryChannelInParentPlatformAndCatalogForCatalog(String platformId, String catalogId); @@ -78,7 +78,7 @@ "left join platform_gb_stream pgs on " + "pp.serverGBId = pgs.platformId " + "left join gb_stream gs " + - "gs.gbStreamId = pgs.gbStreamId " + + "gs.gbId = pgs.gbStreamId " + "WHERE " + "gs.app = #{app} " + "AND gs.stream = #{stream}" + @@ -87,13 +87,13 @@ "</script> ") List<ParentPlatform> queryPlatFormListForGBWithGBId(String app, String stream, List<String> platforms); - @Delete("DELETE FROM platform_gb_stream WHERE gbStreamId = (select id from gb_stream where app=#{app} AND stream=#{stream}) AND platformId=#{platformId}") + @Delete("DELETE FROM platform_gb_stream WHERE gbStreamId = (select gbId from gb_stream where app=#{app} AND stream=#{stream}) AND platformId=#{platformId}") int delByAppAndStreamAndPlatform(String app, String stream, String platformId); @Delete("<script> "+ "DELETE FROM platform_gb_stream where gbStreamId in " + "<foreach collection='gbStreams' item='item' open='(' separator=',' close=')' >" + - "#{item.gbStreamId}" + + "#{item.gbId}" + "</foreach>" + "</script>") void delByGbStreams(List<GbStream> gbStreams); @@ -101,7 +101,7 @@ @Delete("<script> "+ "DELETE FROM platform_gb_stream where platformId=#{platformId} and gbStreamId in " + "<foreach collection='gbStreams' item='item' open='(' separator=',' close=')'>" + - "#{item.gbStreamId} " + + "#{item.gbId} " + "</foreach>" + "</script>") void delByAppAndStreamsByPlatformId(List<GbStream> gbStreams, String platformId); diff --git a/src/main/java/com/genersoft/iot/vmp/storager/impl/VideoManagerStoragerImpl.java b/src/main/java/com/genersoft/iot/vmp/storager/impl/VideoManagerStoragerImpl.java index 1d04c82..77164c2 100644 --- a/src/main/java/com/genersoft/iot/vmp/storager/impl/VideoManagerStoragerImpl.java +++ b/src/main/java/com/genersoft/iot/vmp/storager/impl/VideoManagerStoragerImpl.java @@ -707,7 +707,7 @@ try { if (streamProxyMapper.add(streamProxyItem) > 0) { if (!StringUtils.isEmpty(streamProxyItem.getGbId())) { - if (gbStreamMapper.add(streamProxyItem) > 0) { + if (gbStreamMapper.add(streamProxyItem) < 0) { //浜嬪姟鍥炴粴 dataSourceTransactionManager.rollback(transactionStatus); return false; @@ -742,7 +742,7 @@ try { if (streamProxyMapper.update(streamProxyItem) > 0) { if (!StringUtils.isEmpty(streamProxyItem.getGbId())) { - if (gbStreamMapper.update(streamProxyItem) > 0) { + if (gbStreamMapper.update(streamProxyItem) < 0) { //浜嬪姟鍥炴粴 dataSourceTransactionManager.rollback(transactionStatus); return false; -- Gitblit v1.8.0