Browse Source

perf

master
wxc 1 month ago
parent
commit
92aabe01f8
  1. 3
      src/main/java/com/biutag/supervision/service/WvpDeviceChannelService.java

3
src/main/java/com/biutag/supervision/service/WvpDeviceChannelService.java

@ -1,5 +1,6 @@
package com.biutag.supervision.service;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.biutag.supervision.mapper.WvpDeviceChannelMapper;
import com.biutag.supervision.pojo.entity.WvpDeviceChannel;
@ -12,7 +13,7 @@ import java.util.stream.Collectors;
public class WvpDeviceChannelService extends ServiceImpl<WvpDeviceChannelMapper, WvpDeviceChannel> {
public List<WvpDeviceChannel> getDeviceList() {
List<WvpDeviceChannel> allDevices = list();
List<WvpDeviceChannel> allDevices = list(new LambdaQueryWrapper<WvpDeviceChannel>().eq(WvpDeviceChannel::getStatus, "ON"));
Map<String, WvpDeviceChannel> deviceMap = allDevices.stream()
.collect(Collectors.toMap(WvpDeviceChannel::getDeviceId, device -> device));
List<WvpDeviceChannel> hierarchy = new ArrayList<>();

Loading…
Cancel
Save