临时提交

This commit is contained in:
panlinlin
2024-08-10 23:27:21 +08:00
parent d8d9f76d89
commit 76a0d248ef
65 changed files with 421 additions and 601 deletions

View File

@@ -1,66 +0,0 @@
package com.genersoft.iot.vmp.gb28181.dao;
import com.genersoft.iot.vmp.gb28181.bean.DeviceChannel;
import com.genersoft.iot.vmp.gb28181.bean.PlatformCatalog;
import org.apache.ibatis.annotations.*;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository;
import java.util.List;
@Mapper
@Repository
public interface PlatformCatalogMapper {
@Insert("INSERT INTO wvp_platform_catalog (id, name, platform_id, parent_id, civil_code, business_group_id) VALUES" +
"(#{id}, #{name}, #{platformId}, #{parentId}, #{civilCode}, #{businessGroupId})")
int add(PlatformCatalog platformCatalog);
@Delete("DELETE from wvp_platform_catalog WHERE platform_id=#{platformId} and id=#{id}")
int del(@Param("platformId") String platformId, @Param("id") String id);
@Delete("DELETE from wvp_platform_catalog WHERE platform_id=#{platformId}")
int delByPlatformId(@Param("platformId") String platformId);
@Select("SELECT pc.*, count(pc2.id) as children_count from wvp_platform_catalog pc " +
"left join wvp_platform_catalog pc2 on pc.id = pc2.parent_id " +
"WHERE pc.parent_id=#{parentId} AND pc.platform_id=#{platformId} " +
"group by pc.id, pc.name, pc.platform_id, pc.business_group_id, pc.civil_code, pc.parent_id")
List<PlatformCatalog> selectByParentId(@Param("platformId") String platformId, @Param("parentId") String parentId);
@Update(value = {" <script>" +
"UPDATE wvp_platform_catalog " +
"SET name=#{platformCatalog.name}" +
"WHERE id=#{platformCatalog.id} and platform_id=#{platformCatalog.platformId}"+
"</script>"})
int update(@Param("platformCatalog") PlatformCatalog platformCatalog);
@Select("SELECT *, (SELECT COUNT(1) from wvp_platform_catalog where parent_id = pc.id) as children_count from wvp_platform_catalog pc WHERE pc.platform_id=#{platformId}")
List<PlatformCatalog> selectByPlatForm(@Param("platformId") String platformId);
@Select("SELECT pc.* FROM wvp_platform_catalog pc WHERE pc.id = (SELECT pp.catalog_id from wvp_platform pp WHERE pp.server_gb_id=#{platformId})")
PlatformCatalog selectDefaultByPlatFormId(@Param("platformId") String platformId);
@Select("SELECT pc.id as channel_id, pc.name, pc.civil_code, pc.business_group_id,'1' as parental, pc.parent_id " +
" from wvp_platform_catalog pc WHERE pc.platform_id=#{platformId}")
List<DeviceChannel> queryCatalogInPlatform(@Param("platformId") String platformId);
@Select("SELECT *, " +
"(SELECT COUNT(1) from wvp_platform_catalog where parent_id = pc.id) as children_count " +
" from wvp_platform_catalog pc " +
" WHERE pc.id=#{id} and pc.platform_id=#{platformId}")
PlatformCatalog selectByPlatFormAndCatalogId(@Param("platformId") String platformId, @Param("id") String id);
@Delete("<script> "+
"DELETE from wvp_platform_catalog where platform_id=#{platformId} and id in " +
"<foreach collection='ids' item='item' open='(' separator=',' close=')'>" +
"#{item} " +
"</foreach>" +
"</script>")
int deleteAll(String platformId, List<String> ids);
@Select("SELECT id from wvp_platform_catalog WHERE platform_id=#{platformId} and parent_id = #{id}")
List<String> queryCatalogFromParent(@Param("id") String id, @Param("platformId") String platformId);
}

View File

