代码提交
This commit is contained in:
@@ -13,4 +13,15 @@ import java.util.List;
|
||||
*/
|
||||
public interface CommonService {
|
||||
List<StatisticalDataDTO> commonquery(String lineId, String tableName, String columnName);
|
||||
|
||||
/**
|
||||
* 根据条件获取监测点数据
|
||||
* @param lineId 监测点Id
|
||||
* @param tableName 表名
|
||||
* @param columnName 字段名
|
||||
* @param phasic 相别
|
||||
* @param dataType 数据类型
|
||||
* @return
|
||||
*/
|
||||
StatisticalDataDTO getLineRtData(String lineId, String tableName, String columnName, String phasic, String dataType);
|
||||
}
|
||||
|
||||
@@ -38,4 +38,16 @@ public class CommonServiceImpl implements CommonService {
|
||||
return statistical;
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public StatisticalDataDTO getLineRtData(String lineId, String tableName, String columnName, String phasic, String dataType) {
|
||||
HashMap<String, Class<?>> entityClassesByAnnotation = ReflectUitl.getEntityClassesByAnnotation();
|
||||
Class<?> aClass = entityClassesByAnnotation.get(tableName);
|
||||
InfluxQueryWrapper influxQueryWrapper = new InfluxQueryWrapper(aClass,StatisticalDataDTO.class);
|
||||
influxQueryWrapper.eq("line_id",lineId)
|
||||
.eq("phasic_type",phasic)
|
||||
.eq("value_type",dataType)
|
||||
.last(columnName,"statisticalData");
|
||||
return commonMapper.getLineRtData(influxQueryWrapper);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user