冀北地图接口优化
This commit is contained in:
@@ -207,7 +207,7 @@ AND EXISTS (
|
|||||||
<select id="getOnlineRate" resultType="com.njcn.device.pms.pojo.dto.PmsSimpleDTO">
|
<select id="getOnlineRate" resultType="com.njcn.device.pms.pojo.dto.PmsSimpleDTO">
|
||||||
SELECT
|
SELECT
|
||||||
pdm.Monitor_Sort name,
|
pdm.Monitor_Sort name,
|
||||||
SUM(rmded.dev_effective_rate) doubleValue
|
IFNULL(SUM(rmded.dev_effective_rate),0)doubleValue
|
||||||
FROM pms_distribution_monitor pdm
|
FROM pms_distribution_monitor pdm
|
||||||
LEFT JOIN r_mp_dev_evaluate_detail rmded ON pdm.Terminal_Id = rmded.device_id
|
LEFT JOIN r_mp_dev_evaluate_detail rmded ON pdm.Terminal_Id = rmded.device_id
|
||||||
WHERE pdm.Terminal_Id IN
|
WHERE pdm.Terminal_Id IN
|
||||||
@@ -219,7 +219,7 @@ AND EXISTS (
|
|||||||
<select id="getIntegrity" resultType="com.njcn.device.pms.pojo.dto.PmsSimpleDTO">
|
<select id="getIntegrity" resultType="com.njcn.device.pms.pojo.dto.PmsSimpleDTO">
|
||||||
SELECT
|
SELECT
|
||||||
pdm.Monitor_Sort name,
|
pdm.Monitor_Sort name,
|
||||||
SUM(romd.data_integrity_rate) doubleValue
|
IFNULL(SUM(romd.data_integrity_rate),0) doubleValue
|
||||||
FROM pms_distribution_monitor pdm
|
FROM pms_distribution_monitor pdm
|
||||||
LEFT JOIN r_operating_monitor_d romd ON pdm.Monitor_Id = romd.measurement_point_id
|
LEFT JOIN r_operating_monitor_d romd ON pdm.Monitor_Id = romd.measurement_point_id
|
||||||
WHERE pdm.Monitor_Id IN
|
WHERE pdm.Monitor_Id IN
|
||||||
|
|||||||
@@ -125,13 +125,13 @@ public class SubstationExpendServiceImpl extends ServiceImpl<SubstationExpendMap
|
|||||||
|
|
||||||
// 统计在线率
|
// 统计在线率
|
||||||
List<PmsSimpleDTO> onlineRateStatistic = distributionMonitorMapper.getOnlineRate(terminalIds);
|
List<PmsSimpleDTO> onlineRateStatistic = distributionMonitorMapper.getOnlineRate(terminalIds);
|
||||||
double sum = onlineRateStatistic.stream().mapToDouble(PmsSimpleDTO::getDoubleValue).sum();
|
double sum = onlineRateStatistic.stream().mapToDouble(PmsSimpleDTO::getDoubleValue).sum()!=0?onlineRateStatistic.stream().mapToDouble(PmsSimpleDTO::getDoubleValue).sum():3.14159;
|
||||||
onlineRateStatistic.forEach(dto -> dto.setDoubleValue(new BigDecimal(dto.getDoubleValue() * 100 / sum).setScale(2, BigDecimal.ROUND_HALF_UP).doubleValue()));
|
onlineRateStatistic.forEach(dto -> dto.setDoubleValue(new BigDecimal(dto.getDoubleValue() * 100 / sum).setScale(2, BigDecimal.ROUND_HALF_UP).doubleValue()));
|
||||||
ledgerStaticDTO.setTerminalStatistics(onlineRateStatistic);
|
ledgerStaticDTO.setTerminalStatistics(onlineRateStatistic);
|
||||||
|
|
||||||
// 完整性
|
// 完整性
|
||||||
List<PmsSimpleDTO> integrityStatistic = distributionMonitorMapper.getIntegrity(terminalIds);
|
List<PmsSimpleDTO> integrityStatistic = distributionMonitorMapper.getIntegrity(terminalIds);
|
||||||
double s = integrityStatistic.stream().mapToDouble(PmsSimpleDTO::getDoubleValue).sum();
|
double s = integrityStatistic.stream().mapToDouble(PmsSimpleDTO::getDoubleValue).sum()!=0?integrityStatistic.stream().mapToDouble(PmsSimpleDTO::getDoubleValue).sum():3.14159;
|
||||||
integrityStatistic.forEach(dto -> dto.setDoubleValue(new BigDecimal(dto.getDoubleValue() * 100 / s).setScale(2, BigDecimal.ROUND_HALF_UP).doubleValue()));
|
integrityStatistic.forEach(dto -> dto.setDoubleValue(new BigDecimal(dto.getDoubleValue() * 100 / s).setScale(2, BigDecimal.ROUND_HALF_UP).doubleValue()));
|
||||||
return ledgerStaticDTO;
|
return ledgerStaticDTO;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user