From 7241e0d2d21e408877cf2e1c62a19f17a82a9ac9 Mon Sep 17 00:00:00 2001 From: 648540858 <648540858@qq.com> Date: Tue, 28 Dec 2021 09:33:25 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E5=85=BC=E5=AE=B9=E6=8E=A5?= =?UTF-8?q?=E5=8F=A3=E6=9F=A5=E8=AF=A2=E9=80=9A=E9=81=93=E5=88=97=E8=A1=A8?= =?UTF-8?q?=E6=9F=A5=E8=AF=A2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pom.xml | 2 +- .../iot/vmp/storager/IVideoManagerStorager.java | 2 ++ .../vmp/storager/dao/DeviceChannelMapper.java | 16 ++++++++++++++++ .../storager/impl/VideoManagerStoragerImpl.java | 5 +++++ .../iot/vmp/web/gb28181/ApiDeviceController.java | 10 +++++----- 5 files changed, 29 insertions(+), 6 deletions(-) diff --git a/pom.xml b/pom.xml index 364e6b9e..2a67fb52 100644 --- a/pom.xml +++ b/pom.xml @@ -224,7 +224,7 @@ - + ${project.artifactId}-${project.version}-${maven.build.timestamp} diff --git a/src/main/java/com/genersoft/iot/vmp/storager/IVideoManagerStorager.java b/src/main/java/com/genersoft/iot/vmp/storager/IVideoManagerStorager.java index 18f30a55..6e3ab77f 100644 --- a/src/main/java/com/genersoft/iot/vmp/storager/IVideoManagerStorager.java +++ b/src/main/java/com/genersoft/iot/vmp/storager/IVideoManagerStorager.java @@ -89,6 +89,8 @@ public interface IVideoManagerStorager { * @return */ public PageInfo queryChannelsByDeviceId(String deviceId, String query, Boolean hasSubChannel, Boolean online, int page, int count); + + public List queryChannelsByDeviceIdWithStartAndLimit(String deviceId, String query, Boolean hasSubChannel, Boolean online, int start, int limit); /** * 获取某个设备的通道列表 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 1d0b3659..28d63c3e 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 @@ -168,4 +168,20 @@ public interface DeviceChannelMapper { "" + ""}) void batchUpdate(List updateChannels); + + @Select(value = {" "}) + List queryChannelsByDeviceIdWithStartAndLimit(String deviceId, String parentChannelId, String query, Boolean hasSubChannel, Boolean online, int start, int limit); } diff --git a/src/main/java/com/genersoft/iot/vmp/storager/impl/VideoManagerStoragerImpl.java b/src/main/java/com/genersoft/iot/vmp/storager/impl/VideoManagerStoragerImpl.java index f1a9f9a5..a1f9331c 100644 --- a/src/main/java/com/genersoft/iot/vmp/storager/impl/VideoManagerStoragerImpl.java +++ b/src/main/java/com/genersoft/iot/vmp/storager/impl/VideoManagerStoragerImpl.java @@ -258,6 +258,11 @@ public class VideoManagerStoragerImpl implements IVideoManagerStorager { return new PageInfo<>(all); } + @Override + public List queryChannelsByDeviceIdWithStartAndLimit(String deviceId, String query, Boolean hasSubChannel, Boolean online, int start, int limit) { + return deviceChannelMapper.queryChannelsByDeviceIdWithStartAndLimit(deviceId, null, query, hasSubChannel, online, start, limit); + } + @Override public List queryChannelsByDeviceId(String deviceId) { return deviceChannelMapper.queryChannels(deviceId, null,null, null, null); diff --git a/src/main/java/com/genersoft/iot/vmp/web/gb28181/ApiDeviceController.java b/src/main/java/com/genersoft/iot/vmp/web/gb28181/ApiDeviceController.java index 8d1f0c32..2e96fbe2 100644 --- a/src/main/java/com/genersoft/iot/vmp/web/gb28181/ApiDeviceController.java +++ b/src/main/java/com/genersoft/iot/vmp/web/gb28181/ApiDeviceController.java @@ -110,14 +110,14 @@ public class ApiDeviceController { return result; } List deviceChannels; + List allDeviceChannelList = storager.queryChannelsByDeviceId(serial); if (start == null || limit ==null) { - deviceChannels = storager.queryChannelsByDeviceId(serial); + deviceChannels = allDeviceChannelList; result.put("ChannelCount", deviceChannels.size()); }else { - start ++; - PageInfo pageResult = storager.queryChannelsByDeviceId(serial, null, null, null,start, limit); - result.put("ChannelCount", pageResult.getList().size()); - deviceChannels = pageResult.getList(); + deviceChannels = storager.queryChannelsByDeviceIdWithStartAndLimit(serial, null, null, null,start, limit); + int total = allDeviceChannelList.size(); + result.put("ChannelCount", total); } JSONArray channleJSONList = new JSONArray();