1.部分算法调度任务添加

2.算法调整
This commit is contained in:
2023-07-26 15:29:26 +08:00
parent c14db734fe
commit f4b5786236
23 changed files with 857 additions and 68 deletions

View File

@@ -87,26 +87,20 @@
<select id="getAvgDayData" resultType="com.njcn.prepare.harmonic.pojo.dto.AlarmDetailDayDTO">
select
Y.lineId,
avg(Y.vUnbalance) vUnbalance,
avg(Y.vHarmonic) vHarmonic,
avg(Y.vlDev) vlDev,
avg(Y.freqDev) freqDev,
avg(Y.plt) plt,
avg(Y.sagTimes) sagTimes,
avg(Y.interruptTimes) interruptTimes
from
t0.lineId,
coalesce(t0.vUnbalance, 0) vUnbalance,
coalesce(t0.v, 0) vHarmonic,
coalesce(t1.vlDev, 0) vlDev,
coalesce(t1.freqDev, 0) freqDev,
coalesce(t2.plt, 0) plt,
coalesce(t3.sagTimes, 0) sagTimes,
coalesce(t3.interruptTimes, 0) interruptTimes
from
(
select
A.time,
A.lineId,
coalesce(A.vUnbalance, 0) vUnbalance,
coalesce(A.v, 0) vHarmonic,
coalesce(B.vlDev, 0) vlDev,
coalesce(B.freqDev, 0) freqDev,
coalesce(C.plt, 0) plt,
coalesce(D.sagTimes, 0) sagTimes,
coalesce(D.interruptTimes, 0) interruptTimes
avg(A.vUnbalance) vUnbalance,
avg(A.v) v
from
(
select
@@ -115,27 +109,50 @@
max(v_unbalance) vUnbalance,
max(greatest(v_thd, v_1, v_2, v_3, v_4, v_5, v_6, v_7, v_8, v_9, v_10, v_11, v_12, v_13, v_14, v_15, v_16, v_17, v_18, v_19, v_20, v_21, v_22, v_23, v_24, v_25, v_26, v_27, v_28, v_29, v_30, v_31, v_32, v_33, v_34, v_35, v_36, v_37, v_38, v_39, v_40, v_41, v_42, v_43, v_44, v_45, v_46, v_47, v_48, v_49, v_50)) v
from
r_stat_data_v_d t0
r_stat_data_v_d
where
`time` between #{startTime} and #{endTime} and value_type = 'CP95'
group by `time`,line_id
) A
left join
(
`time` between #{startTime} and #{endTime}
and value_type = 'CP95'
group by
`time`,
line_id
) A
group by
A.lineId
) t0
left join
(
select
B.lineId,
avg(B.vlDev) vlDev,
avg(B.freqDev) freqDev
from
(
select
`time`,
line_id lineId,
max(abs(vl_dev)) vlDev,
max(abs(freq_dev)) freqDev
from
r_stat_data_v_d t0
r_stat_data_v_d
where
`time` between #{startTime} and #{endTime} and value_type = 'MAX'
group by `time`,line_id
) B
on A.lineId = B.lineId
left join
(
`time` between #{startTime} and #{endTime}
and value_type = 'MAX'
group by
`time`,
line_id
) B
group by
B.lineId
) t1
on t0.lineId = t1.lineId
left join
(
select
C.lineId,
avg(C.plt) plt
from
(
select
`time` ,
line_id lineId,
@@ -143,33 +160,38 @@
from
r_stat_data_plt_d
where
`time` between #{startTime} and #{endTime} and value_type = 'MAX'
group by `time`,line_id
) C
on A.lineId = C.lineId
left join
(
select
measurement_point_id lineId,
data_date dataDate,
sag_times sagTimes,
interrupt_times interruptTimes
from
r_mp_event_detail_d
where
data_date between #{startTime} and #{endTime}
) D
on A.lineId = D.lineId
<where>
<if test="list != null and list.size() > 0">
A.lineId in
<foreach collection="list" item="item" open="(" close=")" separator=",">
#{item}
</foreach>
</if>
</where>
) Y
group by Y.lineId
`time` between #{startTime} and #{endTime}
and value_type = 'MAX'
group by
`time`,
line_id
) C
group by
C.lineId
) t2
on t0.lineId = t2.lineId
left join
(
select
measurement_point_id lineId,
avg(sag_times) sagTimes,
avg(interrupt_times) interruptTimes
from
r_mp_event_detail_d
where
data_date between #{startTime} and #{endTime}
group by
measurement_point_id
) t3
on t0.lineId = t3.lineId
<where>
<if test="list != null and list.size() > 0">
A.lineId in
<foreach collection="list" item="item" open="(" close=")" separator=",">
#{item}
</foreach>
</if>
</where>
</select>
<select id="getTargetWarnD" resultType="com.njcn.prepare.harmonic.pojo.dto.RMpTargetWarnDDTO">

View File

