From b90969f180475659307157322ca0108d4b39c6ee Mon Sep 17 00:00:00 2001 From: 648540858 <648540858@qq.com> Date: 星期一, 17 一月 2022 10:35:51 +0800 Subject: [PATCH] 优化推流列表查询排序 --- src/main/java/com/genersoft/iot/vmp/web/gb28181/ApiDeviceController.java | 9 +++++---- 1 files changed, 5 insertions(+), 4 deletions(-) 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 2a021a2..2e96fbe 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,13 +110,14 @@ return result; } List<DeviceChannel> deviceChannels; + List<DeviceChannel> allDeviceChannelList = storager.queryChannelsByDeviceId(serial); if (start == null || limit ==null) { - deviceChannels = storager.queryChannelsByDeviceId(serial); + deviceChannels = allDeviceChannelList; result.put("ChannelCount", deviceChannels.size()); }else { - PageInfo<DeviceChannel> pageResult = storager.queryChannelsByDeviceId(serial, null, null, null,start/limit, limit); - result.put("ChannelCount", pageResult.getTotal()); - deviceChannels = pageResult.getList(); + deviceChannels = storager.queryChannelsByDeviceIdWithStartAndLimit(serial, null, null, null,start, limit); + int total = allDeviceChannelList.size(); + result.put("ChannelCount", total); } JSONArray channleJSONList = new JSONArray(); -- Gitblit v1.8.0