@@ -97,7 +97,7 @@ public interface PlatformChannelMapper {
"AND pp.server_gb_id IN" +
"<foreach collection='platforms' item='item' open='(' separator=',' close=')' > #{item}</foreach>" +
"</script> ")
List<ParentPlatform> queryPlatFormListForGBWithGBId(@Param("channelId") String channelId, @Param("platforms") List<String> platforms);
List<Platform> queryPlatFormListForGBWithGBId(@Param("channelId") String channelId, @Param("platforms") List<String> platforms);
@Delete("<script> " +
"DELETE from wvp_platform_gb_channel WHERE platform_id=#{serverGBId}" +

View File

@@ -1,114 +0,0 @@
package com.genersoft.iot.vmp.gb28181.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.streamProxy.bean.StreamProxy;
import com.genersoft.iot.vmp.streamPush.bean.StreamPush;
import org.apache.ibatis.annotations.*;
import org.springframework.stereotype.Repository;
import java.util.List;
@Mapper
@Repository
public interface PlatformGbStreamMapper {
@Insert("INSERT INTO wvp_platform_gb_stream (gb_stream_id, platform_id, catalog_id) VALUES" +
"( #{gbStreamId}, #{platformId}, #{catalogId})")
int add(PlatformGbStream platformGbStream);
@Insert("<script> " +
"INSERT into wvp_platform_gb_stream " +
"(gb_stream_id, platform_id, catalog_id) " +
"values " +
"<foreach collection='streamPushItems' index='index' item='item' separator=','> " +
"(#{item.gbStreamId}, #{item.platform_id}, #{item.catalogId})" +
"</foreach> " +
"</script>")
int batchAdd(List<StreamPush> streamPushItems);
@Delete("DELETE from wvp_platform_gb_stream WHERE gb_stream_id = (select gb_stream_id from wvp_gb_stream where app=#{app} AND stream=#{stream})")
int delByAppAndStream(@Param("app") String app, @Param("stream") String stream);
@Delete("DELETE from wvp_platform_gb_stream WHERE platform_id=#{platformId}")
int delByPlatformId(String platformId);
@Select("SELECT " +
"pp.* " +
"FROM " +
"wvp_platform_gb_stream pgs " +
"LEFT JOIN wvp_platform pp ON pp.server_gb_id = pgs.platform_id " +
"LEFT join wvp_gb_stream gs ON gs.gb_stream_id = pgs.gb_stream_id " +
"WHERE " +
"gs.app =#{app} " +
"AND gs.stream =#{stream} ")
List<ParentPlatform> selectByAppAndStream(@Param("app") String app, @Param("stream") String stream);
@Select("SELECT pgs.*, gs.gb_id from wvp_platform_gb_stream pgs " +
"LEFT join wvp_gb_stream gs ON pgs.gb_stream_id = gs.gb_stream_id " +
"WHERE gs.app=#{app} AND gs.stream=#{stream} AND pgs.platform_id=#{platformId}")
StreamProxy selectOne(@Param("app") String app, @Param("stream") String stream, @Param("platformId") String platformId);
@Select("<script> " +
"select gs.* " +
" from wvp_gb_stream gs\n" +
" left join wvp_platform_gb_stream pgs\n" +
" on gs.gb_stream_id = pgs.gb_stream_id\n" +
" where pgs.platform_id=#{platformId} " +
" <if test='catalogId != null' > and pgs.catalog_id=#{catalogId}</if>" +
"</script>")
List<GbStream> queryChannelInParentPlatformAndCatalog(@Param("platformId") String platformId, @Param("catalogId") String catalogId);
@Select("select gs.gb_id as id, gs.name as name, pgs.platform_id as platform_id, pgs.catalog_id as catalog_id , 0 as children_count, 2 as type\n" +
"from wvp_gb_stream gs\n" +
" left join wvp_platform_gb_stream pgs\n" +
" on gs.gb_stream_id = pgs.gb_stream_id\n" +
"where pgs.platform_id=#{platformId} and pgs.catalog_id=#{catalogId}")
List<PlatformCatalog> queryChannelInParentPlatformAndCatalogForCatalog(@Param("platformId") String platformId, @Param("catalogId") String catalogId);
@Select("<script> " +
"SELECT " +
"pp.* " +
"FROM " +
"wvp_platform pp " +
"left join wvp_platform_gb_stream pgs on " +
"pp.server_gb_id = pgs.platform_id " +
"left join wvp_gb_stream gs " +
"on gs.gb_stream_id = pgs.gb_stream_id " +
"WHERE " +
"gs.app = #{app} " +
"AND gs.stream = #{stream}" +
"AND pp.server_gb_id IN" +
"<foreach collection='platforms' item='item' open='(' separator=',' close=')' > #{item}</foreach>" +
"</script> ")
List<ParentPlatform> queryPlatFormListForGBWithGBId(@Param("app") String app, @Param("stream") String stream, @Param("platforms") List<String> platforms);
@Delete("DELETE from wvp_platform_gb_stream WHERE gb_stream_id = (select id from wvp_gb_stream where app=#{app} AND stream=#{stream}) AND platform_id=#{platformId}")
int delByAppAndStreamAndPlatform(String app, String stream, String platformId);
@Delete("<script> "+
"DELETE from wvp_platform_gb_stream where gb_stream_id in " +
"<foreach collection='gbStreams' item='item' open='(' separator=',' close=')' >" +
"#{item.gbStreamId}" +
"</foreach>" +
"</script>")
void delByGbStreams(List<GbStream> gbStreams);
@Delete("<script> "+
"DELETE from wvp_platform_gb_stream where platform_id=#{platformId} and gb_stream_id in " +
"<foreach collection='gbStreams' item='item' open='(' separator=',' close=')'>" +
"#{item.gbStreamId} " +
"</foreach>" +
"</script>")
void delByAppAndStreamsByPlatformId(@Param("gbStreams") List<GbStream> gbStreams, @Param("platformId") String platformId);
@Delete("<script> "+
"DELETE from wvp_platform_gb_stream WHERE platform_id=#{platformId}" +
" <if test='catalogId != null' > and catalog_id=#{catalogId}</if>" +
"</script>")
int delByPlatformAndCatalogId(@Param("platformId") String platformId, @Param("catalogId") String catalogId);
}

View File

@@ -1,6 +1,6 @@
package com.genersoft.iot.vmp.gb28181.dao;
import com.genersoft.iot.vmp.gb28181.bean.ParentPlatform;
import com.genersoft.iot.vmp.gb28181.bean.Platform;
import com.genersoft.iot.vmp.storager.dao.dto.ChannelSourceInfo;
import org.apache.ibatis.annotations.*;
import org.apache.ibatis.annotations.Param;
@@ -13,15 +13,15 @@ import java.util.List;
*/
@Mapper
@Repository
public interface ParentPlatformMapper {
public interface PlatformMapper {
@Insert("INSERT INTO wvp_platform (enable, name, server_gb_id, server_gb_domain, server_ip, server_port,device_gb_id,device_ip,"+
"device_port,username,password,expires,keep_timeout,transport,character_set,ptz,rtcp,as_message_channel,auto_push_channel,"+
"status,start_offline_push,catalog_id,administrative_division,catalog_group,create_time,update_time,send_stream_ip) " +
"status,catalog_id,administrative_division,catalog_group,create_time,update_time,send_stream_ip) " +
" VALUES (#{enable}, #{name}, #{serverGBId}, #{serverGBDomain}, #{serverIP}, #{serverPort}, #{deviceGBId}, #{deviceIp}, " +
" #{devicePort}, #{username}, #{password}, #{expires}, #{keepTimeout}, #{transport}, #{characterSet}, #{ptz}, #{rtcp}, #{asMessageChannel}, #{autoPushChannel}, " +
" #{status}, #{startOfflinePush}, #{catalogId}, #{administrativeDivision}, #{catalogGroup}, #{createTime}, #{updateTime}, #{sendStreamIp})")
int addParentPlatform(ParentPlatform parentPlatform);
" #{status}, #{catalogId}, #{administrativeDivision}, #{catalogGroup}, #{createTime}, #{updateTime}, #{sendStreamIp})")
int addParentPlatform(Platform parentPlatform);
@Update("UPDATE wvp_platform " +
"SET enable=#{enable}, " +
@@ -44,7 +44,6 @@ public interface ParentPlatformMapper {
"as_message_channel=#{asMessageChannel}, " +
"auto_push_channel=#{autoPushChannel}, " +
"status=#{status}, " +
"start_offline_push=#{startOfflinePush}, " +
"catalog_group=#{catalogGroup}, " +
"administrative_division=#{administrativeDivision}, " +
"create_time=#{createTime}, " +
@@ -52,10 +51,10 @@ public interface ParentPlatformMapper {
"send_stream_ip=#{sendStreamIp}, " +
"catalog_id=#{catalogId} " +
"WHERE id=#{id}")
int updateParentPlatform(ParentPlatform parentPlatform);
int updateParentPlatform(Platform parentPlatform);
@Delete("DELETE FROM wvp_platform WHERE server_gb_id=#{serverGBId}")
int delParentPlatform(ParentPlatform parentPlatform);
int delParentPlatform(Platform parentPlatform);
@Select("SELECT *, ((SELECT count(0)\n" +
" FROM wvp_platform_gb_channel pc\n" +
@@ -69,19 +68,19 @@ public interface ParentPlatformMapper {
" FROM wvp_platform_catalog pgc\n" +
" WHERE pgc.platform_id = pp.server_gb_id)) as channel_count\n" +
"FROM wvp_platform pp ")
List<ParentPlatform> getParentPlatformList();
List<Platform> getParentPlatformList();
@Select("SELECT * FROM wvp_platform WHERE enable=#{enable} ")
List<ParentPlatform> getEnableParentPlatformList(boolean enable);
List<Platform> getEnableParentPlatformList(boolean enable);
@Select("SELECT * FROM wvp_platform WHERE enable=true and as_message_channel=true")
List<ParentPlatform> queryEnablePlatformListWithAsMessageChannel();
List<Platform> queryEnablePlatformListWithAsMessageChannel();
@Select("SELECT * FROM wvp_platform WHERE server_gb_id=#{platformGbId}")
ParentPlatform getParentPlatByServerGBId(String platformGbId);
Platform getParentPlatByServerGBId(String platformGbId);
@Select("SELECT * FROM wvp_platform WHERE id=#{id}")
ParentPlatform getParentPlatById(int id);
Platform getParentPlatById(int id);
@Update("UPDATE wvp_platform SET status=false" )
int outlineForAllParentPlatform();