From 71128d66bfdcbf1946036b86b8bde1370ed75571 Mon Sep 17 00:00:00 2001 From: xy <748613696@qq.com> Date: Mon, 1 Jun 2026 19:55:16 +0800 Subject: [PATCH] =?UTF-8?q?fix(influx):=20=E4=BF=AE=E5=A4=8D=E6=95=B0?= =?UTF-8?q?=E6=8D=AE=E7=B1=BB=E5=9E=8B=E6=9F=A5=E8=AF=A2=E6=9D=A1=E4=BB=B6?= =?UTF-8?q?=E7=A9=BA=E6=8C=87=E9=92=88=E5=BC=82=E5=B8=B8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 添加了数据类型参数的空值检查 - 避免在查询条件中传入null值导致的异常 - 确保查询构建器只在参数非空时添加数据类型过滤条件 --- .../java/com/njcn/influx/service/impl/CommonServiceImpl.java | 5 ++++- 1 file changed, 4 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 4ea0e29..a6694e7 100644 --- a/src/main/java/com/njcn/influx/service/impl/CommonServiceImpl.java +++ b/src/main/java/com/njcn/influx/service/impl/CommonServiceImpl.java @@ -76,7 +76,10 @@ public class CommonServiceImpl implements CommonService { .eq(InfluxDBTableConstant.PHASIC_TYPE, commonQueryParam.getPhasic()) .eq(InfluxDBTableConstant.PROCESS, commonQueryParam.getProcess()) .between(InfluxDBTableConstant.TIME, commonQueryParam.getStartTime(), commonQueryParam.getEndTime()) - .eq(InfluxDBTableConstant.VALUE_TYPE, commonQueryParam.getDataType()).eq(InfluxDBTableConstant.CL_DID, commonQueryParam.getClDid()); + .eq(InfluxDBTableConstant.CL_DID, commonQueryParam.getClDid()); + if (commonQueryParam.getDataType() != null) { + influxQueryWrapper.eq(InfluxDBTableConstant.VALUE_TYPE, commonQueryParam.getDataType()); + } List deviceRtData = commonMapper.getDeviceRtDataByTime(influxQueryWrapper); resultList.addAll(deviceRtData); }