Browse Source

增加设备条件查询最新时间

lingpeng.li 6 months ago
parent
commit
f95e0d0923

+ 2 - 1
jeecg-module-gather/src/main/java/org/jeecg/modules/watch/MysqlWatch.java

@@ -77,8 +77,9 @@ public class MysqlWatch {
                 devicePointLambdaQueryWrapper.eq(DevicePoint::getDeviceId, device.getId());
                 List<DevicePoint> devicePoints = devicePointMapper.selectList(devicePointLambdaQueryWrapper);
 
-                // 查询 FpgGatherData 表中 createTime 最新的一条记录
+                // 查询 FpgGatherData 表中 该设备下的createTime 最新的一条记录
                 LambdaQueryWrapper<FpgGatherData> fpgGatherDataLambdaQueryWrapper = new LambdaQueryWrapper<>();
+                fpgGatherDataLambdaQueryWrapper.eq(FpgGatherData::getDeviceInformationId, device.getId());
                 fpgGatherDataLambdaQueryWrapper
                         .orderByDesc(FpgGatherData::getCreateTime) // 按 createTime 降序排序
                         .last("LIMIT 1"); // 只取一条记录