|
|
|
|
@ -328,12 +328,14 @@ public class DeviceServiceImpl implements DeviceService {
|
|
|
|
|
.map(DeviceStatusEnum::getCode)
|
|
|
|
|
.collect(Collectors.toList());
|
|
|
|
|
|
|
|
|
|
List<DeviceOperationRecordDO> operationRecords = deviceOperationRecordMapper.selectList(
|
|
|
|
|
Wrappers.<DeviceOperationRecordDO>lambdaQuery()
|
|
|
|
|
.in(DeviceOperationRecordDO::getDeviceId, deviceIds)
|
|
|
|
|
.in(DeviceOperationRecordDO::getRule, ruleCodes)
|
|
|
|
|
.orderByDesc(DeviceOperationRecordDO::getCreateTime)
|
|
|
|
|
);
|
|
|
|
|
// List<DeviceOperationRecordDO> operationRecords = deviceOperationRecordMapper.selectList(
|
|
|
|
|
// Wrappers.<DeviceOperationRecordDO>lambdaQuery()
|
|
|
|
|
// .in(DeviceOperationRecordDO::getDeviceId, deviceIds)
|
|
|
|
|
// .in(DeviceOperationRecordDO::getRule, ruleCodes)
|
|
|
|
|
// .orderByDesc(DeviceOperationRecordDO::getCreateTime)
|
|
|
|
|
// );
|
|
|
|
|
|
|
|
|
|
List<DeviceOperationRecordDO> operationRecords = deviceOperationRecordMapper.selectLatestByDeviceAndRule(deviceIds,ruleCodes);
|
|
|
|
|
|
|
|
|
|
// 按 deviceId 分组,取最新一条
|
|
|
|
|
Map<Long, DeviceOperationRecordDO> latestRecordMap = operationRecords.stream()
|
|
|
|
|
|