修复了拉流添加国标编码上级级联调取不到视频的bug

This commit is contained in:
luoshuyue 2022-02-25 15:04:47 +08:00
parent a42dda2bd3
commit b97db305eb
4 changed files with 25 additions and 25 deletions

View File

@ -389,7 +389,7 @@ DROP TABLE IF EXISTS `platform_gb_stream`;
CREATE TABLE `platform_gb_stream` ( CREATE TABLE `platform_gb_stream` (
`platformId` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL, `platformId` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL,
`catalogId` 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, `id` int NOT NULL AUTO_INCREMENT,
PRIMARY KEY (`id`), PRIMARY KEY (`id`),
UNIQUE KEY `platform_gb_stream_pk` (`platformId`,`catalogId`,`gbStreamId`) UNIQUE KEY `platform_gb_stream_pk` (`platformId`,`catalogId`,`gbStreamId`)

View File

@ -41,15 +41,15 @@ public interface GbStreamMapper {
"SELECT gs.* FROM gb_stream gs " + "SELECT gs.* FROM gb_stream gs " +
"WHERE " + "WHERE " +
"1=1 " + "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> " + "(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> " + "(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='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 == true' > AND gs.status=1</if>" +
" <if test='pushing == false' > AND gs.status=0</if>" + " <if test='pushing == false' > AND gs.status=0</if>" +
" <if test='mediaServerId != null' > AND gs.mediaServerId=#{mediaServerId} </if>" + " <if test='mediaServerId != null' > AND gs.mediaServerId=#{mediaServerId} </if>" +
" order by gs.gbStreamId asc " + " order by gs.gbId asc " +
"</script>") "</script>")
List<GbStream> selectAll(String platformId, String catalogId, String query, Boolean pushing, String mediaServerId); List<GbStream> selectAll(String platformId, String catalogId, String query, Boolean pushing, String mediaServerId);
@ -60,18 +60,18 @@ public interface GbStreamMapper {
List<GbStream> selectByGBId(String gbId); List<GbStream> selectByGBId(String gbId);
@Select("SELECT gs.*, pgs.platformId as platformId, pgs.catalogId as catalogId FROM gb_stream gs " + @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}'") "WHERE gs.gbId = '${gbId}' AND pgs.platformId = '${platformId}'")
GbStream queryStreamInPlatform(String platformId, String gbId); GbStream queryStreamInPlatform(String platformId, String gbId);
@Select("SELECT gs.*, pgs.platformId as platformId, pgs.catalogId as catalogId FROM gb_stream gs " + @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}") "WHERE pgs.platformId = #{platformId}")
List<GbStream> queryGbStreamListInPlatform(String platformId); List<GbStream> queryGbStreamListInPlatform(String platformId);
@Select("SELECT gs.* FROM gb_stream gs LEFT JOIN platform_gb_stream pgs " + @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(); List<GbStream> queryStreamNotInPlatform();
@Update("UPDATE gb_stream " + @Update("UPDATE gb_stream " +

View File

@ -17,7 +17,7 @@ import java.util.List;
public interface PlatformGbStreamMapper { public interface PlatformGbStreamMapper {
@Insert("REPLACE INTO platform_gb_stream (gbStreamId, platformId, catalogId) VALUES" + @Insert("REPLACE INTO platform_gb_stream (gbStreamId, platformId, catalogId) VALUES" +
"( #{gbStreamId}, #{platformId}, #{catalogId})") "( #{gbId}, #{platformId}, #{catalogId})")
int add(PlatformGbStream platformGbStream); int add(PlatformGbStream platformGbStream);
@ -26,12 +26,12 @@ public interface PlatformGbStreamMapper {
"(gbStreamId, platformId, catalogId) " + "(gbStreamId, platformId, catalogId) " +
"values " + "values " +
"<foreach collection='streamPushItems' index='index' item='item' separator=','> " + "<foreach collection='streamPushItems' index='index' item='item' separator=','> " +
"(${item.gbStreamId}, '${item.platformId}', '${item.catalogId}')" + "(#{item.gbId}, #{item.platformId}, #{item.catalogId})" +
"</foreach> " + "</foreach> " +
"</script>") "</script>")
int batchAdd(List<StreamPushItem> streamPushItems); 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); int delByAppAndStream(String app, String stream);
@Delete("DELETE FROM platform_gb_stream WHERE platformId=#{platformId}") @Delete("DELETE FROM platform_gb_stream WHERE platformId=#{platformId}")
@ -42,28 +42,28 @@ public interface PlatformGbStreamMapper {
"FROM " + "FROM " +
"platform_gb_stream pgs " + "platform_gb_stream pgs " +
"LEFT JOIN parent_platform pp ON pp.serverGBId = pgs.platformId " + "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 " + "WHERE " +
"gs.app =#{app} " + "gs.app =#{app} " +
"AND gs.stream =#{stream} ") "AND gs.stream =#{stream} ")
List<ParentPlatform> selectByAppAndStream(String app, String stream); List<ParentPlatform> selectByAppAndStream(String app, String stream);
@Select("SELECT pgs.*, gs.gbId FROM platform_gb_stream pgs " + @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}") "WHERE gs.app=#{app} AND gs.stream=#{stream} AND pgs.platformId=#{serverGBId}")
StreamProxyItem selectOne(String app, String stream, String serverGBId); StreamProxyItem selectOne(String app, String stream, String serverGBId);
@Select("select gs.* \n" + @Select("select gs.* \n" +
"from gb_stream gs\n" + "from gb_stream gs\n" +
" left join platform_gb_stream pgs\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}") "where pgs.platformId=#{platformId} and pgs.catalogId=#{catalogId}")
List<GbStream> queryChannelInParentPlatformAndCatalog(String platformId, String 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" + @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" + "from gb_stream gs\n" +
" left join platform_gb_stream pgs\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}") "where pgs.platformId=#{platformId} and pgs.catalogId=#{catalogId}")
List<PlatformCatalog> queryChannelInParentPlatformAndCatalogForCatalog(String platformId, String catalogId); List<PlatformCatalog> queryChannelInParentPlatformAndCatalogForCatalog(String platformId, String catalogId);
@ -78,7 +78,7 @@ public interface PlatformGbStreamMapper {
"left join platform_gb_stream pgs on " + "left join platform_gb_stream pgs on " +
"pp.serverGBId = pgs.platformId " + "pp.serverGBId = pgs.platformId " +
"left join gb_stream gs " + "left join gb_stream gs " +
"gs.gbStreamId = pgs.gbStreamId " + "gs.gbId = pgs.gbStreamId " +
"WHERE " + "WHERE " +
"gs.app = #{app} " + "gs.app = #{app} " +
"AND gs.stream = #{stream}" + "AND gs.stream = #{stream}" +
@ -87,13 +87,13 @@ public interface PlatformGbStreamMapper {
"</script> ") "</script> ")
List<ParentPlatform> queryPlatFormListForGBWithGBId(String app, String stream, List<String> platforms); 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); int delByAppAndStreamAndPlatform(String app, String stream, String platformId);
@Delete("<script> "+ @Delete("<script> "+
"DELETE FROM platform_gb_stream where gbStreamId in " + "DELETE FROM platform_gb_stream where gbStreamId in " +
"<foreach collection='gbStreams' item='item' open='(' separator=',' close=')' >" + "<foreach collection='gbStreams' item='item' open='(' separator=',' close=')' >" +
"#{item.gbStreamId}" + "#{item.gbId}" +
"</foreach>" + "</foreach>" +
"</script>") "</script>")
void delByGbStreams(List<GbStream> gbStreams); void delByGbStreams(List<GbStream> gbStreams);
@ -101,7 +101,7 @@ public interface PlatformGbStreamMapper {
@Delete("<script> "+ @Delete("<script> "+
"DELETE FROM platform_gb_stream where platformId=#{platformId} and gbStreamId in " + "DELETE FROM platform_gb_stream where platformId=#{platformId} and gbStreamId in " +
"<foreach collection='gbStreams' item='item' open='(' separator=',' close=')'>" + "<foreach collection='gbStreams' item='item' open='(' separator=',' close=')'>" +
"#{item.gbStreamId} " + "#{item.gbId} " +
"</foreach>" + "</foreach>" +
"</script>") "</script>")
void delByAppAndStreamsByPlatformId(List<GbStream> gbStreams, String platformId); void delByAppAndStreamsByPlatformId(List<GbStream> gbStreams, String platformId);

View File

@ -707,7 +707,7 @@ public class VideoManagerStoragerImpl implements IVideoManagerStorager {
try { try {
if (streamProxyMapper.add(streamProxyItem) > 0) { if (streamProxyMapper.add(streamProxyItem) > 0) {
if (!StringUtils.isEmpty(streamProxyItem.getGbId())) { if (!StringUtils.isEmpty(streamProxyItem.getGbId())) {
if (gbStreamMapper.add(streamProxyItem) > 0) { if (gbStreamMapper.add(streamProxyItem) < 0) {
//事务回滚 //事务回滚
dataSourceTransactionManager.rollback(transactionStatus); dataSourceTransactionManager.rollback(transactionStatus);
return false; return false;
@ -742,7 +742,7 @@ public class VideoManagerStoragerImpl implements IVideoManagerStorager {
try { try {
if (streamProxyMapper.update(streamProxyItem) > 0) { if (streamProxyMapper.update(streamProxyItem) > 0) {
if (!StringUtils.isEmpty(streamProxyItem.getGbId())) { if (!StringUtils.isEmpty(streamProxyItem.getGbId())) {
if (gbStreamMapper.update(streamProxyItem) > 0) { if (gbStreamMapper.update(streamProxyItem) < 0) {
//事务回滚 //事务回滚
dataSourceTransactionManager.rollback(transactionStatus); dataSourceTransactionManager.rollback(transactionStatus);
return false; return false;