4 Commits

Author SHA1 Message Date
xy
20b0c44874 微调 2025-07-17 15:34:03 +08:00
xy
e0af988ce4 微调 2025-07-09 16:05:26 +08:00
xy
c3ac9b12f7 新增查询治理各模块数据的方法 2025-07-09 11:51:19 +08:00
xy
3b136b0c5b 新增查询治理各模块数据的方法 2025-06-30 11:16:54 +08:00
3 changed files with 50 additions and 3 deletions

View File

@@ -14,6 +14,7 @@ public class CommonQueryParam {
private String lineId;
private String tableName;
private String columnName;
private String resultName;
private String phasic;
private String startTime;
private String endTime;

View File

@@ -84,5 +84,9 @@ public interface CommonService {
*/
StatisticalDataDTO getCounts(String lineId, String tableName, String columnName,String resultName, String phasic, String dataType, String clDid, String process,String startTime, String endTime);
List<StatisticalDataDTO> getEachModule(CommonQueryParam param);
StatisticalDataDTO getDataCounts(String lineId, String tableName, String columnName,String resultName, String phasic, String dataType, String clDid, String process,String startTime, String endTime);
List<StatisticalDataDTO> getModuleData(CommonQueryParam param);
}

View File

@@ -1,5 +1,6 @@
package com.njcn.influx.service.impl;
import cn.hutool.core.util.ObjectUtil;
import com.njcn.influx.imapper.CommonMapper;
import com.njcn.influx.pojo.bo.CommonQueryParam;
import com.njcn.influx.pojo.constant.InfluxDBTableConstant;
@@ -9,8 +10,7 @@ import com.njcn.influx.service.CommonService;
import lombok.RequiredArgsConstructor;
import org.springframework.stereotype.Service;
import java.util.ArrayList;
import java.util.List;
import java.util.*;
/**
* Description:
@@ -157,9 +157,51 @@ public class CommonServiceImpl implements CommonService {
.eq(InfluxDBTableConstant.VALUE_TYPE,dataType)
.eq(InfluxDBTableConstant.CL_DID,clDid)
.eq(InfluxDBTableConstant.PROCESS,process)
.between(InfluxDBTableConstant.TIME, startTime, endTime);;
.between(InfluxDBTableConstant.TIME, startTime, endTime);
return commonMapper.getLineRtData(influxQueryWrapper);
}
@Override
public List<StatisticalDataDTO> getEachModule(CommonQueryParam param) {
InfluxQueryWrapper influxQueryWrapper = new InfluxQueryWrapper(param.getTableName(),StatisticalDataDTO.class);
influxQueryWrapper.select(param.getColumnName(),param.getResultName())
.between(InfluxDBTableConstant.TIME, param.getStartTime(), param.getEndTime())
.eq(InfluxDBTableConstant.LINE_ID,param.getLineId())
.eq(InfluxDBTableConstant.PHASIC_TYPE, "M")
.eq(InfluxDBTableConstant.VALUE_TYPE,"avg")
.eq(param.getDataType(),0)
.eq(InfluxDBTableConstant.PROCESS,param.getProcess())
.eq(InfluxDBTableConstant.CL_DID,param.getClDid());
return commonMapper.getDeviceRtDataByTime(influxQueryWrapper);
}
@Override
public StatisticalDataDTO getDataCounts(String lineId, String tableName, String columnName, String resultName, String phasic, String dataType, String clDid, String process, String startTime, String endTime) {
InfluxQueryWrapper influxQueryWrapper = new InfluxQueryWrapper(tableName,StatisticalDataDTO.class);
influxQueryWrapper.count(columnName,resultName)
.eq(InfluxDBTableConstant.LINE_ID,lineId)
.eq(InfluxDBTableConstant.PHASIC_TYPE,phasic)
.eq(InfluxDBTableConstant.VALUE_TYPE,dataType)
.eq(InfluxDBTableConstant.CL_DID,clDid)
.eq(InfluxDBTableConstant.PROCESS,process)
.between(InfluxDBTableConstant.TIME, startTime, endTime);
return commonMapper.getLineRtData(influxQueryWrapper);
}
@Override
public List<StatisticalDataDTO> getModuleData(CommonQueryParam param) {
InfluxQueryWrapper influxQueryWrapper = new InfluxQueryWrapper(param.getTableName(),StatisticalDataDTO.class);
influxQueryWrapper
.select(StatisticalDataDTO::getLineId)
.select(StatisticalDataDTO::getPhaseType)
.select("Apf_RmsI_ModOut","value")
.select("Apf_RmsI_Load","avgValue")
.select("Apf_Temp_Env","minValue")
.between(InfluxDBTableConstant.TIME, param.getStartTime(), param.getEndTime())
.eq(InfluxDBTableConstant.LINE_ID,param.getLineId())
.eq(InfluxDBTableConstant.VALUE_TYPE,"avg")
.eq(InfluxDBTableConstant.PROCESS,param.getProcess())
.eq(InfluxDBTableConstant.CL_DID,param.getClDid());
return commonMapper.getDeviceRtDataByTime(influxQueryWrapper);
}
}