代码提交

This commit is contained in:
2023-06-21 09:20:53 +08:00
parent c5d469f6d1
commit 879d90d579
4 changed files with 44 additions and 0 deletions

View File

@@ -24,4 +24,6 @@ public interface CommonMapper extends InfluxDbBaseMapper<PowerQualityData> {
List<StatisticalDataDTO> getDeviceRtData(InfluxQueryWrapper influxQueryWrapper); List<StatisticalDataDTO> getDeviceRtData(InfluxQueryWrapper influxQueryWrapper);
List<StatisticalDataDTO> getDeviceRtDataByTime(InfluxQueryWrapper influxQueryWrapper); List<StatisticalDataDTO> getDeviceRtDataByTime(InfluxQueryWrapper influxQueryWrapper);
StatisticalDataDTO getLineHistoryData(InfluxQueryWrapper influxQueryWrapper);
} }

View File

@@ -32,11 +32,30 @@ public class StatisticalDataDTO {
@Column(name = "value_type") @Column(name = "value_type")
private String valueType; private String valueType;
/**
* 指标值
*/
private Double value; private Double value;
/**
* 指标名称
*/
private String statisticalName; private String statisticalName;
/**
* 指标
*/
private String target; private String target;
/**
* 指标最大值
*/
private Double maxValue;
/**
* 指标最小值
*/
private Double minValue;
} }

View File

@@ -49,4 +49,17 @@ public interface CommonService {
* @Date: 2023/6/13 * @Date: 2023/6/13
*/ */
List<StatisticalDataDTO> getDeviceRtDataByTime(List<String> lineIds, String tableName, String columnName, String phasic, String dataType,String startTime, String endTime); List<StatisticalDataDTO> getDeviceRtDataByTime(List<String> lineIds, String tableName, String columnName, String phasic, String dataType,String startTime, String endTime);
/**
* 根据条件获取监测点时间范围内的最大最小值
* @param lineId 监测点Id
* @param tableName 表名
* @param columnName 字段名
* @param phasic 相别
* @param dataType 数据类型
* @return
*/
StatisticalDataDTO getLineHistoryData(String lineId, String tableName, String columnName, String startTime, String endTime);
} }

View File

@@ -85,4 +85,14 @@ public class CommonServiceImpl implements CommonService {
.eq("value_type",dataType).groupBy("line_id"); .eq("value_type",dataType).groupBy("line_id");
return commonMapper.getDeviceRtDataByTime(influxQueryWrapper); return commonMapper.getDeviceRtDataByTime(influxQueryWrapper);
} }
@Override
public StatisticalDataDTO getLineHistoryData(String lineId, String tableName, String columnName, String startTime, String endTime) {
InfluxQueryWrapper influxQueryWrapper = new InfluxQueryWrapper(tableName,StatisticalDataDTO.class);
influxQueryWrapper.max(columnName,"maxValue")
.min(columnName,"minValue")
.eq("line_id",lineId)
.between("time", startTime, endTime);
return commonMapper.getLineHistoryData(influxQueryWrapper);
}
} }