新增一些公共查询方法

This commit is contained in:
guofeihu
2024-09-13 18:42:57 +08:00
parent ad5833f48a
commit 60afcb97cf
12 changed files with 138 additions and 3 deletions

View File

@@ -1,9 +1,13 @@
package com.njcn.influx.service; package com.njcn.influx.service;
import com.njcn.influx.pojo.po.DataFluc;
import java.util.List;
/** /**
* @author hongawen * @author hongawen
* @version 1.0.0 * @version 1.0.0
* @date 2023年05月05日 09:10 * @date 2023年05月05日 09:10
*/ */
public interface DataFlucService { public interface DataFlucService {
List<DataFluc> getNewDataFluc(String lineIndex, String startTime, String endTime);
} }

View File

@@ -2,6 +2,7 @@ package com.njcn.influx.service;
import com.njcn.influx.pojo.po.DataHarmRateV; import com.njcn.influx.pojo.po.DataHarmRateV;
import com.njcn.influx.query.InfluxQueryWrapper; import com.njcn.influx.query.InfluxQueryWrapper;
import java.util.List;
/** /**
* @author hongawen * @author hongawen
@@ -10,4 +11,5 @@ import com.njcn.influx.query.InfluxQueryWrapper;
*/ */
public interface DataHarmRateVService { public interface DataHarmRateVService {
DataHarmRateV getMeanAllTimesData(InfluxQueryWrapper influxQueryWrapper); DataHarmRateV getMeanAllTimesData(InfluxQueryWrapper influxQueryWrapper);
List<DataHarmRateV> getNewDataHarmRateV(String lineIndex, String startTime, String endTime);
} }

View File

@@ -0,0 +1,13 @@
package com.njcn.influx.service;
import com.njcn.influx.pojo.po.DataInHarmRateV;
import java.util.List;
/**
* @author guofeihu
* @version 1.0.0
* @date 2024年09月13日 11:01
*/
public interface DataInHarmRateVService {
List<DataInHarmRateV> getNewDataInHarmRateV(String lineIndex, String startTime, String endTime);
}

View File

@@ -0,0 +1,13 @@
package com.njcn.influx.service;
import com.njcn.influx.pojo.po.DataPlt;
import java.util.List;
/**
* @author guofeihu
* @version 1.0.0
* @date 2024年09月13日 11:01
*/
public interface DataPltService {
List<DataPlt> getNewDataPlt(String lineIndex, String startTime, String endTime);
}

View File

@@ -21,4 +21,5 @@ public interface IDataIService {
* @Date: 2024/2/27 * @Date: 2024/2/27
*/ */
List<DataI> getWeekDataI(String lineIndex, String startTime, String endTime); List<DataI> getWeekDataI(String lineIndex, String startTime, String endTime);
List<DataI> getNewDataI(String lineIndex, String startTime, String endTime);
} }

View File

@@ -1,12 +1,11 @@
package com.njcn.influx.service; package com.njcn.influx.service;
import com.njcn.influx.pojo.po.DataV; import com.njcn.influx.pojo.po.DataV;
import java.util.List; import java.util.List;
public interface IDataVService { public interface IDataVService {
List<DataV> getDataV(String lineIndex, String startTime, String endTime); List<DataV> getDataV(String lineIndex, String startTime, String endTime);
List<DataV> getHarmonicDataV(String lineIndex, String startTime, String endTime); List<DataV> getHarmonicDataV(String lineIndex, String startTime, String endTime);
List<DataV> getNewDataV(String lineIndex, String startTime, String endTime);
} }

View File

@@ -1,6 +1,12 @@
package com.njcn.influx.service.impl; package com.njcn.influx.service.impl;
import com.njcn.influx.imapper.DataFlucMapper;
import com.njcn.influx.pojo.po.DataFluc;
import com.njcn.influx.query.InfluxQueryWrapper;
import com.njcn.influx.service.DataFlucService;
import lombok.RequiredArgsConstructor;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import java.util.List;
/** /**
* @author hongawen * @author hongawen
@@ -8,5 +14,17 @@ import org.springframework.stereotype.Service;
* @date 2023年05月05日 09:10 * @date 2023年05月05日 09:10
*/ */
@Service @Service
public class DataFlucServiceImpl { @RequiredArgsConstructor
public class DataFlucServiceImpl implements DataFlucService {
private final DataFlucMapper dataFlucMapper;
@Override
public List<DataFluc> getNewDataFluc(String lineIndex, String startTime, String endTime) {
InfluxQueryWrapper influxQueryWrapper = new InfluxQueryWrapper(DataFluc.class);
influxQueryWrapper.eq(DataFluc::getLineId, lineIndex)
.between(DataFluc::getTime, startTime, endTime);
return dataFlucMapper.getStatisticsByWraper(influxQueryWrapper);
}
} }

View File

