越限数据源调整

This commit is contained in:
xy
2025-02-26 14:30:51 +08:00
parent dafa4be195
commit 53142531dd
3 changed files with 46 additions and 24 deletions

View File

@@ -1,6 +1,5 @@
package com.pqs9000.controller.responsibility;
import cn.hutool.json.JSONArray;
import com.alibaba.fastjson.JSON;
import com.njcn.pojo.commons.DatePojo;
import com.njcn.pojo.commons.HttpResult;
@@ -8,10 +7,8 @@ import com.njcn.pojo.commons.RedisDB;
import com.njcn.utils.PubUtils;
import com.njcn.utils.redis.JedisManager;
import com.pqs9000.pojo.responsibility.AreaOverNoraml;
import com.pqs9000.pojo.responsibility.OverLimitMonitor;
import com.pqs9000.service.responsibility.AreaOverNoramlService;
import com.pqs9000.util.ComplexHeadExcel;
import org.apache.commons.lang.StringUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
@@ -23,7 +20,6 @@ import org.springframework.web.bind.annotation.ResponseBody;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.util.ArrayList;
import java.util.List;
/**

View File

@@ -21,7 +21,7 @@
select
count(distinct myindex) allLine
from
limit_target
limit_rate
where
myindex IN
<foreach collection="list" item="list1" open="(" close=")" separator=",">
@@ -34,7 +34,7 @@
SELECT
COUNT(DISTINCT(MYINDEX)) overLine
FROM
limit_target b1,
limit_rate b1,
PQS_DEPTSLINE b2,
PQS_DEPTS b3
WHERE
@@ -58,22 +58,22 @@
or b1.INUHARM_12_OVERTIME >0 or b1.INUHARM_13_OVERTIME >0 or b1.INUHARM_14_OVERTIME >0 or b1.INUHARM_15_OVERTIME >0 or b1.INUHARM_16_OVERTIME >0)
) Y,
(
select
count(distinct myindex) frequencyOverLine
from
limit_target
where
myindex IN
<foreach collection="list" item="list3" open="(" close=")" separator=",">
#{list3}
</foreach>
and timeid BETWEEN TO_DATE(#{startTime}, 'YYYY-MM-DD HH24:MI:SS') AND TO_DATE(#{endTime}, 'YYYY-MM-DD HH24:MI:SS')
and phasic_type = 'T' and FREQ_DEV_OVERTIME > 0
select
count(distinct myindex) frequencyOverLine
from
limit_rate
where
myindex IN
<foreach collection="list" item="list3" open="(" close=")" separator=",">
#{list3}
</foreach>
and timeid BETWEEN TO_DATE(#{startTime}, 'YYYY-MM-DD HH24:MI:SS') AND TO_DATE(#{endTime}, 'YYYY-MM-DD HH24:MI:SS')
and phasic_type = 'T' and FREQ_DEV_OVERTIME > 0
) P,
(select
count(distinct myindex) voltageOverLine
from
limit_target
limit_rate
where
myindex IN
<foreach collection="list" item="list4" open="(" close=")" separator=",">
@@ -86,7 +86,7 @@
select
count(distinct c.myindex) harmonicVoltageOverLine
from
limit_target c
limit_rate c
where
c.myindex in
<foreach collection="list" item="harmonicVoltageList" open="(" close=")" separator=",">
@@ -99,7 +99,7 @@
select
count(distinct c.myindex) harmonicCurrentOverLine
from
limit_target c
limit_rate c
where
c.myindex in
<foreach collection="list" item="harmonicCurrentList" open="(" close=")" separator=",">
@@ -112,7 +112,7 @@
select
count(distinct c.myindex) ubalanceOverLine
from
limit_target c
limit_rate c
where
c.myindex in
<foreach collection="list" item="threePhaseVoltageList" open="(" close=")" separator=",">
@@ -125,7 +125,7 @@
select
count(distinct c.myindex) flicketOverLine
from
limit_target c
limit_rate c
where
c.myindex in
<foreach collection="list" item="flickerList" open="(" close=")" separator=",">
@@ -138,7 +138,7 @@
select
count(distinct c.myindex) negativeOverLine
from
limit_target c
limit_rate c
where
c.myindex in
<foreach collection="list" item="negativeList" open="(" close=")" separator=",">
@@ -151,7 +151,7 @@
select
count(distinct c.myindex) interharmonicOverLine
from
limit_target c
limit_rate c
where
c.myindex in
<foreach collection="list" item="harmonicCurrentList" open="(" close=")" separator=",">

View File

@@ -233,6 +233,7 @@
#{list3}
</foreach>
AND freq_dev_overtime >0
AND phasic_type = 'T'
GROUP BY
TIMEID,
MYINDEX
@@ -261,6 +262,7 @@
#{list4}
</foreach>
AND voltage_dev_overtime >0
AND phasic_type = 'T'
GROUP BY
TIMEID,
MYINDEX
@@ -302,6 +304,7 @@
uharm_21_overtime > 0 or uharm_22_overtime > 0 or
uharm_23_overtime > 0 or uharm_24_overtime > 0 or
uharm_25_overtime > 0)
AND phasic_type = 'T'
GROUP BY
TIMEID,
MYINDEX
@@ -331,6 +334,7 @@
#{list6}
</foreach>
AND uaberrance_overtime >0
AND phasic_type = 'T'
GROUP BY
TIMEID,
MYINDEX
@@ -371,6 +375,7 @@
uharm_21_overtime > 0 or uharm_22_overtime > 0 or
uharm_23_overtime > 0 or uharm_24_overtime > 0 or
uharm_25_overtime > 0)
AND phasic_type = 'T'
GROUP BY
TIMEID,
MYINDEX
@@ -399,6 +404,7 @@
#{list8}
</foreach>
AND (iharm_2_overtime >0 or iharm_3_overtime >0 or iharm_4_overtime >0 or iharm_5_overtime >0 or iharm_6_overtime >0 or iharm_7_overtime >0 or iharm_8_overtime >0 or iharm_9_overtime >0 or iharm_10_overtime >0 or iharm_11_overtime >0 or iharm_12_overtime >0 or iharm_13_overtime >0 or iharm_14_overtime >0 or iharm_15_overtime >0 or iharm_16_overtime >0 or iharm_17_overtime >0 or iharm_18_overtime >0 or iharm_19_overtime >0 or iharm_20_overtime >0 or iharm_21_overtime >0 or iharm_22_overtime >0 or iharm_23_overtime >0 or iharm_24_overtime >0 or iharm_25_overtime >0)
AND phasic_type = 'T'
GROUP BY
TIMEID,
MYINDEX
@@ -427,6 +433,7 @@
#{list9}
</foreach>
AND uharm_3_overtime >0
AND phasic_type = 'T'
GROUP BY
TIMEID,
MYINDEX
@@ -455,6 +462,7 @@
#{list10}
</foreach>
AND uharm_5_overtime >0
AND phasic_type = 'T'
GROUP BY
TIMEID,
MYINDEX
@@ -483,6 +491,7 @@
#{list11}
</foreach>
AND uharm_7_overtime >0
AND phasic_type = 'T'
GROUP BY
TIMEID,
MYINDEX
@@ -511,6 +520,7 @@
#{list12}
</foreach>
AND uharm_11_overtime >0
AND phasic_type = 'T'
GROUP BY
TIMEID,
MYINDEX
@@ -539,6 +549,7 @@
#{list13}
</foreach>
AND uharm_13_overtime >0
AND phasic_type = 'T'
GROUP BY
TIMEID,
MYINDEX
@@ -567,6 +578,7 @@
#{list14}
</foreach>
AND uharm_23_overtime >0
AND phasic_type = 'T'
GROUP BY
TIMEID,
MYINDEX
@@ -595,6 +607,7 @@
#{list15}
</foreach>
AND uharm_25_overtime >0
AND phasic_type = 'T'
GROUP BY
TIMEID,
MYINDEX
@@ -623,6 +636,7 @@
#{list15}
</foreach>
AND (uharm_2_overtime >0 or uharm_4_overtime >0 or uharm_6_overtime >0 or uharm_8_overtime >0 or uharm_9_overtime >0 or uharm_10_overtime >0 or uharm_12_overtime >0 or uharm_14_overtime >0 or uharm_15_overtime >0 or uharm_16_overtime >0 or uharm_17_overtime >0 or uharm_18_overtime >0 or uharm_19_overtime >0 or uharm_20_overtime >0 or uharm_21_overtime >0 or uharm_22_overtime >0 or uharm_24_overtime >0)
AND phasic_type = 'T'
GROUP BY
TIMEID,
MYINDEX
@@ -651,6 +665,7 @@
#{list16}
</foreach>
AND iharm_3_overtime >0
AND phasic_type = 'T'
GROUP BY
TIMEID,
MYINDEX
@@ -679,6 +694,7 @@
#{list17}
</foreach>
AND iharm_5_overtime >0
AND phasic_type = 'T'
GROUP BY
TIMEID,
MYINDEX
@@ -707,6 +723,7 @@
#{list18}
</foreach>
AND iharm_7_overtime >0
AND phasic_type = 'T'
GROUP BY
TIMEID,
MYINDEX
@@ -735,6 +752,7 @@
#{list19}
</foreach>
AND iharm_11_overtime >0
AND phasic_type = 'T'
GROUP BY
TIMEID,
MYINDEX
@@ -763,6 +781,7 @@
#{list20}
</foreach>
AND iharm_13_overtime >0
AND phasic_type = 'T'
GROUP BY
TIMEID,
MYINDEX
@@ -791,6 +810,7 @@
#{list21}
</foreach>
AND iharm_23_overtime >0
AND phasic_type = 'T'
GROUP BY
TIMEID,
MYINDEX
@@ -819,6 +839,7 @@
#{list22}
</foreach>
AND iharm_25_overtime >0
AND phasic_type = 'T'
GROUP BY
TIMEID,
MYINDEX
@@ -847,6 +868,7 @@
#{list23}
</foreach>
AND (iharm_2_overtime >0 or iharm_4_overtime >0 or iharm_6_overtime >0 or iharm_8_overtime >0 or iharm_9_overtime >0 or iharm_10_overtime >0 or iharm_12_overtime >0 or iharm_14_overtime >0 or iharm_15_overtime >0 or iharm_16_overtime >0 or iharm_17_overtime >0 or iharm_18_overtime >0 or iharm_19_overtime >0 or iharm_20_overtime >0 or iharm_21_overtime >0 or iharm_22_overtime >0 or iharm_24_overtime >0)
AND phasic_type = 'T'
GROUP BY
TIMEID,
MYINDEX
@@ -875,6 +897,7 @@
#{list24}
</foreach>
AND ubalance_overtime>0
AND phasic_type = 'T'
GROUP BY
TIMEID,
MYINDEX
@@ -903,6 +926,7 @@
#{list25}
</foreach>
AND flicker_overtime>0
AND phasic_type = 'T'
GROUP BY
TIMEID,
MYINDEX
@@ -944,6 +968,7 @@
#{list27}
</foreach>
AND I_Neg_OverTime>0
AND phasic_type = 'T'
GROUP BY
TIMEID,
MYINDEX
@@ -974,6 +999,7 @@
AND (InUHARM_1_OverTime >0 or InUHARM_2_OverTime >0 or InUHARM_3_OverTime >0 or InUHARM_4_OverTime >0 or InUHARM_5_OverTime >0 or InUHARM_6_OverTime >0
or InUHARM_7_OverTime >0 or InUHARM_8_OverTime >0 or InUHARM_9_OverTime >0 or InUHARM_10_OverTime >0 or InUHARM_11_OverTime >0 or InUHARM_12_OverTime >0
or InUHARM_13_OverTime >0 or InUHARM_14_OverTime >0 or InUHARM_15_OverTime >0 or InUHARM_16_OverTime >0)
AND phasic_type = 'T'
GROUP BY
TIMEID,
MYINDEX