@@ -382,7 +382,207 @@
or t0.inuharm_16_overtime>0
) then 1
else 0
end isInuharm
end isInuharm,
case
when t0.uharm_2_overtime>0 then 1
else 0
end +
case
when t0.uharm_3_overtime>0 then 1
else 0
end +
case
when t0.uharm_4_overtime>0 then 1
else 0
end +
case
when t0.uharm_5_overtime>0 then 1
else 0
end +
case
when t0.uharm_6_overtime>0 then 1
else 0
end +
case
when t0.uharm_7_overtime>0 then 1
else 0
end +
case
when t0.uharm_8_overtime>0 then 1
else 0
end +
case
when t0.uharm_9_overtime>0 then 1
else 0
end +
case
when t0.uharm_10_overtime>0 then 1
else 0
end +
case
when t0.uharm_11_overtime>0 then 1
else 0
end +
case
when t0.uharm_12_overtime>0 then 1
else 0
end +
case
when t0.uharm_13_overtime>0 then 1
else 0
end +
case
when t0.uharm_14_overtime>0 then 1
else 0
end +
case
when t0.uharm_15_overtime>0 then 1
else 0
end +
case
when t0.uharm_16_overtime>0 then 1
else 0
end +
case
when t0.uharm_17_overtime>0 then 1
else 0
end +
case
when t0.uharm_18_overtime>0 then 1
else 0
end +
case
when t0.uharm_19_overtime>0 then 1
else 0
end +
case
when t0.uharm_20_overtime>0 then 1
else 0
end +
case
when t0.uharm_21_overtime>0 then 1
else 0
end +
case
when t0.uharm_22_overtime>0 then 1
else 0
end +
case
when t0.uharm_23_overtime>0 then 1
else 0
end +
case
when t0.uharm_24_overtime>0 then 1
else 0
end +
case
when t0.uharm_25_overtime>0 then 1
else 0
end vTimes,
case
when t0.iharm_2_overtime>0 then 1
else 0
end +
case
when t0.iharm_3_overtime>0 then 1
else 0
end +
case
when t0.iharm_4_overtime>0 then 1
else 0
end +
case
when t0.iharm_5_overtime>0 then 1
else 0
end +
case
when t0.iharm_6_overtime>0 then 1
else 0
end +
case
when t0.iharm_7_overtime>0 then 1
else 0
end +
case
when t0.iharm_8_overtime>0 then 1
else 0
end +
case
when t0.iharm_9_overtime>0 then 1
else 0
end +
case
when t0.iharm_10_overtime>0 then 1
else 0
end +
case
when t0.iharm_11_overtime>0 then 1
else 0
end +
case
when t0.iharm_12_overtime>0 then 1
else 0
end +
case
when t0.iharm_13_overtime>0 then 1
else 0
end +
case
when t0.iharm_14_overtime>0 then 1
else 0
end +
case
when t0.iharm_15_overtime>0 then 1
else 0
end +
case
when t0.iharm_16_overtime>0 then 1
else 0
end +
case
when t0.iharm_17_overtime>0 then 1
else 0
end +
case
when t0.iharm_18_overtime>0 then 1
else 0
end +
case
when t0.iharm_19_overtime>0 then 1
else 0
end +
case
when t0.iharm_20_overtime>0 then 1
else 0
end +
case
when t0.iharm_21_overtime>0 then 1
else 0
end +
case
when t0.iharm_22_overtime>0 then 1
else 0
end +
case
when t0.iharm_23_overtime>0 then 1
else 0
end +
case
when t0.iharm_24_overtime>0 then 1
else 0
end +
case
when t0.iharm_25_overtime>0 then 1
else 0
end iTimes,
case
when t0.ubalance_overtime>0 then 1
else 0
end unbalanceTimes,
case
when t0.i_neg_overtime>0 then 1
else 0
end iNegTimes
from
r_stat_limit_rate_d t0
left join

View File

@@ -126,7 +126,71 @@
case
when t0.inuharm_16_overtime>0 then 1
else 0
end isInuharm16
end isInuharm16,
case
when t0.inuharm_1_overtime>0 then 1
else 0
end +
case
when t0.inuharm_2_overtime>0 then 1
else 0
end +
case
when t0.inuharm_3_overtime>0 then 1
else 0
end +
case
when t0.inuharm_4_overtime>0 then 1
else 0
end +
case
when t0.inuharm_5_overtime>0 then 1
else 0
end +
case
when t0.inuharm_6_overtime>0 then 1
else 0
end +
case
when t0.inuharm_7_overtime>0 then 1
else 0
end +
case
when t0.inuharm_8_overtime>0 then 1
else 0
end +
case
when t0.inuharm_9_overtime>0 then 1
else 0
end +
case
when t0.inuharm_10_overtime>0 then 1
else 0
end +
case
when t0.inuharm_11_overtime>0 then 1
else 0
end +
case
when t0.inuharm_12_overtime>0 then 1
else 0
end +
case
when t0.inuharm_13_overtime>0 then 1
else 0
end +
case
when t0.inuharm_14_overtime>0 then 1
else 0
end +
case
when t0.inuharm_15_overtime>0 then 1
else 0
end +
case
when t0.inuharm_16_overtime>0 then 1
else 0
end inuharmTimes
from
r_stat_limit_rate_d t0
where

View File

@@ -36,6 +36,8 @@ public class RMpPartHarmonicDetailDServiceImpl extends MppServiceImpl<RMpPartHar
log.info(LocalDateTime.now()+"===>监测点稳态指标超标明细日表1开始执行");
List<RMpPartHarmonicDetailD> result = new ArrayList<>();
if (Objects.equals(lineParam.getType(),5)){
System.out.println(lineParam.getDataDate());
System.out.println(lineParam.getLineIds());
result = getData(lineParam.getDataDate(),lineParam.getLineIds());
} else if (Objects.equals(lineParam.getType(),3)){
int year = Integer.parseInt(lineParam.getDataDate().split("-")[0]);