fix(influx): 修复流程条件查询逻辑
- 移动了 PROCESS 条件判断的位置 - 确保仅当 commonQueryParam.getProcess() 不为 null 时才添加查询条件 - 避免了无效的空值查询条件导致的潜在错误 - 优化了查询构建的逻辑结构
This commit is contained in:
@@ -74,12 +74,14 @@ public class CommonServiceImpl implements CommonService {
|
|||||||
.select(commonQueryParam.getColumnName(), InfluxDBTableConstant.VALUE)
|
.select(commonQueryParam.getColumnName(), InfluxDBTableConstant.VALUE)
|
||||||
.eq(InfluxDBTableConstant.LINE_ID, commonQueryParam.getLineId())
|
.eq(InfluxDBTableConstant.LINE_ID, commonQueryParam.getLineId())
|
||||||
.eq(InfluxDBTableConstant.PHASIC_TYPE, commonQueryParam.getPhasic())
|
.eq(InfluxDBTableConstant.PHASIC_TYPE, commonQueryParam.getPhasic())
|
||||||
.eq(InfluxDBTableConstant.PROCESS, commonQueryParam.getProcess())
|
|
||||||
.between(InfluxDBTableConstant.TIME, commonQueryParam.getStartTime(), commonQueryParam.getEndTime())
|
.between(InfluxDBTableConstant.TIME, commonQueryParam.getStartTime(), commonQueryParam.getEndTime())
|
||||||
.eq(InfluxDBTableConstant.CL_DID, commonQueryParam.getClDid());
|
.eq(InfluxDBTableConstant.CL_DID, commonQueryParam.getClDid());
|
||||||
if (commonQueryParam.getDataType() != null) {
|
if (commonQueryParam.getDataType() != null) {
|
||||||
influxQueryWrapper.eq(InfluxDBTableConstant.VALUE_TYPE, commonQueryParam.getDataType());
|
influxQueryWrapper.eq(InfluxDBTableConstant.VALUE_TYPE, commonQueryParam.getDataType());
|
||||||
}
|
}
|
||||||
|
if (commonQueryParam.getProcess() != null) {
|
||||||
|
influxQueryWrapper.eq(InfluxDBTableConstant.PROCESS, commonQueryParam.getProcess());
|
||||||
|
}
|
||||||
List<StatisticalDataDTO> deviceRtData = commonMapper.getDeviceRtDataByTime(influxQueryWrapper);
|
List<StatisticalDataDTO> deviceRtData = commonMapper.getDeviceRtDataByTime(influxQueryWrapper);
|
||||||
resultList.addAll(deviceRtData);
|
resultList.addAll(deviceRtData);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user