|
|
|
|
@@ -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);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|