From de0ad2b32edbd04b1d820bfb9d2b35bc9d20f233 Mon Sep 17 00:00:00 2001 From: 648540858 <648540858@qq.com> Date: Thu, 29 Aug 2024 18:04:16 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E5=9B=BD=E6=A0=87=E7=BA=A7?= =?UTF-8?q?=E8=81=94=E7=82=B9=E6=92=AD=E9=80=9A=E9=81=93=E7=BC=96=E5=8F=B7?= =?UTF-8?q?=E9=87=8D=E5=A4=8D=E5=BC=82=E5=B8=B8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../iot/vmp/gb28181/dao/PlatformChannelMapper.java | 5 +++-- .../iot/vmp/gb28181/service/impl/GbChannelServiceImpl.java | 7 ++++++- 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/src/main/java/com/genersoft/iot/vmp/gb28181/dao/PlatformChannelMapper.java b/src/main/java/com/genersoft/iot/vmp/gb28181/dao/PlatformChannelMapper.java index c42cd674..cc607ae2 100755 --- a/src/main/java/com/genersoft/iot/vmp/gb28181/dao/PlatformChannelMapper.java +++ b/src/main/java/com/genersoft/iot/vmp/gb28181/dao/PlatformChannelMapper.java @@ -199,10 +199,10 @@ public interface PlatformChannelMapper { " coalesce(wpgc.custom_svc_time_support_mode, wdc.gb_svc_time_support_mode, wdc.svc_time_support_mode) as gb_svc_time_support_mode\n" + " from wvp_device_channel wdc" + " left join wvp_platform_channel wpgc on wdc.id = wpgc.device_channel_id" + - " where wdc.channel_type = 0 and wpgc.platform_id = #{platformId} and coalesce(wpgc.custom_device_id, wdc.gb_device_id, wdc.device_id) = #{channelDeviceId}" + " where wdc.channel_type = 0 and wpgc.platform_id = #{platformId} and coalesce(wpgc.custom_device_id, wdc.gb_device_id, wdc.device_id) = #{channelDeviceId} order by wdc.id " ) - CommonGBChannel queryOneWithPlatform(@Param("platformId") Integer platformId, @Param("channelDeviceId") String channelDeviceId); + List queryOneWithPlatform(@Param("platformId") Integer platformId, @Param("channelDeviceId") String channelDeviceId); @Select("") List queryShare(@Param("platformId") Integer platformId, List channelIds); diff --git a/src/main/java/com/genersoft/iot/vmp/gb28181/service/impl/GbChannelServiceImpl.java b/src/main/java/com/genersoft/iot/vmp/gb28181/service/impl/GbChannelServiceImpl.java index 29994033..2fae3b02 100644 --- a/src/main/java/com/genersoft/iot/vmp/gb28181/service/impl/GbChannelServiceImpl.java +++ b/src/main/java/com/genersoft/iot/vmp/gb28181/service/impl/GbChannelServiceImpl.java @@ -627,7 +627,12 @@ public class GbChannelServiceImpl implements IGbChannelService { @Override public CommonGBChannel queryOneWithPlatform(Integer platformId, String channelDeviceId) { - return platformChannelMapper.queryOneWithPlatform(platformId, channelDeviceId); + List channelList = platformChannelMapper.queryOneWithPlatform(platformId, channelDeviceId); + if (!channelList.isEmpty()) { + return channelList.get(channelList.size() - 1); + }else { + return null; + } } @Override