influxdb添加方法
This commit is contained in:
@@ -58,4 +58,31 @@ public class CommonServiceImpl implements CommonService {
|
||||
.eq("value_type",dataType);
|
||||
return commonMapper.getLineRtData(influxQueryWrapper);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<StatisticalDataDTO> getDeviceRtData(List<String> lineIds, String tableName, String columnName, String phasic, String dataType) {
|
||||
InfluxQueryWrapper influxQueryWrapper = new InfluxQueryWrapper(tableName,StatisticalDataDTO.class);
|
||||
influxQueryWrapper.select(StatisticalDataDTO::getLineId)
|
||||
.select(StatisticalDataDTO::getPhaseType)
|
||||
.select(StatisticalDataDTO::getValueType)
|
||||
.last(columnName)
|
||||
.or("line_id",lineIds)
|
||||
.eq("phasic_type",phasic)
|
||||
.eq("value_type",dataType).groupBy("line_id");
|
||||
return commonMapper.getDeviceRtData(influxQueryWrapper);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<StatisticalDataDTO> getDeviceRtDataByTime(List<String> lineIds, String tableName, String columnName, String phasic, String dataType, String startTime, String endTime) {
|
||||
InfluxQueryWrapper influxQueryWrapper = new InfluxQueryWrapper(tableName,StatisticalDataDTO.class);
|
||||
influxQueryWrapper.select(StatisticalDataDTO::getLineId)
|
||||
.select(StatisticalDataDTO::getPhaseType)
|
||||
.select(StatisticalDataDTO::getValueType)
|
||||
.select(columnName,"value")
|
||||
.or("line_id",lineIds)
|
||||
.eq("phasic_type",phasic)
|
||||
.between("time", startTime, endTime)
|
||||
.eq("value_type",dataType).groupBy("line_id");
|
||||
return commonMapper.getDeviceRtDataByTime(influxQueryWrapper);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user