新增方法

This commit is contained in:
xy
2024-11-05 08:52:26 +08:00
parent 5e1e409748
commit a7f17cd2ef
2 changed files with 21 additions and 0 deletions

View File

@@ -77,4 +77,12 @@ public interface CommonService {
* @return
*/
List<StatisticalDataDTO> getTopTemperature(String lineId,String tableName, String columnName,String process);
/**
* 获取监测点的指标数量,用来计算完整率
*
*/
StatisticalDataDTO getCounts(String lineId, String tableName, String columnName,String resultName, String phasic, String dataType, String clDid, String process,String startTime, String endTime);
}

View File

@@ -147,6 +147,19 @@ public class CommonServiceImpl implements CommonService {
return commonMapper.getTopTemperature(influxQueryWrapper);
}
@Override
public StatisticalDataDTO getCounts(String lineId, String tableName, String columnName,String resultName, String phasic, String dataType, String clDid,String process,String startTime, String endTime) {
InfluxQueryWrapper influxQueryWrapper = new InfluxQueryWrapper(tableName,StatisticalDataDTO.class);
influxQueryWrapper.select(StatisticalDataDTO::getLineId)
.count(columnName,resultName)
.eq(InfluxDBTableConstant.LINE_ID,lineId)
.eq(InfluxDBTableConstant.PHASIC_TYPE,phasic)
.eq(InfluxDBTableConstant.VALUE_TYPE,dataType)
.eq(InfluxDBTableConstant.CL_DID,clDid)
.eq(InfluxDBTableConstant.PROCESS,process)
.between(InfluxDBTableConstant.TIME, startTime, endTime);;
return commonMapper.getLineRtData(influxQueryWrapper);
}
}