package com.bonus.core.device.manage.service;

import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.bonus.core.device.manage.mapper.DeviceDcDoorMapper;
import com.bonus.core.device.manage.model.DeviceDcDoor;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;
import java.util.stream.Collectors;

@Service
public class DeviceDcDoorService {
   @Resource
   private DeviceDcDoorMapper deviceDcDoorMapper;


   public List<Long> getAllDeviceIds() {
      return this.deviceDcDoorMapper.selectObjs(Wrappers.lambdaQuery(DeviceDcDoor.class)
                      .select(DeviceDcDoor::getDeviceId)).stream()
              .map(item -> (Long) item)
              .collect(Collectors.toList());
   }
}
