diff --git a/pqs-device/pms-device/pms-device-boot/src/main/java/com/njcn/device/pms/mapper/majornetwork/RStatIntegrityDMapper.java b/pqs-device/pms-device/pms-device-boot/src/main/java/com/njcn/device/pms/mapper/majornetwork/RStatIntegrityDMapper.java index 7a32fcf98..f3041341a 100644 --- a/pqs-device/pms-device/pms-device-boot/src/main/java/com/njcn/device/pms/mapper/majornetwork/RStatIntegrityDMapper.java +++ b/pqs-device/pms-device/pms-device-boot/src/main/java/com/njcn/device/pms/mapper/majornetwork/RStatIntegrityDMapper.java @@ -2,6 +2,8 @@ package com.njcn.device.pms.mapper.majornetwork; import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; +import com.njcn.device.pms.pojo.dto.MonitorIntegrityDataDTO; import com.njcn.device.pq.pojo.param.LineBaseQueryParam; import com.njcn.device.pq.pojo.param.OnlineRateParam; import com.njcn.device.pq.pojo.po.LineDataIntegrity; @@ -22,4 +24,6 @@ import java.util.List; public interface RStatIntegrityDMapper extends BaseMapper { + Page getMonitorIntegrityData (@Param("page") Page page,@Param("monitorIntegrityDataDTO")MonitorIntegrityDataDTO monitorIntegrityDataDTO,@Param("ids")List ids); + } diff --git a/pqs-device/pms-device/pms-device-boot/src/main/java/com/njcn/device/pms/mapper/mapping/RStatIntegrityDMapper.xml b/pqs-device/pms-device/pms-device-boot/src/main/java/com/njcn/device/pms/mapper/mapping/RStatIntegrityDMapper.xml new file mode 100644 index 000000000..ac27a0ef4 --- /dev/null +++ b/pqs-device/pms-device/pms-device-boot/src/main/java/com/njcn/device/pms/mapper/mapping/RStatIntegrityDMapper.xml @@ -0,0 +1,25 @@ + + + + + + + + diff --git a/pqs-device/pms-device/pms-device-boot/src/main/java/com/njcn/device/pms/service/majornetwork/impl/RStatIntegrityDServiceImpl.java b/pqs-device/pms-device/pms-device-boot/src/main/java/com/njcn/device/pms/service/majornetwork/impl/RStatIntegrityDServiceImpl.java index 3d28468ea..7bbed28cb 100644 --- a/pqs-device/pms-device/pms-device-boot/src/main/java/com/njcn/device/pms/service/majornetwork/impl/RStatIntegrityDServiceImpl.java +++ b/pqs-device/pms-device/pms-device-boot/src/main/java/com/njcn/device/pms/service/majornetwork/impl/RStatIntegrityDServiceImpl.java @@ -44,6 +44,7 @@ public class RStatIntegrityDServiceImpl extends ServiceImpl getMonitorIntegrityData(MonitorIntegrityDataDTO monitorIntegrityDataDTO) { Page pageResult =new Page<>(PageFactory.getPageNum(monitorIntegrityDataDTO),PageFactory.getPageSize(monitorIntegrityDataDTO)); @@ -56,11 +57,7 @@ public class RStatIntegrityDServiceImpl extends ServiceImpl map = monitorList.stream().collect(Collectors.toMap(Monitor::getId, Function.identity())); - QueryWrapper queryWrapper = new QueryWrapper<>(); - queryWrapper.select("ROUND(sum(real_time)/sum(due_time),3) as integrityData,line_index as lineIndex").lambda() - .between(RStatIntegrityD::getTimeId,monitorIntegrityDataDTO.getSearchBeginTime(),monitorIntegrityDataDTO.getSearchEndTime()) - .in(RStatIntegrityD::getLineIndex,monitorIds).last("group by lineIndex"); - Page page = this.page(new Page<>(PageFactory.getPageNum(monitorIntegrityDataDTO),PageFactory.getPageSize(monitorIntegrityDataDTO)),queryWrapper); + Page page = this.baseMapper.getMonitorIntegrityData(new Page<>(PageFactory.getPageNum(monitorIntegrityDataDTO),PageFactory.getPageSize(monitorIntegrityDataDTO)),monitorIntegrityDataDTO,monitorIds); List monitorIntegrityDataDTOList = page.getRecords().stream().map(item->{ MonitorIntegrityDataDTO monitorIntegrityDataDTOTem = new MonitorIntegrityDataDTO(); monitorIntegrityDataDTOTem.setMonitorId(item.getLineIndex());