临时提交
This commit is contained in:
@@ -343,11 +343,11 @@ public interface CommonGBChannelMapper {
|
||||
|
||||
@Select("<script>" +
|
||||
" select " +
|
||||
" coalesce(gb_device_id, device_id) as id," +
|
||||
" coalesce(gb_name, name) as label, " +
|
||||
" concat('channel_', id) as tree_id," +
|
||||
" coalesce(gb_device_id, device_id) as device_id," +
|
||||
" coalesce(gb_name, name) as name, " +
|
||||
" coalesce(gb_parent_id, parent_id) as parent_device_id, " +
|
||||
" coalesce(gb_business_group_id, business_group_id) as business_group, " +
|
||||
" id as db_id, " +
|
||||
" 1 as type, " +
|
||||
" true as is_leaf " +
|
||||
" from wvp_device_channel " +
|
||||
@@ -450,12 +450,58 @@ public interface CommonGBChannelMapper {
|
||||
" 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_gb_channel wpgc on wdc.id = wpgc.device_channel_id" +
|
||||
" left join wvp_platform_channel wpgc on wdc.id = wpgc.device_channel_id" +
|
||||
" where wpgc.platform_id = #{platformId} "
|
||||
|
||||
)
|
||||
List<CommonGBChannel> queryWithPlatform(@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.parent_id, wdc.gb_parent_id, wdc.parent_id) = #{parentId}"
|
||||
|
||||
)
|
||||
List<CommonGBChannel> queryShareChannelByParentId(@Param("parentId") String parentId, @Param("platformId") Integer platformId);
|
||||
}
|
||||
|
||||
@@ -328,7 +328,7 @@ public interface DeviceChannelMapper {
|
||||
" pgc.catalog_id as catalog_id " +
|
||||
" FROM wvp_device_channel dc " +
|
||||
" LEFT JOIN wvp_device de ON dc.device_db_id = de.id " +
|
||||
" LEFT JOIN wvp_platform_gb_channel pgc on pgc.device_channel_id = dc.id " +
|
||||
" LEFT JOIN wvp_platform_channel pgc on pgc.device_channel_id = dc.id " +
|
||||
" WHERE 1=1 " +
|
||||
" <if test='query != null'> " +
|
||||
"AND " +
|
||||
@@ -338,7 +338,7 @@ public interface DeviceChannelMapper {
|
||||
" <if test='online == false' > AND dc.status=0</if> " +
|
||||
" <if test='hasSubChannel!= null and hasSubChannel == true' > AND dc.sub_count > 0</if> " +
|
||||
" <if test='hasSubChannel!= null and hasSubChannel == false' > AND dc.sub_count = 0</if> " +
|
||||
" <if test='catalogId == null ' > AND dc.id not in (select device_channel_id from wvp_platform_gb_channel where platform_id=#{platformId} ) </if> " +
|
||||
" <if test='catalogId == null ' > AND dc.id not in (select device_channel_id from wvp_platform_channel where platform_id=#{platformId} ) </if> " +
|
||||
" <if test='catalogId != null ' > AND pgc.platform_id = #{platformId} and pgc.catalog_id=#{catalogId} </if> " +
|
||||
" ORDER BY COALESCE(dc.gb_device_id, dc.device_id) ASC" +
|
||||
" </script>"})
|
||||
|
||||
@@ -3,7 +3,6 @@ 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.GroupTree;
|
||||
import com.genersoft.iot.vmp.gb28181.bean.Region;
|
||||
import org.apache.ibatis.annotations.*;
|
||||
|
||||
import java.util.List;
|
||||
@@ -12,13 +11,13 @@ import java.util.Set;
|
||||
@Mapper
|
||||
public interface GroupMapper {
|
||||
|
||||
@Insert("INSERT INTO wvp_common_group (device_id, name, parent_device_id, business_group, platform_id, create_time, update_time) " +
|
||||
"VALUES (#{deviceId}, #{name}, #{parentDeviceId}, #{businessGroup}, #{platformId}, #{createTime}, #{updateTime})")
|
||||
@Insert("INSERT INTO wvp_common_group (device_id, name, parent_id, parent_device_id, business_group, create_time, update_time) " +
|
||||
"VALUES (#{deviceId}, #{name}, #{parentId}, #{parentDeviceId}, #{businessGroup}, #{createTime}, #{updateTime})")
|
||||
@Options(useGeneratedKeys = true, keyProperty = "id", keyColumn = "id")
|
||||
int add(Group group);
|
||||
|
||||
@Insert("INSERT INTO wvp_common_group (device_id, name, business_group, platform_id, create_time, update_time) " +
|
||||
"VALUES (#{deviceId}, #{name}, #{businessGroup}, #{platformId}, #{createTime}, #{updateTime})")
|
||||
@Insert("INSERT INTO wvp_common_group (device_id, name, business_group, create_time, update_time) " +
|
||||
"VALUES (#{deviceId}, #{name}, #{businessGroup}, #{createTime}, #{updateTime})")
|
||||
@Options(useGeneratedKeys = true, keyProperty = "id", keyColumn = "id")
|
||||
int addBusinessGroup(Group group);
|
||||
|
||||
@@ -26,7 +25,7 @@ public interface GroupMapper {
|
||||
int delete(@Param("id") int id);
|
||||
|
||||
@Update(" UPDATE wvp_common_group " +
|
||||
" SET update_time=#{updateTime}, device_id=#{deviceId}, name=#{name}, parent_device_id=#{parentDeviceId}, business_group=#{businessGroup}" +
|
||||
" SET update_time=#{updateTime}, device_id=#{deviceId}, name=#{name}, parent_id=#{parentId}, parent_device_id=#{parentDeviceId}, business_group=#{businessGroup}" +
|
||||
" WHERE id = #{id}")
|
||||
int update(Group group);
|
||||
|
||||
@@ -38,99 +37,67 @@ public interface GroupMapper {
|
||||
" </script>"})
|
||||
List<Group> query(@Param("query") String query, @Param("parentId") String parentId, @Param("businessGroup") String businessGroup);
|
||||
|
||||
@Select(value = {" <script>" +
|
||||
"SELECT * from wvp_common_group WHERE parent_device_id = #{parentId} "+
|
||||
" <if test='platformId != null'> AND platform_id = #{platformId}</if> " +
|
||||
" <if test='platformId == null'> AND platform_id is null</if> " +
|
||||
" </script>"})
|
||||
List<Group> getChildren(@Param("parentId") String parentId , @Param("platformId") Integer platformId);
|
||||
@Select("SELECT * from wvp_common_group WHERE parent_id = #{parentId} ")
|
||||
List<Group> getChildren(@Param("parentId") int parentId);
|
||||
|
||||
@Select("SELECT * from wvp_common_group WHERE id = #{id} ")
|
||||
Group queryOne(@Param("id") int id);
|
||||
|
||||
@Select(" select coalesce(dc.gb_civil_code, dc.civil_code) as civil_code " +
|
||||
" from wvp_device_channel dc " +
|
||||
" where coalesce(dc.gb_civil_code, dc.civil_code) not in " +
|
||||
" (select device_id from wvp_common_group)")
|
||||
List<String> getUninitializedCivilCode();
|
||||
|
||||
@Select(" <script>" +
|
||||
" SELECT device_id from wvp_common_group " +
|
||||
" where device_id in " +
|
||||
" <foreach collection='codes' item='item' open='(' separator=',' close=')' > #{item}</foreach>" +
|
||||
" </script>")
|
||||
List<String> queryInList(Set<String> codes);
|
||||
|
||||
|
||||
@Insert(" <script>" +
|
||||
" INSERT INTO wvp_common_group (" +
|
||||
" device_id," +
|
||||
" name, " +
|
||||
" parent_device_id," +
|
||||
" parent_id," +
|
||||
" business_group," +
|
||||
" create_time," +
|
||||
" update_time) " +
|
||||
" VALUES " +
|
||||
" <foreach collection='groupList' index='index' item='item' separator=','> " +
|
||||
" (#{item.deviceId}, #{item.name}, #{item.parentDeviceId}, #{item.businessGroup},#{item.createTime},#{item.updateTime})" +
|
||||
" (#{item.deviceId}, #{item.name}, #{item.parentDeviceId}, #{item.parentId}, #{item.businessGroup},#{item.createTime},#{item.updateTime})" +
|
||||
" </foreach> " +
|
||||
" </script>")
|
||||
int batchAdd(List<Group> groupList);
|
||||
|
||||
@Select(" <script>" +
|
||||
" SELECT " +
|
||||
" device_id as id," +
|
||||
" name as label, " +
|
||||
" parent_device_id," +
|
||||
" business_group," +
|
||||
" id as db_id," +
|
||||
" *," +
|
||||
" concat('group_', id) as tree_id," +
|
||||
" 0 as type," +
|
||||
" false as is_leaf" +
|
||||
" from wvp_common_group " +
|
||||
" where 1=1 " +
|
||||
" <if test='parentId != null'> and parent_device_id = #{parentId} </if> " +
|
||||
" <if test='parentId == null'> and parent_device_id is null </if> " +
|
||||
" <if test='platformId != null'> and platform_id = #{platformId} </if> " +
|
||||
" <if test='platformId == null'> and platform_id is null </if> " +
|
||||
" <if test='parentId != null'> and parent_id = #{parentId} </if> " +
|
||||
" <if test='parentId == null'> and parent_id is null </if> " +
|
||||
" <if test='query != null'> AND (device_id LIKE concat('%',#{query},'%') OR name LIKE concat('%',#{query},'%'))</if> " +
|
||||
" </script>")
|
||||
List<GroupTree> queryForTree(@Param("query") String query, @Param("parentId") String parentId,
|
||||
@Param("platformId") Integer platformId);
|
||||
List<GroupTree> queryForTree(@Param("query") String query, @Param("parentId") Integer parentId);
|
||||
|
||||
@Select(" <script>" +
|
||||
" SELECT " +
|
||||
" device_id as id," +
|
||||
" name as label, " +
|
||||
" parent_device_id," +
|
||||
" business_group," +
|
||||
" id as db_id," +
|
||||
" concat('group_', id) as tree_id," +
|
||||
" *, " +
|
||||
" 0 as type," +
|
||||
" false as is_leaf" +
|
||||
" from wvp_common_group " +
|
||||
" where parent_device_id is null and business_group = #{businessGroup} and device_id != #{businessGroup}" +
|
||||
" <if test='platformId != null'> and platform_id = #{platformId} </if> " +
|
||||
" <if test='platformId == null'> and platform_id is null </if> " +
|
||||
" where parent_id is not null and business_group = #{businessGroup} and device_id != #{businessGroup}" +
|
||||
" <if test='query != null'> AND (device_id LIKE concat('%',#{query},'%') OR name LIKE concat('%',#{query},'%'))</if> " +
|
||||
" </script>")
|
||||
List<GroupTree> queryForTreeByBusinessGroup(@Param("query") String query,
|
||||
@Param("businessGroup") String businessGroup,
|
||||
@Param("platformId") Integer platformId);
|
||||
@Param("businessGroup") String businessGroup);
|
||||
|
||||
@Select(" <script>" +
|
||||
" SELECT " +
|
||||
" device_id as id," +
|
||||
" name as label, " +
|
||||
" parent_device_id," +
|
||||
" id as db_id," +
|
||||
" *," +
|
||||
" concat('group_', id) as tree_id," +
|
||||
" 0 as type," +
|
||||
" false as is_leaf" +
|
||||
" from wvp_common_group " +
|
||||
" where device_id=business_group" +
|
||||
" <if test='platformId != null'> AND platform_id = #{platformId} </if> " +
|
||||
" <if test='platformId == null'> AND platform_id is null </if> " +
|
||||
" <if test='query != null'> AND (device_id LIKE concat('%',#{query},'%') OR name LIKE concat('%',#{query},'%'))</if> " +
|
||||
" </script>")
|
||||
List<GroupTree> queryBusinessGroupForTree(String query, Integer platformId);
|
||||
List<GroupTree> queryBusinessGroupForTree(@Param("query") String query);
|
||||
|
||||
@Select("SELECT * from wvp_common_group WHERE device_id = #{deviceId} and business_group = #{businessGroup}")
|
||||
Group queryOneByDeviceId(@Param("deviceId") String deviceId, @Param("businessGroup") String businessGroup);
|
||||
@@ -152,15 +119,15 @@ public interface GroupMapper {
|
||||
|
||||
@Update(" UPDATE wvp_common_group " +
|
||||
" SET parent_device_id=#{group.deviceId}, business_group = #{group.businessGroup}" +
|
||||
" WHERE parent_device_id = #{oldDeviceId}")
|
||||
int updateChild(@Param("oldDeviceId") String oldDeviceId, Group group);
|
||||
" WHERE parentId = #{parentId}")
|
||||
int updateChild(@Param("parentId") Integer parentId, Group group);
|
||||
|
||||
@Select(" <script>" +
|
||||
" SELECT * from wvp_common_group " +
|
||||
" where device_id in " +
|
||||
" <foreach collection='groupList' item='item' open='(' separator=',' close=')' > #{item.deviceId}</foreach>" +
|
||||
" </script>")
|
||||
List<Region> queryInGroupList(List<Group> groupList);
|
||||
List<Group> queryInGroupListByDeviceId(List<Group> groupList);
|
||||
|
||||
@Select(" <script>" +
|
||||
" SELECT " +
|
||||
@@ -175,19 +142,10 @@ public interface GroupMapper {
|
||||
" SELECT " +
|
||||
" * " +
|
||||
" from wvp_common_group " +
|
||||
" where device_id in " +
|
||||
" <foreach collection='regionChannelList' item='item' open='(' separator=',' close=')' > #{item.parentDeviceId}</foreach>" +
|
||||
" where id in " +
|
||||
" <foreach collection='groupSet' item='item' open='(' separator=',' close=')' > #{item.parentId}</foreach>" +
|
||||
" </script>")
|
||||
Set<Group> queryParentInChannelList(Set<Group> regionChannelList);
|
||||
|
||||
@Select(" <script>" +
|
||||
" SELECT " +
|
||||
" * " +
|
||||
" from wvp_common_group " +
|
||||
" where device_id in " +
|
||||
" <foreach collection='channelList' item='item' open='(' separator=',' close=')' > #{item.gbBusinessGroupId}</foreach>" +
|
||||
" </script>")
|
||||
Set<Group> queryBusinessGroupInChannelList(List<CommonGBChannel> channelList);
|
||||
Set<Group> queryParentInChannelList(Set<Group> groupSet);
|
||||
|
||||
@Select(" <script>" +
|
||||
" SELECT " +
|
||||
@@ -206,7 +164,7 @@ public interface GroupMapper {
|
||||
" SELECT * " +
|
||||
" 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 = null and wcg.device_id in " +
|
||||
" 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);
|
||||
@@ -215,7 +173,7 @@ public interface GroupMapper {
|
||||
" SELECT * " +
|
||||
" 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 = null and wcg.id in " +
|
||||
" 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);
|
||||
|
||||
@@ -10,6 +10,7 @@ import org.apache.ibatis.annotations.Select;
|
||||
import org.springframework.stereotype.Repository;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Set;
|
||||
|
||||
@Mapper
|
||||
@Repository
|
||||
@@ -19,13 +20,13 @@ public interface PlatformChannelMapper {
|
||||
* 查询列表里已经关联的
|
||||
*/
|
||||
@Select("<script> "+
|
||||
"SELECT device_channel_id from wvp_platform_gb_channel WHERE platform_id=#{platformId} AND device_channel_id in" +
|
||||
"SELECT device_channel_id from wvp_platform_channel WHERE platform_id=#{platformId} AND device_channel_id in" +
|
||||
"<foreach collection='channelReduces' open='(' item='item' separator=',' close=')'> #{item.id}</foreach>" +
|
||||
"</script>")
|
||||
List<Integer> findChannelRelatedPlatform(@Param("platformId") String platformId, @Param("channelReduces") List<ChannelReduce> channelReduces);
|
||||
|
||||
@Insert("<script> "+
|
||||
"INSERT INTO wvp_platform_gb_channel (platform_id, device_channel_id) VALUES" +
|
||||
"INSERT INTO wvp_platform_channel (platform_id, device_channel_id) VALUES" +
|
||||
"<foreach collection='channelList' item='item' separator=','>" +
|
||||
" (#{platformId}, #{item.gbId} )" +
|
||||
"</foreach>" +
|
||||
@@ -33,53 +34,53 @@ public interface PlatformChannelMapper {
|
||||
int addChannels(@Param("platformId") Integer platformId, @Param("channelList") List<CommonGBChannel> channelList);
|
||||
|
||||
@Delete("<script> "+
|
||||
"DELETE from wvp_platform_gb_channel WHERE platform_id=#{platformId} AND device_channel_id in" +
|
||||
"DELETE from wvp_platform_channel WHERE platform_id=#{platformId} AND device_channel_id in" +
|
||||
"<foreach collection='channelReducesToDel' item='item' open='(' separator=',' close=')' > #{item.id}</foreach>" +
|
||||
"</script>")
|
||||
int delChannelForGB(@Param("platformId") String platformId, @Param("channelReducesToDel") List<ChannelReduce> channelReducesToDel);
|
||||
|
||||
@Delete("<script> "+
|
||||
"DELETE from wvp_platform_gb_channel WHERE device_channel_id in " +
|
||||
"DELETE from wvp_platform_channel WHERE device_channel_id in " +
|
||||
"( select temp.device_channel_id from " +
|
||||
"(select pgc.device_channel_id from wvp_platform_gb_channel pgc " +
|
||||
"(select pgc.device_channel_id from wvp_platform_channel pgc " +
|
||||
"left join wvp_device_channel dc on dc.id = pgc.device_channel_id where dc.device_id =#{deviceId} " +
|
||||
") temp)" +
|
||||
"</script>")
|
||||
int delChannelForDeviceId(String deviceId);
|
||||
|
||||
@Delete("<script> "+
|
||||
"DELETE from wvp_platform_gb_channel WHERE platform_id=#{platformId}" +
|
||||
"DELETE from wvp_platform_channel WHERE platform_id=#{platformId}" +
|
||||
"</script>")
|
||||
int cleanChannelForGB(String platformId);
|
||||
|
||||
@Select("SELECT dc.* from wvp_platform_gb_channel pgc left join wvp_device_channel dc on dc.id = pgc.device_channel_id WHERE dc.channel_id=#{channelId} and pgc.platform_id=#{platformId}")
|
||||
@Select("SELECT dc.* from wvp_platform_channel pgc left join wvp_device_channel dc on dc.id = pgc.device_channel_id WHERE dc.channel_id=#{channelId} and pgc.platform_id=#{platformId}")
|
||||
List<DeviceChannel> queryChannelInParentPlatform(@Param("platformId") String platformId, @Param("channelId") String channelId);
|
||||
|
||||
@Select("<script> "+
|
||||
"SELECT dc.* from wvp_platform_gb_channel pgc left join wvp_device_channel dc on dc.id = pgc.device_channel_id WHERE pgc.platform_id=#{platformId} " +
|
||||
"SELECT dc.* from wvp_platform_channel pgc left join wvp_device_channel dc on dc.id = pgc.device_channel_id WHERE pgc.platform_id=#{platformId} " +
|
||||
" <if test='catalogId != null' > and pgc.catalog_id=#{catalogId}</if>" +
|
||||
"</script>")
|
||||
List<CommonGBChannel> queryAllChannelInCatalog(@Param("platformId") String platformId, @Param("catalogId") String catalogId);
|
||||
|
||||
@Select(" select dc.channel_id as id, dc.name as name, pgc.platform_id as platform_id, pgc.catalog_id as parent_id, 0 as children_count, 1 as type " +
|
||||
" from wvp_device_channel dc left join wvp_platform_gb_channel pgc on dc.id = pgc.device_channel_id " +
|
||||
" from wvp_device_channel dc left join wvp_platform_channel pgc on dc.id = pgc.device_channel_id " +
|
||||
" where pgc.platform_id=#{platformId} and pgc.catalog_id=#{catalogId}")
|
||||
List<PlatformCatalog> queryChannelInParentPlatformAndCatalog(@Param("platformId") String platformId, @Param("catalogId") String catalogId);
|
||||
|
||||
@Select("select d.*\n" +
|
||||
"from wvp_platform_gb_channel pgc\n" +
|
||||
"from wvp_platform_channel pgc\n" +
|
||||
" left join wvp_device_channel dc on dc.id = pgc.device_channel_id\n" +
|
||||
" left join wvp_device d on dc.device_id = d.device_id\n" +
|
||||
"where dc.channel_id = #{channelId} and pgc.platform_id=#{platformId}")
|
||||
List<Device> queryVideoDeviceByPlatformIdAndChannelId(@Param("platformId") String platformId, @Param("channelId") String channelId);
|
||||
|
||||
@Delete("<script> "+
|
||||
"DELETE from wvp_platform_gb_channel WHERE platform_id=#{platformId} and catalog_id=#{id}" +
|
||||
"DELETE from wvp_platform_channel WHERE platform_id=#{platformId} and catalog_id=#{id}" +
|
||||
"</script>")
|
||||
int delByCatalogId(@Param("platformId") String platformId, @Param("id") String id);
|
||||
|
||||
@Delete("<script> "+
|
||||
"DELETE from wvp_platform_gb_channel WHERE catalog_id=#{parentId} AND platform_id=#{platformId} AND channel_id=#{id}" +
|
||||
"DELETE from wvp_platform_channel WHERE catalog_id=#{parentId} AND platform_id=#{platformId} AND channel_id=#{id}" +
|
||||
"</script>")
|
||||
int delByCatalogIdAndChannelIdAndPlatformId(PlatformCatalog platformCatalog);
|
||||
|
||||
@@ -88,7 +89,7 @@ public interface PlatformChannelMapper {
|
||||
"pp.* " +
|
||||
"FROM " +
|
||||
"wvp_platform pp " +
|
||||
"left join wvp_platform_gb_channel pgc on " +
|
||||
"left join wvp_platform_channel pgc on " +
|
||||
"pp.id = pgc.platform_id " +
|
||||
"left join wvp_device_channel dc on " +
|
||||
"dc.id = pgc.device_channel_id " +
|
||||
@@ -100,24 +101,24 @@ public interface PlatformChannelMapper {
|
||||
List<Platform> queryPlatFormListForGBWithGBId(@Param("channelId") String channelId, @Param("platforms") List<String> platforms);
|
||||
|
||||
@Delete("<script> " +
|
||||
"DELETE from wvp_platform_gb_channel WHERE platform_id=#{serverGBId}" +
|
||||
"DELETE from wvp_platform_channel WHERE platform_id=#{serverGBId}" +
|
||||
"</script>")
|
||||
void delByPlatformId(String serverGBId);
|
||||
|
||||
@Delete("<script> " +
|
||||
"DELETE from wvp_platform_gb_channel WHERE platform_id=#{platformId} " +
|
||||
"DELETE from wvp_platform_channel WHERE platform_id=#{platformId} " +
|
||||
" <if test=\"catalogId != null\" > and catalog_id=#{catalogId}</if>" +
|
||||
"</script>")
|
||||
int delChannelForGBByCatalogId(@Param("platformId") String platformId, @Param("catalogId") String catalogId);
|
||||
|
||||
@Select("select dc.channel_id dc.device_id,dc.name,d.manufacturer,d.model,d.firmware\n" +
|
||||
"from wvp_platform_gb_channel pgc\n" +
|
||||
"from wvp_platform_channel pgc\n" +
|
||||
" left join wvp_device_channel dc on dc.id = pgc.device_channel_id\n" +
|
||||
" left join wvp_device d on dc.device_id = d.device_id\n" +
|
||||
"where dc.channel_id = #{channelId} and pgc.platform_id=#{platformId}")
|
||||
List<Device> queryDeviceInfoByPlatformIdAndChannelId(@Param("platformId") String platformId, @Param("channelId") String channelId);
|
||||
|
||||
@Select("SELECT pgc.platform_id from wvp_platform_gb_channel pgc left join wvp_device_channel dc on dc.id = pgc.device_channel_id WHERE dc.device_id=#{channelId}")
|
||||
@Select("SELECT pgc.platform_id from wvp_platform_channel pgc left join wvp_device_channel dc on dc.id = pgc.device_channel_id WHERE dc.device_id=#{channelId}")
|
||||
List<Integer> queryParentPlatformByChannelId(@Param("channelId") String channelId);
|
||||
|
||||
|
||||
@@ -166,7 +167,7 @@ public interface PlatformChannelMapper {
|
||||
" coalesce(wpgc.svc_time_support_mode, wdc.gb_svc_time_support_mode, wdc.svc_time_support_mode) as gb_svc_time_support_mode, \n" +
|
||||
" wpgc.platform_id " +
|
||||
" from wvp_device_channel wdc" +
|
||||
" left join wvp_platform_gb_channel wpgc on wdc.id = wpgc.device_channel_id and wpgc.platform_id = #{platformId}" +
|
||||
" left join wvp_platform_channel wpgc on wdc.id = wpgc.device_channel_id and wpgc.platform_id = #{platformId}" +
|
||||
" where 1=1" +
|
||||
" <if test='query != null'> AND (coalesce(wpgc.device_id, wdc.gb_device_id, wdc.device_id) LIKE concat('%',#{query},'%') " +
|
||||
" OR coalesce(wpgc.name, wdc.gb_name, wdc.name) LIKE concat('%',#{query},'%'))</if> " +
|
||||
@@ -221,7 +222,7 @@ public interface PlatformChannelMapper {
|
||||
" 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_gb_channel wpgc on wdc.id = wpgc.device_channel_id" +
|
||||
" left join wvp_platform_channel wpgc on wdc.id = wpgc.device_channel_id" +
|
||||
" where wpgc.platform_id = #{platformId} and coalesce(wpgc.device_id, wdc.gb_device_id, wdc.device_id) = #{channelDeviceId}"
|
||||
|
||||
)
|
||||
@@ -271,12 +272,11 @@ public interface PlatformChannelMapper {
|
||||
" 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_gb_channel wpgc on wdc.id = wpgc.device_channel_id and wpgc.platform_id = #{platformId}" +
|
||||
" left join wvp_platform_channel wpgc on wdc.id = wpgc.device_channel_id and wpgc.platform_id = #{platformId}" +
|
||||
" where wpgc.platform_id is null" +
|
||||
"<if test='channelIds != null'> AND wdc.id in <foreach item='item' index='index' collection='channelIds' open='(' separator=',' close=')'>" +
|
||||
"#{item} " +
|
||||
"</foreach> </if>" +
|
||||
|
||||
"<if test='channelIds != null'> AND wdc.id in " +
|
||||
"<foreach item='item' index='index' collection='channelIds' open='(' separator=',' close=')'> #{item} </foreach> " +
|
||||
"</if>" +
|
||||
"</script>")
|
||||
List<CommonGBChannel> queryNotShare(@Param("platformId") Integer platformId, List<Integer> channelIds);
|
||||
|
||||
@@ -323,7 +323,7 @@ public interface PlatformChannelMapper {
|
||||
" 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_gb_channel wpgc on wdc.id = wpgc.device_channel_id" +
|
||||
" left join wvp_platform_channel wpgc on wdc.id = wpgc.device_channel_id" +
|
||||
" where wpgc.platform_id = #{platformId}" +
|
||||
"<if test='channelIds != null'> AND wdc.id in " +
|
||||
" <foreach item='item' index='index' collection='channelIds' open='(' separator=',' close=')'>" +
|
||||
@@ -334,7 +334,7 @@ public interface PlatformChannelMapper {
|
||||
List<CommonGBChannel> queryShare(@Param("platformId") Integer platformId, List<Integer> channelIds);
|
||||
|
||||
@Delete("<script> " +
|
||||
"DELETE from wvp_platform_gb_channel WHERE platform_id=#{platformId} " +
|
||||
"DELETE from wvp_platform_channel WHERE platform_id=#{platformId} " +
|
||||
"<if test='channelList != null'> AND device_channel_id in " +
|
||||
" <foreach item='item' index='index' collection='channelList' open='(' separator=',' close=')'>" +
|
||||
" #{item.gbId} " +
|
||||
@@ -344,7 +344,7 @@ public interface PlatformChannelMapper {
|
||||
int removeChannels(@Param("platformId") Integer platformId, List<CommonGBChannel> channelList);
|
||||
|
||||
@Insert("<script> "+
|
||||
"INSERT INTO wvp_platform_group (platform_id, group_id) VALUES" +
|
||||
"INSERT INTO wvp_platform_group (platform_id, group_id) VALUES " +
|
||||
"<foreach collection='groupListNotShare' item='item' separator=','>" +
|
||||
" (#{platformId}, #{item.id} )" +
|
||||
"</foreach>" +
|
||||
@@ -361,4 +361,21 @@ public interface PlatformChannelMapper {
|
||||
"DELETE from wvp_platform_group WHERE platform_id=#{platformId} AND group_id =#{id}" +
|
||||
"</script>")
|
||||
void removePlatformGroupById(@Param("id") int id, @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 = #{parentId} " +
|
||||
" </script>")
|
||||
Set<Group> queryShareChildrenGroup(@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>" +
|
||||
" </script>")
|
||||
Set<Group> queryShareParentGroupByGroupSet(Set<Group> groupSet, @Param("platformId") Integer platformId);
|
||||
}
|
||||
|
||||
@@ -15,11 +15,11 @@ 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,status,catalog_group, update_time," +
|
||||
" create_time, as_message_channel, send_stream_ip, auto_push_channel, catalog_with_platform, custom_group, custom_civil_code, "+
|
||||
" create_time, as_message_channel, send_stream_ip, auto_push_channel, catalog_with_platform,catalog_with_group,catalog_with_region, "+
|
||||
" civil_code,manufacturer,model,address,register_way,secrecy) " +
|
||||
" VALUES (#{enable}, #{name}, #{serverGBId}, #{serverGBDomain}, #{serverIp}, #{serverPort}, #{deviceGBId}, #{deviceIp}, " +
|
||||
" #{devicePort}, #{username}, #{password}, #{expires}, #{keepTimeout}, #{transport}, #{characterSet}, #{ptz}, #{rtcp}, #{status}, #{catalogGroup},#{updateTime}," +
|
||||
" #{createTime}, #{asMessageChannel}, #{sendStreamIp}, #{autoPushChannel}, #{catalogWithPlatform}, #{customGroup},#{customCivilCode}, " +
|
||||
" #{createTime}, #{asMessageChannel}, #{sendStreamIp}, #{autoPushChannel}, #{catalogWithPlatform}, #{catalogWithGroup},#{catalogWithRegion}, " +
|
||||
" #{civilCode}, #{manufacturer}, #{model}, #{address}, #{registerWay}, #{secrecy})")
|
||||
int add(Platform parentPlatform);
|
||||
|
||||
@@ -48,8 +48,8 @@ public interface PlatformMapper {
|
||||
" send_stream_ip=#{sendStreamIp}, " +
|
||||
" auto_push_channel=#{autoPushChannel}, " +
|
||||
" catalog_with_platform=#{catalogWithPlatform}, " +
|
||||
" custom_group=#{customGroup}, " +
|
||||
" custom_civil_code=#{customCivilCode}, " +
|
||||
" catalog_with_group=#{catalogWithGroup}, " +
|
||||
" catalog_with_region=#{catalogWithRegion}, " +
|
||||
" civil_code=#{civilCode}, " +
|
||||
" manufacturer=#{manufacturer}, " +
|
||||
" model=#{model}, " +
|
||||
@@ -63,7 +63,7 @@ public interface PlatformMapper {
|
||||
int delParentPlatform(Platform parentPlatform);
|
||||
|
||||
@Select(" SELECT pp.*, " +
|
||||
" (SELECT count(0) FROM wvp_platform_gb_channel pc WHERE pc.platform_id = pp.id ) as channel_count" +
|
||||
" (SELECT count(0) FROM wvp_platform_channel pc WHERE pc.platform_id = pp.id ) as channel_count" +
|
||||
" FROM wvp_platform pp "
|
||||
)
|
||||
List<Platform> queryList();
|
||||
|
||||
Reference in New Issue
Block a user