fix(influx): 修复流程条件查询逻辑

- 移动了 PROCESS 条件判断的位置
- 确保仅当 commonQueryParam.getProcess() 不为 null 时才添加查询条件
- 避免了无效的空值查询条件导致的潜在错误
- 优化了查询构建的逻辑结构
This commit is contained in:
xy
2026-06-02 09:14:01 +08:00
parent 71128d66bf
commit 1a54d53014

View File

@@ -74,12 +74,14 @@ public class CommonServiceImpl implements CommonService {
.select(commonQueryParam.getColumnName(), InfluxDBTableConstant.VALUE)
.eq(InfluxDBTableConstant.LINE_ID, commonQueryParam.getLineId())
.eq(InfluxDBTableConstant.PHASIC_TYPE, commonQueryParam.getPhasic())
.eq(InfluxDBTableConstant.PROCESS, commonQueryParam.getProcess())
.between(InfluxDBTableConstant.TIME, commonQueryParam.getStartTime(), commonQueryParam.getEndTime())
.eq(InfluxDBTableConstant.CL_DID, commonQueryParam.getClDid());
if (commonQueryParam.getDataType() != null) {
influxQueryWrapper.eq(InfluxDBTableConstant.VALUE_TYPE, commonQueryParam.getDataType());
}
if (commonQueryParam.getProcess() != null) {
influxQueryWrapper.eq(InfluxDBTableConstant.PROCESS, commonQueryParam.getProcess());
}
List<StatisticalDataDTO> deviceRtData = commonMapper.getDeviceRtDataByTime(influxQueryWrapper);
resultList.addAll(deviceRtData);
}