完善数据库结构调用

pull/1733/head
648540858 2024-12-23 23:49:54 +08:00
parent f5ae9718d4
commit 28961f51f7
29 changed files with 284 additions and 251 deletions

View File

@ -10,7 +10,6 @@ import lombok.Getter;
public enum ChannelDataType { public enum ChannelDataType {
GB28181(1,"国标28181"), GB28181(1,"国标28181"),
STREAM_PUSH(2,"推流设备"), STREAM_PUSH(2,"推流设备"),
STREAM_PROXY(3,"拉流代理"); STREAM_PROXY(3,"拉流代理");

View File

@ -1,5 +1,6 @@
package com.genersoft.iot.vmp.gb28181.bean; package com.genersoft.iot.vmp.gb28181.bean;
import com.genersoft.iot.vmp.common.enums.ChannelDataType;
import com.genersoft.iot.vmp.gb28181.utils.MessageElementForCatalog; import com.genersoft.iot.vmp.gb28181.utils.MessageElementForCatalog;
import com.genersoft.iot.vmp.gb28181.utils.XmlUtil; import com.genersoft.iot.vmp.gb28181.utils.XmlUtil;
import io.swagger.v3.oas.annotations.media.Schema; import io.swagger.v3.oas.annotations.media.Schema;
@ -20,9 +21,6 @@ public class DeviceChannel extends CommonGBChannel {
@Schema(description = "数据库自增ID") @Schema(description = "数据库自增ID")
private int id; private int id;
@Schema(description = "设备的数据库自增ID")
private Integer deviceDbId;
@MessageElementForCatalog("DeviceID") @MessageElementForCatalog("DeviceID")
@Schema(description = "编码") @Schema(description = "编码")
private String deviceId; private String deviceId;
@ -191,6 +189,8 @@ public class DeviceChannel extends CommonGBChannel {
@Schema(description = "通道类型, 默认0, 0 普通通道1 行政区划 2 业务分组/虚拟组织") @Schema(description = "通道类型, 默认0, 0 普通通道1 行政区划 2 业务分组/虚拟组织")
private int channelType; private int channelType;
private Integer dataType = ChannelDataType.GB28181.value;
public void setPtzType(int ptzType) { public void setPtzType(int ptzType) {
this.ptzType = ptzType; this.ptzType = ptzType;
switch (ptzType) { switch (ptzType) {

View File

@ -241,7 +241,7 @@ public class DeviceQuery {
return deviceChannelPageResult; return deviceChannelPageResult;
} }
return deviceChannelService.getSubChannels(deviceChannel.getDeviceDbId(), channelId, query, channelType, online, page, count); return deviceChannelService.getSubChannels(deviceChannel.getDataDeviceId(), channelId, query, channelType, online, page, count);
} }
@Operation(summary = "开启/关闭通道的音频", security = @SecurityRequirement(name = JwtUtils.HEADER)) @Operation(summary = "开启/关闭通道的音频", security = @SecurityRequirement(name = JwtUtils.HEADER))

View File

@ -20,8 +20,8 @@ public interface CommonGBChannelMapper {
@Insert(" <script>" + @Insert(" <script>" +
"INSERT INTO wvp_device_channel (" + "INSERT INTO wvp_device_channel (" +
"gb_device_id," + "gb_device_id," +
" <if test='streamProxyId != null' > stream_proxy_id,</if>" + "data_type," +
" <if test='streamPushId != null' > stream_push_id,</if>" + "data_device_id," +
"create_time," + "create_time," +
"update_time," + "update_time," +
"gb_name," + "gb_name," +
@ -59,8 +59,8 @@ public interface CommonGBChannelMapper {
"gb_svc_time_support_mode ) " + "gb_svc_time_support_mode ) " +
"VALUES (" + "VALUES (" +
"#{gbDeviceId}, " + "#{gbDeviceId}, " +
" <if test='streamProxyId != null' > #{streamProxyId},</if>" + "#{dataType}, " +
" <if test='streamPushId != null' > #{streamPushId},</if>" + "#{dataDeviceId}, " +
"#{createTime}, " + "#{createTime}, " +
"#{updateTime}, " + "#{updateTime}, " +
"#{gbName}, " + "#{gbName}, " +
@ -168,8 +168,8 @@ public interface CommonGBChannelMapper {
@Insert(" <script>" + @Insert(" <script>" +
"INSERT INTO wvp_device_channel (" + "INSERT INTO wvp_device_channel (" +
"gb_device_id," + "gb_device_id," +
"stream_proxy_id, " + "data_type, " +
"stream_push_id," + "data_device_id," +
"create_time," + "create_time," +
"update_time," + "update_time," +
"gb_name," + "gb_name," +
@ -207,7 +207,7 @@ public interface CommonGBChannelMapper {
"gb_svc_time_support_mode ) " + "gb_svc_time_support_mode ) " +
"VALUES" + "VALUES" +
"<foreach collection='commonGBChannels' index='index' item='item' separator=','> " + "<foreach collection='commonGBChannels' index='index' item='item' separator=','> " +
"(#{item.gbDeviceId}, #{item.streamProxyId}, #{item.streamPushId},#{item.createTime},#{item.updateTime}," + "(#{item.gbDeviceId}, #{item.dataType}, #{item.dataDeviceId},#{item.createTime},#{item.updateTime}," +
"#{item.gbName},#{item.gbManufacturer}, #{item.gbModel}," + "#{item.gbName},#{item.gbManufacturer}, #{item.gbModel}," +
"#{item.gbOwner},#{item.gbCivilCode},#{item.gbBlock}, #{item.gbAddress}, #{item.gbParental}, #{item.gbParentId},#{item.gbSafetyWay}, " + "#{item.gbOwner},#{item.gbCivilCode},#{item.gbBlock}, #{item.gbAddress}, #{item.gbParental}, #{item.gbParentId},#{item.gbSafetyWay}, " +
"#{item.gbRegisterWay},#{item.gbCertNum},#{item.gbCertifiable},#{item.gbErrCode},#{item.gbEndTime}, #{item.gbSecrecy},#{item.gbIpAddress}," + "#{item.gbRegisterWay},#{item.gbCertNum},#{item.gbCertifiable},#{item.gbErrCode},#{item.gbEndTime}, #{item.gbSecrecy},#{item.gbIpAddress}," +
@ -235,9 +235,9 @@ public interface CommonGBChannelMapper {
" gb_ptz_type = null, gb_position_type = null, gb_room_type = null, gb_use_type = null, gb_supply_light_type = null, " + " gb_ptz_type = null, gb_position_type = null, gb_room_type = null, gb_use_type = null, gb_supply_light_type = null, " +
" gb_direction_type = null, gb_resolution = null, gb_business_group_id = null, gb_download_speed = null, gb_svc_space_support_mod = null, " + " gb_direction_type = null, gb_resolution = null, gb_business_group_id = null, gb_download_speed = null, gb_svc_space_support_mod = null, " +
" gb_svc_time_support_mode = null" + " gb_svc_time_support_mode = null" +
" WHERE id = #{id} and device_db_id = #{gbDeviceDbId}"+ " WHERE id = #{id} and data_type = #{dataType} and data_device_id = #{dataDeviceId}"+
" </script>"}) " </script>"})
void reset(@Param("id") int id, @Param("gbDeviceDbId") int gbDeviceDbId, @Param("updateTime") String updateTime); void reset(@Param("id") int id, @Param("dataType") Integer dataType, @Param("dataDeviceId") int dataDeviceId, @Param("updateTime") String updateTime);
@SelectProvider(type = ChannelProvider.class, method = "queryByIds") @SelectProvider(type = ChannelProvider.class, method = "queryByIds")
@ -252,13 +252,13 @@ public interface CommonGBChannelMapper {
@SelectProvider(type = ChannelProvider.class, method = "queryListByCivilCode") @SelectProvider(type = ChannelProvider.class, method = "queryListByCivilCode")
List<CommonGBChannel> queryListByCivilCode(@Param("query") String query, @Param("online") Boolean online, List<CommonGBChannel> queryListByCivilCode(@Param("query") String query, @Param("online") Boolean online,
@Param("channelType") Integer channelType, @Param("civilCode") String civilCode); @Param("dataType") Integer dataType, @Param("civilCode") String civilCode);
@SelectProvider(type = ChannelProvider.class, method = "queryListByParentId") @SelectProvider(type = ChannelProvider.class, method = "queryListByParentId")
List<CommonGBChannel> queryListByParentId(@Param("query") String query, @Param("online") Boolean online, List<CommonGBChannel> queryListByParentId(@Param("query") String query, @Param("online") Boolean online,
@Param("channelType") Integer channelType, @Param("groupDeviceId") String groupDeviceId); @Param("dataType") Integer dataType, @Param("groupDeviceId") String groupDeviceId);
@ -311,14 +311,14 @@ public interface CommonGBChannelMapper {
List<CommonGBChannel> queryByCivilCode(@Param("civilCode") String civilCode); List<CommonGBChannel> queryByCivilCode(@Param("civilCode") String civilCode);
@SelectProvider(type = ChannelProvider.class, method = "queryByGbDeviceIds") @SelectProvider(type = ChannelProvider.class, method = "queryByGbDeviceIds")
List<CommonGBChannel> queryByGbDeviceIds(List<Integer> deviceIds); List<CommonGBChannel> queryByGbDeviceIds(@Param("dataType") Integer dataType, List<Integer> deviceIds);
@Select(value = {" <script>" + @Select(value = {" <script>" +
" select id from wvp_device_channel " + " select id from wvp_device_channel " +
" where channel_type = 0 and device_db_id in "+ " where channel_type = 0 and data_type = #{dataType} and data_device_id in "+
" <foreach collection='deviceIds' item='item' open='(' separator=',' close=')' > #{item}</foreach>" + " <foreach collection='deviceIds' item='item' open='(' separator=',' close=')' > #{item}</foreach>" +
" </script>"}) " </script>"})
List<Integer> queryByGbDeviceIdsForIds(List<Integer> deviceIds); List<Integer> queryByGbDeviceIdsForIds(@Param("dataType") Integer dataType, List<Integer> deviceIds);
@SelectProvider(type = ChannelProvider.class, method = "queryByGroupList") @SelectProvider(type = ChannelProvider.class, method = "queryByGroupList")
List<CommonGBChannel> queryByGroupList(List<Group> groupList); List<CommonGBChannel> queryByGroupList(List<Group> groupList);
@ -440,19 +440,20 @@ public interface CommonGBChannelMapper {
int updateCivilCodeByChannelList(@Param("civilCode") String civilCode, List<CommonGBChannel> channelList); int updateCivilCodeByChannelList(@Param("civilCode") String civilCode, List<CommonGBChannel> channelList);
@SelectProvider(type = ChannelProvider.class, method = "queryListByStreamPushList") @SelectProvider(type = ChannelProvider.class, method = "queryListByStreamPushList")
List<CommonGBChannel> queryListByStreamPushList(List<StreamPush> streamPushList); List<CommonGBChannel> queryListByStreamPushList(@Param("dataType") Integer dataType, List<StreamPush> streamPushList);
@Update(value = {" <script>" + @Update(value = {" <script>" +
" <foreach collection='channels' item='item' separator=';' >" + " <foreach collection='channels' item='item' separator=';' >" +
" UPDATE wvp_device_channel " + " UPDATE wvp_device_channel " +
" SET gb_longitude=#{item.gbLongitude}, gb_latitude=#{item.gbLatitude} " + " SET gb_longitude=#{item.gbLongitude}, gb_latitude=#{item.gbLatitude} " +
" WHERE stream_push_id IS NOT NULL AND gb_device_id=#{item.gbDeviceId} "+ " WHERE data_type = #{dataType} AND gb_device_id=#{item.gbDeviceId} "+
"</foreach>"+ "</foreach>"+
" </script>"}) " </script>"})
void updateGpsByDeviceIdForStreamPush(List<CommonGBChannel> channels); void updateGpsByDeviceIdForStreamPush(@Param("dataType") Integer dataType, List<CommonGBChannel> channels);
@SelectProvider(type = ChannelProvider.class, method = "queryList") @SelectProvider(type = ChannelProvider.class, method = "queryList")
List<CommonGBChannel> queryList(@Param("query") String query, @Param("online") Boolean online, @Param("hasRecordPlan") Boolean hasRecordPlan, @Param("channelType") Integer channelType); List<CommonGBChannel> queryList(@Param("query") String query, @Param("online") Boolean online,
@Param("hasRecordPlan") Boolean hasRecordPlan, @Param("dataType") Integer dataType);
@Update(value = {" <script>" + @Update(value = {" <script>" +
" UPDATE wvp_device_channel " + " UPDATE wvp_device_channel " +
@ -487,9 +488,8 @@ public interface CommonGBChannelMapper {
@Select("<script>" + @Select("<script>" +
" select " + " select " +
" wdc.id as gb_id,\n" + " wdc.id as gb_id,\n" +
" wdc.device_db_id as gb_device_db_id,\n" + " wdc.data_type,\n" +
" wdc.stream_push_id,\n" + " wdc.data_device_id,\n" +
" wdc.stream_proxy_id,\n" +
" wdc.create_time,\n" + " wdc.create_time,\n" +
" wdc.update_time,\n" + " wdc.update_time,\n" +
" wdc.record_plan_id,\n" + " wdc.record_plan_id,\n" +
@ -536,12 +536,10 @@ public interface CommonGBChannelMapper {
" <if test='online == false'> AND coalesce(wdc.gb_status, wdc.status) = 'OFF'</if> " + " <if test='online == false'> AND coalesce(wdc.gb_status, wdc.status) = 'OFF'</if> " +
" <if test='hasLink == true'> AND wdc.record_plan_id = #{planId}</if> " + " <if test='hasLink == true'> AND wdc.record_plan_id = #{planId}</if> " +
" <if test='hasLink == false'> AND wdc.record_plan_id is null</if> " + " <if test='hasLink == false'> AND wdc.record_plan_id is null</if> " +
" <if test='channelType == 0'> AND wdc.device_db_id is not null</if> " + " <if test='dataType != null'> AND wdc.data_type = #{dataType}</if> " +
" <if test='channelType == 1'> AND wdc.stream_push_id is not null</if> " +
" <if test='channelType == 2'> AND wdc.stream_proxy_id is not null</if> " +
"</script>") "</script>")
List<CommonGBChannel> queryForRecordPlanForWebList(@Param("planId") Integer planId, @Param("query") String query, List<CommonGBChannel> queryForRecordPlanForWebList(@Param("planId") Integer planId, @Param("query") String query,
@Param("channelType") Integer channelType, @Param("online") Boolean online, @Param("dataType") Integer dataType, @Param("online") Boolean online,
@Param("hasLink") Boolean hasLink); @Param("hasLink") Boolean hasLink);
@SelectProvider(type = ChannelProvider.class, method = "queryByDataId") @SelectProvider(type = ChannelProvider.class, method = "queryByDataId")

View File

@ -21,13 +21,13 @@ public interface DeviceChannelMapper {
@Insert("<script> " + @Insert("<script> " +
"insert into wvp_device_channel " + "insert into wvp_device_channel " +
"(device_id, device_db_id, name, manufacturer, model, owner, civil_code, block, " + "(device_id, data_type, data_device_id, name, manufacturer, model, owner, civil_code, block, " +
"address, parental, parent_id, safety_way, register_way, cert_num, certifiable, err_code, end_time, secrecy, " + "address, parental, parent_id, safety_way, register_way, cert_num, certifiable, err_code, end_time, secrecy, " +
"ip_address, port, password, status, longitude, latitude, ptz_type, position_type, room_type, use_type, " + "ip_address, port, password, status, longitude, latitude, ptz_type, position_type, room_type, use_type, " +
"supply_light_type, direction_type, resolution, business_group_id, download_speed, svc_space_support_mod, " + "supply_light_type, direction_type, resolution, business_group_id, download_speed, svc_space_support_mod, " +
"svc_time_support_mode, create_time, update_time, sub_count, stream_id, has_audio, gps_time, stream_identification, channel_type) " + "svc_time_support_mode, create_time, update_time, sub_count, stream_id, has_audio, gps_time, stream_identification, channel_type) " +
"values " + "values " +
"(#{deviceId}, #{deviceDbId}, #{name}, #{manufacturer}, #{model}, #{owner}, #{civilCode}, #{block}, " + "(#{deviceId}, #{dataType}, #{dataDeviceId}, #{name}, #{manufacturer}, #{model}, #{owner}, #{civilCode}, #{block}, " +
"#{address}, #{parental}, #{parentId}, #{safetyWay}, #{registerWay}, #{certNum}, #{certifiable}, #{errCode}, #{endTime}, #{secrecy}, " + "#{address}, #{parental}, #{parentId}, #{safetyWay}, #{registerWay}, #{certNum}, #{certifiable}, #{errCode}, #{endTime}, #{secrecy}, " +
"#{ipAddress}, #{port}, #{password}, #{status}, #{longitude}, #{latitude}, #{ptzType}, #{positionType}, #{roomType}, #{useType}, " + "#{ipAddress}, #{port}, #{password}, #{status}, #{longitude}, #{latitude}, #{ptzType}, #{positionType}, #{roomType}, #{useType}, " +
"#{supplyLightType}, #{directionType}, #{resolution}, #{businessGroupId}, #{downloadSpeed}, #{svcSpaceSupportMod}," + "#{supplyLightType}, #{directionType}, #{resolution}, #{businessGroupId}, #{downloadSpeed}, #{svcSpaceSupportMod}," +
@ -40,7 +40,8 @@ public interface DeviceChannelMapper {
"UPDATE wvp_device_channel " + "UPDATE wvp_device_channel " +
"SET update_time=#{updateTime}" + "SET update_time=#{updateTime}" +
", device_id=#{deviceId}" + ", device_id=#{deviceId}" +
", device_db_id=#{deviceDbId}" + ", data_type=#{dataType}" +
", data_device_id=#{dataDeviceId}" +
", name=#{name}" + ", name=#{name}" +
", manufacturer=#{manufacturer}" + ", manufacturer=#{manufacturer}" +
", model=#{model}" + ", model=#{model}" +
@ -85,22 +86,22 @@ public interface DeviceChannelMapper {
int update(DeviceChannel channel); int update(DeviceChannel channel);
@SelectProvider(type = DeviceChannelProvider.class, method = "queryChannels") @SelectProvider(type = DeviceChannelProvider.class, method = "queryChannels")
List<DeviceChannel> queryChannels(@Param("deviceDbId") int deviceDbId, @Param("civilCode") String civilCode, List<DeviceChannel> queryChannels(@Param("dataDeviceId") int dataDeviceId, @Param("civilCode") String civilCode,
@Param("businessGroupId") String businessGroupId, @Param("parentChannelId") String parentChannelId, @Param("businessGroupId") String businessGroupId, @Param("parentChannelId") String parentChannelId,
@Param("query") String query, @Param("hasSubChannel") Boolean hasSubChannel, @Param("query") String query, @Param("hasSubChannel") Boolean hasSubChannel,
@Param("online") Boolean online, @Param("channelIds") List<String> channelIds); @Param("online") Boolean online, @Param("channelIds") List<String> channelIds);
@SelectProvider(type = DeviceChannelProvider.class, method = "queryChannelsByDeviceDbId") @SelectProvider(type = DeviceChannelProvider.class, method = "queryChannelsByDeviceDbId")
List<DeviceChannel> queryChannelsByDeviceDbId(@Param("deviceDbId") int deviceDbId); List<DeviceChannel> queryChannelsByDeviceDbId(@Param("dataDeviceId") int dataDeviceId);
@Select(value = {" <script> " + @Select("<script> " +
"select id from wvp_device_channel where device_db_id in " + "select id from wvp_device_channel where data_type =1 and data_device_id in " +
" <foreach item='item' index='index' collection='deviceDbIds' open='(' separator=',' close=')'> #{item} </foreach>" + " <foreach item='item' index='index' collection='deviceDbIds' open='(' separator=',' close=')'> #{item} </foreach>" +
" </script>"}) " </script>")
List<Integer> queryChaneIdListByDeviceDbIds(List<Integer> deviceDbIds); List<Integer> queryChaneIdListByDeviceDbIds(List<Integer> deviceDbIds);
@Delete("DELETE FROM wvp_device_channel WHERE device_db_id=#{deviceId}") @Delete("DELETE FROM wvp_device_channel WHERE data_type =1 and data_device_id=#{deviceId}")
int cleanChannelsByDeviceId(@Param("deviceId") int deviceId); int cleanChannelsByDeviceId(@Param("dataDeviceId") int dataDeviceId);
@Delete("DELETE FROM wvp_device_channel WHERE id=#{id}") @Delete("DELETE FROM wvp_device_channel WHERE id=#{id}")
int del(@Param("id") int id); int del(@Param("id") int id);
@ -141,8 +142,8 @@ public interface DeviceChannelMapper {
" coalesce(dc.gb_business_group_id, dc.business_group_id) as business_group_id " + " coalesce(dc.gb_business_group_id, dc.business_group_id) as business_group_id " +
" from " + " from " +
" wvp_device_channel dc " + " wvp_device_channel dc " +
" LEFT JOIN wvp_device de ON dc.device_db_id = de.id " + " LEFT JOIN wvp_device de ON dc.data_device_id = de.id " +
" WHERE 1=1" + " WHERE dc.data_type = 1 " +
" <if test='deviceId != null'> AND de.device_id = #{deviceId} </if> " + " <if test='deviceId != null'> AND de.device_id = #{deviceId} </if> " +
" <if test='query != null'> AND (dc.device_id LIKE '%${query}%' OR dc.name LIKE '%${query}%' OR dc.name LIKE '%${query}%')</if> " + " <if test='query != null'> AND (dc.device_id LIKE '%${query}%' OR dc.name LIKE '%${query}%' OR dc.name LIKE '%${query}%')</if> " +
" <if test='parentChannelId != null'> AND dc.parent_id=#{parentChannelId} </if> " + " <if test='parentChannelId != null'> AND dc.parent_id=#{parentChannelId} </if> " +
@ -172,9 +173,9 @@ public interface DeviceChannelMapper {
" pgc.platform_id as platform_id,\n" + " pgc.platform_id as platform_id,\n" +
" pgc.catalog_id as catalog_id " + " pgc.catalog_id as catalog_id " +
" FROM wvp_device_channel dc " + " FROM wvp_device_channel dc " +
" LEFT JOIN wvp_device de ON dc.device_db_id = de.id " + " LEFT JOIN wvp_device de ON dc.data_device_id = de.id " +
" LEFT JOIN wvp_platform_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 " + " WHERE dc.data_type = 1 " +
" <if test='query != null'> " + " <if test='query != null'> " +
"AND " + "AND " +
"(COALESCE(dc.gb_device_id, dc.device_id) LIKE concat('%',#{query},'%') " + "(COALESCE(dc.gb_device_id, dc.device_id) LIKE concat('%',#{query},'%') " +
@ -195,14 +196,14 @@ public interface DeviceChannelMapper {
@Insert("<script> " + @Insert("<script> " +
"insert into wvp_device_channel " + "insert into wvp_device_channel " +
"(device_id, device_db_id, name, manufacturer, model, owner, civil_code, block, " + "(device_id, data_type, data_device_id, name, manufacturer, model, owner, civil_code, block, " +
"address, parental, parent_id, safety_way, register_way, cert_num, certifiable, err_code, end_time, secrecy, " + "address, parental, parent_id, safety_way, register_way, cert_num, certifiable, err_code, end_time, secrecy, " +
"ip_address, port, password, status, longitude, latitude, ptz_type, position_type, room_type, use_type, " + "ip_address, port, password, status, longitude, latitude, ptz_type, position_type, room_type, use_type, " +
"supply_light_type, direction_type, resolution, business_group_id, download_speed, svc_space_support_mod, " + "supply_light_type, direction_type, resolution, business_group_id, download_speed, svc_space_support_mod, " +
"svc_time_support_mode, create_time, update_time, sub_count, stream_id, has_audio, gps_time, stream_identification, channel_type) " + "svc_time_support_mode, create_time, update_time, sub_count, stream_id, has_audio, gps_time, stream_identification, channel_type) " +
"values " + "values " +
"<foreach collection='addChannels' index='index' item='item' separator=','> " + "<foreach collection='addChannels' index='index' item='item' separator=','> " +
"(#{item.deviceId}, #{item.deviceDbId}, #{item.name}, #{item.manufacturer}, #{item.model}, #{item.owner}, #{item.civilCode}, #{item.block}, " + "(#{item.deviceId}, #{item.dataType}, #{item.dataDeviceId}, #{item.name}, #{item.manufacturer}, #{item.model}, #{item.owner}, #{item.civilCode}, #{item.block}, " +
"#{item.address}, #{item.parental}, #{item.parentId}, #{item.safetyWay}, #{item.registerWay}, #{item.certNum}, #{item.certifiable}, #{item.errCode}, #{item.endTime}, #{item.secrecy}, " + "#{item.address}, #{item.parental}, #{item.parentId}, #{item.safetyWay}, #{item.registerWay}, #{item.certNum}, #{item.certifiable}, #{item.errCode}, #{item.endTime}, #{item.secrecy}, " +
"#{item.ipAddress}, #{item.port}, #{item.password}, #{item.status}, #{item.longitude}, #{item.latitude}, #{item.ptzType}, #{item.positionType}, #{item.roomType}, #{item.useType}, " + "#{item.ipAddress}, #{item.port}, #{item.password}, #{item.status}, #{item.longitude}, #{item.latitude}, #{item.ptzType}, #{item.positionType}, #{item.roomType}, #{item.useType}, " +
"#{item.supplyLightType}, #{item.directionType}, #{item.resolution}, #{item.businessGroupId}, #{item.downloadSpeed}, #{item.svcSpaceSupportMod}," + "#{item.supplyLightType}, #{item.directionType}, #{item.resolution}, #{item.businessGroupId}, #{item.downloadSpeed}, #{item.svcSpaceSupportMod}," +
@ -221,7 +222,8 @@ public interface DeviceChannelMapper {
" wvp_device_channel" + " wvp_device_channel" +
" SET update_time=#{item.updateTime}" + " SET update_time=#{item.updateTime}" +
", device_id=#{item.deviceId}" + ", device_id=#{item.deviceId}" +
", device_db_id=#{item.deviceDbId}" + ", data_type=#{item.dataType}" +
", data_device_id=#{item.dataDeviceId}" +
", name=#{item.name}" + ", name=#{item.name}" +
", manufacturer=#{item.manufacturer}" + ", manufacturer=#{item.manufacturer}" +
", model=#{item.model}" + ", model=#{item.model}" +
@ -273,7 +275,8 @@ public interface DeviceChannelMapper {
" wvp_device_channel" + " wvp_device_channel" +
" SET update_time=#{item.updateTime}" + " SET update_time=#{item.updateTime}" +
", device_id=#{item.deviceId}" + ", device_id=#{item.deviceId}" +
", device_db_id=#{item.deviceDbId}" + ", data_type=#{item.dataType}" +
", data_device_id=#{item.dataDeviceId}" +
", name=#{item.name}" + ", name=#{item.name}" +
", manufacturer=#{item.manufacturer}" + ", manufacturer=#{item.manufacturer}" +
", model=#{item.model}" + ", model=#{item.model}" +
@ -313,7 +316,7 @@ public interface DeviceChannelMapper {
", gps_time=#{item.gpsTime}" + ", gps_time=#{item.gpsTime}" +
", stream_identification=#{item.streamIdentification}" + ", stream_identification=#{item.streamIdentification}" +
", channel_type=#{item.channelType}" + ", channel_type=#{item.channelType}" +
" WHERE device_db_id = #{item.deviceDbId} and device_id=#{item.deviceId}" + " WHERE data_type = #{item.dataType} and data_device_id = #{item.dataDeviceId} and device_id=#{item.deviceId}" +
"</foreach>" + "</foreach>" +
"</script>"}) "</script>"})
int batchUpdateForNotify(List<DeviceChannel> updateChannels); int batchUpdateForNotify(List<DeviceChannel> updateChannels);
@ -322,9 +325,9 @@ public interface DeviceChannelMapper {
" set sub_count = (select *" + " set sub_count = (select *" +
" from (select count(0)" + " from (select count(0)" +
" from wvp_device_channel" + " from wvp_device_channel" +
" where device_db_id = #{deviceDbId} and parent_id = #{channelId}) as temp)" + " where data_type = 1 and data_device_id = #{dataDeviceId} and parent_id = #{channelId}) as temp)" +
" where device_db_id = #{deviceDbId} and device_id = #{channelId}") " where data_type = 1 and data_device_id = #{dataDeviceId} and device_id = #{channelId}")
int updateChannelSubCount(@Param("deviceDbId") int deviceDbId, @Param("channelId") String channelId); int updateChannelSubCount(@Param("dataDeviceId") int dataDeviceId, @Param("channelId") String channelId);
@Update(value = {" <script>" + @Update(value = {" <script>" +
" UPDATE wvp_device_channel " + " UPDATE wvp_device_channel " +
@ -338,7 +341,7 @@ public interface DeviceChannelMapper {
@Select("select " + @Select("select " +
" id,\n" + " id,\n" +
" device_db_id,\n" + " data_device_id,\n" +
" create_time,\n" + " create_time,\n" +
" update_time,\n" + " update_time,\n" +
" sub_count,\n" + " sub_count,\n" +
@ -381,11 +384,11 @@ public interface DeviceChannelMapper {
" download_speed,\n" + " download_speed,\n" +
" svc_space_support_mod,\n" + " svc_space_support_mod,\n" +
" svc_time_support_mode\n" + " svc_time_support_mode\n" +
" from wvp_device_channel where device_db_id = #{deviceDbId}") " from wvp_device_channel where data_type = 1 and data_device_id = #{dataDeviceId}")
List<DeviceChannel> queryAllChannelsForRefresh(@Param("deviceDbId") int deviceDbId); List<DeviceChannel> queryAllChannelsForRefresh(@Param("dataDeviceId") int dataDeviceId);
@Select("select de.* from wvp_device de left join wvp_device_channel dc on de.device_id = dc.device_id where dc.device_id=#{channelId}") @Select("select de.* from wvp_device de left join wvp_device_channel dc on de.device_id = dc.device_id where dc.data_type = 1 and dc.device_id=#{channelId}")
List<Device> getDeviceByChannelDeviceId(String channelId); List<Device> getDeviceByChannelDeviceId(@Param("channelId") String channelId);
@Delete({"<script>" + @Delete({"<script>" +
@ -397,7 +400,7 @@ public interface DeviceChannelMapper {
@Update({"<script>" + @Update({"<script>" +
"<foreach collection='channels' item='item' separator=';'>" + "<foreach collection='channels' item='item' separator=';'>" +
"UPDATE wvp_device_channel SET status=#{item.status} WHERE device_id=#{item.deviceId}" + "UPDATE wvp_device_channel SET status=#{item.status} WHERE data_type = #{item.dataType} and device_id=#{item.deviceId}" +
"</foreach>" + "</foreach>" +
"</script>"}) "</script>"})
int batchUpdateStatus(List<DeviceChannel> channels); int batchUpdateStatus(List<DeviceChannel> channels);
@ -427,7 +430,7 @@ public interface DeviceChannelMapper {
"<if test='item.latitude != null'>, latitude=#{item.latitude}</if>" + "<if test='item.latitude != null'>, latitude=#{item.latitude}</if>" +
"<if test='item.gpsTime != null'>, gps_time=#{item.gpsTime}</if>" + "<if test='item.gpsTime != null'>, gps_time=#{item.gpsTime}</if>" +
"<if test='item.id > 0'>WHERE id=#{item.id}</if>" + "<if test='item.id > 0'>WHERE id=#{item.id}</if>" +
"<if test='item.id == 0'>WHERE device_db_id=#{item.deviceDbId} AND device_id=#{item.deviceId}</if>" + "<if test='item.id == 0'>WHERE data_type = #{item.dataType} and data_device_id=#{item.dataDeviceId} AND device_id=#{item.deviceId}</if>" +
"</foreach>" + "</foreach>" +
"</script>"}) "</script>"})
void batchUpdatePosition(List<DeviceChannel> channelList); void batchUpdatePosition(List<DeviceChannel> channelList);
@ -438,7 +441,7 @@ public interface DeviceChannelMapper {
@Select(value = {" <script>" + @Select(value = {" <script>" +
" SELECT " + " SELECT " +
" id,\n" + " id,\n" +
" device_db_id,\n" + " data_device_id,\n" +
" create_time,\n" + " create_time,\n" +
" update_time,\n" + " update_time,\n" +
" sub_count,\n" + " sub_count,\n" +
@ -487,13 +490,13 @@ public interface DeviceChannelMapper {
DeviceChannel getOneForSource(@Param("id") int id); DeviceChannel getOneForSource(@Param("id") int id);
@SelectProvider(type = DeviceChannelProvider.class, method = "getOneByDeviceId") @SelectProvider(type = DeviceChannelProvider.class, method = "getOneByDeviceId")
DeviceChannel getOneByDeviceId(@Param("deviceDbId") int deviceDbId, @Param("channelId") String channelId); DeviceChannel getOneByDeviceId(@Param("dataDeviceId") int dataDeviceId, @Param("channelId") String channelId);
@Select(value = {" <script>" + @Select(value = {" <script>" +
" SELECT " + " SELECT " +
" id,\n" + " id,\n" +
" device_db_id,\n" + " data_device_id,\n" +
" create_time,\n" + " create_time,\n" +
" update_time,\n" + " update_time,\n" +
" sub_count,\n" + " sub_count,\n" +
@ -537,9 +540,9 @@ public interface DeviceChannelMapper {
" svc_space_support_mod,\n" + " svc_space_support_mod,\n" +
" svc_time_support_mode\n" + " svc_time_support_mode\n" +
" from wvp_device_channel " + " from wvp_device_channel " +
" where device_db_id=#{deviceDbId} and coalesce(gb_device_id, device_id) = #{channelId}" + " where data_type = 1 and data_device_id=#{dataDeviceId} and coalesce(gb_device_id, device_id) = #{channelId}" +
" </script>"}) " </script>"})
DeviceChannel getOneByDeviceIdForSource(@Param("deviceDbId") int deviceDbId, @Param("channelId") String channelId); DeviceChannel getOneByDeviceIdForSource(@Param("dataDeviceId") int dataDeviceId, @Param("channelId") String channelId);
@Update(value = {"UPDATE wvp_device_channel SET stream_id=null WHERE id=#{channelId}"}) @Update(value = {"UPDATE wvp_device_channel SET stream_id=null WHERE id=#{channelId}"})
@ -559,7 +562,7 @@ public interface DeviceChannelMapper {
"</script>") "</script>")
void updateStreamGPS(List<GPSMsgInfo> gpsMsgInfoList); void updateStreamGPS(List<GPSMsgInfo> gpsMsgInfoList);
@Update("UPDATE wvp_device_channel SET status=#{status} WHERE device_db_id=#{deviceDbId} AND device_id=#{deviceId}") @Update("UPDATE wvp_device_channel SET status=#{status} WHERE data_type=#{dataType} and data_device_id=#{dataDeviceId} AND device_id=#{deviceId}")
void updateStatus(DeviceChannel channel); void updateStatus(DeviceChannel channel);
@ -568,7 +571,7 @@ public interface DeviceChannelMapper {
" wvp_device_channel" + " wvp_device_channel" +
" SET update_time=#{updateTime}" + " SET update_time=#{updateTime}" +
", device_id=#{deviceId}" + ", device_id=#{deviceId}" +
", device_db_id=#{deviceDbId}" + ", data_device_id=#{dataDeviceId}" +
", name=#{name}" + ", name=#{name}" +
", manufacturer=#{manufacturer}" + ", manufacturer=#{manufacturer}" +
", model=#{model}" + ", model=#{model}" +
@ -616,7 +619,7 @@ public interface DeviceChannelMapper {
@Select(value = {" <script>" + @Select(value = {" <script>" +
" SELECT " + " SELECT " +
" id,\n" + " id,\n" +
" device_db_id,\n" + " data_device_id,\n" +
" create_time,\n" + " create_time,\n" +
" update_time,\n" + " update_time,\n" +
" sub_count,\n" + " sub_count,\n" +
@ -660,7 +663,7 @@ public interface DeviceChannelMapper {
" svc_space_support_mod,\n" + " svc_space_support_mod,\n" +
" svc_time_support_mode\n" + " svc_time_support_mode\n" +
" from wvp_device_channel " + " from wvp_device_channel " +
" where device_db_id=#{deviceDbId} and device_id = #{channelId}" + " where data_type = 1 and data_device_id=#{dataDeviceId} and device_id = #{channelId}" +
" </script>"}) " </script>"})
DeviceChannel getOneBySourceChannelId(int deviceDbId, String channelId); DeviceChannel getOneBySourceChannelId(@Param("dataDeviceId") int dataDeviceId, @Param("channelId") String channelId);
} }

View File

@ -45,9 +45,9 @@ public interface DeviceMapper {
"on_line," + "on_line," +
"media_server_id," + "media_server_id," +
"broadcast_push_after_ack," + "broadcast_push_after_ack," +
"(SELECT count(0) FROM wvp_device_channel dc WHERE dc.device_db_id= de.id) as channel_count "+ "(SELECT count(0) FROM wvp_device_channel dc WHERE dc.data_type = 1 and dc.data_device_id= de.id) as channel_count "+
" FROM wvp_device de WHERE de.device_id = #{deviceId}") " FROM wvp_device de WHERE de.device_id = #{deviceId}")
Device getDeviceByDeviceId(String deviceId); Device getDeviceByDeviceId( @Param("deviceId") String deviceId);
@Insert("INSERT INTO wvp_device (" + @Insert("INSERT INTO wvp_device (" +
"device_id, " + "device_id, " +
@ -167,13 +167,13 @@ public interface DeviceMapper {
"geo_coord_sys,"+ "geo_coord_sys,"+
"on_line,"+ "on_line,"+
"media_server_id,"+ "media_server_id,"+
"(SELECT count(0) FROM wvp_device_channel dc WHERE dc.device_db_id= de.id) as channel_count " + "(SELECT count(0) FROM wvp_device_channel dc WHERE dc.data_type = #{dataType} and dc.data_device_id= de.id) as channel_count " +
"FROM wvp_device de" + "FROM wvp_device de" +
"<if test=\"onLine != null\"> where de.on_line=${onLine}</if>"+ "<if test='online != null'> where de.on_line=${online}</if>"+
" order by de.create_time desc "+ " order by de.create_time desc "+
" </script>" " </script>"
) )
List<Device> getDevices(Boolean onLine); List<Device> getDevices(@Param("dataType") Integer dataType, @Param("online") Boolean online);
@Delete("DELETE FROM wvp_device WHERE device_id=#{deviceId}") @Delete("DELETE FROM wvp_device WHERE device_id=#{deviceId}")
int del(String deviceId); int del(String deviceId);
@ -326,7 +326,7 @@ public interface DeviceMapper {
"geo_coord_sys,"+ "geo_coord_sys,"+
"on_line,"+ "on_line,"+
"media_server_id,"+ "media_server_id,"+
"(SELECT count(0) FROM wvp_device_channel dc WHERE dc.device_db_id= de.id) as channel_count " + "(SELECT count(0) FROM wvp_device_channel dc WHERE dc.data_type = #{dataType} and dc.data_device_id= de.id) as channel_count " +
" FROM wvp_device de" + " FROM wvp_device de" +
" where 1 = 1 "+ " where 1 = 1 "+
" <if test='status != null'> AND de.on_line=${status}</if>"+ " <if test='status != null'> AND de.on_line=${status}</if>"+
@ -337,7 +337,7 @@ public interface DeviceMapper {
"</if> " + "</if> " +
" order by create_time desc "+ " order by create_time desc "+
" </script>") " </script>")
List<Device> getDeviceList(@Param("query") String query, @Param("status") Boolean status); List<Device> getDeviceList(@Param("dataType") Integer dataType, @Param("query") String query, @Param("status") Boolean status);
@Select("select * from wvp_device_channel where id = #{id}") @Select("select * from wvp_device_channel where id = #{id}")
DeviceChannel getRawChannel(@Param("id") int id); DeviceChannel getRawChannel(@Param("id") int id);
@ -345,10 +345,10 @@ public interface DeviceMapper {
@Select("select * from wvp_device where id = #{id}") @Select("select * from wvp_device where id = #{id}")
Device query(@Param("id") Integer id); Device query(@Param("id") Integer id);
@Select("select wd.* from wvp_device wd left join wvp_device_channel wdc on wd.id = wdc.device_db_id where wdc.id = #{channelId}") @Select("select wd.* from wvp_device wd left join wvp_device_channel wdc on wdc.data_type = #{dataType} and wd.id = wdc.data_device_id where wdc.id = #{channelId}")
Device queryByChannelId(@Param("channelId") Integer channelId); Device queryByChannelId(@Param("dataType") Integer dataType, @Param("channelId") Integer channelId);
@Select("select wd.* from wvp_device wd left join wvp_device_channel wdc on wd.id = wdc.device_db_id where wdc.device_id = #{channelDeviceId}") @Select("select wd.* from wvp_device wd left join wvp_device_channel wdc on wdc.data_type = #{dataType} and wd.id = wdc.data_device_id where wdc.device_id = #{channelDeviceId}")
Device getDeviceBySourceChannelDeviceId(@Param("channelDeviceId") String channelDeviceId); Device getDeviceBySourceChannelDeviceId(@Param("dataType") Integer dataType, @Param("channelDeviceId") String channelDeviceId);
} }

View File

@ -65,9 +65,8 @@ public interface PlatformChannelMapper {
" select " + " select " +
" wpgc.id ,\n" + " wpgc.id ,\n" +
" wdc.id as gb_id,\n" + " wdc.id as gb_id,\n" +
" wdc.device_db_id as gb_device_db_id,\n" + " wdc.data_type ,\n" +
" wdc.stream_push_id,\n" + " wdc.data_device_id,\n" +
" wdc.stream_proxy_id,\n" +
" wdc.create_time,\n" + " wdc.create_time,\n" +
" wdc.update_time,\n" + " wdc.update_time,\n" +
" wpgc.custom_device_id, \n" + " wpgc.custom_device_id, \n" +
@ -149,19 +148,16 @@ public interface PlatformChannelMapper {
" <if test='online == false'> AND coalesce(wpgc.status, wdc.gb_status, wdc.status) = 'OFF'</if> " + " <if test='online == false'> AND coalesce(wpgc.status, wdc.gb_status, wdc.status) = 'OFF'</if> " +
" <if test='hasShare == true'> AND wpgc.platform_id = #{platformId}</if> " + " <if test='hasShare == true'> AND wpgc.platform_id = #{platformId}</if> " +
" <if test='hasShare == false'> AND wpgc.platform_id is null</if> " + " <if test='hasShare == false'> AND wpgc.platform_id is null</if> " +
" <if test='channelType == 0'> AND wdc.device_db_id is not null</if> " + " <if test='dataType != null'> AND wdc.data_type = #{dataType}</if> " +
" <if test='channelType == 1'> AND wdc.stream_push_id is not null</if> " +
" <if test='channelType == 2'> AND wdc.stream_proxy_id is not null</if> " +
"</script>") "</script>")
List<PlatformChannel> queryForPlatformForWebList(@Param("platformId") Integer platformId, @Param("query") String query, List<PlatformChannel> queryForPlatformForWebList(@Param("platformId") Integer platformId, @Param("query") String query,
@Param("channelType") Integer channelType, @Param("online") Boolean online, @Param("dataType") Integer dataType, @Param("online") Boolean online,
@Param("hasShare") Boolean hasShare); @Param("hasShare") Boolean hasShare);
@Select("select\n" + @Select("select\n" +
" wdc.id as gb_id,\n" + " wdc.id as gb_id,\n" +
" wdc.device_db_id as gb_device_db_id,\n" + " wdc.data_type,\n" +
" wdc.stream_push_id,\n" + " wdc.data_device_id,\n" +
" wdc.stream_proxy_id,\n" +
" wdc.create_time,\n" + " wdc.create_time,\n" +
" wdc.update_time,\n" + " wdc.update_time,\n" +
" coalesce(wpgc.custom_device_id, wdc.gb_device_id, wdc.device_id) as gb_device_id,\n" + " coalesce(wpgc.custom_device_id, wdc.gb_device_id, wdc.device_id) as gb_device_id,\n" +
@ -209,9 +205,8 @@ public interface PlatformChannelMapper {
@Select("<script>" + @Select("<script>" +
" select " + " select " +
" wdc.id as gb_id,\n" + " wdc.id as gb_id,\n" +
" wdc.device_db_id as gb_device_db_id,\n" + " wdc.data_type,\n" +
" wdc.stream_push_id,\n" + " wdc.data_device_id,\n" +
" wdc.stream_proxy_id,\n" +
" wdc.create_time,\n" + " wdc.create_time,\n" +
" wdc.update_time,\n" + " wdc.update_time,\n" +
" coalesce(wpgc.custom_device_id, wdc.gb_device_id, wdc.device_id) as gb_device_id,\n" + " coalesce(wpgc.custom_device_id, wdc.gb_device_id, wdc.device_id) as gb_device_id,\n" +
@ -260,9 +255,8 @@ public interface PlatformChannelMapper {
@Select("<script>" + @Select("<script>" +
" select " + " select " +
" wdc.id as gb_id,\n" + " wdc.id as gb_id,\n" +
" wdc.device_db_id as gb_device_db_id,\n" + " wdc.data_type,\n" +
" wdc.stream_push_id,\n" + " wdc.data_device_id,\n" +
" wdc.stream_proxy_id,\n" +
" wdc.create_time,\n" + " wdc.create_time,\n" +
" wdc.update_time,\n" + " wdc.update_time,\n" +
" coalesce(wpgc.custom_device_id, wdc.gb_device_id, wdc.device_id) as gb_device_id,\n" + " coalesce(wpgc.custom_device_id, wdc.gb_device_id, wdc.device_id) as gb_device_id,\n" +
@ -485,9 +479,8 @@ public interface PlatformChannelMapper {
@Select("<script>" + @Select("<script>" +
" select " + " select " +
" wdc.id as gb_id,\n" + " wdc.id as gb_id,\n" +
" wdc.device_db_id as gb_device_db_id,\n" + " wdc.data_type,\n" +
" wdc.stream_push_id,\n" + " wdc.data_device_id,\n" +
" wdc.stream_proxy_id,\n" +
" wdc.create_time,\n" + " wdc.create_time,\n" +
" wdc.update_time,\n" + " wdc.update_time,\n" +
" coalesce(wpgc.custom_device_id, wdc.gb_device_id, wdc.device_id) as gb_device_id,\n" + " coalesce(wpgc.custom_device_id, wdc.gb_device_id, wdc.device_id) as gb_device_id,\n" +

View File

@ -12,7 +12,6 @@ public class ChannelProvider {
public final static String BASE_SQL = "select\n" + public final static String BASE_SQL = "select\n" +
" id as gb_id,\n" + " id as gb_id,\n" +
" device_db_id as gb_device_db_id,\n" +
" data_type,\n" + " data_type,\n" +
" data_device_id,\n" + " data_device_id,\n" +
" create_time,\n" + " create_time,\n" +
@ -58,8 +57,7 @@ public class ChannelProvider {
private final static String BASE_SQL_FOR_PLATFORM = private final static String BASE_SQL_FOR_PLATFORM =
"select\n" + "select\n" +
" wdc.id as gb_id,\n" + " wdc.id as gb_id,\n" +
" wdc.device_db_id as gb_device_db_id,\n" + " wdc.data_type,\n" +
" wdc.stream_push_id,\n" +
" wdc.data_device_id,\n" + " wdc.data_device_id,\n" +
" wdc.create_time,\n" + " wdc.create_time,\n" +
" wdc.update_time,\n" + " wdc.update_time,\n" +
@ -133,14 +131,8 @@ public class ChannelProvider {
}else { }else {
sqlBuild.append(" AND coalesce(gb_civil_code, civil_code) is null"); sqlBuild.append(" AND coalesce(gb_civil_code, civil_code) is null");
} }
if (params.get("channelType") != null) { if (params.get("dataType") != null) {
if ((Integer)params.get("channelType") == 0) { sqlBuild.append(" AND data_type = #{dataType}");
sqlBuild.append(" AND device_db_id is not null");
}else if ((Integer)params.get("channelType") == 1) {
sqlBuild.append(" AND stream_push_id is not null");
}else if ((Integer)params.get("channelType") == 2) {
sqlBuild.append(" AND stream_proxy_id is not null");
}
} }
return sqlBuild.toString(); return sqlBuild.toString();
} }
@ -165,15 +157,8 @@ public class ChannelProvider {
}else { }else {
sqlBuild.append(" AND coalesce(gb_parent_id, parent_id) is null"); sqlBuild.append(" AND coalesce(gb_parent_id, parent_id) is null");
} }
if (params.get("dataType") != null) {
if (params.get("channelType") != null) { sqlBuild.append(" AND data_type = #{dataType}");
if ((Integer)params.get("channelType") == 0) {
sqlBuild.append(" AND device_db_id is not null");
}else if ((Integer)params.get("channelType") == 1) {
sqlBuild.append(" AND stream_push_id is not null");
}else if ((Integer)params.get("channelType") == 2) {
sqlBuild.append(" AND stream_proxy_id is not null");
}
} }
return sqlBuild.toString(); return sqlBuild.toString();
} }
@ -196,15 +181,8 @@ public class ChannelProvider {
if (params.get("hasRecordPlan") != null && (Boolean)params.get("hasRecordPlan")) { if (params.get("hasRecordPlan") != null && (Boolean)params.get("hasRecordPlan")) {
sqlBuild.append(" AND record_plan_id > 0"); sqlBuild.append(" AND record_plan_id > 0");
} }
if (params.get("dataType") != null) {
if (params.get("channelType") != null) { sqlBuild.append(" AND data_type = #{dataType}");
if ((Integer)params.get("channelType") == 0) {
sqlBuild.append(" AND device_db_id is not null");
}else if ((Integer)params.get("channelType") == 1) {
sqlBuild.append(" AND stream_push_id is not null");
}else if ((Integer)params.get("channelType") == 2) {
sqlBuild.append(" AND stream_proxy_id is not null");
}
} }
return sqlBuild.toString(); return sqlBuild.toString();
} }
@ -248,7 +226,7 @@ public class ChannelProvider {
public String queryByGbDeviceIds(Map<String, Object> params ){ public String queryByGbDeviceIds(Map<String, Object> params ){
StringBuilder sqlBuild = new StringBuilder(); StringBuilder sqlBuild = new StringBuilder();
sqlBuild.append(BASE_SQL); sqlBuild.append(BASE_SQL);
sqlBuild.append("where channel_type = 0 and device_db_id in ( "); sqlBuild.append("where channel_type = 0 and data_type = #{dataType} and data_device_id in ( ");
Collection<Integer> ids = (Collection<Integer>)params.get("deviceIds"); Collection<Integer> ids = (Collection<Integer>)params.get("deviceIds");
boolean first = true; boolean first = true;
@ -351,7 +329,7 @@ public class ChannelProvider {
StringBuilder sqlBuild = new StringBuilder(); StringBuilder sqlBuild = new StringBuilder();
sqlBuild.append(BASE_SQL); sqlBuild.append(BASE_SQL);
sqlBuild.append(" where channel_type = 0 and stream_push_id in ( "); sqlBuild.append(" where channel_type = 0 and data_type = #{dataType} and data_device_id in ( ");
Collection<StreamPush> ids = (Collection<StreamPush>)params.get("streamPushList"); Collection<StreamPush> ids = (Collection<StreamPush>)params.get("streamPushList");
boolean first = true; boolean first = true;
for (StreamPush streamPush : ids) { for (StreamPush streamPush : ids) {

View File

@ -1,5 +1,6 @@
package com.genersoft.iot.vmp.gb28181.dao.provider; package com.genersoft.iot.vmp.gb28181.dao.provider;
import com.genersoft.iot.vmp.common.enums.ChannelDataType;
import org.springframework.util.ObjectUtils; import org.springframework.util.ObjectUtils;
import java.util.List; import java.util.List;
@ -10,7 +11,7 @@ public class DeviceChannelProvider {
public String getBaseSelectSql(){ public String getBaseSelectSql(){
return "SELECT " + return "SELECT " +
" dc.id,\n" + " dc.id,\n" +
" dc.device_db_id,\n" + " dc.data_device_id,\n" +
" dc.create_time,\n" + " dc.create_time,\n" +
" dc.update_time,\n" + " dc.update_time,\n" +
" dc.sub_count,\n" + " dc.sub_count,\n" +
@ -60,7 +61,7 @@ public class DeviceChannelProvider {
public String queryChannels(Map<String, Object> params ){ public String queryChannels(Map<String, Object> params ){
StringBuilder sqlBuild = new StringBuilder(); StringBuilder sqlBuild = new StringBuilder();
sqlBuild.append(getBaseSelectSql()); sqlBuild.append(getBaseSelectSql());
sqlBuild.append(" where dc.device_db_id = #{deviceDbId} "); sqlBuild.append(" where data_type = " + ChannelDataType.GB28181.value + " and dc.data_device_id = #{dataDeviceId} ");
if (params.get("businessGroupId") != null ) { if (params.get("businessGroupId") != null ) {
sqlBuild.append(" AND coalesce(dc.gb_business_group_id, dc.business_group_id)=#{businessGroupId} AND coalesce(dc.gb_parent_id, dc.parent_id) is null"); sqlBuild.append(" AND coalesce(dc.gb_business_group_id, dc.business_group_id)=#{businessGroupId} AND coalesce(dc.gb_parent_id, dc.parent_id) is null");
}else if (params.get("parentChannelId") != null ) { }else if (params.get("parentChannelId") != null ) {
@ -107,14 +108,14 @@ public class DeviceChannelProvider {
public String queryChannelsByDeviceDbId(Map<String, Object> params ){ public String queryChannelsByDeviceDbId(Map<String, Object> params ){
StringBuilder sqlBuild = new StringBuilder(); StringBuilder sqlBuild = new StringBuilder();
sqlBuild.append(getBaseSelectSql()); sqlBuild.append(getBaseSelectSql());
sqlBuild.append(" where dc.device_db_id = #{deviceDbId}"); sqlBuild.append(" where data_type = " + ChannelDataType.GB28181.value + " and dc.data_device_id = #{dataDeviceId}");
return sqlBuild.toString(); return sqlBuild.toString();
} }
public String queryAllChannels(Map<String, Object> params ){ public String queryAllChannels(Map<String, Object> params ){
StringBuilder sqlBuild = new StringBuilder(); StringBuilder sqlBuild = new StringBuilder();
sqlBuild.append(getBaseSelectSql()); sqlBuild.append(getBaseSelectSql());
sqlBuild.append(" where dc.device_db_id = #{deviceDbId}"); sqlBuild.append(" where data_type = " + ChannelDataType.GB28181.value + " and dc.data_device_id = #{dataDeviceId}");
return sqlBuild.toString(); return sqlBuild.toString();
} }
@ -128,33 +129,25 @@ public class DeviceChannelProvider {
public String getOneByDeviceId(Map<String, Object> params ){ public String getOneByDeviceId(Map<String, Object> params ){
StringBuilder sqlBuild = new StringBuilder(); StringBuilder sqlBuild = new StringBuilder();
sqlBuild.append(getBaseSelectSql()); sqlBuild.append(getBaseSelectSql());
sqlBuild.append(" where dc.device_db_id=#{deviceDbId} and coalesce(dc.gb_device_id, dc.device_id) = #{channelId}"); sqlBuild.append(" where data_type = " + ChannelDataType.GB28181.value + " and dc.data_device_id=#{dataDeviceId} and coalesce(dc.gb_device_id, dc.device_id) = #{channelId}");
return sqlBuild.toString(); return sqlBuild.toString();
} }
public String queryByDeviceId(Map<String, Object> params ){ public String queryByDeviceId(Map<String, Object> params ){
return getBaseSelectSql() + " where channel_type = 0 and coalesce(gb_device_id, device_id) = #{gbDeviceId}"; return getBaseSelectSql() + " where data_type = " + ChannelDataType.GB28181.value + " and channel_type = 0 and coalesce(gb_device_id, device_id) = #{gbDeviceId}";
} }
public String queryById(Map<String, Object> params ){ public String queryById(Map<String, Object> params ){
return getBaseSelectSql() + " where channel_type = 0 and id = #{gbId}"; return getBaseSelectSql() + " where data_type = " + ChannelDataType.GB28181.value + " and channel_type = 0 and id = #{gbId}";
}
public String queryByStreamPushId(Map<String, Object> params ){
return getBaseSelectSql() + " where channel_type = 0 and stream_push_id = #{streamPushId}";
}
public String queryByStreamProxyId(Map<String, Object> params ){
return getBaseSelectSql() + " where channel_type = 0 and stream_proxy_id = #{streamProxyId}";
} }
public String queryList(Map<String, Object> params ){ public String queryList(Map<String, Object> params ){
StringBuilder sqlBuild = new StringBuilder(); StringBuilder sqlBuild = new StringBuilder();
sqlBuild.append(getBaseSelectSql()); sqlBuild.append(getBaseSelectSql());
sqlBuild.append(" where channel_type = 0 "); sqlBuild.append(" where channel_type = 0 and data_type = " + ChannelDataType.GB28181.value);
if (params.get("query") != null) { if (params.get("query") != null) {
sqlBuild.append(" AND (coalesce(gb_device_id, device_id) LIKE concat('%',#{query},'%')" + sqlBuild.append(" AND (coalesce(gb_device_id, device_id) LIKE concat('%',#{query},'%')" +
" OR coalesce(gb_name, name) LIKE concat('%',#{query},'%') )") " OR coalesce(gb_name, name) LIKE concat('%',#{query},'%') )")

View File

@ -4,6 +4,7 @@ import com.alibaba.fastjson2.JSONObject;
import com.baomidou.dynamic.datasource.annotation.DS; import com.baomidou.dynamic.datasource.annotation.DS;
import com.genersoft.iot.vmp.common.InviteInfo; import com.genersoft.iot.vmp.common.InviteInfo;
import com.genersoft.iot.vmp.common.InviteSessionType; import com.genersoft.iot.vmp.common.InviteSessionType;
import com.genersoft.iot.vmp.common.enums.ChannelDataType;
import com.genersoft.iot.vmp.conf.UserSetting; import com.genersoft.iot.vmp.conf.UserSetting;
import com.genersoft.iot.vmp.conf.exception.ControllerException; import com.genersoft.iot.vmp.conf.exception.ControllerException;
import com.genersoft.iot.vmp.gb28181.bean.Device; import com.genersoft.iot.vmp.gb28181.bean.Device;
@ -84,7 +85,7 @@ public class DeviceChannelServiceImpl implements IDeviceChannelService {
List<DeviceChannel> channelList = channelMapper.queryChannelsByDeviceDbId(device.getId()); List<DeviceChannel> channelList = channelMapper.queryChannelsByDeviceDbId(device.getId());
if (channelList.isEmpty()) { if (channelList.isEmpty()) {
for (DeviceChannel channel : channels) { for (DeviceChannel channel : channels) {
channel.setDeviceDbId(device.getId()); channel.setDataDeviceId(device.getId());
InviteInfo inviteInfo = inviteStreamService.getInviteInfoByDeviceAndChannel(InviteSessionType.PLAY, channel.getId()); InviteInfo inviteInfo = inviteStreamService.getInviteInfoByDeviceAndChannel(InviteSessionType.PLAY, channel.getId());
if (inviteInfo != null && inviteInfo.getStreamInfo() != null) { if (inviteInfo != null && inviteInfo.getStreamInfo() != null) {
channel.setStreamId(inviteInfo.getStreamInfo().getStream()); channel.setStreamId(inviteInfo.getStreamInfo().getStream());
@ -96,7 +97,7 @@ public class DeviceChannelServiceImpl implements IDeviceChannelService {
} }
}else { }else {
for (DeviceChannel deviceChannel : channelList) { for (DeviceChannel deviceChannel : channelList) {
channelsInStore.put(deviceChannel.getDeviceDbId() + deviceChannel.getDeviceId(), deviceChannel); channelsInStore.put(deviceChannel.getDataDeviceId() + deviceChannel.getDeviceId(), deviceChannel);
} }
for (DeviceChannel channel : channels) { for (DeviceChannel channel : channels) {
InviteInfo inviteInfo = inviteStreamService.getInviteInfoByDeviceAndChannel(InviteSessionType.PLAY, channel.getId()); InviteInfo inviteInfo = inviteStreamService.getInviteInfoByDeviceAndChannel(InviteSessionType.PLAY, channel.getId());
@ -105,7 +106,7 @@ public class DeviceChannelServiceImpl implements IDeviceChannelService {
} }
String now = DateUtil.getNow(); String now = DateUtil.getNow();
channel.setUpdateTime(now); channel.setUpdateTime(now);
DeviceChannel deviceChannelInDb = channelsInStore.get(channel.getDeviceDbId() + channel.getDeviceId()); DeviceChannel deviceChannelInDb = channelsInStore.get(channel.getDataDeviceId() + channel.getDeviceId());
if ( deviceChannelInDb != null) { if ( deviceChannelInDb != null) {
channel.setId(deviceChannelInDb.getId()); channel.setId(deviceChannelInDb.getId());
channel.setUpdateTime(now); channel.setUpdateTime(now);
@ -324,7 +325,7 @@ public class DeviceChannelServiceImpl implements IDeviceChannelService {
} }
for (DeviceChannel channel : channels) { for (DeviceChannel channel : channels) {
if (channel.getParentId() != null) { if (channel.getParentId() != null) {
channelMapper.updateChannelSubCount(channel.getDeviceDbId(), channel.getParentId()); channelMapper.updateChannelSubCount(channel.getDataDeviceId(), channel.getParentId());
} }
} }
} }
@ -487,7 +488,7 @@ public class DeviceChannelServiceImpl implements IDeviceChannelService {
Map<String,DeviceChannel> allChannelMap = new HashMap<>(); Map<String,DeviceChannel> allChannelMap = new HashMap<>();
if (!allChannels.isEmpty()) { if (!allChannels.isEmpty()) {
for (DeviceChannel deviceChannel : allChannels) { for (DeviceChannel deviceChannel : allChannels) {
allChannelMap.put(deviceChannel.getDeviceDbId() + deviceChannel.getDeviceId(), deviceChannel); allChannelMap.put(deviceChannel.getDataDeviceId() + deviceChannel.getDeviceId(), deviceChannel);
} }
} }
// 数据去重 // 数据去重
@ -500,7 +501,7 @@ public class DeviceChannelServiceImpl implements IDeviceChannelService {
Map<String, Integer> subContMap = new HashMap<>(); Map<String, Integer> subContMap = new HashMap<>();
for (DeviceChannel deviceChannel : deviceChannelList) { for (DeviceChannel deviceChannel : deviceChannelList) {
DeviceChannel channelInDb = allChannelMap.get(deviceChannel.getDeviceDbId() + deviceChannel.getDeviceId()); DeviceChannel channelInDb = allChannelMap.get(deviceChannel.getDataDeviceId() + deviceChannel.getDeviceId());
if (channelInDb != null) { if (channelInDb != null) {
deviceChannel.setStreamId(channelInDb.getStreamId()); deviceChannel.setStreamId(channelInDb.getStreamId());
deviceChannel.setHasAudio(channelInDb.isHasAudio()); deviceChannel.setHasAudio(channelInDb.isHasAudio());
@ -520,7 +521,7 @@ public class DeviceChannelServiceImpl implements IDeviceChannelService {
deviceChannel.setUpdateTime(DateUtil.getNow()); deviceChannel.setUpdateTime(DateUtil.getNow());
addChannels.add(deviceChannel); addChannels.add(deviceChannel);
} }
allChannelMap.remove(deviceChannel.getDeviceDbId() + deviceChannel.getDeviceId()); allChannelMap.remove(deviceChannel.getDataDeviceId() + deviceChannel.getDeviceId());
channels.add(deviceChannel); channels.add(deviceChannel);
if (!ObjectUtils.isEmpty(deviceChannel.getParentId())) { if (!ObjectUtils.isEmpty(deviceChannel.getParentId())) {
if (subContMap.get(deviceChannel.getParentId()) == null) { if (subContMap.get(deviceChannel.getParentId()) == null) {
@ -700,6 +701,8 @@ public class DeviceChannelServiceImpl implements IDeviceChannelService {
@Override @Override
public void addChannel(DeviceChannel channel) { public void addChannel(DeviceChannel channel) {
channel.setDataType(ChannelDataType.GB28181.value);
channel.setDataDeviceId(channel.getDataDeviceId());
channelMapper.add(channel); channelMapper.add(channel);
} }

View File

@ -4,6 +4,7 @@ import com.alibaba.fastjson2.JSON;
import com.baomidou.dynamic.datasource.annotation.DS; import com.baomidou.dynamic.datasource.annotation.DS;
import com.genersoft.iot.vmp.common.CommonCallback; import com.genersoft.iot.vmp.common.CommonCallback;
import com.genersoft.iot.vmp.common.VideoManagerConstants; import com.genersoft.iot.vmp.common.VideoManagerConstants;
import com.genersoft.iot.vmp.common.enums.ChannelDataType;
import com.genersoft.iot.vmp.conf.DynamicTask; import com.genersoft.iot.vmp.conf.DynamicTask;
import com.genersoft.iot.vmp.conf.UserSetting; import com.genersoft.iot.vmp.conf.UserSetting;
import com.genersoft.iot.vmp.conf.exception.ControllerException; import com.genersoft.iot.vmp.conf.exception.ControllerException;
@ -71,9 +72,6 @@ public class DeviceServiceImpl implements IDeviceService {
@Autowired @Autowired
private PlatformChannelMapper platformChannelMapper; private PlatformChannelMapper platformChannelMapper;
@Autowired
private IDeviceChannelService deviceChannelService;
@Autowired @Autowired
private DeviceChannelMapper deviceChannelMapper; private DeviceChannelMapper deviceChannelMapper;
@ -95,11 +93,15 @@ public class DeviceServiceImpl implements IDeviceService {
@Autowired @Autowired
private AudioBroadcastManager audioBroadcastManager; private AudioBroadcastManager audioBroadcastManager;
private Device getDeviceByDeviceIdFromDb(String deviceId) {
return deviceMapper.getDeviceByDeviceId(deviceId);
}
@Override @Override
public void online(Device device, SipTransactionInfo sipTransactionInfo) { public void online(Device device, SipTransactionInfo sipTransactionInfo) {
log.info("[设备上线] deviceId{}->{}:{}", device.getDeviceId(), device.getIp(), device.getPort()); log.info("[设备上线] deviceId{}->{}:{}", device.getDeviceId(), device.getIp(), device.getPort());
Device deviceInRedis = redisCatchStorage.getDevice(device.getDeviceId()); Device deviceInRedis = redisCatchStorage.getDevice(device.getDeviceId());
Device deviceInDb = deviceMapper.getDeviceByDeviceId(device.getDeviceId()); Device deviceInDb = getDeviceByDeviceIdFromDb(device.getDeviceId());
String now = DateUtil.getNow(); String now = DateUtil.getNow();
if (deviceInRedis != null && deviceInDb == null) { if (deviceInRedis != null && deviceInDb == null) {
@ -194,7 +196,7 @@ public class DeviceServiceImpl implements IDeviceService {
@Override @Override
public void offline(String deviceId, String reason) { public void offline(String deviceId, String reason) {
log.warn("[设备离线]{}, device{}", reason, deviceId); log.warn("[设备离线]{}, device{}", reason, deviceId);
Device device = deviceMapper.getDeviceByDeviceId(deviceId); Device device = getDeviceByDeviceIdFromDb(deviceId);
if (device == null) { if (device == null) {
return; return;
} }
@ -346,7 +348,7 @@ public class DeviceServiceImpl implements IDeviceService {
public Device getDeviceByDeviceId(String deviceId) { public Device getDeviceByDeviceId(String deviceId) {
Device device = redisCatchStorage.getDevice(deviceId); Device device = redisCatchStorage.getDevice(deviceId);
if (device == null) { if (device == null) {
device = deviceMapper.getDeviceByDeviceId(deviceId); device = getDeviceByDeviceIdFromDb(deviceId);
if (device != null) { if (device != null) {
redisCatchStorage.updateDevice(device); redisCatchStorage.updateDevice(device);
} }
@ -361,7 +363,7 @@ public class DeviceServiceImpl implements IDeviceService {
@Override @Override
public List<Device> getAllByStatus(Boolean status) { public List<Device> getAllByStatus(Boolean status) {
return deviceMapper.getDevices(status); return deviceMapper.getDevices(ChannelDataType.GB28181.value, status);
} }
@Override @Override
@ -403,7 +405,7 @@ public class DeviceServiceImpl implements IDeviceService {
@Override @Override
public boolean isExist(String deviceId) { public boolean isExist(String deviceId) {
return deviceMapper.getDeviceByDeviceId(deviceId) != null; return getDeviceByDeviceIdFromDb(deviceId) != null;
} }
@Override @Override
@ -496,7 +498,7 @@ public class DeviceServiceImpl implements IDeviceService {
@Override @Override
@Transactional @Transactional
public boolean delete(String deviceId) { public boolean delete(String deviceId) {
Device device = deviceMapper.getDeviceByDeviceId(deviceId); Device device = getDeviceByDeviceIdFromDb(deviceId);
if (device == null) { if (device == null) {
throw new ControllerException(ErrorCode.ERROR100.getCode(), "未找到设备:" + deviceId); throw new ControllerException(ErrorCode.ERROR100.getCode(), "未找到设备:" + deviceId);
} }
@ -527,7 +529,7 @@ public class DeviceServiceImpl implements IDeviceService {
.replaceAll("%", "/%") .replaceAll("%", "/%")
.replaceAll("_", "/_"); .replaceAll("_", "/_");
} }
List<Device> all = deviceMapper.getDeviceList(query, status); List<Device> all = deviceMapper.getDeviceList(ChannelDataType.GB28181.value, query, status);
return new PageInfo<>(all); return new PageInfo<>(all);
} }
@ -538,11 +540,11 @@ public class DeviceServiceImpl implements IDeviceService {
@Override @Override
public Device getDeviceByChannelId(Integer channelId) { public Device getDeviceByChannelId(Integer channelId) {
return deviceMapper.queryByChannelId(channelId); return deviceMapper.queryByChannelId(ChannelDataType.GB28181.value,channelId);
} }
@Override @Override
public Device getDeviceBySourceChannelDeviceId(String channelId) { public Device getDeviceBySourceChannelDeviceId(String channelId) {
return deviceMapper.getDeviceBySourceChannelDeviceId(channelId); return deviceMapper.getDeviceBySourceChannelDeviceId(ChannelDataType.GB28181.value,channelId);
} }
} }

View File

@ -372,7 +372,7 @@ public class GbChannelServiceImpl implements IGbChannelService {
throw new ControllerException(ErrorCode.ERROR100.getCode(), "非国标下级通道无法重置"); throw new ControllerException(ErrorCode.ERROR100.getCode(), "非国标下级通道无法重置");
} }
// 这个多加一个参数,为了防止将非国标的通道通过此方法清空内容,导致意外发生 // 这个多加一个参数,为了防止将非国标的通道通过此方法清空内容,导致意外发生
commonGBChannelMapper.reset(id, channel.getDataDeviceId(), DateUtil.getNow()); commonGBChannelMapper.reset(id, ChannelDataType.GB28181.value, channel.getDataDeviceId(), DateUtil.getNow());
CommonGBChannel channelNew = getOne(id); CommonGBChannel channelNew = getOne(id);
// 发送通过更新通知 // 发送通过更新通知
try { try {
@ -495,7 +495,7 @@ public class GbChannelServiceImpl implements IGbChannelService {
@Override @Override
public void addChannelToRegionByGbDevice(String civilCode, List<Integer> deviceIds) { public void addChannelToRegionByGbDevice(String civilCode, List<Integer> deviceIds) {
List<CommonGBChannel> channelList = commonGBChannelMapper.queryByGbDeviceIds(deviceIds); List<CommonGBChannel> channelList = commonGBChannelMapper.queryByGbDeviceIds(ChannelDataType.GB28181.value, deviceIds);
if (channelList.isEmpty()) { if (channelList.isEmpty()) {
throw new ControllerException(ErrorCode.ERROR100.getCode(), "所有通道Id不存在"); throw new ControllerException(ErrorCode.ERROR100.getCode(), "所有通道Id不存在");
} }
@ -516,7 +516,7 @@ public class GbChannelServiceImpl implements IGbChannelService {
@Override @Override
public void deleteChannelToRegionByGbDevice(List<Integer> deviceIds) { public void deleteChannelToRegionByGbDevice(List<Integer> deviceIds) {
List<CommonGBChannel> channelList = commonGBChannelMapper.queryByGbDeviceIds(deviceIds); List<CommonGBChannel> channelList = commonGBChannelMapper.queryByGbDeviceIds(ChannelDataType.GB28181.value, deviceIds);
if (channelList.isEmpty()) { if (channelList.isEmpty()) {
throw new ControllerException(ErrorCode.ERROR100.getCode(), "所有通道Id不存在"); throw new ControllerException(ErrorCode.ERROR100.getCode(), "所有通道Id不存在");
} }
@ -633,7 +633,7 @@ public class GbChannelServiceImpl implements IGbChannelService {
@Override @Override
@Transactional @Transactional
public void addChannelToGroupByGbDevice(String parentId, String businessGroup, List<Integer> deviceIds) { public void addChannelToGroupByGbDevice(String parentId, String businessGroup, List<Integer> deviceIds) {
List<CommonGBChannel> channelList = commonGBChannelMapper.queryByGbDeviceIds(deviceIds); List<CommonGBChannel> channelList = commonGBChannelMapper.queryByGbDeviceIds(ChannelDataType.GB28181.value, deviceIds);
if (channelList.isEmpty()) { if (channelList.isEmpty()) {
throw new ControllerException(ErrorCode.ERROR100.getCode(), "所有通道Id不存在"); throw new ControllerException(ErrorCode.ERROR100.getCode(), "所有通道Id不存在");
} }
@ -661,7 +661,7 @@ public class GbChannelServiceImpl implements IGbChannelService {
@Override @Override
public void deleteChannelToGroupByGbDevice(List<Integer> deviceIds) { public void deleteChannelToGroupByGbDevice(List<Integer> deviceIds) {
List<CommonGBChannel> channelList = commonGBChannelMapper.queryByGbDeviceIds(deviceIds); List<CommonGBChannel> channelList = commonGBChannelMapper.queryByGbDeviceIds(ChannelDataType.GB28181.value, deviceIds);
if (channelList.isEmpty()) { if (channelList.isEmpty()) {
throw new ControllerException(ErrorCode.ERROR100.getCode(), "所有通道Id不存在"); throw new ControllerException(ErrorCode.ERROR100.getCode(), "所有通道Id不存在");
} }
@ -703,12 +703,12 @@ public class GbChannelServiceImpl implements IGbChannelService {
@Override @Override
public List<CommonGBChannel> queryListByStreamPushList(List<StreamPush> streamPushList) { public List<CommonGBChannel> queryListByStreamPushList(List<StreamPush> streamPushList) {
return commonGBChannelMapper.queryListByStreamPushList(streamPushList); return commonGBChannelMapper.queryListByStreamPushList(ChannelDataType.STREAM_PUSH.value, streamPushList);
} }
@Override @Override
public void updateGpsByDeviceIdForStreamPush(List<CommonGBChannel> channels) { public void updateGpsByDeviceIdForStreamPush(List<CommonGBChannel> channels) {
commonGBChannelMapper.updateGpsByDeviceIdForStreamPush(channels); commonGBChannelMapper.updateGpsByDeviceIdForStreamPush(ChannelDataType.STREAM_PUSH.value, channels);
} }
@Override @Override

View File

@ -1,6 +1,7 @@
package com.genersoft.iot.vmp.gb28181.service.impl; package com.genersoft.iot.vmp.gb28181.service.impl;
import com.baomidou.dynamic.datasource.annotation.DS; import com.baomidou.dynamic.datasource.annotation.DS;
import com.genersoft.iot.vmp.common.enums.ChannelDataType;
import com.genersoft.iot.vmp.gb28181.bean.*; import com.genersoft.iot.vmp.gb28181.bean.*;
import com.genersoft.iot.vmp.gb28181.dao.*; import com.genersoft.iot.vmp.gb28181.dao.*;
import com.genersoft.iot.vmp.gb28181.event.EventPublisher; import com.genersoft.iot.vmp.gb28181.event.EventPublisher;
@ -288,14 +289,14 @@ public class PlatformChannelServiceImpl implements IPlatformChannelService {
@Override @Override
@Transactional @Transactional
public void addChannelByDevice(Integer platformId, List<Integer> deviceIds) { public void addChannelByDevice(Integer platformId, List<Integer> deviceIds) {
List<Integer> channelList = commonGBChannelMapper.queryByGbDeviceIdsForIds(deviceIds); List<Integer> channelList = commonGBChannelMapper.queryByGbDeviceIdsForIds(ChannelDataType.GB28181.value, deviceIds);
addChannels(platformId, channelList); addChannels(platformId, channelList);
} }
@Override @Override
@Transactional @Transactional
public void removeChannelByDevice(Integer platformId, List<Integer> deviceIds) { public void removeChannelByDevice(Integer platformId, List<Integer> deviceIds) {
List<Integer> channelList = commonGBChannelMapper.queryByGbDeviceIdsForIds(deviceIds); List<Integer> channelList = commonGBChannelMapper.queryByGbDeviceIdsForIds(ChannelDataType.GB28181.value, deviceIds);
removeChannels(platformId, channelList); removeChannels(platformId, channelList);
} }

View File

@ -1623,7 +1623,7 @@ public class PlayServiceImpl implements IPlayService {
log.warn("[停止点播] 发现通道不存在"); log.warn("[停止点播] 发现通道不存在");
return; return;
} }
Device device = deviceService.getDevice(channel.getDeviceDbId()); Device device = deviceService.getDevice(channel.getDataDeviceId());
if (device == null) { if (device == null) {
log.warn("[停止点播] 发现设备不存在"); log.warn("[停止点播] 发现设备不存在");
return; return;

View File

@ -115,7 +115,7 @@ public class NotifyRequestForCatalogProcessor extends SIPRequestProcessorParent
log.info("[解析CatalogChannelEvent]成功:但是解析通道信息失败, 原文如下: \n{}", new String(evt.getRequest().getRawContent())); log.info("[解析CatalogChannelEvent]成功:但是解析通道信息失败, 原文如下: \n{}", new String(evt.getRequest().getRawContent()));
continue; continue;
} }
catalogChannelEvent.getChannel().setDeviceDbId(device.getId()); catalogChannelEvent.getChannel().setDataDeviceId(device.getId());
} catch (InvocationTargetException | NoSuchMethodException | InstantiationException | } catch (InvocationTargetException | NoSuchMethodException | InstantiationException |
IllegalAccessException e) { IllegalAccessException e) {
log.error("[解析CatalogChannelEvent]失败,", e); log.error("[解析CatalogChannelEvent]失败,", e);

View File

@ -139,7 +139,7 @@ public class CatalogResponseMessageHandler extends SIPRequestProcessorParent imp
log.info("[收到目录订阅]:但是解析失败 {}", new String(evt.getRequest().getRawContent())); log.info("[收到目录订阅]:但是解析失败 {}", new String(evt.getRequest().getRawContent()));
continue; continue;
} }
channel.setDeviceDbId(take.getDevice().getId()); channel.setDataDeviceId(take.getDevice().getId());
if (channel.getParentId() != null && channel.getParentId().equals(sipConfig.getId())) { if (channel.getParentId() != null && channel.getParentId().equals(sipConfig.getId())) {
channel.setParentId(null); channel.setParentId(null);
} }

View File

@ -266,14 +266,14 @@ public class RecordPlanServiceImpl implements IRecordPlanService {
} }
@Override @Override
public PageInfo<CommonGBChannel> queryChannelList(int page, int count, String query, Integer channelType, Boolean online, Integer planId, Boolean hasLink) { public PageInfo<CommonGBChannel> queryChannelList(int page, int count, String query, Integer dataType, Boolean online, Integer planId, Boolean hasLink) {
PageHelper.startPage(page, count); PageHelper.startPage(page, count);
if (query != null) { if (query != null) {
query = query.replaceAll("/", "//") query = query.replaceAll("/", "//")
.replaceAll("%", "/%") .replaceAll("%", "/%")
.replaceAll("_", "/_"); .replaceAll("_", "/_");
} }
List<CommonGBChannel> all = channelMapper.queryForRecordPlanForWebList(planId, query, channelType, online, hasLink); List<CommonGBChannel> all = channelMapper.queryForRecordPlanForWebList(planId, query, dataType, online, hasLink);
return new PageInfo<>(all); return new PageInfo<>(all);
} }

View File

@ -4,6 +4,7 @@ import com.alibaba.fastjson2.JSON;
import com.alibaba.fastjson2.JSONObject; import com.alibaba.fastjson2.JSONObject;
import com.genersoft.iot.vmp.common.SystemAllInfo; import com.genersoft.iot.vmp.common.SystemAllInfo;
import com.genersoft.iot.vmp.common.VideoManagerConstants; import com.genersoft.iot.vmp.common.VideoManagerConstants;
import com.genersoft.iot.vmp.common.enums.ChannelDataType;
import com.genersoft.iot.vmp.conf.UserSetting; import com.genersoft.iot.vmp.conf.UserSetting;
import com.genersoft.iot.vmp.gb28181.bean.*; import com.genersoft.iot.vmp.gb28181.bean.*;
import com.genersoft.iot.vmp.gb28181.dao.DeviceChannelMapper; import com.genersoft.iot.vmp.gb28181.dao.DeviceChannelMapper;

View File

@ -1,5 +1,7 @@
package com.genersoft.iot.vmp.streamProxy.dao.provider; package com.genersoft.iot.vmp.streamProxy.dao.provider;
import com.genersoft.iot.vmp.common.enums.ChannelDataType;
import java.util.Map; import java.util.Map;
public class StreamProxyProvider { public class StreamProxyProvider {
@ -7,12 +9,13 @@ public class StreamProxyProvider {
public String getBaseSelectSql(){ public String getBaseSelectSql(){
return "SELECT " + return "SELECT " +
" st.*, " + " st.*, " +
" st.id as stream_proxy_id, " + ChannelDataType.STREAM_PROXY.value + " as data_type, " +
" st.id as data_device_id, " +
" wdc.*, " + " wdc.*, " +
" wdc.id as gb_id" + " wdc.id as gb_id" +
" FROM wvp_stream_proxy st " + " FROM wvp_stream_proxy st " +
" LEFT join wvp_device_channel wdc " + " LEFT join wvp_device_channel wdc " +
" on st.id = wdc.stream_proxy_id "; " on wdc.data_type = 3 and st.id = wdc.data_device_id ";
} }
public String select(Map<String, Object> params ){ public String select(Map<String, Object> params ){

View File

@ -79,6 +79,8 @@ public class StreamPush extends CommonGBChannel implements Comparable<StreamPush
private String uniqueKey; private String uniqueKey;
private Integer dataType = ChannelDataType.STREAM_PUSH.value;
@Override @Override
public int compareTo(@NotNull StreamPush streamPushItem) { public int compareTo(@NotNull StreamPush streamPushItem) {
return Long.valueOf(DateUtil.yyyy_MM_dd_HH_mm_ssToTimestamp(this.createTime) return Long.valueOf(DateUtil.yyyy_MM_dd_HH_mm_ssToTimestamp(this.createTime)

View File

@ -1,5 +1,6 @@
package com.genersoft.iot.vmp.streamPush.dao; package com.genersoft.iot.vmp.streamPush.dao;
import com.genersoft.iot.vmp.common.enums.ChannelDataType;
import com.genersoft.iot.vmp.streamPush.bean.StreamPush; import com.genersoft.iot.vmp.streamPush.bean.StreamPush;
import com.genersoft.iot.vmp.service.bean.StreamPushItemFromRedis; import com.genersoft.iot.vmp.service.bean.StreamPushItemFromRedis;
import org.apache.ibatis.annotations.*; import org.apache.ibatis.annotations.*;
@ -13,6 +14,8 @@ import java.util.Set;
@Repository @Repository
public interface StreamPushMapper { public interface StreamPushMapper {
Integer dataType = ChannelDataType.GB28181.value;
@Insert("INSERT INTO wvp_stream_push (app, stream, media_server_id, server_id, push_time, update_time, create_time, pushing, start_offline_push) VALUES" + @Insert("INSERT INTO wvp_stream_push (app, stream, media_server_id, server_id, push_time, update_time, create_time, pushing, start_offline_push) VALUES" +
"(#{app}, #{stream}, #{mediaServerId} , #{serverId} , #{pushTime} ,#{updateTime}, #{createTime}, #{pushing}, #{startOfflinePush})") "(#{app}, #{stream}, #{mediaServerId} , #{serverId} , #{pushTime} ,#{updateTime}, #{createTime}, #{pushing}, #{startOfflinePush})")
@Options(useGeneratedKeys = true, keyProperty = "id", keyColumn = "id") @Options(useGeneratedKeys = true, keyProperty = "id", keyColumn = "id")
@ -39,13 +42,13 @@ public interface StreamPushMapper {
@Select(value = {" <script>" + @Select(value = {" <script>" +
" SELECT " + " SELECT " +
" st.*, " + " st.*, " +
" st.id as stream_push_id, " + " st.id as data_device_id, " +
" wdc.*, " + " wdc.*, " +
" wdc.id as gb_id" + " wdc.id as gb_id" +
" from " + " from " +
" wvp_stream_push st " + " wvp_stream_push st " +
" LEFT join wvp_device_channel wdc " + " LEFT join wvp_device_channel wdc " +
" on st.id = wdc.stream_push_id " + " on st.id = wdc.data_device_id " +
" WHERE " + " WHERE " +
" 1=1 " + " 1=1 " +
" <if test='query != null'> AND (st.app LIKE concat('%',#{query},'%') escape '/' OR st.stream LIKE concat('%',#{query},'%') escape '/' " + " <if test='query != null'> AND (st.app LIKE concat('%',#{query},'%') escape '/' OR st.stream LIKE concat('%',#{query},'%') escape '/' " +
@ -57,7 +60,7 @@ public interface StreamPushMapper {
" </script>"}) " </script>"})
List<StreamPush> selectAll(@Param("query") String query, @Param("pushing") Boolean pushing, @Param("mediaServerId") String mediaServerId); List<StreamPush> selectAll(@Param("query") String query, @Param("pushing") Boolean pushing, @Param("mediaServerId") String mediaServerId);
@Select("SELECT st.*, st.id as stream_push_id, wdc.*, wdc.id as gb_id FROM wvp_stream_push st LEFT join wvp_device_channel wdc on st.id = wdc.stream_push_id WHERE st.app=#{app} AND st.stream=#{stream}") @Select("SELECT st.*, st.id as data_device_id, wdc.*, wdc.id as gb_id FROM wvp_stream_push st LEFT join wvp_device_channel wdc on wdc.data_type = 2 and st.id = wdc.data_device_id WHERE st.app=#{app} AND st.stream=#{stream}")
StreamPush selectByAppAndStream(@Param("app") String app, @Param("stream") String stream); StreamPush selectByAppAndStream(@Param("app") String app, @Param("stream") String stream);
@Insert("<script>" + @Insert("<script>" +
@ -70,10 +73,10 @@ public interface StreamPushMapper {
@Options(useGeneratedKeys = true, keyProperty = "id", keyColumn = "id") @Options(useGeneratedKeys = true, keyProperty = "id", keyColumn = "id")
int addAll(List<StreamPush> streamPushItems); int addAll(List<StreamPush> streamPushItems);
@Select("SELECT st.*, st.id as stream_push_id, wdc.*, wdc.id as gb_id FROM wvp_stream_push st LEFT join wvp_device_channel wdc on st.id = wdc.stream_push_id WHERE st.media_server_id=#{mediaServerId}") @Select("SELECT st.*, st.id as data_device_id, wdc.*, wdc.id as gb_id FROM wvp_stream_push st LEFT join wvp_device_channel wdc on wdc.data_type = 2 and st.id = wdc.data_device_id WHERE st.media_server_id=#{mediaServerId}")
List<StreamPush> selectAllByMediaServerId(String mediaServerId); List<StreamPush> selectAllByMediaServerId(String mediaServerId);
@Select("SELECT st.*, st.id as stream_push_id, wdc.*, wdc.id as gb_id FROM wvp_stream_push st LEFT join wvp_device_channel wdc on st.id = wdc.stream_push_id WHERE st.media_server_id=#{mediaServerId} and wdc.gb_device_id is null") @Select("SELECT st.*, st.id as data_device_id, wdc.*, wdc.id as gb_id FROM wvp_stream_push st LEFT join wvp_device_channel wdc on wdc.data_type = 2 and st.id = wdc.data_device_id WHERE st.media_server_id=#{mediaServerId} and wdc.gb_device_id is null")
List<StreamPush> selectAllByMediaServerIdWithOutGbID(String mediaServerId); List<StreamPush> selectAllByMediaServerIdWithOutGbID(String mediaServerId);
@Update("UPDATE wvp_stream_push " + @Update("UPDATE wvp_stream_push " +
@ -83,7 +86,7 @@ public interface StreamPushMapper {
@Select("<script> "+ @Select("<script> "+
"SELECT st.*, st.id as stream_push_id, wdc.*, wdc.id as gb_id FROM wvp_stream_push st LEFT join wvp_device_channel wdc on st.id = wdc.stream_push_id " + "SELECT st.*, st.id as data_device_id, wdc.*, wdc.id as gb_id FROM wvp_stream_push st LEFT join wvp_device_channel wdc on wdc.data_type = 2 and st.id = wdc.data_device_id " +
"where (st.app, st.stream) in (" + "where (st.app, st.stream) in (" +
"<foreach collection='offlineStreams' item='item' separator=','>" + "<foreach collection='offlineStreams' item='item' separator=','>" +
"(#{item.app}, #{item.stream}) " + "(#{item.app}, #{item.stream}) " +
@ -106,21 +109,21 @@ public interface StreamPushMapper {
@MapKey("uniqueKey") @MapKey("uniqueKey")
@Select("SELECT CONCAT(wsp.app, wsp.stream) as unique_key, wsp.*, wsp.* , wdc.id as gb_id " + @Select("SELECT CONCAT(wsp.app, wsp.stream) as unique_key, wsp.*, wsp.* , wdc.id as gb_id " +
" from wvp_stream_push wsp " + " from wvp_stream_push wsp " +
" LEFT join wvp_device_channel wdc on wsp.id = wdc.stream_push_id") " LEFT join wvp_device_channel wdc on wdc.data_type = 2 and wsp.id = wdc.data_device_id")
Map<String, StreamPush> getAllAppAndStreamMap(); Map<String, StreamPush> getAllAppAndStreamMap();
@MapKey("gbDeviceId") @MapKey("gbDeviceId")
@Select("SELECT wdc.gb_device_id, wsp.id as stream_push_id, wsp.*, wsp.* , wdc.id as gb_id " + @Select("SELECT wdc.gb_device_id, wsp.id as data_device_id, wsp.*, wsp.* , wdc.id as gb_id " +
" from wvp_stream_push wsp " + " from wvp_stream_push wsp " +
" LEFT join wvp_device_channel wdc on wsp.id = wdc.stream_push_id") " LEFT join wvp_device_channel wdc on wdc.data_type = 2 and wsp.id = wdc.data_device_id")
Map<String, StreamPush> getAllGBId(); Map<String, StreamPush> getAllGBId();
@Select("SELECT st.*, st.id as stream_push_id, wdc.*, wdc.id as gb_id FROM wvp_stream_push st LEFT join wvp_device_channel wdc on st.id = wdc.stream_push_id WHERE st.id=#{id}") @Select("SELECT st.*, st.id as data_device_id, wdc.*, wdc.id as gb_id FROM wvp_stream_push st LEFT join wvp_device_channel wdc on wdc.data_type = 2 and st.id = wdc.data_device_id WHERE st.id=#{id}")
StreamPush queryOne(@Param("id") int id); StreamPush queryOne(@Param("id") int id);
@Select("<script> "+ @Select("<script> "+
"SELECT st.*, st.id as stream_push_id, wdc.*, wdc.id as gb_id FROM wvp_stream_push st LEFT join wvp_device_channel wdc on st.id = wdc.stream_push_id " + "SELECT st.*, st.id as data_device_id, wdc.*, wdc.id as gb_id FROM wvp_stream_push st LEFT join wvp_device_channel wdc on wdc.data_type = 2 and st.id = wdc.data_device_id " +
" where st.id in (" + " where st.id in (" +
" <foreach collection='ids' item='item' separator=','>" + " <foreach collection='ids' item='item' separator=','>" +
" #{item} " + " #{item} " +

View File

@ -4,6 +4,8 @@ import com.alibaba.fastjson2.JSON;
import com.alibaba.fastjson2.JSONObject; import com.alibaba.fastjson2.JSONObject;
import com.genersoft.iot.vmp.common.SystemAllInfo; import com.genersoft.iot.vmp.common.SystemAllInfo;
import com.genersoft.iot.vmp.common.VersionPo; import com.genersoft.iot.vmp.common.VersionPo;
import com.genersoft.iot.vmp.common.enums.ChannelDataType;
import com.genersoft.iot.vmp.common.enums.DeviceControlType;
import com.genersoft.iot.vmp.conf.SipConfig; import com.genersoft.iot.vmp.conf.SipConfig;
import com.genersoft.iot.vmp.conf.UserSetting; import com.genersoft.iot.vmp.conf.UserSetting;
import com.genersoft.iot.vmp.conf.VersionInfo; import com.genersoft.iot.vmp.conf.VersionInfo;
@ -42,10 +44,7 @@ import oshi.software.os.OperatingSystem;
import java.io.File; import java.io.File;
import java.text.DecimalFormat; import java.text.DecimalFormat;
import java.util.ArrayList; import java.util.*;
import java.util.LinkedHashMap;
import java.util.List;
import java.util.Map;
@SuppressWarnings("rawtypes") @SuppressWarnings("rawtypes")
@Tag(name = "服务控制") @Tag(name = "服务控制")
@ -346,6 +345,20 @@ public class ServerController {
return result; return result;
} }
@GetMapping(value = "/channel/datatype")
@ResponseBody
@Operation(summary = "获取系统接入的数据类型")
public List<Map<String, Object>> getDataType() {
List<Map<String, Object>> result = new LinkedList<>();
for (ChannelDataType item : ChannelDataType.values()) {
Map<String, Object> map = new LinkedHashMap<>();
map.put("key", item.desc);
map.put("value", item.value);
result.add(map);
}
return result;
}
/** /**
* *
*/ */

View File

@ -206,7 +206,7 @@
<div style="float: right;"> <div style="float: right;">
<el-button type="primary" @click="onSubmit"></el-button> <el-button type="primary" @click="onSubmit"></el-button>
<el-button v-if="cancel" @click="cancelSubmit"></el-button> <el-button v-if="cancel" @click="cancelSubmit"></el-button>
<el-button v-if="form.gbDeviceDbId" @click="reset"></el-button> <el-button v-if="form.dataType === 1" @click="reset"></el-button>
</div> </div>
</div> </div>

View File

@ -0,0 +1,63 @@
<template>
<div id="channelDataTypeSelect" >
<el-select size="mini" @change="$emit('change', $event.target.value)" v-model="dataType" placeholder="请选择"
default-first-option>
<el-option label="全部" value=""></el-option>
<el-option
v-for="item in dataTypeArray"
:key="item.key"
:label="item.key"
:value="item.value">
</el-option>
</el-select>
</div>
</template>
<script>
export default {
name: "channelDataTypeSelect",
model: {
prop: 'dataType',
event: 'change'
},
props: {
dataType: {
type: String,
default: ''
}
},
components: {},
created() {
this.init()
},
data() {
return {
dataTypeArray: []
};
},
methods: {
init: function (){
this.$axios({
method: 'get',
url: `/api/server/channel/datatype`,
params: {}
}).then((res)=> {
if (res.data.code === 0) {
this.dataTypeArray = res.data.data;
}
})
},
},
};
</script>
<style>
.channel-form {
display: grid;
background-color: #FFFFFF;
padding: 1rem 2rem 0 2rem;
grid-template-columns: 1fr 1fr 1fr;
gap: 1rem;
}
</style>

View File

@ -23,13 +23,7 @@
<el-option label="离线" value="false"></el-option> <el-option label="离线" value="false"></el-option>
</el-select> </el-select>
类型: 类型:
<el-select size="mini" style="width: 8rem; margin-right: 1rem;" @change="getChannelList" v-model="channelType" placeholder="请选择" <channelDataTypeSelect style="width: 8rem; margin-right: 1rem;" @change="getChannelList" v-model="channelType"></channelDataTypeSelect>
default-first-option>
<el-option label="全部" value=""></el-option>
<el-option label="国标设备" :value="0"></el-option>
<el-option label="推流设备" :value="1"></el-option>
<el-option label="拉流代理" :value="2"></el-option>
</el-select>
<el-button size="mini" :loading="getChannelListLoading" <el-button size="mini" :loading="getChannelListLoading"
@click="getChannelList()">刷新</el-button> @click="getChannelList()">刷新</el-button>
<el-button type="primary" size="mini" style="float: right" @click="onSubmit"> </el-button> <el-button type="primary" size="mini" style="float: right" @click="onSubmit"> </el-button>
@ -49,9 +43,9 @@
<el-table-column label="类型" min-width="100"> <el-table-column label="类型" min-width="100">
<template v-slot:default="scope"> <template v-slot:default="scope">
<div slot="reference" class="name-wrapper"> <div slot="reference" class="name-wrapper">
<el-tag size="medium" effect="plain" v-if="scope.row.gbDeviceDbId"></el-tag> <el-tag size="medium" effect="plain" v-if="scope.row.dataType === 1"></el-tag>
<el-tag size="medium" effect="plain" type="success" v-if="scope.row.streamPushId"></el-tag> <el-tag size="medium" effect="plain" type="success" v-else-if="scope.row.dataType === 2" >推流设备</el-tag>
<el-tag size="medium" effect="plain" type="warning" v-if="scope.row.streamProxyId"></el-tag> <el-tag size="medium" effect="plain" type="warning" v-else-if="scope.row.dataType === 3">拉流代理</el-tag>
</div> </div>
</template> </template>
</el-table-column> </el-table-column>
@ -86,8 +80,11 @@
<script> <script>
import ChannelDataTypeSelect from "../common/channelDataTypeSelect.vue";
export default { export default {
name: "gbChannelSelect", name: "gbChannelSelect",
components: {ChannelDataTypeSelect},
props: ['dataType', "selected"], props: ['dataType', "selected"],
computed: {}, computed: {},
data() { data() {

View File

@ -22,13 +22,7 @@
<el-option label="离线" value="false"></el-option> <el-option label="离线" value="false"></el-option>
</el-select> </el-select>
类型: 类型:
<el-select size="mini" style="width: 8rem; margin-right: 1rem;" @change="search" v-model="channelType" placeholder="请选择" <channelDataTypeSelect style="width: 8rem; margin-right: 1rem;" @change="search" v-model="channelType"></channelDataTypeSelect>
default-first-option>
<el-option label="全部" value=""></el-option>
<el-option label="国标设备" :value="0"></el-option>
<el-option label="推流设备" :value="1"></el-option>
<el-option label="拉流代理" :value="2"></el-option>
</el-select>
<el-button v-if="hasLink !=='true'" size="mini" type="primary" @click="add()"> <el-button v-if="hasLink !=='true'" size="mini" type="primary" @click="add()">
添加 添加
</el-button> </el-button>
@ -56,9 +50,9 @@
<el-table-column label="类型" min-width="100"> <el-table-column label="类型" min-width="100">
<template v-slot:default="scope"> <template v-slot:default="scope">
<div slot="reference" class="name-wrapper"> <div slot="reference" class="name-wrapper">
<el-tag size="medium" effect="plain" v-if="scope.row.gbDeviceDbId"></el-tag> <el-tag size="medium" effect="plain" v-if="scope.row.dataType === 1"></el-tag>
<el-tag size="medium" effect="plain" type="success" v-if="scope.row.streamPushId"></el-tag> <el-tag size="medium" effect="plain" type="success" v-else-if="scope.row.dataType === 2" >推流设备</el-tag>
<el-tag size="medium" effect="plain" type="warning" v-if="scope.row.streamProxyId"></el-tag> <el-tag size="medium" effect="plain" type="warning" v-else-if="scope.row.dataType === 3">拉流代理</el-tag>
</div> </div>
</template> </template>
</el-table-column> </el-table-column>
@ -91,10 +85,11 @@
<script> <script>
import gbDeviceSelect from "./GbDeviceSelect.vue"; import gbDeviceSelect from "./GbDeviceSelect.vue";
import ChannelDataTypeSelect from "../common/channelDataTypeSelect.vue";
export default { export default {
name: 'linkChannelRecord', name: 'linkChannelRecord',
components: {gbDeviceSelect}, components: {ChannelDataTypeSelect, gbDeviceSelect},
data() { data() {
return { return {
dialogLoading: false, dialogLoading: false,

View File

@ -20,13 +20,7 @@
<el-option label="离线" value="false"></el-option> <el-option label="离线" value="false"></el-option>
</el-select> </el-select>
类型: 类型:
<el-select size="mini" style="width: 8rem; margin-right: 1rem;" @change="search" v-model="channelType" placeholder="请选择" <channelDataTypeSelect style="width: 8rem; margin-right: 1rem;" @change="search" v-model="channelType"></channelDataTypeSelect>
default-first-option>
<el-option label="全部" value=""></el-option>
<el-option label="国标设备" :value="0"></el-option>
<el-option label="推流设备" :value="1"></el-option>
<el-option label="拉流代理" :value="2"></el-option>
</el-select>
<el-button v-if="hasShare !=='true'" size="mini" type="primary" @click="add()"> <el-button v-if="hasShare !=='true'" size="mini" type="primary" @click="add()">
添加 添加
</el-button> </el-button>
@ -74,9 +68,9 @@
<el-table-column label="类型" min-width="100"> <el-table-column label="类型" min-width="100">
<template v-slot:default="scope"> <template v-slot:default="scope">
<div slot="reference" class="name-wrapper"> <div slot="reference" class="name-wrapper">
<el-tag size="medium" effect="plain" v-if="scope.row.gbDeviceDbId"></el-tag> <el-tag size="medium" effect="plain" v-if="scope.row.dataType === 1"></el-tag>
<el-tag size="medium" effect="plain" type="success" v-if="scope.row.streamPushId"></el-tag> <el-tag size="medium" effect="plain" type="success" v-else-if="scope.row.dataType === 2" >推流设备</el-tag>
<el-tag size="medium" effect="plain" type="warning" v-if="scope.row.streamProxyId"></el-tag> <el-tag size="medium" effect="plain" type="warning" v-else-if="scope.row.dataType === 3">拉流代理</el-tag>
</div> </div>
</template> </template>
</el-table-column> </el-table-column>
@ -107,10 +101,11 @@
<script> <script>
import gbDeviceSelect from "./GbDeviceSelect.vue"; import gbDeviceSelect from "./GbDeviceSelect.vue";
import ChannelDataTypeSelect from "../common/channelDataTypeSelect.vue";
export default { export default {
name: 'shareChannelAdd', name: 'shareChannelAdd',
components: {gbDeviceSelect}, components: {ChannelDataTypeSelect, gbDeviceSelect},
props: [ 'platformId'], props: [ 'platformId'],
data() { data() {
return { return {

View File

@ -28,14 +28,7 @@
<el-option label="离线" value="false"></el-option> <el-option label="离线" value="false"></el-option>
</el-select> </el-select>
类型: 类型:
<el-select size="mini" style="width: 8rem; margin-right: 1rem;" @change="getChannelList" <channelDataTypeSelect style="width: 8rem; margin-right: 1rem;" @change="getChannelList" v-model="channelType"></channelDataTypeSelect>
v-model="channelType" placeholder="请选择"
default-first-option>
<el-option label="全部" value=""></el-option>
<el-option label="国标设备" :value="0"></el-option>
<el-option label="推流设备" :value="1"></el-option>
<el-option label="拉流代理" :value="2"></el-option>
</el-select>
<el-button size="mini" type="primary" @click="add()"> <el-button size="mini" type="primary" @click="add()">
添加通道 添加通道
</el-button> </el-button>
@ -60,9 +53,9 @@
<el-table-column label="类型" min-width="100"> <el-table-column label="类型" min-width="100">
<template v-slot:default="scope"> <template v-slot:default="scope">
<div slot="reference" class="name-wrapper"> <div slot="reference" class="name-wrapper">
<el-tag size="medium" effect="plain" v-if="scope.row.gbDeviceDbId"></el-tag> <el-tag size="medium" effect="plain" v-if="scope.row.dataType === 1"></el-tag>
<el-tag size="medium" effect="plain" type="success" v-if="scope.row.streamPushId"></el-tag> <el-tag size="medium" effect="plain" type="success" v-else-if="scope.row.dataType === 2" >推流设备</el-tag>
<el-tag size="medium" effect="plain" type="warning" v-if="scope.row.streamProxyId"></el-tag> <el-tag size="medium" effect="plain" type="warning" v-else-if="scope.row.dataType === 3">拉流代理</el-tag>
</div> </div>
</template> </template>
</el-table-column> </el-table-column>
@ -97,10 +90,12 @@ import DeviceService from "./service/DeviceService";
import GroupTree from "./common/GroupTree.vue"; import GroupTree from "./common/GroupTree.vue";
import GbChannelSelect from "./dialog/GbChannelSelect.vue"; import GbChannelSelect from "./dialog/GbChannelSelect.vue";
import RegionTree from "./common/RegionTree.vue"; import RegionTree from "./common/RegionTree.vue";
import ChannelDataTypeSelect from "./common/channelDataTypeSelect.vue";
export default { export default {
name: 'channelList', name: 'channelList',
components: { components: {
ChannelDataTypeSelect,
RegionTree, RegionTree,
GbChannelSelect, GbChannelSelect,
uiHeader, uiHeader,

View File

@ -28,13 +28,7 @@
<el-option label="离线" value="false"></el-option> <el-option label="离线" value="false"></el-option>
</el-select> </el-select>
类型: 类型:
<el-select size="mini" style="width: 8rem; margin-right: 1rem;" @change="getChannelList" v-model="channelType" placeholder="请选择" <channelDataTypeSelect style="width: 8rem; margin-right: 1rem;" @change="getChannelList" v-model="channelType"></channelDataTypeSelect>
default-first-option>
<el-option label="全部" value=""></el-option>
<el-option label="国标设备" :value="0"></el-option>
<el-option label="推流设备" :value="1"></el-option>
<el-option label="拉流代理" :value="2"></el-option>
</el-select>
<el-button size="mini" type="primary" @click="add()"> <el-button size="mini" type="primary" @click="add()">
添加通道 添加通道
</el-button> </el-button>
@ -59,9 +53,9 @@
<el-table-column label="类型" min-width="100"> <el-table-column label="类型" min-width="100">
<template v-slot:default="scope"> <template v-slot:default="scope">
<div slot="reference" class="name-wrapper"> <div slot="reference" class="name-wrapper">
<el-tag size="medium" effect="plain" v-if="scope.row.gbDeviceDbId"></el-tag> <el-tag size="medium" effect="plain" v-if="scope.row.dataType === 1"></el-tag>
<el-tag size="medium" effect="plain" type="success" v-if="scope.row.streamPushId"></el-tag> <el-tag size="medium" effect="plain" type="success" v-else-if="scope.row.dataType === 2" >推流设备</el-tag>
<el-tag size="medium" effect="plain" type="warning" v-if="scope.row.streamProxyId"></el-tag> <el-tag size="medium" effect="plain" type="warning" v-else-if="scope.row.dataType === 3">拉流代理</el-tag>
</div> </div>
</template> </template>
</el-table-column> </el-table-column>
@ -95,10 +89,12 @@ import uiHeader from '../layout/UiHeader.vue'
import DeviceService from "./service/DeviceService"; import DeviceService from "./service/DeviceService";
import RegionTree from "./common/RegionTree.vue"; import RegionTree from "./common/RegionTree.vue";
import GbChannelSelect from "./dialog/GbChannelSelect.vue"; import GbChannelSelect from "./dialog/GbChannelSelect.vue";
import ChannelDataTypeSelect from "./common/channelDataTypeSelect.vue";
export default { export default {
name: 'channelList', name: 'channelList',
components: { components: {
ChannelDataTypeSelect,
GbChannelSelect, GbChannelSelect,
uiHeader, uiHeader,
RegionTree, RegionTree,