监测点分布接口优化
This commit is contained in:
@@ -280,7 +280,7 @@
|
|||||||
<if test="deviceInfoParam.powerFlag!=2">
|
<if test="deviceInfoParam.powerFlag!=2">
|
||||||
and t2.Power_Flag = #{deviceInfoParam.powerFlag}
|
and t2.Power_Flag = #{deviceInfoParam.powerFlag}
|
||||||
</if>
|
</if>
|
||||||
<if test="deviceInfoParam.lineGrade!='' and deviceInfoParam.lineGrade!=''">
|
<if test="deviceInfoParam.lineGrade!='' and deviceInfoParam.lineGrade!=null">
|
||||||
and t2.line_grade = #{deviceInfoParam.lineGrade}
|
and t2.line_grade = #{deviceInfoParam.lineGrade}
|
||||||
</if>
|
</if>
|
||||||
<if test="deviceInfoParam.loadType!=null and deviceInfoParam.loadType.size()!=0">
|
<if test="deviceInfoParam.loadType!=null and deviceInfoParam.loadType.size()!=0">
|
||||||
|
|||||||
@@ -276,20 +276,7 @@ public class LineServiceImpl extends ServiceImpl<LineMapper, Line> implements Li
|
|||||||
lineDistributionVO.setValue(generalDeviceDTO.getLineIndexes().size());
|
lineDistributionVO.setValue(generalDeviceDTO.getLineIndexes().size());
|
||||||
lineDistributionVOList.add(lineDistributionVO);
|
lineDistributionVOList.add(lineDistributionVO);
|
||||||
}
|
}
|
||||||
|
return lineDistributionVOList;
|
||||||
List<LineDistributionVO> result = new ArrayList<LineDistributionVO>();
|
|
||||||
Map<String, Integer> map = new HashMap<String, Integer>();
|
|
||||||
for (LineDistributionVO lineDistributionVO : lineDistributionVOList) {
|
|
||||||
if (map.containsKey(lineDistributionVO.getName())) {
|
|
||||||
map.put(lineDistributionVO.getName(), map.get(lineDistributionVO.getName()) + lineDistributionVO.getValue());
|
|
||||||
} else {
|
|
||||||
map.put(lineDistributionVO.getName(), lineDistributionVO.getValue());
|
|
||||||
}
|
|
||||||
}
|
|
||||||
for (Map.Entry<String, Integer> entry : map.entrySet()) {
|
|
||||||
result.add(new LineDistributionVO(entry.getKey(), entry.getValue()));
|
|
||||||
}
|
|
||||||
return result;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@@ -308,7 +295,9 @@ public class LineServiceImpl extends ServiceImpl<LineMapper, Line> implements Li
|
|||||||
//获取监测点新增数
|
//获取监测点新增数
|
||||||
QueryWrapper<Line> lineQueryWrapper = new QueryWrapper<>();
|
QueryWrapper<Line> lineQueryWrapper = new QueryWrapper<>();
|
||||||
lineQueryWrapper.in("pq_line.id", generalDeviceDTO.getLineIndexes());
|
lineQueryWrapper.in("pq_line.id", generalDeviceDTO.getLineIndexes());
|
||||||
lineQueryWrapper.between("pq_line.Create_Time", DateUtil.beginOfDay(DateUtil.parse(deviceInfoParam.getSearchBeginTime())), DateUtil.endOfDay(DateUtil.parse(deviceInfoParam.getSearchEndTime())));
|
lineQueryWrapper.between("pq_line.Create_Time",
|
||||||
|
DateUtil.beginOfDay(DateUtil.parse(deviceInfoParam.getSearchBeginTime())),
|
||||||
|
DateUtil.endOfDay(DateUtil.parse(deviceInfoParam.getSearchEndTime())));
|
||||||
int countNum = lineMapper.selectCount(lineQueryWrapper);
|
int countNum = lineMapper.selectCount(lineQueryWrapper);
|
||||||
lineSaveTail += countNum;
|
lineSaveTail += countNum;
|
||||||
lineStatisticsDetail.setAddLineNum(countNum);
|
lineStatisticsDetail.setAddLineNum(countNum);
|
||||||
|
|||||||
Reference in New Issue
Block a user