package cn.iocoder.yudao.module.pms.service;


import cn.iocoder.yudao.module.pms.controller.admin.vo.DeviceTdVO;
import cn.iocoder.yudao.module.pms.controller.admin.vo.DeviceVO;
import cn.iocoder.yudao.module.pms.dal.mysql.TDDeviceMapper;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.validation.annotation.Validated;

import java.util.List;


@Service
@Validated
public class DeviceServiceImpl implements IDeviceService {
    private static final Logger log = LoggerFactory.getLogger(DeviceServiceImpl.class);

    @Autowired
    private TDDeviceMapper deviceMapper;


    /**
     * 查询设备
     *
     * @param
     * @return 设备
     */
    // TODO 22--slaveId
    @Override
    public List<DeviceVO> selectBySpan(DeviceVO deviceVO) {
        List<DeviceVO> device = deviceMapper.selectBySpan(deviceVO.getDeviceName(),deviceVO.getTs(),deviceVO.getTs1());
        return device;
    }

    @Override
    public List<DeviceVO> selectNew(DeviceVO deviceVO) {
        List<DeviceVO> device = deviceMapper.selectNew(deviceVO.getDeviceName());
        return device;
    }

    @Override
    public List<DeviceVO> selectByTs(DeviceVO deviceVO) {
        List<DeviceVO> device = deviceMapper.selectByTs(deviceVO.getDeviceName(),deviceVO.getTs());
        return device;
    }

    @Override
    public DeviceVO getYesInfo(DeviceVO deviceVO) {
        return deviceMapper.getYesInfo(deviceVO.getDeviceName(), deviceVO.getColName(),deviceVO.getTs(),deviceVO.getTs1());
    }

    @Override
    public List<DeviceTdVO> batchGetYesInfo(List<DeviceTdVO> queries) {
        return deviceMapper.batchGetYesInfo(queries);
    }


}
