代码优化

This commit is contained in:
xy
2024-05-15 11:49:18 +08:00
parent b496452fd2
commit d7920e744e
6 changed files with 31 additions and 27 deletions

View File

@@ -17,6 +17,7 @@
<foreach collection="list" item="item" separator="," open="(" close=")">
#{item}
</foreach>
and quality_flag = 0
group by
`time`,line_id
</select>

View File

@@ -14,10 +14,11 @@
`time` between #{startTime} and #{endTime}
and phasic_type = 'T'
and value_type = 'MAX'
AND line_id IN
and line_id IN
<foreach collection="list" item="item" separator="," open="(" close=")">
#{item}
</foreach>
and quality_flag = 0
group by
`time`,line_id
</select>
@@ -26,7 +27,7 @@
select
`time` time,
line_id lineId,
avg(vl_dev) vlDev
avg(vu_dev) vuDev
from
r_stat_data_v_d
where
@@ -37,6 +38,7 @@
<foreach collection="list" item="item" separator="," open="(" close=")">
#{item}
</foreach>
and quality_flag = 0
group by
`time`,line_id
</select>
@@ -56,6 +58,7 @@
<foreach collection="list" item="item" separator="," open="(" close=")">
#{item}
</foreach>
and quality_flag = 0
group by
`time`,line_id
</select>

View File

@@ -317,7 +317,7 @@ public class GridServiceImpl implements IGridService {
vo1.setSd(targetSd(d,avg));
}
if (CollUtil.isNotEmpty(list2)) {
List<Double> d = list2.stream().map(o->o.getVlDev().doubleValue()).collect(Collectors.toList());
List<Double> d = list2.stream().map(o->o.getVuDev().doubleValue()).collect(Collectors.toList());
double avg = d.stream().collect(Collectors.averagingDouble(x->x));
vo2.setAvg(PubUtils.doubleRound(2,avg));
vo2.setSd(targetSd(d,avg));