CommonService新增getNewDeviceRtDataByTime方法
This commit is contained in:
@@ -80,6 +80,37 @@ public class CommonServiceImpl implements CommonService {
|
||||
return resultList;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<StatisticalDataDTO> getNewDeviceRtDataByTime(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())
|
||||
.between(InfluxDBTableConstant.TIME, commonQueryParam.getStartTime(), commonQueryParam.getEndTime());
|
||||
//此方法和getDeviceRtDataByTime方法逻辑一致,只是在以下条件判断中允许部分查询参数为空,也即可以不带入查询
|
||||
if(commonQueryParam.getPhasic() != null) {
|
||||
influxQueryWrapper.eq(InfluxDBTableConstant.PHASIC_TYPE, commonQueryParam.getPhasic());
|
||||
}
|
||||
if(commonQueryParam.getProcess() != null) {
|
||||
influxQueryWrapper.eq(InfluxDBTableConstant.PROCESS, commonQueryParam.getProcess());
|
||||
}
|
||||
if(commonQueryParam.getDataType() != null) {
|
||||
influxQueryWrapper.eq(InfluxDBTableConstant.VALUE_TYPE, commonQueryParam.getDataType());
|
||||
}
|
||||
if(commonQueryParam.getClDid() != null) {
|
||||
influxQueryWrapper.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);
|
||||
|
||||
Reference in New Issue
Block a user