From 1a54d530149f5c359e4e44fda207c633ad34a3b2 Mon Sep 17 00:00:00 2001 From: xy <748613696@qq.com> Date: Tue, 2 Jun 2026 09:14:01 +0800 Subject: [PATCH] =?UTF-8?q?fix(influx):=20=E4=BF=AE=E5=A4=8D=E6=B5=81?= =?UTF-8?q?=E7=A8=8B=E6=9D=A1=E4=BB=B6=E6=9F=A5=E8=AF=A2=E9=80=BB=E8=BE=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 移动了 PROCESS 条件判断的位置 - 确保仅当 commonQueryParam.getProcess() 不为 null 时才添加查询条件 - 避免了无效的空值查询条件导致的潜在错误 - 优化了查询构建的逻辑结构 --- .../java/com/njcn/influx/service/impl/CommonServiceImpl.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/main/java/com/njcn/influx/service/impl/CommonServiceImpl.java b/src/main/java/com/njcn/influx/service/impl/CommonServiceImpl.java index a6694e7..dc00039 100644 --- a/src/main/java/com/njcn/influx/service/impl/CommonServiceImpl.java +++ b/src/main/java/com/njcn/influx/service/impl/CommonServiceImpl.java @@ -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 deviceRtData = commonMapper.getDeviceRtDataByTime(influxQueryWrapper); resultList.addAll(deviceRtData); }