修改接口

This commit is contained in:
huangzj
2023-04-25 12:47:53 +08:00
parent 72b88326fa
commit 5b3c5e6c94

View File

@@ -135,11 +135,11 @@ public class THDistortionServiceImpl implements THDistortionService {
/*监测点ID扁平化*/ /*监测点ID扁平化*/
List<String> collect = deviceList.stream().map(GeneralDeviceDTO::getLineIndexes).flatMap(Collection::stream).distinct().collect(Collectors.toList()); List<String> collect = deviceList.stream().map(GeneralDeviceDTO::getLineIndexes).flatMap(Collection::stream).distinct().collect(Collectors.toList());
QueryWrapper<RMpVThd> wrapper = new QueryWrapper<>(); QueryWrapper<RMpVThd> wrapper = new QueryWrapper<>();
wrapper.select ("measurement_point_id","max(v_thd)") wrapper.select ("measurement_point_id","max(v_thd) as v_thd")
.in("measurement_point_id", collect) .in("measurement_point_id", collect)
.between("data_date", statisticsBizBaseParam.getStartTime(), statisticsBizBaseParam.getEndTime()) .between("data_date", statisticsBizBaseParam.getStartTime(), statisticsBizBaseParam.getEndTime())
.eq("data_type", 0).groupBy ("measurement_point_id") .eq("data_type", 0).groupBy ("measurement_point_id")
.orderByDesc("max(v_thd)"); .orderByDesc("v_thd");
List<RMpVThd> rMpVThdList = rMpVThdMapper.selectList(wrapper); List<RMpVThd> rMpVThdList = rMpVThdMapper.selectList(wrapper);
rMpVThdVOList = rMpVThdList.stream().limit(topNum).map(rMpVThd -> { rMpVThdVOList = rMpVThdList.stream().limit(topNum).map(rMpVThd -> {
RMpVThdVO rMpVThdVO = new RMpVThdVO(); RMpVThdVO rMpVThdVO = new RMpVThdVO();