@@ -2,11 +2,14 @@ package com.njcn.influx.service.impl;
import com.njcn.influx.imapper.DataHarmRateVMapper; import com.njcn.influx.imapper.DataHarmRateVMapper;
import com.njcn.influx.pojo.po.DataHarmRateV; import com.njcn.influx.pojo.po.DataHarmRateV;
import com.njcn.influx.pojo.po.DataV;
import com.njcn.influx.query.InfluxQueryWrapper; import com.njcn.influx.query.InfluxQueryWrapper;
import com.njcn.influx.service.DataHarmRateVService; import com.njcn.influx.service.DataHarmRateVService;
import lombok.RequiredArgsConstructor; import lombok.RequiredArgsConstructor;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import java.util.List;
/** /**
* @author hongawen * @author hongawen
* @version 1.0.0 * @version 1.0.0
@@ -23,4 +26,12 @@ public class DataHarmRateVServiceImpl implements DataHarmRateVService {
public DataHarmRateV getMeanAllTimesData(InfluxQueryWrapper influxQueryWrapper) { public DataHarmRateV getMeanAllTimesData(InfluxQueryWrapper influxQueryWrapper) {
return dataHarmRateVMapper.getMeanAllTimesData(influxQueryWrapper); return dataHarmRateVMapper.getMeanAllTimesData(influxQueryWrapper);
} }
@Override
public List<DataHarmRateV> getNewDataHarmRateV(String lineIndex, String startTime, String endTime) {
InfluxQueryWrapper influxQueryWrapper = new InfluxQueryWrapper(DataHarmRateV.class);
influxQueryWrapper.eq(DataHarmRateV::getLineId, lineIndex)
.between(DataHarmRateV::getTime, startTime, endTime);;
return dataHarmRateVMapper.getStatisticsByWraper(influxQueryWrapper);
}
} }

View File

@@ -0,0 +1,29 @@
package com.njcn.influx.service.impl;
import com.njcn.influx.imapper.DataInHarmRateVMapper;
import com.njcn.influx.pojo.po.DataInHarmRateV;
import com.njcn.influx.query.InfluxQueryWrapper;
import com.njcn.influx.service.DataInHarmRateVService;
import lombok.RequiredArgsConstructor;
import org.springframework.stereotype.Service;
import java.util.List;
/**
* @author guofeihu
* @version 1.0.0
* @date 2024年09月13日 11:01
*/
@Service
@RequiredArgsConstructor
public class DataInHarmRateVServiceImpl implements DataInHarmRateVService {
private final DataInHarmRateVMapper dataInHarmRateVMapper;
@Override
public List<DataInHarmRateV> getNewDataInHarmRateV(String lineIndex, String startTime, String endTime) {
InfluxQueryWrapper influxQueryWrapper = new InfluxQueryWrapper(DataInHarmRateV.class);
influxQueryWrapper.eq(DataInHarmRateV::getLineId, lineIndex)
.between(DataInHarmRateV::getTime, startTime, endTime);;
return dataInHarmRateVMapper.getStatisticsByWraper(influxQueryWrapper);
}
}

View File

@@ -0,0 +1,29 @@
package com.njcn.influx.service.impl;
import com.njcn.influx.imapper.DataPltMapper;
import com.njcn.influx.pojo.po.*;
import com.njcn.influx.query.InfluxQueryWrapper;
import com.njcn.influx.service.DataPltService;
import lombok.RequiredArgsConstructor;
import org.springframework.stereotype.Service;
import java.util.List;
/**
* @author guofeihu
* @version 1.0.0
* @date 2024年09月13日 11:01
*/
@Service
@RequiredArgsConstructor
public class DataPltServiceImpl implements DataPltService {
private final DataPltMapper dataPltMapper;
@Override
public List<DataPlt> getNewDataPlt(String lineIndex, String startTime, String endTime) {
InfluxQueryWrapper influxQueryWrapper = new InfluxQueryWrapper(DataPlt.class);
influxQueryWrapper.eq(DataPlt::getLineId, lineIndex)
.between(DataPlt::getTime, startTime, endTime);;
return dataPltMapper.getStatisticsByWraper(influxQueryWrapper);
}
}

View File

@@ -61,6 +61,14 @@ public class DataVServiceImpl implements IDataVService {
return result1; return result1;
} }
@Override
public List<DataV> getNewDataV(String lineIndex, String startTime, String endTime) {
InfluxQueryWrapper influxQueryWrapper = new InfluxQueryWrapper(DataV.class);
influxQueryWrapper.eq(DataV::getLineId, lineIndex)
.between(DataV::getTime, startTime, endTime);;
return dataVMapper.getStatisticsByWraper(influxQueryWrapper);
}
/*** /***
* 自定义需要查询的谐波次数 * 自定义需要查询的谐波次数

View File

@@ -37,4 +37,12 @@ public class IDataIServiceImpl implements IDataIService {
result1 = dataIMapper.getStatisticsByWraper(influxQueryWrapper); result1 = dataIMapper.getStatisticsByWraper(influxQueryWrapper);
return result1; return result1;
} }
@Override
public List<DataI> getNewDataI(String lineIndex, String startTime, String endTime) {
InfluxQueryWrapper influxQueryWrapper = new InfluxQueryWrapper(DataI.class);
influxQueryWrapper.eq(DataI::getLineId, lineIndex)
.between(DataI::getTime, startTime, endTime);;
return dataIMapper.getStatisticsByWraper(influxQueryWrapper);
}
} }