新增查询治理各模块数据的方法
This commit is contained in:
@@ -84,11 +84,7 @@ public interface CommonService {
|
||||
*/
|
||||
StatisticalDataDTO getCounts(String lineId, String tableName, String columnName,String resultName, String phasic, String dataType, String clDid, String process,String startTime, String endTime);
|
||||
|
||||
/**
|
||||
* 获取治理各个模块在规定时间内是否存在数据
|
||||
* @return
|
||||
*/
|
||||
StatisticalDataDTO getModuleCounts(String lineId, String tableName, String columnName,String resultName,String startTime, String endTime, String clDid);
|
||||
|
||||
List<StatisticalDataDTO> getEachModule(CommonQueryParam param);
|
||||
|
||||
StatisticalDataDTO getDataCounts(String lineId, String tableName, String columnName,String resultName, String phasic, String dataType, String clDid, String process,String startTime, String endTime);
|
||||
}
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
package com.njcn.influx.service.impl;
|
||||
|
||||
import cn.hutool.core.util.ObjectUtil;
|
||||
import com.njcn.influx.imapper.CommonMapper;
|
||||
import com.njcn.influx.pojo.bo.CommonQueryParam;
|
||||
import com.njcn.influx.pojo.constant.InfluxDBTableConstant;
|
||||
@@ -11,6 +12,7 @@ import org.springframework.stereotype.Service;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.Objects;
|
||||
|
||||
/**
|
||||
* Description:
|
||||
@@ -157,16 +159,6 @@ public class CommonServiceImpl implements CommonService {
|
||||
.eq(InfluxDBTableConstant.VALUE_TYPE,dataType)
|
||||
.eq(InfluxDBTableConstant.CL_DID,clDid)
|
||||
.eq(InfluxDBTableConstant.PROCESS,process)
|
||||
.between(InfluxDBTableConstant.TIME, startTime, endTime);;
|
||||
return commonMapper.getLineRtData(influxQueryWrapper);
|
||||
}
|
||||
|
||||
@Override
|
||||
public StatisticalDataDTO getModuleCounts(String lineId, String tableName, String columnName, String resultName, String startTime, String endTime, String clDid) {
|
||||
InfluxQueryWrapper influxQueryWrapper = new InfluxQueryWrapper(tableName,StatisticalDataDTO.class);
|
||||
influxQueryWrapper.count(columnName,resultName)
|
||||
.eq(InfluxDBTableConstant.LINE_ID,lineId)
|
||||
.eq(InfluxDBTableConstant.CL_DID,clDid)
|
||||
.between(InfluxDBTableConstant.TIME, startTime, endTime);
|
||||
return commonMapper.getLineRtData(influxQueryWrapper);
|
||||
}
|
||||
@@ -184,4 +176,18 @@ public class CommonServiceImpl implements CommonService {
|
||||
.eq(InfluxDBTableConstant.CL_DID,param.getClDid());
|
||||
return commonMapper.getDeviceRtDataByTime(influxQueryWrapper);
|
||||
}
|
||||
|
||||
@Override
|
||||
public StatisticalDataDTO getDataCounts(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.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);
|
||||
System.out.println("sql==:" + influxQueryWrapper.generateSql());
|
||||
return commonMapper.getLineRtData(influxQueryWrapper);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user