From 20082441ef5f6d62b93d572cc5dfebb3616bea9a Mon Sep 17 00:00:00 2001 From: 648540858 <648540858@qq.com> Date: 星期三, 24 十一月 2021 15:09:43 +0800 Subject: [PATCH] 拉流代理接口添加无人观看则自动移除参数,拉流代理返回值增加流地址信息 --- src/main/java/com/genersoft/iot/vmp/storager/dao/DeviceChannelMapper.java | 16 ++++++++++++++-- 1 files changed, 14 insertions(+), 2 deletions(-) diff --git a/src/main/java/com/genersoft/iot/vmp/storager/dao/DeviceChannelMapper.java b/src/main/java/com/genersoft/iot/vmp/storager/dao/DeviceChannelMapper.java index 0be9b19..eef7a15 100644 --- a/src/main/java/com/genersoft/iot/vmp/storager/dao/DeviceChannelMapper.java +++ b/src/main/java/com/genersoft/iot/vmp/storager/dao/DeviceChannelMapper.java @@ -19,12 +19,12 @@ "ipAddress, port, password, PTZType, status, streamId, longitude, latitude, createTime, updateTime) " + "VALUES ('${channelId}', '${deviceId}', '${name}', '${manufacture}', '${model}', '${owner}', '${civilCode}', '${block}'," + "'${address}', ${parental}, '${parentId}', ${safetyWay}, ${registerWay}, '${certNum}', ${certifiable}, ${errCode}, '${secrecy}', " + - "'${ipAddress}', ${port}, '${password}', ${PTZType}, ${status}, '${streamId}', ${longitude}, ${latitude}, datetime('now','localtime'), datetime('now','localtime'))") + "'${ipAddress}', ${port}, '${password}', ${PTZType}, ${status}, '${streamId}', ${longitude}, ${latitude},'${createTime}', '${updateTime}')") int add(DeviceChannel channel); @Update(value = {" <script>" + "UPDATE device_channel " + - "SET updateTime=datetime('now','localtime')" + + "SET updateTime='${updateTime}'" + "<if test=\"name != null\">, name='${name}'</if>" + "<if test=\"manufacture != null\">, manufacture='${manufacture}'</if>" + "<if test=\"model != null\">, model='${model}'</if>" + @@ -74,6 +74,9 @@ @Delete("DELETE FROM device_channel WHERE deviceId=#{deviceId}") int cleanChannelsByDeviceId(String deviceId); + @Delete("DELETE FROM device_channel WHERE deviceId=#{deviceId} AND channelId=#{channelId}") + int del(String deviceId, String channelId); + @Update(value = {"UPDATE device_channel SET streamId=null WHERE deviceId=#{deviceId} AND channelId=#{channelId}"}) void stopPlay(String deviceId, String channelId); @@ -102,4 +105,13 @@ " </script>"}) List<ChannelReduce> queryChannelListInAll(String query, Boolean online, Boolean hasSubChannel, String platformId, Boolean inPlatform); + + @Select("SELECT * FROM device_channel WHERE channelId=#{channelId}") + List<DeviceChannel> queryChannelByChannelId( String channelId); + + @Update(value = {"UPDATE device_channel SET status=0 WHERE deviceId=#{deviceId} AND channelId=#{channelId}"}) + void offline(String deviceId, String channelId); + + @Update(value = {"UPDATE device_channel SET status=1 WHERE deviceId=#{deviceId} AND channelId=#{channelId}"}) + void online(String deviceId, String channelId); } -- Gitblit v1.8.0