初始化influx公共模块项目
This commit is contained in:
@@ -0,0 +1,14 @@
|
||||
package com.njcn.influx.service.impl;
|
||||
|
||||
import com.njcn.influx.service.CldStatisticsFlowService;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
/**
|
||||
* @author hongawen
|
||||
* @version 1.0.0
|
||||
* @date 2023年05月05日 09:00
|
||||
*/
|
||||
@Service
|
||||
public class CldStatisticsFlowServiceImpl implements CldStatisticsFlowService {
|
||||
|
||||
}
|
||||
@@ -0,0 +1,114 @@
|
||||
package com.njcn.influx.service.impl;
|
||||
|
||||
import com.njcn.influx.imapper.CommonMapper;
|
||||
import com.njcn.influx.pojo.bo.CommonQueryParam;
|
||||
import com.njcn.influx.pojo.constant.InfluxDBTableConstant;
|
||||
import com.njcn.influx.pojo.dto.StatisticalDataDTO;
|
||||
import com.njcn.influx.query.InfluxQueryWrapper;
|
||||
import com.njcn.influx.service.CommonService;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* Description:
|
||||
* Date: 2023/6/2 16:04【需求编号】
|
||||
*
|
||||
* @author clam
|
||||
* @version V1.0.0
|
||||
*/
|
||||
@Service
|
||||
@RequiredArgsConstructor
|
||||
public class CommonServiceImpl implements CommonService {
|
||||
|
||||
private final CommonMapper commonMapper;
|
||||
|
||||
@Override
|
||||
public StatisticalDataDTO getLineRtData(String lineId, String tableName, String columnName, String phasic, String dataType, String clDid) {
|
||||
InfluxQueryWrapper influxQueryWrapper = new InfluxQueryWrapper(tableName,StatisticalDataDTO.class);
|
||||
influxQueryWrapper.select(StatisticalDataDTO::getLineId)
|
||||
.select(StatisticalDataDTO::getPhaseType)
|
||||
.select(StatisticalDataDTO::getValueType)
|
||||
.last(columnName)
|
||||
.eq(InfluxDBTableConstant.LINE_ID,lineId)
|
||||
.eq(InfluxDBTableConstant.PHASIC_TYPE,phasic)
|
||||
.eq(InfluxDBTableConstant.VALUE_TYPE,dataType)
|
||||
.eq(InfluxDBTableConstant.CL_DID,clDid);
|
||||
return commonMapper.getLineRtData(influxQueryWrapper);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<StatisticalDataDTO> getDeviceRtData(List<CommonQueryParam> commonQueryParams) {
|
||||
List<StatisticalDataDTO> resultList = new ArrayList<>();
|
||||
for (CommonQueryParam commonQueryParam: commonQueryParams) {
|
||||
InfluxQueryWrapper influxQueryWrapper = new InfluxQueryWrapper(commonQueryParam.getTableName(),StatisticalDataDTO.class);
|
||||
influxQueryWrapper.select(StatisticalDataDTO::getLineId)
|
||||
.select(StatisticalDataDTO::getPhaseType)
|
||||
.select(StatisticalDataDTO::getValueType)
|
||||
.last(commonQueryParam.getColumnName(),InfluxDBTableConstant.VALUE)
|
||||
.eq(InfluxDBTableConstant.LINE_ID,commonQueryParam.getLineId())
|
||||
.eq(InfluxDBTableConstant.PROCESS,commonQueryParam.getProcess())
|
||||
.eq(InfluxDBTableConstant.PHASIC_TYPE,commonQueryParam.getPhasic())
|
||||
.eq(InfluxDBTableConstant.VALUE_TYPE,commonQueryParam.getDataType()).eq(InfluxDBTableConstant.CL_DID,commonQueryParam.getClDid());
|
||||
List<StatisticalDataDTO> deviceRtData = commonMapper.getDeviceRtData(influxQueryWrapper);
|
||||
resultList.addAll(deviceRtData);
|
||||
}
|
||||
|
||||
return resultList;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<StatisticalDataDTO> getDeviceRtDataByTime(List<CommonQueryParam> commonQueryParams) {
|
||||
List<StatisticalDataDTO> resultList = new ArrayList<>();
|
||||
for (CommonQueryParam commonQueryParam: commonQueryParams) {
|
||||
InfluxQueryWrapper influxQueryWrapper = new InfluxQueryWrapper(commonQueryParam.getTableName(), StatisticalDataDTO.class);
|
||||
influxQueryWrapper.select(StatisticalDataDTO::getLineId)
|
||||
.select(StatisticalDataDTO::getPhaseType)
|
||||
.select(StatisticalDataDTO::getValueType)
|
||||
.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.VALUE_TYPE, commonQueryParam.getDataType()).eq(InfluxDBTableConstant.CL_DID, commonQueryParam.getClDid());
|
||||
List<StatisticalDataDTO> deviceRtData = commonMapper.getDeviceRtDataByTime(influxQueryWrapper);
|
||||
resultList.addAll(deviceRtData);
|
||||
}
|
||||
|
||||
return resultList;
|
||||
}
|
||||
|
||||
@Override
|
||||
public StatisticalDataDTO getLineHistoryData(String lineId, String tableName, String columnName, String startTime, String endTime, String clDid) {
|
||||
InfluxQueryWrapper influxQueryWrapper = new InfluxQueryWrapper(tableName,StatisticalDataDTO.class);
|
||||
influxQueryWrapper.max(columnName,InfluxDBTableConstant.MAX_VALUE)
|
||||
.min(columnName,InfluxDBTableConstant.MIN_VALUE)
|
||||
.mean(columnName,InfluxDBTableConstant.AVG_VALUE)
|
||||
.eq(InfluxDBTableConstant.LINE_ID,lineId)
|
||||
.eq(InfluxDBTableConstant.CL_DID,clDid)
|
||||
.between(InfluxDBTableConstant.TIME, startTime, endTime);
|
||||
return commonMapper.getLineHistoryData(influxQueryWrapper);
|
||||
}
|
||||
|
||||
@Override
|
||||
public StatisticalDataDTO selectBySql(StringBuilder sql) {
|
||||
return commonMapper.selectBySql(sql);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<StatisticalDataDTO> getTopTemperature(String lineId, String tableName, String columnName,String process) {
|
||||
InfluxQueryWrapper influxQueryWrapper = new InfluxQueryWrapper(tableName,StatisticalDataDTO.class);
|
||||
influxQueryWrapper.select(StatisticalDataDTO::getLineId)
|
||||
.select(StatisticalDataDTO::getClDid)
|
||||
.last(columnName,InfluxDBTableConstant.VALUE)
|
||||
.eq(InfluxDBTableConstant.LINE_ID,lineId)
|
||||
.eq(InfluxDBTableConstant.PROCESS,process)
|
||||
.groupBy(InfluxDBTableConstant.CL_DID);
|
||||
return commonMapper.getTopTemperature(influxQueryWrapper);
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,95 @@
|
||||
package com.njcn.influx.service.impl;
|
||||
|
||||
import com.fasterxml.jackson.core.JsonProcessingException;
|
||||
import com.fasterxml.jackson.databind.ObjectMapper;
|
||||
import com.njcn.influx.imapper.DataFlickerMapper;
|
||||
import com.njcn.influx.pojo.dto.DataFlickerDTO;
|
||||
import com.njcn.influx.pojo.po.DataFlicker;
|
||||
import com.njcn.influx.query.InfluxQueryWrapper;
|
||||
import com.njcn.influx.service.DataFlickerService;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @author hongawen
|
||||
* @version 1.0.0
|
||||
* @date 2023年05月05日 09:05
|
||||
*/
|
||||
@Service
|
||||
public class DataFlickerServiceImpl implements DataFlickerService {
|
||||
|
||||
@Resource
|
||||
private DataFlickerMapper dataFlickerMapper;
|
||||
|
||||
|
||||
@Override
|
||||
public List<DataFlickerDTO> getDataFlicker(String lineIndex, String startTime, String endTime) {
|
||||
//最小值
|
||||
List<DataFlickerDTO> result1 ;
|
||||
InfluxQueryWrapper influxQueryWrapper = new InfluxQueryWrapper(DataFlicker.class, DataFlickerDTO.class);
|
||||
influxQueryWrapper.eq(DataFlicker::getLineId, lineIndex)
|
||||
.min(DataFlicker::getFluc)
|
||||
.min(DataFlicker::getPlt)
|
||||
.min(DataFlicker::getPst)
|
||||
.groupBy(DataFlicker::getLineId,DataFlicker::getPhaseType,DataFlicker::getQualityFlag)
|
||||
.between(DataFlicker::getTime, startTime, endTime);
|
||||
result1 = dataFlickerMapper.getStatisticsByWraper(influxQueryWrapper);
|
||||
result1.forEach(item -> {
|
||||
item.setValueType("MIN");
|
||||
});
|
||||
//最大值
|
||||
List<DataFlickerDTO> result2 ;
|
||||
influxQueryWrapper.initSql();
|
||||
influxQueryWrapper.eq(DataFlicker::getLineId, lineIndex)
|
||||
.max(DataFlicker::getFluc)
|
||||
.max(DataFlicker::getPlt)
|
||||
.max(DataFlicker::getPst)
|
||||
.groupBy(DataFlicker::getLineId,DataFlicker::getPhaseType,DataFlicker::getQualityFlag)
|
||||
.between(DataFlicker::getTime, startTime, endTime);
|
||||
result2 = dataFlickerMapper.getStatisticsByWraper(influxQueryWrapper);
|
||||
result2.forEach(item -> {
|
||||
item.setValueType("MAX");
|
||||
});
|
||||
//平均值
|
||||
List<DataFlickerDTO> result3 ;
|
||||
influxQueryWrapper.initSql();
|
||||
influxQueryWrapper.eq(DataFlicker::getLineId, lineIndex)
|
||||
.mean(DataFlicker::getFluc)
|
||||
.mean(DataFlicker::getPlt)
|
||||
.mean(DataFlicker::getPst)
|
||||
.groupBy(DataFlicker::getLineId,DataFlicker::getPhaseType,DataFlicker::getQualityFlag)
|
||||
.between(DataFlicker::getTime, startTime, endTime);
|
||||
result3 = dataFlickerMapper.getStatisticsByWraper(influxQueryWrapper);
|
||||
result3.forEach(item -> {
|
||||
item.setValueType("AVG");
|
||||
});
|
||||
List<DataFlickerDTO> result4 ;
|
||||
influxQueryWrapper.initSql();
|
||||
influxQueryWrapper.eq(DataFlicker::getLineId, lineIndex)
|
||||
.percentile(DataFlicker::getFluc, 95)
|
||||
.percentile(DataFlicker::getPlt, 95)
|
||||
.percentile(DataFlicker::getPst, 95)
|
||||
.groupBy(DataFlicker::getLineId,DataFlicker::getPhaseType,DataFlicker::getQualityFlag)
|
||||
.between(DataFlicker::getTime, startTime, endTime);
|
||||
//CP95值
|
||||
result4 = dataFlickerMapper.getStatisticsByWraper(influxQueryWrapper);
|
||||
result4.forEach(item -> {
|
||||
item.setValueType("CP95");
|
||||
});
|
||||
List<DataFlickerDTO> result = new ArrayList<>();
|
||||
result.addAll(result1);
|
||||
result.addAll(result2);
|
||||
result.addAll(result3);
|
||||
result.addAll(result4);
|
||||
ObjectMapper objectMapper = new ObjectMapper();
|
||||
try {
|
||||
System.out.println(objectMapper.writeValueAsString(result));
|
||||
} catch (JsonProcessingException e) {
|
||||
throw new RuntimeException(e);
|
||||
}
|
||||
return result;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,12 @@
|
||||
package com.njcn.influx.service.impl;
|
||||
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
/**
|
||||
* @author hongawen
|
||||
* @version 1.0.0
|
||||
* @date 2023年05月05日 09:10
|
||||
*/
|
||||
@Service
|
||||
public class DataFlucServiceImpl {
|
||||
}
|
||||
@@ -0,0 +1,13 @@
|
||||
package com.njcn.influx.service.impl;
|
||||
|
||||
import com.njcn.influx.service.DataHarmPhasicIService;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
/**
|
||||
* @author hongawen
|
||||
* @version 1.0.0
|
||||
* @date 2023年05月05日 09:46
|
||||
*/
|
||||
@Service
|
||||
public class DataHarmPhasicIServiceImpl implements DataHarmPhasicIService {
|
||||
}
|
||||
@@ -0,0 +1,13 @@
|
||||
package com.njcn.influx.service.impl;
|
||||
|
||||
import com.njcn.influx.service.DataHarmPhasicVService;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
/**
|
||||
* @author hongawen
|
||||
* @version 1.0.0
|
||||
* @date 2023年05月05日 09:50
|
||||
*/
|
||||
@Service
|
||||
public class DataHarmPhasicVServiceImpl implements DataHarmPhasicVService {
|
||||
}
|
||||
@@ -0,0 +1,32 @@
|
||||
package com.njcn.influx.service.impl;
|
||||
|
||||
import com.njcn.influx.imapper.DataHarmPowerPMapper;
|
||||
import com.njcn.influx.pojo.po.DataHarmPowerP;
|
||||
import com.njcn.influx.query.InfluxQueryWrapper;
|
||||
import com.njcn.influx.service.DataHarmPowerPService;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @author hongawen
|
||||
* @version 1.0.0
|
||||
* @date 2023年05月05日 09:51
|
||||
*/
|
||||
@Service
|
||||
public class DataHarmPowerPServiceImpl implements DataHarmPowerPService {
|
||||
@Resource
|
||||
private DataHarmPowerPMapper dataHarmPowerPMapper;
|
||||
@Override
|
||||
public List<DataHarmPowerP> getHarmonicPowerP(String lineIndex, String startTime, String endTime) {
|
||||
List<DataHarmPowerP> result1 ;
|
||||
InfluxQueryWrapper influxQueryWrapper = new InfluxQueryWrapper(DataHarmPowerP.class);
|
||||
influxQueryWrapper.eq(DataHarmPowerP::getLineId, lineIndex)
|
||||
.eq(DataHarmPowerP::getValueType, "AVG")
|
||||
.eq(DataHarmPowerP::getPhaseType, "T")
|
||||
.between(DataHarmPowerP::getTime, startTime, endTime);
|
||||
result1 = dataHarmPowerPMapper.getStatisticsByWraper(influxQueryWrapper);
|
||||
return result1;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,35 @@
|
||||
package com.njcn.influx.service.impl;
|
||||
|
||||
import com.njcn.influx.imapper.DataHarmPowerQMapper;
|
||||
import com.njcn.influx.pojo.po.DataHarmPowerP;
|
||||
import com.njcn.influx.pojo.po.DataHarmPowerQ;
|
||||
import com.njcn.influx.query.InfluxQueryWrapper;
|
||||
import com.njcn.influx.service.DataHarmPowerQService;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* Description:
|
||||
* Date: 2024/2/27 14:50【需求编号】
|
||||
*
|
||||
* @author clam
|
||||
* @version V1.0.0
|
||||
*/
|
||||
@Service
|
||||
public class DataHarmPowerQServiceImpl implements DataHarmPowerQService {
|
||||
@Resource
|
||||
private DataHarmPowerQMapper dataHarmPowerQMapper;
|
||||
@Override
|
||||
public List<DataHarmPowerQ> getHarmonicPowerQ(String lineIndex, String startTime, String endTime) {
|
||||
List<DataHarmPowerQ> result1 ;
|
||||
InfluxQueryWrapper influxQueryWrapper = new InfluxQueryWrapper(DataHarmPowerP.class);
|
||||
influxQueryWrapper.eq(DataHarmPowerQ::getLineId, lineIndex)
|
||||
.eq(DataHarmPowerQ::getValueType, "AVG")
|
||||
.eq(DataHarmPowerQ::getPhaseType, "T")
|
||||
.between(DataHarmPowerQ::getTime, startTime, endTime);
|
||||
result1 = dataHarmPowerQMapper.getStatisticsByWraper(influxQueryWrapper);
|
||||
return result1;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,26 @@
|
||||
package com.njcn.influx.service.impl;
|
||||
|
||||
import com.njcn.influx.imapper.DataHarmRateVMapper;
|
||||
import com.njcn.influx.pojo.po.DataHarmRateV;
|
||||
import com.njcn.influx.query.InfluxQueryWrapper;
|
||||
import com.njcn.influx.service.DataHarmRateVService;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
/**
|
||||
* @author hongawen
|
||||
* @version 1.0.0
|
||||
* @date 2023年07月17日 11:02
|
||||
*/
|
||||
@Service
|
||||
@RequiredArgsConstructor
|
||||
public class DataHarmRateVServiceImpl implements DataHarmRateVService {
|
||||
|
||||
private final DataHarmRateVMapper dataHarmRateVMapper;
|
||||
|
||||
|
||||
@Override
|
||||
public DataHarmRateV getMeanAllTimesData(InfluxQueryWrapper influxQueryWrapper) {
|
||||
return dataHarmRateVMapper.getMeanAllTimesData(influxQueryWrapper);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,80 @@
|
||||
package com.njcn.influx.service.impl;
|
||||
|
||||
import com.njcn.influx.imapper.DataVMapper;
|
||||
import com.njcn.influx.pojo.po.DataV;
|
||||
import com.njcn.influx.query.InfluxQueryWrapper;
|
||||
import com.njcn.influx.service.IDataVService;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 类的介绍:
|
||||
*
|
||||
* @author xuyang
|
||||
* @version 1.0.0
|
||||
* @createTime 2023/5/5 14:38
|
||||
*/
|
||||
@Service
|
||||
public class DataVServiceImpl implements IDataVService {
|
||||
|
||||
@Resource
|
||||
private DataVMapper dataVMapper;
|
||||
|
||||
@Override
|
||||
public List<DataV> getDataV(String lineIndex, String startTime, String endTime) {
|
||||
//最小值
|
||||
List<DataV> result1 ;
|
||||
InfluxQueryWrapper influxQueryWrapper = new InfluxQueryWrapper(DataV.class);
|
||||
influxQueryWrapper.minSamePrefixAndSuffix("v_","", this.harmonicTimesList(1,50,1));
|
||||
influxQueryWrapper.eq(DataV::getLineId, lineIndex)
|
||||
.eq(DataV::getValueType, "MIN")
|
||||
.min(DataV::getFreq)
|
||||
.min(DataV::getFreqDev)
|
||||
.min(DataV::getRms)
|
||||
.min(DataV::getRmsLvr)
|
||||
.min(DataV::getVNeg)
|
||||
.min(DataV::getVPos)
|
||||
.min(DataV::getVThd)
|
||||
.min(DataV::getVUnbalance)
|
||||
.min(DataV::getVZero)
|
||||
.min(DataV::getVlDev)
|
||||
.min(DataV::getVuDev)
|
||||
.groupBy(DataV::getLineId,DataV::getPhasicType,DataV::getQualityFlag,DataV::getValueType)
|
||||
.between(DataV::getTime, startTime, endTime);
|
||||
result1 = dataVMapper.getStatisticsByWraper(influxQueryWrapper);
|
||||
System.out.println("result1==:" + result1);
|
||||
return result1;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<DataV> getHarmonicDataV(String lineIndex, String startTime, String endTime) {
|
||||
List<DataV> result1 ;
|
||||
InfluxQueryWrapper influxQueryWrapper = new InfluxQueryWrapper(DataV.class);
|
||||
influxQueryWrapper.eq(DataV::getLineId, lineIndex)
|
||||
.eq(DataV::getValueType, "CP95")
|
||||
.ne(DataV::getPhasicType, "T")
|
||||
.between(DataV::getTime, startTime, endTime);;
|
||||
result1 = dataVMapper.getStatisticsByWraper(influxQueryWrapper);
|
||||
return result1;
|
||||
}
|
||||
|
||||
|
||||
/***
|
||||
* 自定义需要查询的谐波次数
|
||||
* @author xuyang
|
||||
* @param start 起始次数@Min(value = 1) @Max(value = 100)
|
||||
* @param end 结束次数 @Min(value = 1) @Max(value = 100)
|
||||
* @param interval 间隔
|
||||
* @return List<Object>
|
||||
*/
|
||||
public List<Object> harmonicTimesList(Integer start, Integer end, Integer interval) {
|
||||
List<Object> timesList = new ArrayList<>();
|
||||
for (int i = start; i <= end;i = i+interval) {
|
||||
timesList.add(i);
|
||||
}
|
||||
return timesList;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,53 @@
|
||||
package com.njcn.influx.service.impl;
|
||||
|
||||
import com.njcn.influx.imapper.CommonMapper;
|
||||
import com.njcn.influx.imapper.EvtDataMapper;
|
||||
import com.njcn.influx.pojo.constant.InfluxDBTableConstant;
|
||||
import com.njcn.influx.pojo.dto.EventDataSetDTO;
|
||||
import com.njcn.influx.pojo.dto.EventQueryDTO;
|
||||
import com.njcn.influx.pojo.dto.StatisticalDataDTO;
|
||||
import com.njcn.influx.pojo.po.cs.EntData;
|
||||
import com.njcn.influx.query.InfluxQueryWrapper;
|
||||
import com.njcn.influx.service.EvtDataService;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.util.CollectionUtils;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* Description:
|
||||
* Date: 2023/8/30 19:08【需求编号】
|
||||
*
|
||||
* @author clam
|
||||
* @version V1.0.0
|
||||
*/
|
||||
@Service
|
||||
@RequiredArgsConstructor
|
||||
public class EvtDataServiceImpl implements EvtDataService {
|
||||
private final EvtDataMapper commonMapper;
|
||||
@Override
|
||||
@Deprecated
|
||||
public List<EntData> getEventData(EventQueryDTO eventQueryDTO) {
|
||||
InfluxQueryWrapper influxQueryWrapper = new InfluxQueryWrapper("evt_data", EntData.class);
|
||||
influxQueryWrapper.select(EntData::getLineId,EntData::getTarget,EntData::getTime,EntData::getTime,
|
||||
EntData::getEvtVva,EntData::getSec,EntData::getEvtVvaphase,EntData::getEvtVvadepth,
|
||||
EntData::getEvtVvatm)
|
||||
.or(InfluxDBTableConstant.LINE_ID,eventQueryDTO.getLineIds())
|
||||
.or("target",eventQueryDTO.getTarget());
|
||||
|
||||
|
||||
return commonMapper.getEventData(influxQueryWrapper);
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public EventDataSetDTO getEventDataSet(String tableName, String uuid, String columnName) {
|
||||
InfluxQueryWrapper influxQueryWrapper = new InfluxQueryWrapper(tableName, EventDataSetDTO.class);
|
||||
influxQueryWrapper.select(columnName,InfluxDBTableConstant.VALUE)
|
||||
.eq(InfluxDBTableConstant.UUID,uuid);
|
||||
|
||||
|
||||
return commonMapper.getEventDataSet(influxQueryWrapper);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,48 @@
|
||||
package com.njcn.influx.service.impl;
|
||||
|
||||
import com.njcn.influx.imapper.HaronicRatioMapper;
|
||||
import com.njcn.influx.pojo.po.HarmonicRatioData;
|
||||
import com.njcn.influx.query.InfluxQueryWrapper;
|
||||
import com.njcn.influx.service.HaronicRatioService;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* Description:
|
||||
* Date: 2023/5/24 9:22【需求编号】
|
||||
*
|
||||
* @author clam
|
||||
* @version V1.0.0
|
||||
*/
|
||||
@Service
|
||||
@RequiredArgsConstructor
|
||||
public class HaronicRatioServiceImpl implements HaronicRatioService {
|
||||
|
||||
private final HaronicRatioMapper haronicRatioMapper;
|
||||
@Override
|
||||
public List<HarmonicRatioData> getFirstHaronicRatio(List<String> lineIds, String columnName) {
|
||||
List<HarmonicRatioData> result1 ;
|
||||
InfluxQueryWrapper influxQueryWrapper = new InfluxQueryWrapper(HarmonicRatioData.class);
|
||||
influxQueryWrapper.or(HarmonicRatioData::getLineId, lineIds)
|
||||
.last(columnName,columnName).groupBy(HarmonicRatioData::getLineId, HarmonicRatioData::getStatMethod, HarmonicRatioData::getPhase);
|
||||
|
||||
result1 = haronicRatioMapper.getHaronicRatio(influxQueryWrapper);
|
||||
return result1;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<HarmonicRatioData> getHaronicRatio(List<String> lineIds, String columnName, String startTime, String endTime) {
|
||||
List<HarmonicRatioData> result1;
|
||||
|
||||
InfluxQueryWrapper influxQueryWrapper = new InfluxQueryWrapper(HarmonicRatioData.class);
|
||||
influxQueryWrapper.or(HarmonicRatioData::getLineId, lineIds)
|
||||
.percentile(columnName, 95)
|
||||
.between(HarmonicRatioData::getTime, startTime, endTime)
|
||||
.groupBy(HarmonicRatioData::getLineId,HarmonicRatioData::getStatMethod,HarmonicRatioData::getPhase);
|
||||
result1 = haronicRatioMapper.getHaronicRatio(influxQueryWrapper);
|
||||
|
||||
return result1;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,40 @@
|
||||
package com.njcn.influx.service.impl;
|
||||
|
||||
import com.njcn.influx.imapper.IDataIMapper;
|
||||
import com.njcn.influx.pojo.po.DataI;
|
||||
import com.njcn.influx.query.InfluxQueryWrapper;
|
||||
import com.njcn.influx.service.IDataIService;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @author hongawen
|
||||
* @version 1.0.0
|
||||
* @date 2023年07月17日 11:05
|
||||
*/
|
||||
@Service
|
||||
@RequiredArgsConstructor
|
||||
public class IDataIServiceImpl implements IDataIService {
|
||||
|
||||
private final IDataIMapper dataIMapper;
|
||||
|
||||
@Override
|
||||
public DataI getMeanAllTimesData(InfluxQueryWrapper influxQueryWrapper) {
|
||||
return dataIMapper.getMeanAllTimesData(influxQueryWrapper);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<DataI> getWeekDataI(String lineIndex, String startTime, String endTime) {
|
||||
List<DataI> result1 ;
|
||||
InfluxQueryWrapper influxQueryWrapper = new InfluxQueryWrapper(DataI.class);
|
||||
influxQueryWrapper
|
||||
.eq(DataI::getLineId, lineIndex)
|
||||
.eq(DataI::getValueType, "CP95")
|
||||
.ne(DataI::getPhaseType, "T")
|
||||
.between(DataI::getTime, startTime, endTime);;
|
||||
result1 = dataIMapper.getStatisticsByWraper(influxQueryWrapper);
|
||||
return result1;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,49 @@
|
||||
package com.njcn.influx.service.impl;
|
||||
|
||||
import com.njcn.influx.imapper.PowerQualityMapper;
|
||||
import com.njcn.influx.pojo.po.PowerQualityData;
|
||||
import com.njcn.influx.query.InfluxQueryWrapper;
|
||||
import com.njcn.influx.service.PowerQualityService;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* Description:
|
||||
* Date: 2023/5/18 16:12【需求编号】
|
||||
*
|
||||
* @author clam
|
||||
* @version V1.0.0
|
||||
*/
|
||||
@Service
|
||||
@RequiredArgsConstructor
|
||||
public class PowerQualityServiceImpl implements PowerQualityService {
|
||||
|
||||
private final PowerQualityMapper powerQualityMapper;
|
||||
@Override
|
||||
public List<PowerQualityData> getFirstPowerQuality(List<String> lineIds,String columnName) {
|
||||
List<PowerQualityData> result1 ;
|
||||
InfluxQueryWrapper influxQueryWrapper = new InfluxQueryWrapper(PowerQualityData.class);
|
||||
influxQueryWrapper.or(PowerQualityData::getLineId, lineIds)
|
||||
.last(columnName,columnName).groupBy(PowerQualityData::getLineId, PowerQualityData::getStatMethod, PowerQualityData::getPhase);
|
||||
|
||||
result1 = powerQualityMapper.getFirstPowerQuality(influxQueryWrapper);
|
||||
|
||||
return result1;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<PowerQualityData> getPowerQuality(List<String> lineIds,String columnName, String startTime, String endTime) {
|
||||
List<PowerQualityData> result1;
|
||||
|
||||
InfluxQueryWrapper influxQueryWrapper = new InfluxQueryWrapper(PowerQualityData.class);
|
||||
influxQueryWrapper.or(PowerQualityData::getLineId, lineIds)
|
||||
.percentile(columnName, 95)
|
||||
.between(PowerQualityData::getTime, startTime, endTime)
|
||||
.groupBy(PowerQualityData::getLineId,PowerQualityData::getStatMethod,PowerQualityData::getPhase);
|
||||
result1 = powerQualityMapper.getPowerQuality(influxQueryWrapper);
|
||||
|
||||
return result1;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,13 @@
|
||||
package com.njcn.influx.service.impl;
|
||||
|
||||
import com.njcn.influx.service.PqsCommunicateService;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
/**
|
||||
* @author hongawen
|
||||
* @version 1.0.0
|
||||
* @date 2023年08月09日 09:28
|
||||
*/
|
||||
@Service
|
||||
public class PqsCommunicateServiceImpl implements PqsCommunicateService {
|
||||
}
|
||||
Reference in New Issue
Block a user