| | |
| | | * @return
|
| | | */
|
| | | public PageInfo queryChannelsByDeviceId(String deviceId, String query, Boolean hasSubChannel, Boolean online, int page, int count);
|
| | | |
| | | public List<DeviceChannel> queryChannelsByDeviceIdWithStartAndLimit(String deviceId, String query, Boolean hasSubChannel, Boolean online, int start, int limit);
|
| | |
|
| | | /**
|
| | | * 获取某个设备的通道列表
|
| | |
| | | "</foreach>" + |
| | | "</script>"}) |
| | | void batchUpdate(List<DeviceChannel> updateChannels); |
| | | |
| | | @Select(value = {" <script>" + |
| | | "SELECT * FROM ( "+ |
| | | " SELECT * , (SELECT count(0) FROM device_channel WHERE parentId=dc.channelId) as subCount FROM device_channel dc " + |
| | | " WHERE dc.deviceId=#{deviceId} " + |
| | | " <if test='query != null'> AND (dc.channelId LIKE '%${query}%' OR dc.name LIKE '%${query}%' OR dc.name LIKE '%${query}%')</if> " + |
| | | " <if test='parentChannelId != null'> AND dc.parentId=#{parentChannelId} </if> " + |
| | | " <if test='online == true' > AND dc.status=1</if>" + |
| | | " <if test='online == false' > AND dc.status=0</if>) dcr" + |
| | | " WHERE 1=1 " + |
| | | " <if test='hasSubChannel == true' > AND subCount >0</if>" + |
| | | " <if test='hasSubChannel == false' > AND subCount=0</if>" + |
| | | " ORDER BY channelId ASC" + |
| | | " LIMIT #{limit} OFFSET #{start}" + |
| | | " </script>"}) |
| | | List<DeviceChannel> queryChannelsByDeviceIdWithStartAndLimit(String deviceId, String parentChannelId, String query, Boolean hasSubChannel, Boolean online, int start, int limit); |
| | | } |
| | |
| | | } |
| | | |
| | | @Override |
| | | public List<DeviceChannel> 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<DeviceChannel> queryChannelsByDeviceId(String deviceId) { |
| | | return deviceChannelMapper.queryChannels(deviceId, null,null, null, null); |
| | | } |
| | |
| | | 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 { |
| | | 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(); |