海南初始版本提交
This commit is contained in:
@@ -1,8 +1,10 @@
|
||||
package com.njcn.influx.imapper;
|
||||
|
||||
import com.njcn.influx.ano.Param;
|
||||
import com.njcn.influx.ano.Select;
|
||||
import com.njcn.influx.base.InfluxDbBaseMapper;
|
||||
import com.njcn.influx.pojo.bo.CarryCapcityData;
|
||||
import com.njcn.influx.pojo.po.DataHarmPowerP;
|
||||
import com.njcn.influx.pojo.po.DataV;
|
||||
import com.njcn.influx.query.InfluxQueryWrapper;
|
||||
|
||||
import java.util.List;
|
||||
@@ -15,4 +17,7 @@ import java.util.List;
|
||||
public interface DataHarmPowerPMapper extends InfluxDbBaseMapper<DataHarmPowerP> {
|
||||
|
||||
List<DataHarmPowerP> getStatisticsByWraper(InfluxQueryWrapper influxQueryWrapper);
|
||||
|
||||
@Select(value = "#{sql}",resultType = CarryCapcityData.class)
|
||||
List<CarryCapcityData> getSqlResult(@Param("sql")String sql);
|
||||
}
|
||||
|
||||
@@ -1,6 +1,9 @@
|
||||
package com.njcn.influx.imapper;
|
||||
|
||||
import com.njcn.influx.ano.Param;
|
||||
import com.njcn.influx.ano.Select;
|
||||
import com.njcn.influx.base.InfluxDbBaseMapper;
|
||||
import com.njcn.influx.pojo.bo.CarryCapcityData;
|
||||
import com.njcn.influx.pojo.po.DataHarmPowerQ;
|
||||
import com.njcn.influx.query.InfluxQueryWrapper;
|
||||
|
||||
@@ -14,5 +17,6 @@ import java.util.List;
|
||||
public interface DataHarmPowerQMapper extends InfluxDbBaseMapper<DataHarmPowerQ> {
|
||||
|
||||
List<DataHarmPowerQ> getStatisticsByWraper(InfluxQueryWrapper influxQueryWrapper);
|
||||
|
||||
@Select(value = "#{sql}",resultType = CarryCapcityData.class)
|
||||
List<CarryCapcityData> getSqlResult(@Param("sql")String sql);
|
||||
}
|
||||
|
||||
@@ -1,6 +1,9 @@
|
||||
package com.njcn.influx.imapper;
|
||||
|
||||
import com.njcn.influx.ano.Param;
|
||||
import com.njcn.influx.ano.Select;
|
||||
import com.njcn.influx.base.InfluxDbBaseMapper;
|
||||
import com.njcn.influx.pojo.bo.CarryCapcityData;
|
||||
import com.njcn.influx.pojo.bo.MeasurementCount;
|
||||
import com.njcn.influx.pojo.po.DataV;
|
||||
import com.njcn.influx.query.InfluxQueryWrapper;
|
||||
@@ -19,5 +22,6 @@ public interface DataVMapper extends InfluxDbBaseMapper<DataV> {
|
||||
|
||||
List<DataV> getStatisticsByWraper(InfluxQueryWrapper influxQueryWrapper);
|
||||
List<MeasurementCount> getMeasurementCount(InfluxQueryWrapper influxQueryWrapper);
|
||||
|
||||
@Select(value = "#{sql}",resultType = CarryCapcityData.class)
|
||||
List<CarryCapcityData> getSqlResult(@Param("sql")String sql);
|
||||
}
|
||||
|
||||
@@ -1,5 +1,7 @@
|
||||
package com.njcn.influx.imapper;
|
||||
|
||||
import com.njcn.influx.ano.Param;
|
||||
import com.njcn.influx.ano.Select;
|
||||
import com.njcn.influx.base.InfluxDbBaseMapper;
|
||||
import com.njcn.influx.pojo.dto.HarmData;
|
||||
import com.njcn.influx.pojo.po.DataI;
|
||||
@@ -19,4 +21,7 @@ public interface IDataIMapper extends InfluxDbBaseMapper<DataI> {
|
||||
List<HarmData> getIHistoryData(InfluxQueryWrapper influxQueryWrapper);
|
||||
|
||||
List<DataI> getStatisticsByWraper(InfluxQueryWrapper influxQueryWrapper);
|
||||
|
||||
@Select(value = "#{sql}",resultType = DataI.class)
|
||||
List<DataI> getSqlResult(@Param("sql")String sql);
|
||||
}
|
||||
|
||||
@@ -0,0 +1,38 @@
|
||||
package com.njcn.influx.pojo.bo;
|
||||
|
||||
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
|
||||
import com.njcn.influx.utils.InstantDateSerializer;
|
||||
import lombok.Data;
|
||||
import org.influxdb.annotation.Column;
|
||||
|
||||
import java.time.Instant;
|
||||
|
||||
/**
|
||||
* 类的介绍:
|
||||
*
|
||||
* @author xuyang
|
||||
* @version 1.0.0
|
||||
* @createTime 2022/5/12 9:13
|
||||
*/
|
||||
@Data
|
||||
public class CarryCapcityData {
|
||||
|
||||
@Column(name = "time")
|
||||
@JsonSerialize(using = InstantDateSerializer.class)
|
||||
private Instant time;
|
||||
|
||||
@Column(name = "line_id")
|
||||
private String lineId;
|
||||
|
||||
@Column(name = "phasic_type")
|
||||
private String phaseType;
|
||||
|
||||
@Column(name = "quality_flag")
|
||||
private String qualityFlag;
|
||||
|
||||
@Column(name = "value_type")
|
||||
private String valueType;
|
||||
|
||||
private Double value;
|
||||
|
||||
}
|
||||
@@ -28,16 +28,16 @@ public class DataFluc {
|
||||
@Column(name = "fluccf")
|
||||
private Double fluccf;
|
||||
|
||||
@Column(name = "line_id")
|
||||
@Column(name = "line_id",tag = true)
|
||||
private String lineId;
|
||||
|
||||
@Column(name = "phasic_type")
|
||||
@Column(name = "phasic_type",tag = true)
|
||||
private String phaseType;
|
||||
|
||||
@Column(name = "quality_flag")
|
||||
@Column(name = "quality_flag",tag = true)
|
||||
private String qualityFlag;
|
||||
|
||||
@Column(name = "value_type")
|
||||
@Column(name = "value_type",tag = true)
|
||||
private String valueType;
|
||||
|
||||
}
|
||||
|
||||
@@ -22,16 +22,16 @@ public class DataHarmPhasicI {
|
||||
@JsonSerialize(using = InstantDateSerializer.class)
|
||||
private Instant time;
|
||||
|
||||
@Column(name = "line_id")
|
||||
@Column(name = "line_id",tag = true)
|
||||
private String lineId;
|
||||
|
||||
@Column(name = "phasic_type")
|
||||
@Column(name = "phasic_type",tag = true)
|
||||
private String phaseType;
|
||||
|
||||
@Column(name = "quality_flag")
|
||||
@Column(name = "quality_flag",tag = true)
|
||||
private String qualityFlag;
|
||||
|
||||
@Column(name = "value_type")
|
||||
@Column(name = "value_type",tag = true)
|
||||
private String valueType;
|
||||
|
||||
@Column(name = "i_1")
|
||||
|
||||
@@ -23,16 +23,16 @@ public class DataHarmPowerP {
|
||||
@JsonSerialize(using = InstantDateSerializer.class)
|
||||
private Instant time;
|
||||
|
||||
@Column(name = "line_id")
|
||||
@Column(name = "line_id",tag = true)
|
||||
private String lineId;
|
||||
|
||||
@Column(name = "phasic_type")
|
||||
@Column(name = "phasic_type",tag = true)
|
||||
private String phaseType;
|
||||
|
||||
@Column(name = "quality_flag")
|
||||
@Column(name = "quality_flag",tag = true)
|
||||
private String qualityFlag;
|
||||
|
||||
@Column(name = "value_type")
|
||||
@Column(name = "value_type",tag = true)
|
||||
private String valueType;
|
||||
|
||||
@Column(name = "df")
|
||||
|
||||
@@ -23,18 +23,19 @@ public class DataHarmPowerQ {
|
||||
@JsonSerialize(using = InstantDateSerializer.class)
|
||||
private Instant time;
|
||||
|
||||
@Column(name = "line_id")
|
||||
@Column(name = "line_id", tag = true)
|
||||
private String lineId;
|
||||
|
||||
@Column(name = "phasic_type")
|
||||
@Column(name = "phasic_type", tag = true)
|
||||
private String phaseType;
|
||||
|
||||
@Column(name = "quality_flag")
|
||||
@Column(name = "quality_flag", tag = true)
|
||||
private String qualityFlag;
|
||||
|
||||
@Column(name = "value_type")
|
||||
@Column(name = "value_type", tag = true)
|
||||
private String valueType;
|
||||
|
||||
|
||||
@Column(name = "q")
|
||||
private Double q;
|
||||
|
||||
|
||||
@@ -23,16 +23,16 @@ public class DataHarmPowerS {
|
||||
@JsonSerialize(using = InstantDateSerializer.class)
|
||||
private Instant time;
|
||||
|
||||
@Column(name = "line_id")
|
||||
@Column(name = "line_id",tag = true)
|
||||
private String lineId;
|
||||
|
||||
@Column(name = "phasic_type")
|
||||
@Column(name = "phasic_type",tag = true)
|
||||
private String phaseType;
|
||||
|
||||
@Column(name = "quality_flag")
|
||||
@Column(name = "quality_flag",tag = true)
|
||||
private String qualityFlag;
|
||||
|
||||
@Column(name = "value_type")
|
||||
@Column(name = "value_type",tag = true)
|
||||
private String valueType;
|
||||
|
||||
@Column(name = "s")
|
||||
|
||||
@@ -20,16 +20,16 @@ public class DataInHarmRateI {
|
||||
@Column(name = "time")
|
||||
private Instant time;
|
||||
|
||||
@Column(name = "line_id")
|
||||
@Column(name = "line_id",tag = true)
|
||||
private String lineId;
|
||||
|
||||
@Column(name = "phasic_type")
|
||||
@Column(name = "phasic_type",tag = true)
|
||||
private String phaseType;
|
||||
|
||||
@Column(name = "quality_flag")
|
||||
@Column(name = "quality_flag",tag = true)
|
||||
private String qualityFlag;
|
||||
|
||||
@Column(name = "value_type")
|
||||
@Column(name = "value_type",tag = true)
|
||||
private String valueType;
|
||||
|
||||
@Column(name = "i_1")
|
||||
|
||||
@@ -0,0 +1,15 @@
|
||||
package com.njcn.influx.service;
|
||||
|
||||
|
||||
import com.njcn.influx.pojo.po.DataHarmPowerQ;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @author hongawen
|
||||
* @version 1.0.0
|
||||
* @date 2023年05月05日 09:51
|
||||
*/
|
||||
public interface DataHarmPowerQService {
|
||||
List<DataHarmPowerQ> getHarmonicPowerQ(String lineIndex, String startTime, String endTime);
|
||||
}
|
||||
@@ -3,6 +3,8 @@ package com.njcn.influx.service;
|
||||
import com.njcn.influx.pojo.po.DataI;
|
||||
import com.njcn.influx.query.InfluxQueryWrapper;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @author hongawen
|
||||
* @version 1.0.0
|
||||
@@ -11,4 +13,12 @@ import com.njcn.influx.query.InfluxQueryWrapper;
|
||||
public interface IDataIService {
|
||||
|
||||
DataI getMeanAllTimesData(InfluxQueryWrapper influxQueryWrapper);
|
||||
/**
|
||||
* @Description: getWeekDataI 承载能力评估获取一周数据
|
||||
* @Param:
|
||||
* @return: java.util.List<com.njcn.influx.pojo.po.DataI>
|
||||
* @Author: clam
|
||||
* @Date: 2024/2/27
|
||||
*/
|
||||
List<DataI> getWeekDataI(String lineIndex, String startTime, String endTime);
|
||||
}
|
||||
|
||||
@@ -8,4 +8,5 @@ public interface IDataVService {
|
||||
|
||||
List<DataV> getDataV(String lineIndex, String startTime, String endTime);
|
||||
List<DataV> getHarmonicDataV(String lineIndex, String startTime, String endTime);
|
||||
|
||||
}
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
}
|
||||
@@ -61,6 +61,7 @@ public class DataVServiceImpl implements IDataVService {
|
||||
return result1;
|
||||
}
|
||||
|
||||
|
||||
/***
|
||||
* 自定义需要查询的谐波次数
|
||||
* @author xuyang
|
||||
|
||||
@@ -7,6 +7,8 @@ import com.njcn.influx.service.IDataIService;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @author hongawen
|
||||
* @version 1.0.0
|
||||
@@ -22,4 +24,17 @@ public class IDataIServiceImpl implements IDataIService {
|
||||
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;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user