修改bug
This commit is contained in:
@@ -410,7 +410,7 @@ public interface LineMapper extends BaseMapper<Line> {
|
|||||||
"\t\tFROM\n",
|
"\t\tFROM\n",
|
||||||
"\t\t\tpq_line a\n",
|
"\t\t\tpq_line a\n",
|
||||||
"\t\tINNER JOIN pq_device b ON a.id = b.id\n",
|
"\t\tINNER JOIN pq_device b ON a.id = b.id\n",
|
||||||
"where b.Run_Flag = 0 and a.Pid in",
|
"where b.com_flag = 0 and a.Pid in",
|
||||||
"<foreach item='item' index='index' collection='items' open='(' separator=',' close=')'>",
|
"<foreach item='item' index='index' collection='items' open='(' separator=',' close=')'>",
|
||||||
"#{item}",
|
"#{item}",
|
||||||
"</foreach>",
|
"</foreach>",
|
||||||
|
|||||||
@@ -712,10 +712,10 @@ public class GeneralDeviceService {
|
|||||||
|
|
||||||
List<GeneralDeviceDTO> deptDeviceInfos = this.getDeviceInfoAsDept(deviceInfoParam, Stream.of(0, 1).collect(Collectors.toList()), Stream.of(1).collect(Collectors.toList()));
|
List<GeneralDeviceDTO> deptDeviceInfos = this.getDeviceInfoAsDept(deviceInfoParam, Stream.of(0, 1).collect(Collectors.toList()), Stream.of(1).collect(Collectors.toList()));
|
||||||
|
|
||||||
List<String> DeviceIds = deptDeviceInfos.stream().map(GeneralDeviceDTO::getSubIndexes).flatMap(Collection::stream).collect(Collectors.toList());
|
List<String> subIds = deptDeviceInfos.stream().map(GeneralDeviceDTO::getSubIndexes).flatMap(Collection::stream).collect(Collectors.toList());
|
||||||
Integer substationCount = DeviceIds.size();
|
Integer substationCount = subIds.size();
|
||||||
|
|
||||||
Integer count = lineMapper.queryOnlineSubstaion(DeviceIds);
|
Integer count = lineMapper.queryOnlineSubstaion(subIds);
|
||||||
deptSubstationDetailVO.setSubstationCount(substationCount);
|
deptSubstationDetailVO.setSubstationCount(substationCount);
|
||||||
deptSubstationDetailVO.setRunsubstationCount(count);
|
deptSubstationDetailVO.setRunsubstationCount(count);
|
||||||
BigDecimal rate = BigDecimal.valueOf(count).divide(BigDecimal.valueOf(substationCount), 4, BigDecimal.ROUND_HALF_UP);
|
BigDecimal rate = BigDecimal.valueOf(count).divide(BigDecimal.valueOf(substationCount), 4, BigDecimal.ROUND_HALF_UP);
|
||||||
|
|||||||
Reference in New Issue
Block a user