国标级联通道共享重构完善
This commit is contained in:
@@ -507,6 +507,55 @@ public interface CommonGBChannelMapper {
|
||||
List<CommonGBChannel> queryShareChannelByParentId(@Param("parentId") String parentId, @Param("platformId") Integer platformId);
|
||||
|
||||
|
||||
@Select("select\n" +
|
||||
" wdc.id as gb_id,\n" +
|
||||
" wdc.device_db_id as gb_device_db_id,\n" +
|
||||
" wdc.stream_push_id,\n" +
|
||||
" wdc.stream_proxy_id,\n" +
|
||||
" wdc.create_time,\n" +
|
||||
" wdc.update_time,\n" +
|
||||
" coalesce(wpgc.device_id, wdc.gb_device_id, wdc.device_id) as gb_device_id,\n" +
|
||||
" coalesce(wpgc.name, wdc.gb_name, wdc.name) as gb_name,\n" +
|
||||
" coalesce(wpgc.manufacturer, wdc.gb_manufacturer, wdc.manufacturer) as gb_manufacturer,\n" +
|
||||
" coalesce(wpgc.model, wdc.gb_model, wdc.model) as gb_model,\n" +
|
||||
" coalesce(wpgc.owner, wdc.gb_owner, wdc.owner) as gb_owner,\n" +
|
||||
" coalesce(wpgc.civil_code, wdc.gb_civil_code, wdc.civil_code) as gb_civil_code,\n" +
|
||||
" coalesce(wpgc.block, wdc.gb_block, wdc.block) as gb_block,\n" +
|
||||
" coalesce(wpgc.address, wdc.gb_address, wdc.address) as gb_address,\n" +
|
||||
" coalesce(wpgc.parental, wdc.gb_parental, wdc.parental) as gb_parental,\n" +
|
||||
" coalesce(wpgc.parent_id, wdc.gb_parent_id, wdc.parent_id) as gb_parent_id,\n" +
|
||||
" coalesce(wpgc.safety_way, wdc.gb_safety_way, wdc.safety_way) as gb_safety_way,\n" +
|
||||
" coalesce(wpgc.register_way, wdc.gb_register_way, wdc.register_way) as gb_register_way,\n" +
|
||||
" coalesce(wpgc.cert_num, wdc.gb_cert_num, wdc.cert_num) as gb_cert_num,\n" +
|
||||
" coalesce(wpgc.certifiable, wdc.gb_certifiable, wdc.certifiable) as gb_certifiable,\n" +
|
||||
" coalesce(wpgc.err_code, wdc.gb_err_code, wdc.err_code) as gb_err_code,\n" +
|
||||
" coalesce(wpgc.end_time, wdc.gb_end_time, wdc.end_time) as gb_end_time,\n" +
|
||||
" coalesce(wpgc.secrecy, wdc.gb_secrecy, wdc.secrecy) as gb_secrecy,\n" +
|
||||
" coalesce(wpgc.ip_address, wdc.gb_ip_address, wdc.ip_address) as gb_ip_address,\n" +
|
||||
" coalesce(wpgc.port, wdc.gb_port, wdc.port) as gb_port,\n" +
|
||||
" coalesce(wpgc.password, wdc.gb_password, wdc.password) as gb_password,\n" +
|
||||
" coalesce(wpgc.status, wdc.gb_status, wdc.status) as gb_status,\n" +
|
||||
" coalesce(wpgc.longitude, wdc.gb_longitude, wdc.longitude) as gb_longitude,\n" +
|
||||
" coalesce(wpgc.latitude, wdc.gb_latitude, wdc.latitude) as gb_latitude,\n" +
|
||||
" coalesce(wpgc.ptz_type, wdc.gb_ptz_type, wdc.ptz_type) as gb_ptz_type,\n" +
|
||||
" coalesce(wpgc.position_type, wdc.gb_position_type, wdc.position_type) as gb_position_type,\n" +
|
||||
" coalesce(wpgc.room_type, wdc.gb_room_type, wdc.room_type) as gb_room_type,\n" +
|
||||
" coalesce(wpgc.use_type, wdc.gb_use_type, wdc.use_type) as gb_use_type,\n" +
|
||||
" coalesce(wpgc.supply_light_type, wdc.gb_supply_light_type, wdc.supply_light_type) as gb_supply_light_type,\n" +
|
||||
" coalesce(wpgc.direction_type, wdc.gb_direction_type, wdc.direction_type) as gb_direction_type,\n" +
|
||||
" coalesce(wpgc.resolution, wdc.gb_resolution, wdc.resolution) as gb_resolution,\n" +
|
||||
" coalesce(wpgc.business_group_id, wdc.gb_business_group_id, wdc.business_group_id) as gb_business_group_id,\n" +
|
||||
" coalesce(wpgc.download_speed, wdc.gb_download_speed, wdc.download_speed) as gb_download_speed,\n" +
|
||||
" coalesce(wpgc.svc_space_support_mod, wdc.gb_svc_space_support_mod, wdc.svc_space_support_mod) as gb_svc_space_support_mod,\n" +
|
||||
" coalesce(wpgc.svc_time_support_mode, wdc.gb_svc_time_support_mode, wdc.svc_time_support_mode) as gb_svc_time_support_mode\n" +
|
||||
" from wvp_device_channel wdc" +
|
||||
" left join wvp_platform_channel wpgc on wdc.id = wpgc.device_channel_id " +
|
||||
" where wpgc.platform_id = #{platformId} and coalesce(wpgc.civil_code, wdc.gb_civil_code, wdc.civil_code) = #{civilCode}"
|
||||
|
||||
)
|
||||
List<CommonGBChannel> queryShareChannelByCivilCode(@Param("civilCode") String civilCode, @Param("platformId") Integer platformId);
|
||||
|
||||
|
||||
@Update(value = {" <script>" +
|
||||
" UPDATE wvp_device_channel " +
|
||||
" SET gb_civil_code = #{civilCode}" +
|
||||
|
||||
@@ -165,7 +165,7 @@ public interface GroupMapper {
|
||||
" where wpg.platform_id is null and wcg.device_id in " +
|
||||
" <foreach collection='channelList' item='item' open='(' separator=',' close=')' > #{item.gbParentId}</foreach>" +
|
||||
" </script>")
|
||||
Set<Group> queryNotShareForPlatformByChannelList(List<CommonGBChannel> channelList, @Param("platformId") Integer platformId);
|
||||
Set<Group> queryNotShareGroupForPlatformByChannelList(List<CommonGBChannel> channelList, @Param("platformId") Integer platformId);
|
||||
|
||||
@Select(" <script>" +
|
||||
" SELECT * " +
|
||||
@@ -174,7 +174,8 @@ public interface GroupMapper {
|
||||
" where wpg.platform_id IS NULL and wcg.id in " +
|
||||
" <foreach collection='allGroup' item='item' open='(' separator=',' close=')' > #{item.id}</foreach>" +
|
||||
" </script>")
|
||||
Set<Group> queryNotShareForPlatformByGroupList(Set<Group> allGroup, @Param("platformId") Integer platformId);
|
||||
Set<Group> queryNotShareGroupForPlatformByGroupList(Set<Group> allGroup, @Param("platformId") Integer platformId);
|
||||
|
||||
|
||||
@Select(" <script>" +
|
||||
" SELECT " +
|
||||
@@ -182,7 +183,8 @@ public interface GroupMapper {
|
||||
" from wvp_common_group " +
|
||||
" where device_id in " +
|
||||
" <foreach collection='channelList' item='item' open='(' separator=',' close=')' > #{item.gbParentId}</foreach>" +
|
||||
" </script>")
|
||||
" order by id " +
|
||||
"</script>")
|
||||
Set<Group> queryByChannelList(List<CommonGBChannel> channelList);
|
||||
|
||||
@Update(" <script>" +
|
||||
|
||||
@@ -134,7 +134,7 @@ public interface PlatformChannelMapper {
|
||||
" coalesce(wpgc.manufacturer, wdc.gb_manufacturer, wdc.manufacturer) as gb_manufacturer,\n" +
|
||||
" coalesce(wpgc.model, wdc.gb_model, wdc.model) as gb_model,\n" +
|
||||
" coalesce(wpgc.owner, wdc.gb_owner, wdc.owner) as gb_owner,\n" +
|
||||
" coalesce(wpgc.civil_code, wdc.gb_civil_code, wdc.civil_code),\n" +
|
||||
" coalesce(wpgc.civil_code, wdc.gb_civil_code, wdc.civil_code) as gb_civil_code,\n" +
|
||||
" coalesce(wpgc.block, wdc.gb_block, wdc.block) as gb_block,\n" +
|
||||
" coalesce(wpgc.address, wdc.gb_address, wdc.address) as gb_address,\n" +
|
||||
" coalesce(wpgc.parental, wdc.gb_parental, wdc.parental) as gb_parental,\n" +
|
||||
@@ -190,7 +190,7 @@ public interface PlatformChannelMapper {
|
||||
" coalesce(wpgc.manufacturer, wdc.gb_manufacturer, wdc.manufacturer) as gb_manufacturer,\n" +
|
||||
" coalesce(wpgc.model, wdc.gb_model, wdc.model) as gb_model,\n" +
|
||||
" coalesce(wpgc.owner, wdc.gb_owner, wdc.owner) as gb_owner,\n" +
|
||||
" coalesce(wpgc.civil_code, wdc.gb_civil_code, wdc.civil_code),\n" +
|
||||
" coalesce(wpgc.civil_code, wdc.gb_civil_code, wdc.civil_code) as gb_civil_code,\n" +
|
||||
" coalesce(wpgc.block, wdc.gb_block, wdc.block) as gb_block,\n" +
|
||||
" coalesce(wpgc.address, wdc.gb_address, wdc.address) as gb_address,\n" +
|
||||
" coalesce(wpgc.parental, wdc.gb_parental, wdc.parental) as gb_parental,\n" +
|
||||
@@ -240,7 +240,7 @@ public interface PlatformChannelMapper {
|
||||
" coalesce(wpgc.manufacturer, wdc.gb_manufacturer, wdc.manufacturer) as gb_manufacturer,\n" +
|
||||
" coalesce(wpgc.model, wdc.gb_model, wdc.model) as gb_model,\n" +
|
||||
" coalesce(wpgc.owner, wdc.gb_owner, wdc.owner) as gb_owner,\n" +
|
||||
" coalesce(wpgc.civil_code, wdc.gb_civil_code, wdc.civil_code),\n" +
|
||||
" coalesce(wpgc.civil_code, wdc.gb_civil_code, wdc.civil_code) as gb_civil_code,\n" +
|
||||
" coalesce(wpgc.block, wdc.gb_block, wdc.block) as gb_block,\n" +
|
||||
" coalesce(wpgc.address, wdc.gb_address, wdc.address) as gb_address,\n" +
|
||||
" coalesce(wpgc.parental, wdc.gb_parental, wdc.parental) as gb_parental,\n" +
|
||||
@@ -291,7 +291,7 @@ public interface PlatformChannelMapper {
|
||||
" coalesce(wpgc.manufacturer, wdc.gb_manufacturer, wdc.manufacturer) as gb_manufacturer,\n" +
|
||||
" coalesce(wpgc.model, wdc.gb_model, wdc.model) as gb_model,\n" +
|
||||
" coalesce(wpgc.owner, wdc.gb_owner, wdc.owner) as gb_owner,\n" +
|
||||
" coalesce(wpgc.civil_code, wdc.gb_civil_code, wdc.civil_code),\n" +
|
||||
" coalesce(wpgc.civil_code, wdc.gb_civil_code, wdc.civil_code) as gb_civil_code,\n" +
|
||||
" coalesce(wpgc.block, wdc.gb_block, wdc.block) as gb_block,\n" +
|
||||
" coalesce(wpgc.address, wdc.gb_address, wdc.address) as gb_address,\n" +
|
||||
" coalesce(wpgc.parental, wdc.gb_parental, wdc.parental) as gb_parental,\n" +
|
||||
@@ -349,6 +349,14 @@ public interface PlatformChannelMapper {
|
||||
"</script>")
|
||||
int addPlatformGroup(List<Group> groupListNotShare, @Param("platformId") Integer platformId);
|
||||
|
||||
@Insert("<script> "+
|
||||
"INSERT INTO wvp_platform_region (platform_id, region_id) VALUES " +
|
||||
"<foreach collection='regionListNotShare' item='item' separator=','>" +
|
||||
" (#{platformId}, #{item.id} )" +
|
||||
"</foreach>" +
|
||||
"</script>")
|
||||
int addPlatformRegion(List<Region> regionListNotShare, @Param("platformId") Integer platformId);
|
||||
|
||||
@Delete("<script> "+
|
||||
"DELETE from wvp_platform_group WHERE platform_id=#{platformId} AND group_id in" +
|
||||
"<foreach collection='groupList' item='item' open='(' separator=',' close=')' > #{item.id}</foreach>" +
|
||||
@@ -360,6 +368,11 @@ public interface PlatformChannelMapper {
|
||||
"</script>")
|
||||
void removePlatformGroupById(@Param("id") int id, @Param("platformId") Integer platformId);
|
||||
|
||||
@Delete("<script> "+
|
||||
"DELETE from wvp_platform_region WHERE platform_id=#{platformId} AND region_id =#{id}" +
|
||||
"</script>")
|
||||
void removePlatformRegionById(@Param("id") int id, @Param("platformId") Integer platformId);
|
||||
|
||||
@Select(" <script>" +
|
||||
" SELECT wcg.* " +
|
||||
" from wvp_common_group wcg" +
|
||||
@@ -368,12 +381,29 @@ public interface PlatformChannelMapper {
|
||||
" </script>")
|
||||
Set<Group> queryShareChildrenGroup(@Param("parentId") String parentId, @Param("platformId") Integer platformId);
|
||||
|
||||
@Select(" <script>" +
|
||||
" SELECT wcr.* " +
|
||||
" from wvp_common_region wcr" +
|
||||
" left join wvp_platform_region wpr on wpr.region_id = wcr.id and wpr.platform_id = #{platformId}" +
|
||||
" where wpr.platform_id IS NOT NULL and wcr.parent_device_id = #{parentId} " +
|
||||
" </script>")
|
||||
Set<Region> queryShareChildrenRegion(@Param("parentId") String parentId, @Param("platformId") Integer platformId);
|
||||
|
||||
@Select(" <script>" +
|
||||
" SELECT wcg.* " +
|
||||
" from wvp_common_group wcg" +
|
||||
" left join wvp_platform_group wpg on wpg.group_id = wcg.id and wpg.platform_id = #{platformId}" +
|
||||
" where wpg.platform_id is not null and wcg.parent_device_id in " +
|
||||
"<foreach collection='groupSet' item='item' open='(' separator=',' close=')' > #{item.deviceId}</foreach>" +
|
||||
" where wpg.platform_id is not null and wcg.id in " +
|
||||
"<foreach collection='groupSet' item='item' open='(' separator=',' close=')' > #{item.parentId}</foreach>" +
|
||||
" </script>")
|
||||
Set<Group> queryShareParentGroupByGroupSet(Set<Group> groupSet, @Param("platformId") Integer platformId);
|
||||
|
||||
@Select(" <script>" +
|
||||
" SELECT wcr.* " +
|
||||
" from wvp_common_region wcr" +
|
||||
" left join wvp_platform_region wpr on wpr.region_id = wcr.id and wpr.platform_id = #{platformId}" +
|
||||
" where wpr.platform_id is not null and wcr.id in " +
|
||||
"<foreach collection='regionSet' item='item' open='(' separator=',' close=')' > #{item.parentId}</foreach>" +
|
||||
" </script>")
|
||||
Set<Region> queryShareParentRegionByRegionSet(Set<Region> regionSet, @Param("platformId") Integer platformId);
|
||||
}
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
package com.genersoft.iot.vmp.gb28181.dao;
|
||||
|
||||
import com.genersoft.iot.vmp.gb28181.bean.CommonGBChannel;
|
||||
import com.genersoft.iot.vmp.gb28181.bean.Group;
|
||||
import com.genersoft.iot.vmp.gb28181.bean.Region;
|
||||
import com.genersoft.iot.vmp.gb28181.bean.RegionTree;
|
||||
import org.apache.ibatis.annotations.*;
|
||||
@@ -123,4 +124,42 @@ public interface RegionMapper {
|
||||
|
||||
@Select("SELECT * from wvp_common_region WHERE device_id = #{deviceId} ")
|
||||
Region queryByDeviceId(@Param("deviceId") String deviceId);
|
||||
|
||||
@Select(" <script>" +
|
||||
" SELECT " +
|
||||
" * " +
|
||||
" from wvp_common_region " +
|
||||
" where id in " +
|
||||
" <foreach collection='regionSet' item='item' open='(' separator=',' close=')' > #{item.parentId}</foreach>" +
|
||||
" </script>")
|
||||
Set<Region> queryParentInChannelList(Set<Region> regionSet);
|
||||
|
||||
@Select(" <script>" +
|
||||
" SELECT " +
|
||||
" * " +
|
||||
" from wvp_common_region " +
|
||||
" where device_id in " +
|
||||
" <foreach collection='channelList' item='item' open='(' separator=',' close=')' > #{item.gbCivilCode}</foreach>" +
|
||||
" order by id " +
|
||||
"</script>")
|
||||
Set<Region> queryByChannelList(List<CommonGBChannel> channelList);
|
||||
|
||||
@Select(" <script>" +
|
||||
" SELECT * " +
|
||||
" from wvp_common_region wcr" +
|
||||
" left join wvp_platform_region wpr on wpr.region_id = wcr.id and wpr.platform_id = #{platformId}" +
|
||||
" where wpr.platform_id is null and wcr.device_id in " +
|
||||
" <foreach collection='channelList' item='item' open='(' separator=',' close=')' > #{item.gbCivilCode}</foreach>" +
|
||||
" </script>")
|
||||
Set<Region> queryNotShareRegionForPlatformByChannelList(List<CommonGBChannel> channelList, @Param("platformId") Integer platformId);
|
||||
|
||||
@Select(" <script>" +
|
||||
" SELECT * " +
|
||||
" from wvp_common_region wcr" +
|
||||
" left join wvp_platform_region wpr on wpr.region_id = wcr.id and wpr.platform_id = #{platformId}" +
|
||||
" where wpr.platform_id IS NULL and wcr.id in " +
|
||||
" <foreach collection='allRegion' item='item' open='(' separator=',' close=')' > #{item.id}</foreach>" +
|
||||
" </script>")
|
||||
Set<Region> queryNotShareRegionForPlatformByRegionList(Set<Region> allRegion, @Param("platformId") Integer platformId);
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user