This commit is contained in:
xy
2025-07-09 16:05:26 +08:00
parent c3ac9b12f7
commit e0af988ce4
2 changed files with 19 additions and 4 deletions

View File

@@ -87,4 +87,6 @@ public interface CommonService {
List<StatisticalDataDTO> getEachModule(CommonQueryParam param); 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); StatisticalDataDTO getDataCounts(String lineId, String tableName, String columnName,String resultName, String phasic, String dataType, String clDid, String process,String startTime, String endTime);
List<StatisticalDataDTO> getModuleData(CommonQueryParam param);
} }

View File

@@ -10,9 +10,7 @@ import com.njcn.influx.service.CommonService;
import lombok.RequiredArgsConstructor; import lombok.RequiredArgsConstructor;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import java.util.ArrayList; import java.util.*;
import java.util.List;
import java.util.Objects;
/** /**
* Description: * Description:
@@ -187,7 +185,22 @@ public class CommonServiceImpl implements CommonService {
.eq(InfluxDBTableConstant.CL_DID,clDid) .eq(InfluxDBTableConstant.CL_DID,clDid)
.eq(InfluxDBTableConstant.PROCESS,process) .eq(InfluxDBTableConstant.PROCESS,process)
.between(InfluxDBTableConstant.TIME, startTime, endTime); .between(InfluxDBTableConstant.TIME, startTime, endTime);
System.out.println("sql==:" + influxQueryWrapper.generateSql());
return commonMapper.getLineRtData(influxQueryWrapper); return commonMapper.getLineRtData(influxQueryWrapper);
} }
@Override
public List<StatisticalDataDTO> getModuleData(CommonQueryParam param) {
InfluxQueryWrapper influxQueryWrapper = new InfluxQueryWrapper(param.getTableName(),StatisticalDataDTO.class);
influxQueryWrapper
.select(StatisticalDataDTO::getLineId)
.select(StatisticalDataDTO::getPhaseType)
.select("Apf_RmsI_ModOut","value")
.select("Apf_RmsI_Load","avgValue")
.between(InfluxDBTableConstant.TIME, param.getStartTime(), param.getEndTime())
.eq(InfluxDBTableConstant.LINE_ID,param.getLineId())
.eq(InfluxDBTableConstant.VALUE_TYPE,"avg")
.eq(InfluxDBTableConstant.PROCESS,param.getProcess())
.eq(InfluxDBTableConstant.CL_DID,param.getClDid());
return commonMapper.getDeviceRtDataByTime(influxQueryWrapper);
}
} }