45 lines
1.5 KiB
Java
45 lines
1.5 KiB
Java
|
|
package com.fastbee.service;
|
||
|
|
|
||
|
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||
|
|
import com.fastbee.iot.domain.DeviceRunningStatusHistory;
|
||
|
|
import com.fastbee.entity.ErrorIdentificationStandard;
|
||
|
|
import com.fastbee.iot.mapper.DeviceStatusHistoryMapper;
|
||
|
|
import com.fastbee.mapper.ErrorIdentificationStandardMapper;
|
||
|
|
import lombok.extern.slf4j.Slf4j;
|
||
|
|
import org.apache.commons.lang3.StringUtils;
|
||
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
||
|
|
import org.springframework.stereotype.Service;
|
||
|
|
|
||
|
|
import java.util.List;
|
||
|
|
|
||
|
|
@Service
|
||
|
|
@Slf4j
|
||
|
|
public class NettyDeviceService {
|
||
|
|
|
||
|
|
@Autowired
|
||
|
|
private DeviceStatusHistoryMapper deviceStatusHistoryMapper;
|
||
|
|
|
||
|
|
@Autowired
|
||
|
|
private ErrorIdentificationStandardMapper errorIdentificationStandardMapper;
|
||
|
|
|
||
|
|
public List<DeviceRunningStatusHistory> statusHistory(DeviceRunningStatusHistory history) {
|
||
|
|
|
||
|
|
LambdaQueryWrapper<DeviceRunningStatusHistory> queryWrapper = new LambdaQueryWrapper<>();
|
||
|
|
if (!StringUtils.isEmpty(history.getDeviceId())) {
|
||
|
|
queryWrapper.eq(DeviceRunningStatusHistory::getDeviceId, history.getDeviceId());
|
||
|
|
}
|
||
|
|
return deviceStatusHistoryMapper.selectList(queryWrapper);
|
||
|
|
}
|
||
|
|
|
||
|
|
|
||
|
|
public List<ErrorIdentificationStandard> allErrorIdentificationStandard() {
|
||
|
|
return errorIdentificationStandardMapper.selectList(null);
|
||
|
|
}
|
||
|
|
|
||
|
|
public int updateErrorIdentification(ErrorIdentificationStandard standard) {
|
||
|
|
return errorIdentificationStandardMapper.updateById(standard);
|
||
|
|
}
|
||
|
|
|
||
|
|
|
||
|
|
}
|