提交代码
This commit is contained in:
@@ -36,4 +36,6 @@ public interface CommonMapper extends InfluxDbBaseMapper<PowerQualityData> {
|
||||
|
||||
@Select(value = "#{sql}",resultType = HarmonicHistoryData.class)
|
||||
List<HarmonicHistoryData> getHistoryResult(@Param("sql")String sql);
|
||||
|
||||
List<StatisticalDataDTO> getTopTemperature(InfluxQueryWrapper influxQueryWrapper);
|
||||
}
|
||||
|
||||
@@ -32,6 +32,10 @@ public class StatisticalDataDTO {
|
||||
@Column(name = "value_type")
|
||||
private String valueType;
|
||||
|
||||
@Column(name = "cl_did")
|
||||
private String clDid;
|
||||
|
||||
|
||||
/**
|
||||
* 指标值
|
||||
*/
|
||||
|
||||
@@ -68,4 +68,14 @@ public interface CommonService {
|
||||
* @return StatisticalDataDTO
|
||||
*/
|
||||
StatisticalDataDTO selectBySql(StringBuilder sql);
|
||||
/*获取各个模块温度数据*/
|
||||
|
||||
/**
|
||||
*
|
||||
* @param lineId
|
||||
* @param tableName apf_data
|
||||
* @param columnName Apf_Temp_Env
|
||||
* @return
|
||||
*/
|
||||
List<StatisticalDataDTO> getTopTemperature(String lineId,String tableName, String columnName);
|
||||
}
|
||||
|
||||
@@ -108,6 +108,16 @@ public class CommonServiceImpl implements CommonService {
|
||||
return commonMapper.selectBySql(sql);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<StatisticalDataDTO> getTopTemperature(String lineId, String tableName, String columnName) {
|
||||
InfluxQueryWrapper influxQueryWrapper = new InfluxQueryWrapper(tableName,StatisticalDataDTO.class);
|
||||
influxQueryWrapper.select(StatisticalDataDTO::getLineId)
|
||||
.select(StatisticalDataDTO::getClDid)
|
||||
.last(columnName,InfluxDBTableConstant.VALUE)
|
||||
.eq(InfluxDBTableConstant.LINE_ID,lineId).groupBy(InfluxDBTableConstant.CL_DID);
|
||||
return commonMapper.getTopTemperature(influxQueryWrapper);
|
||||
}
|
||||
|
||||
/*表名换成了id本方法做转换*/
|
||||
private String getTableNameByClassId(String classId){
|
||||
DictData data = dicDataFeignClient.getDicDataById(classId).getData();
|
||||
|
||||
Reference in New Issue
Block a user