完成向上级联->通道推送
修复选择通道是查询的bug
This commit is contained in:
@@ -210,6 +210,11 @@ public interface IVideoManagerStorager {
|
||||
*/
|
||||
PageInfo<ChannelReduce> queryAllChannelList(int page, int count, String query, Boolean online, Boolean channelType, String platformId, Boolean inPlatform);
|
||||
|
||||
/**
|
||||
* 查询设备的通道信息
|
||||
*/
|
||||
List<ChannelReduce> queryChannelListInParentPlatform(String platformId);
|
||||
|
||||
|
||||
/**
|
||||
* 更新上级平台的通道信息
|
||||
|
||||
@@ -83,19 +83,19 @@ public interface DeviceChannelMapper {
|
||||
"SELECT * FROM ( "+
|
||||
" SELECT dc.channelId, dc.deviceId, dc.name, de.manufacturer, de.hostAddress, " +
|
||||
"(SELECT count(0) FROM device_channel WHERE parentId=dc.channelId) as subCount, " +
|
||||
"pc.platformId " +
|
||||
"(SELECT pc.platformId FROM platform_gb_channel pc WHERE pc.deviceId=dc.deviceId AND pc.channelId = dc.channelId ) as platformId " +
|
||||
"FROM device_channel dc " +
|
||||
"LEFT JOIN device de ON dc.deviceId = de.deviceId " +
|
||||
"LEFT JOIN platform_gb_channel pc on pc.deviceId = dc.deviceId AND pc.channelId = dc.channelId " +
|
||||
" WHERE 1=1 " +
|
||||
" <if test=\"query != null\"> AND (dc.channelId LIKE '%${query}%' OR dc.name LIKE '%${query}%' OR dc.name LIKE '%${query}%')</if> " +
|
||||
" <if test=\"online == true\" > AND dc.status=1</if> " +
|
||||
" <if test=\"online == false\" > AND dc.status=0</if> " +
|
||||
" <if test=\"platformId != null and inPlatform == true\"> AND pc.platformId=#{platformId} </if> " +
|
||||
") dcr" +
|
||||
" WHERE 1=1 " +
|
||||
" <if test=\"hasSubChannel!= null and hasSubChannel == true\" > AND subCount >0</if> " +
|
||||
" <if test=\"hasSubChannel!= null and hasSubChannel == false\" > AND subCount=0</if> " +
|
||||
" <if test=\"platformId != null and inPlatform == true \" > AND platformId='${platformId}'</if> " +
|
||||
" <if test=\"platformId != null and inPlatform == false \" > AND (platformId != '${platformId}' OR platformId is NULL ) </if> " +
|
||||
" </script>"})
|
||||
|
||||
List<ChannelReduce> queryChannelListInAll(String query, Boolean online, Boolean hasSubChannel, String platformId, Boolean inPlatform);
|
||||
|
||||
@@ -45,7 +45,7 @@ public interface ParentPlatformMapper {
|
||||
@Delete("DELETE FROM parent_platform WHERE deviceGBId=#{deviceGBId}")
|
||||
int delParentPlatform(ParentPlatform parentPlatform);
|
||||
|
||||
@Select("SELECT * FROM parent_platform")
|
||||
@Select("SELECT *,( SELECT count(0) FROM platform_gb_channel pc WHERE pc.platformId = pp.deviceGBId) as channelCount FROM parent_platform pp ")
|
||||
List<ParentPlatform> getParentPlatformList();
|
||||
|
||||
@Select("SELECT * FROM parent_platform WHERE enable=#{enable}")
|
||||
|
||||
@@ -30,8 +30,13 @@ public interface PatformChannelMapper {
|
||||
|
||||
|
||||
@Delete("<script> "+
|
||||
"DELETE FROM platform_gb_channel WHERE deviceAndChannelId in" +
|
||||
"DELETE FROM platform_gb_channel WHERE platformId='${platformId}' AND deviceAndChannelId in" +
|
||||
"<foreach collection='channelReducesToDel' item='item' open='(' separator=',' close=')' > '${item.deviceId}_${item.channelId}'</foreach>" +
|
||||
"</script>")
|
||||
int delChannelForGB(String platformId, List<ChannelReduce> channelReducesToDel);
|
||||
|
||||
@Delete("<script> "+
|
||||
"DELETE FROM platform_gb_channel WHERE platformId='${platformId}'" +
|
||||
"</script>")
|
||||
int cleanChannelForGB(String platformId);
|
||||
}
|
||||
|
||||
@@ -249,9 +249,12 @@ public class VideoManagerStoragerImpl implements IVideoManagerStorager {
|
||||
return result > 0;
|
||||
}
|
||||
|
||||
@Transactional
|
||||
@Override
|
||||
public boolean deleteParentPlatform(ParentPlatform parentPlatform) {
|
||||
int result = platformMapper.delParentPlatform(parentPlatform);
|
||||
// 删除关联的通道
|
||||
patformChannelMapper.cleanChannelForGB(parentPlatform.getDeviceGBId());
|
||||
return result > 0;
|
||||
}
|
||||
|
||||
@@ -286,6 +289,11 @@ public class VideoManagerStoragerImpl implements IVideoManagerStorager {
|
||||
return new PageInfo<>(all);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<ChannelReduce> queryChannelListInParentPlatform(String platformId) {
|
||||
|
||||
return deviceChannelMapper.queryChannelListInAll(null, null, null, platformId, true);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int updateChannelForGB(String platformId, List<ChannelReduce> channelReduces) {
|
||||
|
||||
Reference in New Issue
Block a user