This commit is contained in:
huangzj
2023-11-07 14:09:06 +08:00
parent 86816568ce
commit 01edcba6e2
3 changed files with 11 additions and 0 deletions

View File

@@ -120,6 +120,11 @@ public interface InfluxDBTableConstant {
*/ */
String MIN_VALUE = "minValue"; String MIN_VALUE = "minValue";
/**
* 统计结果平均值
*/
String AVG_VALUE = "avgValue";
/** /**
* 数据质量标志 * 数据质量标志
*/ */

View File

@@ -61,5 +61,10 @@ public class StatisticalDataDTO {
*/ */
private Double minValue; private Double minValue;
/**
* 指标平均值
*/
private Double avgValue;
} }

View File

@@ -96,6 +96,7 @@ public class CommonServiceImpl implements CommonService {
InfluxQueryWrapper influxQueryWrapper = new InfluxQueryWrapper(getTableNameByClassId(tableName),StatisticalDataDTO.class); InfluxQueryWrapper influxQueryWrapper = new InfluxQueryWrapper(getTableNameByClassId(tableName),StatisticalDataDTO.class);
influxQueryWrapper.max(columnName,InfluxDBTableConstant.MAX_VALUE) influxQueryWrapper.max(columnName,InfluxDBTableConstant.MAX_VALUE)
.min(columnName,InfluxDBTableConstant.MIN_VALUE) .min(columnName,InfluxDBTableConstant.MIN_VALUE)
.mean(columnName)
.eq(InfluxDBTableConstant.LINE_ID,lineId) .eq(InfluxDBTableConstant.LINE_ID,lineId)
.eq(InfluxDBTableConstant.CL_DID,clDid) .eq(InfluxDBTableConstant.CL_DID,clDid)
.between(InfluxDBTableConstant.TIME, startTime, endTime); .between(InfluxDBTableConstant.TIME, startTime, endTime);