初始化项目
This commit is contained in:
@@ -0,0 +1,70 @@
|
||||
<?xml version='1.0' encoding='UTF-8' ?>
|
||||
<!DOCTYPE mapper
|
||||
PUBLIC '-//mybatis.org//DTD Mapper 3.0//EN'
|
||||
'http://mybatis.org/dtd/mybatis-3-mapper.dtd'>
|
||||
<mapper namespace='com.njcn.mapper.data.AssesMapper'>
|
||||
<select id="getVol" resultType="asses">
|
||||
SELECT
|
||||
AVG(VU_DEV) VU_DEV ,
|
||||
AVG(Freq_Dev) Freq_Dev ,
|
||||
AVG(Data_PLT) Data_PLT ,
|
||||
AVG(V_Unbalance_CP95) V_Unbalance_CP95 ,
|
||||
AVG(V_THD_CP95) V_THD_CP95
|
||||
FROM
|
||||
PQS_ASSES
|
||||
WHERE
|
||||
TIMEID BETWEEN #{startTime}
|
||||
AND #{endTime}
|
||||
AND LINEID IN
|
||||
<foreach collection="list" item="item" separator="," open="(" close=")">
|
||||
#{item}
|
||||
</foreach>
|
||||
</select>
|
||||
|
||||
<select id="getSynData" resultType="pqsComasses">
|
||||
SELECT
|
||||
T .LINEID,
|
||||
AVG (T .freq_Dev1) freqDev1,
|
||||
AVG (T .freq_Dev2) freqDev2,
|
||||
AVG (T .freq_Dev3) freqDev3,
|
||||
AVG (T .freq_Dev4) freqDev4,
|
||||
AVG (T .freq_Dev5) freqDev5,
|
||||
AVG (T .vu_Dev1) vuDev1,
|
||||
AVG (T .vu_Dev2) vuDev2,
|
||||
AVG (T .vu_Dev3) vuDev3,
|
||||
AVG (T .vu_Dev4) vuDev4,
|
||||
AVG (T .vu_Dev5) vuDev5,
|
||||
AVG (T .data_Pst1) dataPst1,
|
||||
AVG (T .data_Pst2) dataPst2,
|
||||
AVG (T .data_Pst3) dataPst3,
|
||||
AVG (T .data_Pst4) dataPst4,
|
||||
AVG (T .data_Pst5) dataPst5,
|
||||
AVG (T .v_Unbalance1) vUnbalance1,
|
||||
AVG (T .v_Unbalance2) vUnbalance2,
|
||||
AVG (T .v_Unbalance3) vUnbalance3,
|
||||
AVG (T .v_Unbalance4) vUnbalance4,
|
||||
AVG (T .v_Unbalance5) vUnbalance5,
|
||||
AVG (T .v_Thd1) vThd1,
|
||||
AVG (T .v_Thd2) vThd2,
|
||||
AVG (T .v_Thd3) vThd3,
|
||||
AVG (T .v_Thd4) vThd4,
|
||||
AVG (T .v_Thd5) vThd5,
|
||||
AVG (T .event1) event1,
|
||||
AVG (T .event2) event2,
|
||||
AVG (T .event3) event3,
|
||||
AVG (T .event4) event4,
|
||||
AVG (T .event5) event5
|
||||
FROM
|
||||
PQS_COMASSES T
|
||||
where
|
||||
TIMEID BETWEEN #{startTime}
|
||||
AND #{endTime}
|
||||
and LINEID in
|
||||
<foreach collection="list" item="item" separator="," open="(" close=")">
|
||||
#{item}
|
||||
</foreach>
|
||||
GROUP BY
|
||||
LINEID
|
||||
</select>
|
||||
|
||||
</mapper>
|
||||
@@ -0,0 +1,23 @@
|
||||
<?xml version='1.0' encoding='UTF-8' ?>
|
||||
<!DOCTYPE mapper
|
||||
PUBLIC '-//mybatis.org//DTD Mapper 3.0//EN'
|
||||
'http://mybatis.org/dtd/mybatis-3-mapper.dtd'>
|
||||
<mapper namespace='com.pqs9000.mapper.data.DataIMapper'>
|
||||
|
||||
<select id="getHistoryData" resultType="Responsibility">
|
||||
SELECT
|
||||
T1.TIMEID TIME,
|
||||
max(T1.I_${time}) value
|
||||
FROM
|
||||
data_I T1
|
||||
WHERE
|
||||
T1.TIMEID BETWEEN #{startTime} AND #{endTime}
|
||||
AND T1.LINEID = #{lineIndex}
|
||||
AND T1.PHASIC_TYPE in('A','B','C')
|
||||
GROUP BY
|
||||
T1.TIMEID
|
||||
ORDER BY
|
||||
T1.TIMEID asc
|
||||
</select>
|
||||
|
||||
</mapper>
|
||||
@@ -0,0 +1,39 @@
|
||||
<?xml version='1.0' encoding='UTF-8' ?>
|
||||
<!DOCTYPE mapper
|
||||
PUBLIC '-//mybatis.org//DTD Mapper 3.0//EN'
|
||||
'http://mybatis.org/dtd/mybatis-3-mapper.dtd'>
|
||||
<mapper namespace='com.pqs9000.mapper.data.DataVMapper'>
|
||||
|
||||
<select id="getHistoryData" resultType="Responsibility">
|
||||
SELECT
|
||||
T1.TIMEID TIME,
|
||||
max(T1.v_${time}) value
|
||||
FROM
|
||||
Data_HarmRate_V T1
|
||||
WHERE
|
||||
T1.TIMEID BETWEEN #{startTime} AND #{endTime}
|
||||
AND T1.LINEID = #{lineIndex}
|
||||
AND T1.PHASIC_TYPE in('A','B','C')
|
||||
GROUP BY
|
||||
T1.TIMEID
|
||||
ORDER BY
|
||||
T1.TIMEID asc
|
||||
</select>
|
||||
|
||||
<select id="queryData" resultType="DataV">
|
||||
SELECT
|
||||
*
|
||||
FROM
|
||||
Data_V T1
|
||||
WHERE
|
||||
<if test="_databaseId == 'MariaDB'">
|
||||
T1.TIMEID BETWEEN str_to_date(#{startTime},'%Y-%m-%d %H:%i:%s')
|
||||
AND str_to_date(#{endTime}, '%Y-%m-%d %H:%i:%s')
|
||||
</if>
|
||||
<if test="_databaseId == 'Oracle'">
|
||||
T1.TIMEID BETWEEN to_date(#{startTime}, 'yyyy-MM-dd Hh24:mi::ss')
|
||||
AND to_date(#{endTime}, 'yyyy-MM-dd Hh24:mi::ss')
|
||||
</if>
|
||||
AND T1.LINEID = #{lineIndex}
|
||||
</select>
|
||||
</mapper>
|
||||
@@ -0,0 +1,224 @@
|
||||
<?xml version='1.0' encoding='UTF-8' ?>
|
||||
<!DOCTYPE mapper
|
||||
PUBLIC '-//mybatis.org//DTD Mapper 3.0//EN'
|
||||
'http://mybatis.org/dtd/mybatis-3-mapper.dtd'>
|
||||
<mapper namespace='com.njcn.mapper.data.EventDetailMapper'>
|
||||
<resultMap type="com.njcn.pojo.data.EventDetail" id="EventDetailMapperMap" autoMapping="true">
|
||||
<id property="lineId" column="LINEID"/>
|
||||
</resultMap>
|
||||
<select id="queryZj" resultMap="EventDetailMapperMap">
|
||||
select timeId,EVENTDETAIL_INDEX from pqs_eventdetail where
|
||||
<if test="_databaseId == 'MariaDB'">
|
||||
str_to_date(timeid,'%Y-%m-%d')
|
||||
</if>
|
||||
<if test="_databaseId == 'Oracle'">
|
||||
to_char(timeid,'yyyy-mm-DD')
|
||||
</if>
|
||||
between #{startTime}
|
||||
and #{endTime} and
|
||||
<if test="_databaseId == 'MariaDB'">
|
||||
str_to_date(timeid,'%H:%i:%s')
|
||||
</if>
|
||||
<if test="_databaseId == 'Oracle'">
|
||||
to_char(timeid,'hh24:mm:ss')
|
||||
</if>
|
||||
between #{start} and #{end}
|
||||
and lineid = #{lineId} order by TIMEID asc
|
||||
</select>
|
||||
|
||||
|
||||
|
||||
<select id="queryVoltageList" resultType="eventDetail">
|
||||
SELECT
|
||||
M .EVENTDETAIL_INDEX,
|
||||
M .LINEID,
|
||||
M.WAVETYPE,
|
||||
m.fileflag,
|
||||
<if test="_databaseId == 'MariaDB'">
|
||||
CONCAT(str_to_date( M.TIMEID, '%Y-%m-%d %H:%i:%s'),'.',M.MS) time,
|
||||
</if>
|
||||
<if test="_databaseId == 'Oracle'">
|
||||
to_char(M .TIMEID,'YYYY-mm-dd hh24:mi:ss.')||M.MS time,
|
||||
</if>
|
||||
round(M .PERSISTTIME/1000, 3) PERSISTTIME,
|
||||
round(M.EVENTVALUE*100,2) EVENTVALUE,
|
||||
M .EVENTREASON,
|
||||
M .EVENTTYPE,
|
||||
M.severity,
|
||||
M .NAME lineName,
|
||||
M.EVENTASS_INDEX,
|
||||
S. NAME GDNAME,
|
||||
S1. NAME SUBNAME,
|
||||
S2.DIC_NAME SCALE,
|
||||
S3.IP,
|
||||
M.DEVTYPE devtype
|
||||
FROM
|
||||
(
|
||||
SELECT
|
||||
T1.EVENTDETAIL_INDEX,
|
||||
T1.LINEID,
|
||||
T1.TIMEID,
|
||||
T1.WAVETYPE,
|
||||
T1.FILEFLAG,
|
||||
nvl(substr(10000+T1.MS,-3),T1.MS) MS,
|
||||
T1.PERSISTTIME,
|
||||
T1.EVENTVALUE,
|
||||
T1.severity,
|
||||
T2.DIC_NAME EVENTREASON,
|
||||
T3.DIC_NAME EVENTTYPE,
|
||||
T1.EVENTASS_INDEX,
|
||||
T4.NAME,
|
||||
T4.GD_INDEX GDINDEX,
|
||||
T4.SUB_INDEX SUBINDEX,
|
||||
T4.SCALE,
|
||||
T4.DEV_INDEX DEVINDEX,
|
||||
s5.DIC_NAME DEVTYPE
|
||||
FROM
|
||||
PQS_EVENTDETAIL T1
|
||||
INNER JOIN PQS_DICDATA T2 ON T1.EVENTREASON = T2.DIC_INDEX
|
||||
INNER JOIN PQS_DICDATA T3 ON T1.EVENTTYPE = T3.DIC_INDEX
|
||||
INNER JOIN PQ_LINE T4 ON T1.LINEID = T4.LINE_INDEX
|
||||
INNER JOIN pq_device S4 ON T4 .dev_index = S4.Dev_index
|
||||
INNER JOIN PQS_DICDATA S5 ON S4.devtype=S5 .DIC_INDEX
|
||||
WHERE
|
||||
T1.TIMEID
|
||||
BETWEEN #{startTime} AND #{endTime}
|
||||
and T1.LINEID in
|
||||
<foreach collection="list" item="item" index="index" open="("
|
||||
separator="," close=")">
|
||||
#{item}
|
||||
</foreach>
|
||||
<if test="minfuzhi !=null and maxfuzhi!=null">
|
||||
and T1.EVENTVALUE between #{minfuzhi} and #{maxfuzhi}
|
||||
</if>
|
||||
<if test="minfuzhi !=null and maxfuzhi==null">
|
||||
and T1.EVENTVALUE > #{minfuzhi}
|
||||
</if>
|
||||
<if test="minfuzhi ==null and maxfuzhi!=null">
|
||||
and T1.EVENTVALUE < #{maxfuzhi}
|
||||
</if>
|
||||
|
||||
<if test="mintime !=null and maxtime!=null">
|
||||
and T1.PERSISTTIME between #{mintime} and #{maxtime}
|
||||
</if>
|
||||
<if test="mintime !=null and maxtime==null">
|
||||
and T1.PERSISTTIME > #{mintime}
|
||||
</if>
|
||||
<if test="mintime ==null and maxtime!=null">
|
||||
and T1.PERSISTTIME < #{maxtime}
|
||||
</if>
|
||||
|
||||
<if test="minseverity !=null and maxseverity!=null">
|
||||
and T1.severity between #{minseverity} and #{maxseverity}
|
||||
</if>
|
||||
<if test="minseverity !=null and maxseverity==null">
|
||||
and T1.severity > #{minseverity}
|
||||
</if>
|
||||
<if test="minseverity ==null and maxseverity!=null">
|
||||
and T1.severity < #{maxseverity}
|
||||
</if>
|
||||
|
||||
|
||||
<if test="eventType!=null">
|
||||
and T1.EVENTTYPE in
|
||||
<foreach collection="eventType" item="item" index="index" separator="," open="(" close=")">
|
||||
#{item}
|
||||
</foreach>
|
||||
</if>
|
||||
<if test="eventReason!=null">
|
||||
and T1.EVENTREASON in
|
||||
<foreach collection="eventReason" item="item" index="index" separator="," open="(" close=")">
|
||||
#{item}
|
||||
</foreach>
|
||||
</if>
|
||||
<if test="triggerType!=null">
|
||||
and T1.WAVETYPE in
|
||||
<foreach collection="triggerType" item="item" index="index" separator="," open="(" close=")">
|
||||
#{item}
|
||||
</foreach>
|
||||
</if>
|
||||
<if test="fileflag!=null">
|
||||
and T1.FILEFLAG = #{fileflag}
|
||||
</if>
|
||||
|
||||
) M
|
||||
INNER JOIN PQ_GDINFORMATION S ON M .GDINDEX = S.GD_INDEX
|
||||
INNER JOIN PQ_SUBSTATION S1 ON M .SUBINDEX = S1.SUB_INDEX
|
||||
INNER JOIN PQS_DICDATA S2 ON M . SCALE = S2.DIC_INDEX
|
||||
INNER JOIN pq_device S3 ON M . DEVINDEX = S3.Dev_index
|
||||
ORDER BY
|
||||
M .TIMEID DESC
|
||||
</select>
|
||||
|
||||
<update id="updateSeverity">
|
||||
update
|
||||
PQS_EVENTDETAIL
|
||||
set
|
||||
Severity = #{severity}
|
||||
where
|
||||
EVENTDETAIL_INDEX=#{index}
|
||||
</update>
|
||||
|
||||
<select id="selectByIndex" resultType="eventDetail">
|
||||
SELECT
|
||||
EVENTDETAIL_INDEX,
|
||||
LINEID,
|
||||
TIMEID,
|
||||
MS,
|
||||
WAVETYPE,
|
||||
PERSISTTIME,
|
||||
EVENTVALUE,
|
||||
EVENTREASON,
|
||||
EVENTTYPE,
|
||||
EVENTASS_INDEX,
|
||||
DQTIME,
|
||||
DEALTIME,
|
||||
NUM,
|
||||
FILEFLAG,
|
||||
DEALFLAG,
|
||||
FIRSTTIME,
|
||||
FIRSTTYPE,
|
||||
FIRSTMS,
|
||||
WAVENAME,
|
||||
Energy,
|
||||
Severity
|
||||
FROM
|
||||
PQS_EVENTDETAIL
|
||||
WHERE
|
||||
EVENTDETAIL_INDEX = #{eventIndex}
|
||||
</select>
|
||||
<select id="selectByTimeIdAndLineIndex" resultType="eventDetail">
|
||||
SELECT
|
||||
EVENTDETAIL_INDEX,
|
||||
LINEID,
|
||||
TIMEID,
|
||||
MS,
|
||||
WAVETYPE,
|
||||
PERSISTTIME,
|
||||
EVENTVALUE,
|
||||
EVENTREASON,
|
||||
EVENTTYPE,
|
||||
EVENTASS_INDEX,
|
||||
DQTIME,
|
||||
DEALTIME,
|
||||
NUM,
|
||||
FILEFLAG,
|
||||
DEALFLAG,
|
||||
FIRSTTIME,
|
||||
FIRSTTYPE,
|
||||
FIRSTMS,
|
||||
WAVENAME,
|
||||
Energy,
|
||||
Severity
|
||||
FROM
|
||||
PQS_EVENTDETAIL
|
||||
WHERE
|
||||
TIMEID = #{timeId}
|
||||
and
|
||||
MS = #{ms}
|
||||
and
|
||||
lineId =#{lineId}
|
||||
</select>
|
||||
|
||||
|
||||
</mapper>
|
||||
@@ -0,0 +1,965 @@
|
||||
<?xml version='1.0' encoding='UTF-8' ?>
|
||||
<!DOCTYPE mapper
|
||||
PUBLIC '-//mybatis.org//DTD Mapper 3.0//EN'
|
||||
'http://mybatis.org/dtd/mybatis-3-mapper.dtd'>
|
||||
<mapper namespace='com.njcn.mapper.data.HistoryDataMapper'>
|
||||
<select id="getXVrValue" resultType="historyData">
|
||||
select TIMEID timeId,sum(case when Phasic_Type='A' then RMS else 0 end) aAvrValue
|
||||
,sum(case when Phasic_Type='B' then RMS else 0 end) bAvrValue
|
||||
,sum(case when Phasic_Type='C' then RMS else 0 end) cAvrValue
|
||||
,sum(case when Phasic_Type='A' then RMS_MAX else 0 end) aMaxValue
|
||||
,sum(case when Phasic_Type='B' then RMS_MAX else 0 end) bMaxValue
|
||||
,sum(case when Phasic_Type='C' then RMS_MAX else 0 end) cMaxValue
|
||||
,sum(case when Phasic_Type='A' then RMS_MIN else 0 end) aMinValue
|
||||
,sum(case when Phasic_Type='B' then RMS_MIN else 0 end) bMinValue
|
||||
,sum(case when Phasic_Type='C' then RMS_MIN else 0 end) cMinValue
|
||||
,sum(case when Phasic_Type='A' then RMS_CP95 else 0 end) aCP95Value
|
||||
,sum(case when Phasic_Type='B' then RMS_CP95 else 0 end) bCP95Value
|
||||
,sum(case when Phasic_Type='C' then RMS_CP95 else 0 end) cCP95Value from
|
||||
<choose>
|
||||
<when test="flagday == 1">
|
||||
data_v
|
||||
</when>
|
||||
<otherwise>
|
||||
data_v_take
|
||||
</otherwise>
|
||||
</choose>
|
||||
where
|
||||
<if test="_databaseId == 'MariaDB'">
|
||||
DATE_FORMAT(timeid,'%Y-%m-%d %H:%i:%s') between concat(#{startTime},' ',#{start}) and
|
||||
concat(#{endTime},' ',#{end})
|
||||
</if>
|
||||
<if test="_databaseId == 'Oracle'">
|
||||
timeid between to_date(#{startTime},'yyyy-mm-DD hh24:mi:ss') and to_date(#{endTime},'yyyy-mm-DD hh24:mi:ss')
|
||||
</if>
|
||||
and lineid = #{lineIndex}
|
||||
and phasic_type!='T' group by timeid order by timeid asc
|
||||
</select>
|
||||
|
||||
<select id="getLVrValue" resultType="historyData">
|
||||
select TIMEID timeId,RMSAB aAvrValue,RMSBC bAvrValue,RMSCA cAvrValue
|
||||
,RMSAB_MAX aMaxValue,RMSBC_MAX bMaxValue,RMSCA_MAX cMaxValue,RMSAB_MIN aMinValue
|
||||
,RMSBC_MIN bMinValue,RMSCA_MIN cMinValue,RMSAB_CP95 aCP95Value
|
||||
,RMSBC_CP95 bCP95Value,RMSCA_CP95 cCP95Value from
|
||||
<choose>
|
||||
<when test="flagday == 1">
|
||||
data_v
|
||||
</when>
|
||||
<otherwise>
|
||||
data_v_take
|
||||
</otherwise>
|
||||
</choose>
|
||||
where
|
||||
<if test="_databaseId == 'MariaDB'">
|
||||
DATE_FORMAT(timeid,'%Y-%m-%d %H:%i:%s') between concat(#{startTime},' ',#{start}) and
|
||||
concat(#{endTime},' ',#{end})
|
||||
</if>
|
||||
<if test="_databaseId == 'Oracle'">
|
||||
timeid between to_date(#{startTime},'yyyy-mm-DD hh24:mi:ss') and to_date(#{endTime},'yyyy-mm-DD hh24:mi:ss')
|
||||
</if>
|
||||
and lineid = #{lineIndex}
|
||||
and phasic_type='T' order by timeid
|
||||
</select>
|
||||
|
||||
<select id="getDypc" resultType="historyData">
|
||||
select TIMEID timeId,sum(case when Phasic_Type='A' then VU_DEV else 0 end) aAvrValue
|
||||
,sum(case when Phasic_Type='B' then VU_DEV else 0 end) bAvrValue
|
||||
,sum(case when Phasic_Type='C' then VU_DEV else 0 end) cAvrValue
|
||||
,sum(case when Phasic_Type='A' then VU_DEV_MAX else 0 end) aMaxValue
|
||||
,sum(case when Phasic_Type='B' then VU_DEV_MAX else 0 end) bMaxValue
|
||||
,sum(case when Phasic_Type='C' then VU_DEV_MAX else 0 end) cMaxValue
|
||||
,sum(case when Phasic_Type='A' then VU_DEV_MIN else 0 end) aMinValue
|
||||
,sum(case when Phasic_Type='B' then VU_DEV_MIN else 0 end) bMinValue
|
||||
,sum(case when Phasic_Type='C' then VU_DEV_MIN else 0 end) cMinValue
|
||||
,sum(case when Phasic_Type='A' then VU_DEV_CP95 else 0 end) aCP95Value
|
||||
,sum(case when Phasic_Type='B' then VU_DEV_CP95 else 0 end) bCP95Value
|
||||
,sum(case when Phasic_Type='C' then VU_DEV_CP95 else 0 end) cCP95Value from
|
||||
<choose>
|
||||
<when test="flagday == 1">
|
||||
data_v
|
||||
</when>
|
||||
<otherwise>
|
||||
data_v_take
|
||||
</otherwise>
|
||||
</choose>
|
||||
where
|
||||
<if test="_databaseId == 'MariaDB'">
|
||||
DATE_FORMAT(timeid,'%Y-%m-%d %H:%i:%s') between concat(#{startTime},' ',#{start}) and
|
||||
concat(#{endTime},' ',#{end})
|
||||
</if>
|
||||
<if test="_databaseId == 'Oracle'">
|
||||
timeid between to_date(#{startTime},'yyyy-mm-DD hh24:mi:ss') and to_date(#{endTime},'yyyy-mm-DD hh24:mi:ss')
|
||||
</if>
|
||||
and lineid = #{lineIndex}
|
||||
and phasic_type!='T' group by timeid order by timeid
|
||||
</select>
|
||||
|
||||
<select id="getSxbphd" resultType="historyData">
|
||||
select TIMEID timeId,V_Unbalance fAvrValue,V_Unbalance_MAX fMaxValue
|
||||
,V_Unbalance_MIN fMinValue,V_Unbalance_CP95 fCP95Value from
|
||||
<choose>
|
||||
<when test="flagday == 1">
|
||||
data_v
|
||||
</when>
|
||||
<otherwise>
|
||||
data_v_take
|
||||
</otherwise>
|
||||
</choose>
|
||||
where
|
||||
<if test="_databaseId == 'MariaDB'">
|
||||
DATE_FORMAT(timeid,'%Y-%m-%d %H:%i:%s') between concat(#{startTime},' ',#{start}) and
|
||||
concat(#{endTime},' ',#{end})
|
||||
</if>
|
||||
<if test="_databaseId == 'Oracle'">
|
||||
timeid between to_date(#{startTime},'yyyy-mm-DD hh24:mi:ss') and to_date(#{endTime},'yyyy-mm-DD hh24:mi:ss')
|
||||
</if>
|
||||
and lineid = #{lineIndex}
|
||||
and phasic_type='T' order by timeid
|
||||
</select>
|
||||
|
||||
<select id="getBphdy" resultType="historyData">
|
||||
select TIMEID timeId,V_ZERO aAvrValue,V_POS bAvrValue,V_NEG cAvrValue
|
||||
,V_ZERO_MAX aMaxValue,V_POS_MAX bMaxValue,V_NEG_MAX cMaxValue
|
||||
,V_ZERO_MIN aMinValue,V_POS_MIN bMinValue,V_NEG_MIN cMinValue
|
||||
,V_ZERO_CP95 aCP95Value,V_POS_CP95 bCP95Value,V_NEG_CP95 cCP95Value from
|
||||
<choose>
|
||||
<when test="flagday == 1">
|
||||
data_v
|
||||
</when>
|
||||
<otherwise>
|
||||
data_v_take
|
||||
</otherwise>
|
||||
</choose>
|
||||
where
|
||||
<if test="_databaseId == 'MariaDB'">
|
||||
DATE_FORMAT(timeid,'%Y-%m-%d %H:%i:%s') between concat(#{startTime},' ',#{start}) and
|
||||
concat(#{endTime},' ',#{end})
|
||||
</if>
|
||||
<if test="_databaseId == 'Oracle'">
|
||||
timeid between to_date(#{startTime},'yyyy-mm-DD hh24:mi:ss') and to_date(#{endTime},'yyyy-mm-DD hh24:mi:ss')
|
||||
</if>
|
||||
and lineid = #{lineIndex}
|
||||
and phasic_type='T' order by timeid
|
||||
</select>
|
||||
|
||||
<select id="getDyzjbl" resultType="historyData">
|
||||
select TIMEID timeId,sum(case when Phasic_Type='A' then V_THD else 0 end) aAvrValue
|
||||
,sum(case when Phasic_Type='B' then V_THD else 0 end) bAvrValue
|
||||
,sum(case when Phasic_Type='C' then V_THD else 0 end) cAvrValue
|
||||
,sum(case when Phasic_Type='A' then V_THD_MAX else 0 end) aMaxValue
|
||||
,sum(case when Phasic_Type='B' then V_THD_MAX else 0 end) bMaxValue
|
||||
,sum(case when Phasic_Type='C' then V_THD_MAX else 0 end) cMaxValue
|
||||
,sum(case when Phasic_Type='A' then V_THD_MIN else 0 end) aMinValue
|
||||
,sum(case when Phasic_Type='B' then V_THD_MIN else 0 end) bMinValue
|
||||
,sum(case when Phasic_Type='C' then V_THD_MIN else 0 end) cMinValue
|
||||
,sum(case when Phasic_Type='A' then V_THD_CP95 else 0 end) aCP95Value
|
||||
,sum(case when Phasic_Type='B' then V_THD_CP95 else 0 end) bCP95Value
|
||||
,sum(case when Phasic_Type='C' then V_THD_CP95 else 0 end) cCP95Value from
|
||||
<choose>
|
||||
<when test="flagday == 1">
|
||||
data_v
|
||||
</when>
|
||||
<otherwise>
|
||||
data_v_take
|
||||
</otherwise>
|
||||
</choose>
|
||||
where
|
||||
<if test="_databaseId == 'MariaDB'">
|
||||
DATE_FORMAT(timeid,'%Y-%m-%d %H:%i:%s') between concat(#{startTime},' ',#{start}) and
|
||||
concat(#{endTime},' ',#{end})
|
||||
</if>
|
||||
<if test="_databaseId == 'Oracle'">
|
||||
timeid between to_date(#{startTime},'yyyy-mm-DD hh24:mi:ss') and to_date(#{endTime},'yyyy-mm-DD hh24:mi:ss')
|
||||
</if>
|
||||
and lineid = #{lineIndex}
|
||||
and phasic_type!='T' group by timeid order by timeid
|
||||
</select>
|
||||
|
||||
<select id="getDlyxz" resultType="historyData">
|
||||
select TIMEID timeId,sum(case when Phasic_Type='A' then RMS else 0 end) aAvrValue
|
||||
,sum(case when Phasic_Type='B' then RMS else 0 end) bAvrValue
|
||||
,sum(case when Phasic_Type='C' then RMS else 0 end) cAvrValue
|
||||
,sum(case when Phasic_Type='A' then RMS_MAX else 0 end) aMaxValue
|
||||
,sum(case when Phasic_Type='B' then RMS_MAX else 0 end) bMaxValue
|
||||
,sum(case when Phasic_Type='C' then RMS_MAX else 0 end) cMaxValue
|
||||
,sum(case when Phasic_Type='A' then RMS_MIN else 0 end) aMinValue
|
||||
,sum(case when Phasic_Type='B' then RMS_MIN else 0 end) bMinValue
|
||||
,sum(case when Phasic_Type='C' then RMS_MIN else 0 end) cMinValue
|
||||
,sum(case when Phasic_Type='A' then RMS_CP95 else 0 end) aCP95Value
|
||||
,sum(case when Phasic_Type='B' then RMS_CP95 else 0 end) bCP95Value
|
||||
,sum(case when Phasic_Type='C' then RMS_CP95 else 0 end) cCP95Value from
|
||||
<choose>
|
||||
<when test="flagday == 1">
|
||||
data_i
|
||||
</when>
|
||||
<otherwise>
|
||||
data_i_take
|
||||
</otherwise>
|
||||
</choose>
|
||||
where
|
||||
<if test="_databaseId == 'MariaDB'">
|
||||
DATE_FORMAT(timeid,'%Y-%m-%d %H:%i:%s') between concat(#{startTime},' ',#{start}) and
|
||||
concat(#{endTime},' ',#{end})
|
||||
</if>
|
||||
<if test="_databaseId == 'Oracle'">
|
||||
timeid between to_date(#{startTime},'yyyy-mm-DD hh24:mi:ss') and to_date(#{endTime},'yyyy-mm-DD hh24:mi:ss')
|
||||
</if>
|
||||
and lineid = #{lineIndex}
|
||||
and phasic_type!='T' group by timeid order by timeid
|
||||
</select>
|
||||
|
||||
<select id="getFxdl" resultType="historyData">
|
||||
select TIMEID timeId,sum(case when Phasic_Type='T' then I_NEG else 0 end) fAvrValue
|
||||
,sum(case when Phasic_Type='T' then I_NEG_MAX else 0 end) fMaxValue
|
||||
,sum(case when Phasic_Type='T' then I_NEG_MIN else 0 end) fMinValue
|
||||
,sum(case when Phasic_Type='T' then I_NEG_CP95 else 0 end) fCP95Value from
|
||||
<choose>
|
||||
<when test="flagday == 1">
|
||||
data_i
|
||||
</when>
|
||||
<otherwise>
|
||||
data_i_take
|
||||
</otherwise>
|
||||
</choose>
|
||||
where lineid = #{lineIndex}
|
||||
and phasic_type ='T'
|
||||
<if test="_databaseId == 'MariaDB'">
|
||||
DATE_FORMAT(timeid,'%Y-%m-%d %H:%i:%s') between concat(#{startTime},' ',#{start}) and
|
||||
concat(#{endTime},' ',#{end})
|
||||
</if>
|
||||
<if test="_databaseId == 'Oracle'">
|
||||
and timeid between to_date(#{startTime},'yyyy-MM-dd hh24:mi:ss') and to_date(#{endTime},'yyyy-MM-dd hh24:mi:ss')
|
||||
</if>
|
||||
group by timeid order by timeid
|
||||
</select>
|
||||
|
||||
<select id="getPl" resultType="historyData">
|
||||
select TIMEID timeId,Freq fAvrValue,Freq_MAX fMaxValue,Freq_MIN fMinValue
|
||||
,Freq_CP95 fCP95Value from
|
||||
<choose>
|
||||
<when test="flagday == 1">
|
||||
data_v
|
||||
</when>
|
||||
<otherwise>
|
||||
data_v_take
|
||||
</otherwise>
|
||||
</choose>
|
||||
where
|
||||
<if test="_databaseId == 'MariaDB'">
|
||||
DATE_FORMAT(timeid,'%Y-%m-%d %H:%i:%s') between concat(#{startTime},' ',#{start}) and
|
||||
concat(#{endTime},' ',#{end})
|
||||
</if>
|
||||
<if test="_databaseId == 'Oracle'">
|
||||
timeid between to_date(#{startTime},'yyyy-mm-DD hh24:mi:ss') and to_date(#{endTime},'yyyy-mm-DD hh24:mi:ss')
|
||||
</if>
|
||||
and lineid = #{lineIndex}
|
||||
and phasic_type='T' order by timeid
|
||||
</select>
|
||||
|
||||
<select id="getJbhyl" resultType="historyData">
|
||||
select TIMEID timeId,sum(case when Phasic_Type='A' then V_1 else 0 end) aAvrValue
|
||||
,sum(case when Phasic_Type='B' then V_1 else 0 end) bAvrValue
|
||||
,sum(case when Phasic_Type='C' then V_1 else 0 end) cAvrValue
|
||||
,sum(case when Phasic_Type='A' then V_1_MAX else 0 end) aMaxValue
|
||||
,sum(case when Phasic_Type='B' then V_1_MAX else 0 end) bMaxValue
|
||||
,sum(case when Phasic_Type='C' then V_1_MAX else 0 end) cMaxValue
|
||||
,sum(case when Phasic_Type='A' then V_1_MIN else 0 end) aMinValue
|
||||
,sum(case when Phasic_Type='B' then V_1_MIN else 0 end) bMinValue
|
||||
,sum(case when Phasic_Type='C' then V_1_MIN else 0 end) cMinValue
|
||||
,sum(case when Phasic_Type='A' then V_1_CP95 else 0 end) aCP95Value
|
||||
,sum(case when Phasic_Type='B' then V_1_CP95 else 0 end) bCP95Value
|
||||
,sum(case when Phasic_Type='C' then V_1_CP95 else 0 end) cCP95Value from
|
||||
<choose>
|
||||
<when test="flagday == 1">
|
||||
data_v
|
||||
</when>
|
||||
<otherwise>
|
||||
data_v_take
|
||||
</otherwise>
|
||||
</choose>
|
||||
where
|
||||
<if test="_databaseId == 'MariaDB'">
|
||||
DATE_FORMAT(timeid,'%Y-%m-%d %H:%i:%s') between concat(#{startTime},' ',#{start}) and
|
||||
concat(#{endTime},' ',#{end})
|
||||
</if>
|
||||
<if test="_databaseId == 'Oracle'">
|
||||
timeid between to_date(#{startTime},'yyyy-mm-DD hh24:mi:ss') and to_date(#{endTime},'yyyy-mm-DD hh24:mi:ss')
|
||||
</if>
|
||||
and lineid = #{lineIndex}
|
||||
and phasic_type!='T' group by timeid order by timeid
|
||||
</select>
|
||||
|
||||
<select id="getXbhyl" resultType="historyData">
|
||||
select TIMEID timeId,sum(case when Phasic_Type='A' then V_${number} else 0 end) aAvrValue
|
||||
,sum(case when Phasic_Type='B' then V_${number} else 0 end) bAvrValue
|
||||
,sum(case when Phasic_Type='C' then V_${number} else 0 end) cAvrValue
|
||||
,sum(case when Phasic_Type='A' then V_${number}_MAX else 0 end) aMaxValue
|
||||
,sum(case when Phasic_Type='B' then V_${number}_MAX else 0 end) bMaxValue
|
||||
,sum(case when Phasic_Type='C' then V_${number}_MAX else 0 end) cMaxValue
|
||||
,sum(case when Phasic_Type='A' then V_${number}_MIN else 0 end) aMinValue
|
||||
,sum(case when Phasic_Type='B' then V_${number}_MIN else 0 end) bMinValue
|
||||
,sum(case when Phasic_Type='C' then V_${number}_MIN else 0 end) cMinValue
|
||||
,sum(case when Phasic_Type='A' then V_${number}_CP95 else 0 end) aCP95Value
|
||||
,sum(case when Phasic_Type='B' then V_${number}_CP95 else 0 end) bCP95Value
|
||||
,sum(case when Phasic_Type='C' then V_${number}_CP95 else 0 end) cCP95Value from
|
||||
<choose>
|
||||
<when test="flagday == 1">
|
||||
data_harmrate_v
|
||||
</when>
|
||||
<otherwise>
|
||||
data_harmrate_v_take
|
||||
</otherwise>
|
||||
</choose>
|
||||
where
|
||||
<if test="_databaseId == 'MariaDB'">
|
||||
DATE_FORMAT(timeid,'%Y-%m-%d %H:%i:%s') between concat(#{startTime},' ',#{start}) and
|
||||
concat(#{endTime},' ',#{end})
|
||||
</if>
|
||||
<if test="_databaseId == 'Oracle'">
|
||||
timeid between to_date(#{startTime},'yyyy-mm-DD hh24:mi:ss') and to_date(#{endTime},'yyyy-mm-DD hh24:mi:ss')
|
||||
</if>
|
||||
and lineid = #{lineIndex}
|
||||
and phasic_type!='T' group by timeid order by timeid
|
||||
</select>
|
||||
|
||||
<select id="getJxbhyl" resultType="historyData">
|
||||
select TIMEID timeId,sum(case when Phasic_Type='A' then V_${innumber} else 0 end) aAvrValue
|
||||
,sum(case when Phasic_Type='B' then V_${innumber} else 0 end) bAvrValue
|
||||
,sum(case when Phasic_Type='C' then V_${innumber} else 0 end) cAvrValue
|
||||
,sum(case when Phasic_Type='A' then V_${innumber}_MAX else 0 end) aMaxValue
|
||||
,sum(case when Phasic_Type='B' then V_${innumber}_MAX else 0 end) bMaxValue
|
||||
,sum(case when Phasic_Type='C' then V_${innumber}_MAX else 0 end) cMaxValue
|
||||
,sum(case when Phasic_Type='A' then V_${innumber}_MIN else 0 end) aMinValue
|
||||
,sum(case when Phasic_Type='B' then V_${innumber}_MIN else 0 end) bMinValue
|
||||
,sum(case when Phasic_Type='C' then V_${innumber}_MIN else 0 end) cMinValue
|
||||
,sum(case when Phasic_Type='A' then V_${innumber}_CP95 else 0 end) aCP95Value
|
||||
,sum(case when Phasic_Type='B' then V_${innumber}_CP95 else 0 end) bCP95Value
|
||||
,sum(case when Phasic_Type='C' then V_${innumber}_CP95 else 0 end) cCP95Value from
|
||||
<choose>
|
||||
<when test="flagday == 1">
|
||||
data_inharm_v
|
||||
</when>
|
||||
<otherwise>
|
||||
data_inharm_v_take
|
||||
</otherwise>
|
||||
</choose>
|
||||
where
|
||||
<if test="_databaseId == 'MariaDB'">
|
||||
DATE_FORMAT(timeid,'%Y-%m-%d %H:%i:%s') between concat(#{startTime},' ',#{start}) and
|
||||
concat(#{endTime},' ',#{end})
|
||||
</if>
|
||||
<if test="_databaseId == 'Oracle'">
|
||||
timeid between to_date(#{startTime},'yyyy-mm-DD hh24:mi:ss') and to_date(#{endTime},'yyyy-mm-DD hh24:mi:ss')
|
||||
</if>
|
||||
and lineid = #{lineIndex}
|
||||
and phasic_type!='T' group by timeid order by timeid
|
||||
</select>
|
||||
|
||||
<select id="getXbdlfz" resultType="historyData">
|
||||
select TIMEID timeId,sum(case when Phasic_Type='A' then I_${number} else 0 end) aAvrValue
|
||||
,sum(case when Phasic_Type='B' then I_${number} else 0 end) bAvrValue
|
||||
,sum(case when Phasic_Type='C' then I_${number} else 0 end) cAvrValue
|
||||
,sum(case when Phasic_Type='A' then I_${number}_MAX else 0 end) aMaxValue
|
||||
,sum(case when Phasic_Type='B' then I_${number}_MAX else 0 end) bMaxValue
|
||||
,sum(case when Phasic_Type='C' then I_${number}_MAX else 0 end) cMaxValue
|
||||
,sum(case when Phasic_Type='A' then I_${number}_MIN else 0 end) aMinValue
|
||||
,sum(case when Phasic_Type='B' then I_${number}_MIN else 0 end) bMinValue
|
||||
,sum(case when Phasic_Type='C' then I_${number}_MIN else 0 end) cMinValue
|
||||
,sum(case when Phasic_Type='A' then I_${number}_CP95 else 0 end) aCP95Value
|
||||
,sum(case when Phasic_Type='B' then I_${number}_CP95 else 0 end) bCP95Value
|
||||
,sum(case when Phasic_Type='C' then I_${number}_CP95 else 0 end) cCP95Value from
|
||||
<choose>
|
||||
<when test="flagday == 1">
|
||||
data_i
|
||||
</when>
|
||||
<otherwise>
|
||||
data_i_take
|
||||
</otherwise>
|
||||
</choose>
|
||||
where
|
||||
<if test="_databaseId == 'MariaDB'">
|
||||
DATE_FORMAT(timeid,'%Y-%m-%d %H:%i:%s') between concat(#{startTime},' ',#{start}) and
|
||||
concat(#{endTime},' ',#{end})
|
||||
</if>
|
||||
<if test="_databaseId == 'Oracle'">
|
||||
timeid between to_date(#{startTime},'yyyy-mm-DD hh24:mi:ss') and to_date(#{endTime},'yyyy-mm-DD hh24:mi:ss')
|
||||
</if>
|
||||
and lineid = #{lineIndex}
|
||||
and phasic_type!='T' group by timeid order by timeid
|
||||
</select>
|
||||
|
||||
<select id="getYggl" resultType="historyData">
|
||||
select TIMEID timeId,sum(case when Phasic_Type='A' then P else 0 end) aAvrValue
|
||||
,sum(case when Phasic_Type='B' then P else 0 end) bAvrValue
|
||||
,sum(case when Phasic_Type='C' then P else 0 end) cAvrValue
|
||||
,sum(case when Phasic_Type='A' then P_MAX else 0 end) aMaxValue
|
||||
,sum(case when Phasic_Type='B' then P_MAX else 0 end) bMaxValue
|
||||
,sum(case when Phasic_Type='C' then P_MAX else 0 end) cMaxValue
|
||||
,sum(case when Phasic_Type='A' then P_MIN else 0 end) aMinValue
|
||||
,sum(case when Phasic_Type='B' then P_MIN else 0 end) bMinValue
|
||||
,sum(case when Phasic_Type='C' then P_MIN else 0 end) cMinValue
|
||||
,sum(case when Phasic_Type='A' then P_CP95 else 0 end) aCP95Value
|
||||
,sum(case when Phasic_Type='B' then P_CP95 else 0 end) bCP95Value
|
||||
,sum(case when Phasic_Type='C' then P_CP95 else 0 end) cCP95Value from
|
||||
<choose>
|
||||
<when test="flagday == 1">
|
||||
data_harmpower_p
|
||||
</when>
|
||||
<otherwise>
|
||||
data_harmpower_p_take
|
||||
</otherwise>
|
||||
</choose>
|
||||
where
|
||||
<if test="_databaseId == 'MariaDB'">
|
||||
DATE_FORMAT(timeid,'%Y-%m-%d %H:%i:%s') between concat(#{startTime},' ',#{start}) and
|
||||
concat(#{endTime},' ',#{end})
|
||||
</if>
|
||||
<if test="_databaseId == 'Oracle'">
|
||||
timeid between to_date(#{startTime},'yyyy-mm-DD hh24:mi:ss') and to_date(#{endTime},'yyyy-mm-DD hh24:mi:ss')
|
||||
</if>
|
||||
and lineid = #{lineIndex}
|
||||
group by timeid order by timeid
|
||||
</select>
|
||||
|
||||
<select id="getYgzgl" resultType="historyData">
|
||||
select TIMEID timeId
|
||||
,sum(case when Phasic_Type='T' then P else 0 end) fAvrValue
|
||||
,sum(case when Phasic_Type='T' then P_MAX else 0 end) fMaxValue
|
||||
,sum(case when Phasic_Type='T' then P_MIN else 0 end) fMinValue
|
||||
,sum(case when Phasic_Type='T' then P_CP95 else 0 end) fCP95Value from
|
||||
<choose>
|
||||
<when test="flagday == 1">
|
||||
data_harmpower_p
|
||||
</when>
|
||||
<otherwise>
|
||||
data_harmpower_p_take
|
||||
</otherwise>
|
||||
</choose>
|
||||
where
|
||||
<if test="_databaseId == 'MariaDB'">
|
||||
DATE_FORMAT(timeid,'%Y-%m-%d %H:%i:%s') between concat(#{startTime},' ',#{start}) and
|
||||
concat(#{endTime},' ',#{end})
|
||||
</if>
|
||||
<if test="_databaseId == 'Oracle'">
|
||||
timeid between to_date(#{startTime},'yyyy-mm-DD hh24:mi:ss') and to_date(#{endTime},'yyyy-mm-DD hh24:mi:ss')
|
||||
</if>
|
||||
and lineid = #{lineIndex}
|
||||
group by timeid order by timeid
|
||||
</select>
|
||||
|
||||
<select id="getWggl" resultType="historyData">
|
||||
select TIMEID timeId,sum(case when Phasic_Type='A' then Q else 0 end) aAvrValue
|
||||
,sum(case when Phasic_Type='B' then Q else 0 end) bAvrValue
|
||||
,sum(case when Phasic_Type='C' then Q else 0 end) cAvrValue
|
||||
,sum(case when Phasic_Type='A' then Q_MAX else 0 end) aMaxValue
|
||||
,sum(case when Phasic_Type='B' then Q_MAX else 0 end) bMaxValue
|
||||
,sum(case when Phasic_Type='C' then Q_MAX else 0 end) cMaxValue
|
||||
,sum(case when Phasic_Type='A' then Q_MIN else 0 end) aMinValue
|
||||
,sum(case when Phasic_Type='B' then Q_MIN else 0 end) bMinValue
|
||||
,sum(case when Phasic_Type='C' then Q_MIN else 0 end) cMinValue
|
||||
,sum(case when Phasic_Type='A' then Q_CP95 else 0 end) aCP95Value
|
||||
,sum(case when Phasic_Type='B' then Q_CP95 else 0 end) bCP95Value
|
||||
,sum(case when Phasic_Type='C' then Q_CP95 else 0 end) cCP95Value from
|
||||
<choose>
|
||||
<when test="flagday == 1">
|
||||
data_harmpower_q
|
||||
</when>
|
||||
<otherwise>
|
||||
data_harmpower_q_take
|
||||
</otherwise>
|
||||
</choose>
|
||||
|
||||
where
|
||||
<if test="_databaseId == 'MariaDB'">
|
||||
DATE_FORMAT(timeid,'%Y-%m-%d %H:%i:%s') between concat(#{startTime},' ',#{start}) and
|
||||
concat(#{endTime},' ',#{end})
|
||||
</if>
|
||||
<if test="_databaseId == 'Oracle'">
|
||||
timeid between to_date(#{startTime},'yyyy-mm-DD hh24:mi:ss') and to_date(#{endTime},'yyyy-mm-DD hh24:mi:ss')
|
||||
</if>
|
||||
and lineid = #{lineIndex}
|
||||
group by timeid order by timeid
|
||||
</select>
|
||||
|
||||
<select id="getWgzgl" resultType="historyData">
|
||||
select TIMEID timeId
|
||||
,sum(case when Phasic_Type='T' then Q else 0 end) fAvrValue
|
||||
,sum(case when Phasic_Type='T' then Q_MAX else 0 end) fMaxValue
|
||||
,sum(case when Phasic_Type='T' then Q_MIN else 0 end) fMinValue
|
||||
,sum(case when Phasic_Type='T' then Q_CP95 else 0 end) fCP95Value from
|
||||
<choose>
|
||||
<when test="flagday == 1">
|
||||
data_harmpower_q
|
||||
</when>
|
||||
<otherwise>
|
||||
data_harmpower_q_take
|
||||
</otherwise>
|
||||
</choose>
|
||||
where
|
||||
<if test="_databaseId == 'MariaDB'">
|
||||
DATE_FORMAT(timeid,'%Y-%m-%d %H:%i:%s') between concat(#{startTime},' ',#{start}) and
|
||||
concat(#{endTime},' ',#{end})
|
||||
</if>
|
||||
<if test="_databaseId == 'Oracle'">
|
||||
timeid between to_date(#{startTime},'yyyy-mm-DD hh24:mi:ss') and to_date(#{endTime},'yyyy-mm-DD hh24:mi:ss')
|
||||
</if>
|
||||
and lineid = #{lineIndex}
|
||||
group by timeid order by timeid
|
||||
</select>
|
||||
|
||||
<select id="getSzgl" resultType="historyData">
|
||||
select TIMEID timeId,sum(case when Phasic_Type='A' then S else 0 end) aAvrValue
|
||||
,sum(case when Phasic_Type='B' then S else 0 end) bAvrValue
|
||||
,sum(case when Phasic_Type='C' then S else 0 end) cAvrValue
|
||||
,sum(case when Phasic_Type='A' then S_MAX else 0 end) aMaxValue
|
||||
,sum(case when Phasic_Type='B' then S_MAX else 0 end) bMaxValue
|
||||
,sum(case when Phasic_Type='C' then S_MAX else 0 end) cMaxValue
|
||||
,sum(case when Phasic_Type='A' then S_MIN else 0 end) aMinValue
|
||||
,sum(case when Phasic_Type='B' then S_MIN else 0 end) bMinValue
|
||||
,sum(case when Phasic_Type='C' then S_MIN else 0 end) cMinValue
|
||||
,sum(case when Phasic_Type='A' then S_CP95 else 0 end) aCP95Value
|
||||
,sum(case when Phasic_Type='B' then S_CP95 else 0 end) bCP95Value
|
||||
,sum(case when Phasic_Type='C' then S_CP95 else 0 end) cCP95Value from
|
||||
<choose>
|
||||
<when test="flagday == 1">
|
||||
data_harmpower_s
|
||||
</when>
|
||||
<otherwise>
|
||||
data_harmpower_s_take
|
||||
</otherwise>
|
||||
</choose>
|
||||
where
|
||||
<if test="_databaseId == 'MariaDB'">
|
||||
DATE_FORMAT(timeid,'%Y-%m-%d %H:%i:%s') between concat(#{startTime},' ',#{start}) and
|
||||
concat(#{endTime},' ',#{end})
|
||||
</if>
|
||||
<if test="_databaseId == 'Oracle'">
|
||||
timeid between to_date(#{startTime},'yyyy-mm-DD hh24:mi:ss') and to_date(#{endTime},'yyyy-mm-DD hh24:mi:ss')
|
||||
</if>
|
||||
and lineid = #{lineIndex}
|
||||
group by timeid order by timeid asc
|
||||
</select>
|
||||
|
||||
<select id="getSzglys" resultType="historyData">
|
||||
select TIMEID timeId,sum(case when Phasic_Type='A' then PF else 0 end) aAvrValue
|
||||
,sum(case when Phasic_Type='B' then PF else 0 end) bAvrValue
|
||||
,sum(case when Phasic_Type='C' then PF else 0 end) cAvrValue
|
||||
,sum(case when Phasic_Type='A' then PF_MAX else 0 end) aMaxValue
|
||||
,sum(case when Phasic_Type='B' then PF_MAX else 0 end) bMaxValue
|
||||
,sum(case when Phasic_Type='C' then PF_MAX else 0 end) cMaxValue
|
||||
,sum(case when Phasic_Type='A' then PF_MIN else 0 end) aMinValue
|
||||
,sum(case when Phasic_Type='B' then PF_MIN else 0 end) bMinValue
|
||||
,sum(case when Phasic_Type='C' then PF_MIN else 0 end) cMinValue
|
||||
,sum(case when Phasic_Type='A' then PF_CP95 else 0 end) aCP95Value
|
||||
,sum(case when Phasic_Type='B' then PF_CP95 else 0 end) bCP95Value
|
||||
,sum(case when Phasic_Type='C' then PF_CP95 else 0 end) cCP95Value from
|
||||
<choose>
|
||||
<when test="flagday == 1">
|
||||
data_harmpower_p
|
||||
</when>
|
||||
<otherwise>
|
||||
data_harmpower_p_take
|
||||
</otherwise>
|
||||
</choose>
|
||||
where
|
||||
<if test="_databaseId == 'MariaDB'">
|
||||
DATE_FORMAT(timeid,'%Y-%m-%d %H:%i:%s') between concat(#{startTime},' ',#{start}) and
|
||||
concat(#{endTime},' ',#{end})
|
||||
</if>
|
||||
<if test="_databaseId == 'Oracle'">
|
||||
timeid between to_date(#{startTime},'yyyy-mm-DD hh24:mi:ss') and to_date(#{endTime},'yyyy-mm-DD hh24:mi:ss')
|
||||
</if>
|
||||
and lineid = #{lineIndex}
|
||||
group by timeid order by timeid asc
|
||||
</select>
|
||||
|
||||
<select id="getZSzglys" resultType="historyData">
|
||||
select TIMEID timeId,sum(case when Phasic_Type='T' then PF else 0 end) fAvrValue
|
||||
,sum(case when Phasic_Type='T' then PF else 0 end) fAvrValue
|
||||
,sum(case when Phasic_Type='T' then PF_MAX else 0 end) fMaxValue
|
||||
,sum(case when Phasic_Type='T' then PF_MIN else 0 end) fMinValue
|
||||
,sum(case when Phasic_Type='T' then PF_CP95 else 0 end) fCP95Value from
|
||||
<choose>
|
||||
<when test="flagday == 1">
|
||||
data_harmpower_p
|
||||
</when>
|
||||
<otherwise>
|
||||
data_harmpower_p_take
|
||||
</otherwise>
|
||||
</choose>
|
||||
where
|
||||
<if test="_databaseId == 'MariaDB'">
|
||||
DATE_FORMAT(timeid,'%Y-%m-%d %H:%i:%s') between concat(#{startTime},' ',#{start}) and
|
||||
concat(#{endTime},' ',#{end})
|
||||
</if>
|
||||
<if test="_databaseId == 'Oracle'">
|
||||
timeid between to_date(#{startTime},'yyyy-mm-DD hh24:mi:ss') and to_date(#{endTime},'yyyy-mm-DD hh24:mi:ss')
|
||||
</if>
|
||||
and lineid = #{lineIndex}
|
||||
group by timeid order by timeid asc
|
||||
</select>
|
||||
|
||||
<select id="getWyglys" resultType="historyData">
|
||||
select TIMEID timeId,sum(case when Phasic_Type='A' then DF else 0 end) aAvrValue
|
||||
,sum(case when Phasic_Type='B' then DF else 0 end) bAvrValue
|
||||
,sum(case when Phasic_Type='C' then DF else 0 end) cAvrValue
|
||||
,sum(case when Phasic_Type='A' then DF_MAX else 0 end) aMaxValue
|
||||
,sum(case when Phasic_Type='B' then DF_MAX else 0 end) bMaxValue
|
||||
,sum(case when Phasic_Type='C' then DF_MAX else 0 end) cMaxValue
|
||||
,sum(case when Phasic_Type='A' then DF_MIN else 0 end) aMinValue
|
||||
,sum(case when Phasic_Type='B' then DF_MIN else 0 end) bMinValue
|
||||
,sum(case when Phasic_Type='C' then DF_MIN else 0 end) cMinValue
|
||||
,sum(case when Phasic_Type='A' then DF_CP95 else 0 end) aCP95Value
|
||||
,sum(case when Phasic_Type='B' then DF_CP95 else 0 end) bCP95Value
|
||||
,sum(case when Phasic_Type='C' then DF_CP95 else 0 end) cCP95Value from
|
||||
<choose>
|
||||
<when test="flagday == 1">
|
||||
data_harmpower_p
|
||||
</when>
|
||||
<otherwise>
|
||||
data_harmpower_p_take
|
||||
</otherwise>
|
||||
</choose>
|
||||
where
|
||||
<if test="_databaseId == 'MariaDB'">
|
||||
DATE_FORMAT(timeid,'%Y-%m-%d %H:%i:%s') between concat(#{startTime},' ',#{start}) and
|
||||
concat(#{endTime},' ',#{end})
|
||||
</if>
|
||||
<if test="_databaseId == 'Oracle'">
|
||||
timeid between to_date(#{startTime},'yyyy-mm-DD hh24:mi:ss') and to_date(#{endTime},'yyyy-mm-DD hh24:mi:ss')
|
||||
</if>
|
||||
and lineid = #{lineIndex}
|
||||
group by timeid order by timeid asc
|
||||
</select>
|
||||
|
||||
<select id="getZWyglys" resultType="historyData">
|
||||
select TIMEID timeId,sum(case when Phasic_Type='T' then DF else 0 end) fAvrValue
|
||||
,sum(case when Phasic_Type='T' then DF_MAX else 0 end) fMaxValue
|
||||
,sum(case when Phasic_Type='T' then DF_MIN else 0 end) fMinValue
|
||||
,sum(case when Phasic_Type='T' then DF_CP95 else 0 end) fCP95Value from
|
||||
<choose>
|
||||
<when test="flagday == 1">
|
||||
data_harmpower_p
|
||||
</when>
|
||||
<otherwise>
|
||||
data_harmpower_p_take
|
||||
</otherwise>
|
||||
</choose>
|
||||
where
|
||||
<if test="_databaseId == 'MariaDB'">
|
||||
DATE_FORMAT(timeid,'%Y-%m-%d %H:%i:%s') between concat(#{startTime},' ',#{start}) and
|
||||
concat(#{endTime},' ',#{end})
|
||||
</if>
|
||||
<if test="_databaseId == 'Oracle'">
|
||||
timeid between to_date(#{startTime},'yyyy-mm-DD hh24:mi:ss') and to_date(#{endTime},'yyyy-mm-DD hh24:mi:ss')
|
||||
</if>
|
||||
and lineid = #{lineIndex}
|
||||
group by timeid order by timeid asc
|
||||
</select>
|
||||
|
||||
<select id="getSzzgl" resultType="historyData">
|
||||
select TIMEID timeId
|
||||
,sum(case when Phasic_Type='T' then S else 0 end) fAvrValue
|
||||
,sum(case when Phasic_Type='T' then S_MAX else 0 end) fMaxValue
|
||||
,sum(case when Phasic_Type='T' then S_MIN else 0 end) fMinValue
|
||||
,sum(case when Phasic_Type='T' then S_CP95 else 0 end) fCP95Value from
|
||||
<choose>
|
||||
<when test="flagday == 1">
|
||||
data_harmpower_s
|
||||
</when>
|
||||
<otherwise>
|
||||
data_harmpower_s_take
|
||||
</otherwise>
|
||||
</choose>
|
||||
where
|
||||
<if test="_databaseId == 'MariaDB'">
|
||||
DATE_FORMAT(timeid,'%Y-%m-%d %H:%i:%s') between concat(#{startTime},' ',#{start}) and
|
||||
concat(#{endTime},' ',#{end})
|
||||
</if>
|
||||
<if test="_databaseId == 'Oracle'">
|
||||
timeid between to_date(#{startTime},'yyyy-mm-DD hh24:mi:ss') and to_date(#{endTime},'yyyy-mm-DD hh24:mi:ss')
|
||||
</if>
|
||||
and lineid = #{lineIndex}
|
||||
group by timeid order by timeid asc
|
||||
</select>
|
||||
|
||||
<select id="getDlzjbl" resultType="historyData">
|
||||
select TIMEID timeId,sum(case when Phasic_Type='A' then I_THD else 0 end) aAvrValue
|
||||
,sum(case when Phasic_Type='B' then I_THD else 0 end) bAvrValue
|
||||
,sum(case when Phasic_Type='C' then I_THD else 0 end) cAvrValue
|
||||
,sum(case when Phasic_Type='A' then I_THD_MAX else 0 end) aMaxValue
|
||||
,sum(case when Phasic_Type='B' then I_THD_MAX else 0 end) bMaxValue
|
||||
,sum(case when Phasic_Type='C' then I_THD_MAX else 0 end) cMaxValue
|
||||
,sum(case when Phasic_Type='A' then I_THD_MIN else 0 end) aMinValue
|
||||
,sum(case when Phasic_Type='B' then I_THD_MIN else 0 end) bMinValue
|
||||
,sum(case when Phasic_Type='C' then I_THD_MIN else 0 end) cMinValue
|
||||
,sum(case when Phasic_Type='A' then I_THD_CP95 else 0 end) aCP95Value
|
||||
,sum(case when Phasic_Type='B' then I_THD_CP95 else 0 end) bCP95Value
|
||||
,sum(case when Phasic_Type='C' then I_THD_CP95 else 0 end) cCP95Value from
|
||||
<choose>
|
||||
<when test="flagday == 1">
|
||||
data_i
|
||||
</when>
|
||||
<otherwise>
|
||||
data_i_take
|
||||
</otherwise>
|
||||
</choose>
|
||||
where
|
||||
<if test="_databaseId == 'MariaDB'">
|
||||
DATE_FORMAT(timeid,'%Y-%m-%d %H:%i:%s') between concat(#{startTime},' ',#{start}) and
|
||||
concat(#{endTime},' ',#{end})
|
||||
</if>
|
||||
<if test="_databaseId == 'Oracle'">
|
||||
timeid between to_date(#{startTime},'yyyy-mm-DD hh24:mi:ss') and to_date(#{endTime},'yyyy-mm-DD hh24:mi:ss')
|
||||
</if>
|
||||
and lineid = #{lineIndex}
|
||||
and phasic_type != 'T' group by timeid order by timeid
|
||||
</select>
|
||||
|
||||
<select id="getCssb" resultType="historyData">
|
||||
select TIMEID timeId,sum(case when Phasic_Type='A' then PLT else 0 end) aAvrValue
|
||||
,sum(case when Phasic_Type='B' then PLT else 0 end) bAvrValue
|
||||
,sum(case when Phasic_Type='C' then PLT else 0 end) cAvrValue from
|
||||
<choose>
|
||||
<when test="flagday == 1">
|
||||
data_plt
|
||||
</when>
|
||||
<otherwise>
|
||||
data_plt_take
|
||||
</otherwise>
|
||||
</choose>
|
||||
|
||||
where
|
||||
<if test="_databaseId == 'MariaDB'">
|
||||
DATE_FORMAT(timeid,'%Y-%m-%d %H:%i:%s') between concat(#{startTime},' ',#{start}) and
|
||||
concat(#{endTime},' ',#{end})
|
||||
</if>
|
||||
<if test="_databaseId == 'Oracle'">
|
||||
timeid between to_date(#{startTime},'yyyy-mm-DD hh24:mi:ss') and to_date(#{endTime},'yyyy-mm-DD hh24:mi:ss')
|
||||
</if>
|
||||
and lineid = #{lineIndex}
|
||||
and phasic_type!='T' group by timeid order by timeid
|
||||
</select>
|
||||
|
||||
<select id="getDssb" resultType="historyData">
|
||||
select TIMEID timeId,sum(case when Phasic_Type='A' then PST else 0 end) aAvrValue
|
||||
,sum(case when Phasic_Type='B' then PST else 0 end) bAvrValue
|
||||
,sum(case when Phasic_Type='C' then PST else 0 end) cAvrValue from
|
||||
<choose>
|
||||
<when test="flagday == 1">
|
||||
data_flicker
|
||||
</when>
|
||||
<otherwise>
|
||||
data_flicker_take
|
||||
</otherwise>
|
||||
</choose>
|
||||
|
||||
where
|
||||
<if test="_databaseId == 'MariaDB'">
|
||||
DATE_FORMAT(timeid,'%Y-%m-%d %H:%i:%s') between concat(#{startTime},' ',#{start}) and
|
||||
concat(#{endTime},' ',#{end})
|
||||
</if>
|
||||
<if test="_databaseId == 'Oracle'">
|
||||
timeid between to_date(#{startTime},'yyyy-mm-DD hh24:mi:ss') and to_date(#{endTime},'yyyy-mm-DD hh24:mi:ss')
|
||||
</if>
|
||||
and lineid = #{lineIndex}
|
||||
and phasic_type!='T' group by timeid order by timeid
|
||||
</select>
|
||||
|
||||
<select id="getDybd" resultType="historyData">
|
||||
select TIMEID timeId,sum(case when Phasic_Type='A' then FLUC else 0 end) aAvrValue
|
||||
,sum(case when Phasic_Type='B' then FLUC else 0 end) bAvrValue
|
||||
,sum(case when Phasic_Type='C' then FLUC else 0 end) cAvrValue from
|
||||
<choose>
|
||||
<when test="flagday == 1">
|
||||
data_fluc
|
||||
</when>
|
||||
<otherwise>
|
||||
data_fluc_take
|
||||
</otherwise>
|
||||
</choose>
|
||||
where
|
||||
<if test="_databaseId == 'MariaDB'">
|
||||
DATE_FORMAT(timeid,'%Y-%m-%d %H:%i:%s') between concat(#{startTime},' ',#{start}) and
|
||||
concat(#{endTime},' ',#{end})
|
||||
</if>
|
||||
<if test="_databaseId == 'Oracle'">
|
||||
timeid between to_date(#{startTime},'yyyy-mm-DD hh24:mi:ss') and to_date(#{endTime},'yyyy-mm-DD hh24:mi:ss')
|
||||
</if>
|
||||
and lineid = #{lineIndex}
|
||||
and phasic_type!='T' group by timeid order by timeid
|
||||
</select>
|
||||
|
||||
|
||||
<select id="getXbIXj" resultType="historyData">
|
||||
select TIMEID timeId,
|
||||
sum(case when Phasic_Type='A' then I_${number} else 0 end) aAvrValue
|
||||
,sum(case when Phasic_Type='B' then I_${number} else 0 end) bAvrValue
|
||||
,sum(case when Phasic_Type='C' then I_${number} else 0 end) cAvrValue
|
||||
,sum(case when Phasic_Type='A' then I_${number}_MAX else 0 end) aMaxValue
|
||||
,sum(case when Phasic_Type='B' then I_${number}_MAX else 0 end) bMaxValue
|
||||
,sum(case when Phasic_Type='C' then I_${number}_MAX else 0 end) cMaxValue
|
||||
,sum(case when Phasic_Type='A' then I_${number}_MIN else 0 end) aMinValue
|
||||
,sum(case when Phasic_Type='B' then I_${number}_MIN else 0 end) bMinValue
|
||||
,sum(case when Phasic_Type='C' then I_${number}_MIN else 0 end) cMinValue
|
||||
,sum(case when Phasic_Type='A' then I_${number}_CP95 else 0 end) aCP95Value
|
||||
,sum(case when Phasic_Type='B' then I_${number}_CP95 else 0 end) bCP95Value
|
||||
,sum(case when Phasic_Type='C' then I_${number}_CP95 else 0 end) cCP95Value from
|
||||
<choose>
|
||||
<when test="flagday == 1">
|
||||
Data_HarmPhasic_I
|
||||
</when>
|
||||
<otherwise>
|
||||
DATA_HARMPHASIC_I_TAKE
|
||||
</otherwise>
|
||||
</choose>
|
||||
where
|
||||
<if test="_databaseId == 'MariaDB'">
|
||||
DATE_FORMAT(timeid,'%Y-%m-%d %H:%i:%s') between concat(#{startTime},' ',#{start}) and
|
||||
concat(#{endTime},' ',#{end})
|
||||
</if>
|
||||
<if test="_databaseId == 'Oracle'">
|
||||
timeid between to_date(#{startTime},'yyyy-mm-DD hh24:mi:ss') and to_date(#{endTime},'yyyy-mm-DD hh24:mi:ss')
|
||||
</if>
|
||||
and lineid = #{lineIndex}
|
||||
group by timeid order by timeid asc
|
||||
</select>
|
||||
|
||||
|
||||
|
||||
<select id="getXbVXj" resultType="historyData">
|
||||
select TIMEID timeId,
|
||||
sum(case when Phasic_Type='A' then V_${number} else 0 end) aAvrValue
|
||||
,sum(case when Phasic_Type='B' then V_${number} else 0 end) bAvrValue
|
||||
,sum(case when Phasic_Type='C' then V_${number} else 0 end) cAvrValue
|
||||
,sum(case when Phasic_Type='A' then V_${number}_MAX else 0 end) aMaxValue
|
||||
,sum(case when Phasic_Type='B' then V_${number}_MAX else 0 end) bMaxValue
|
||||
,sum(case when Phasic_Type='C' then V_${number}_MAX else 0 end) cMaxValue
|
||||
,sum(case when Phasic_Type='A' then V_${number}_MIN else 0 end) aMinValue
|
||||
,sum(case when Phasic_Type='B' then V_${number}_MIN else 0 end) bMinValue
|
||||
,sum(case when Phasic_Type='C' then V_${number}_MIN else 0 end) cMinValue
|
||||
,sum(case when Phasic_Type='A' then V_${number}_CP95 else 0 end) aCP95Value
|
||||
,sum(case when Phasic_Type='B' then V_${number}_CP95 else 0 end) bCP95Value
|
||||
,sum(case when Phasic_Type='C' then V_${number}_CP95 else 0 end) cCP95Value from
|
||||
<choose>
|
||||
<when test="flagday == 1">
|
||||
Data_HarmPhasic_V
|
||||
</when>
|
||||
<otherwise>
|
||||
DATA_HARMPHASIC_V_TAKE
|
||||
</otherwise>
|
||||
</choose>
|
||||
where
|
||||
<if test="_databaseId == 'MariaDB'">
|
||||
DATE_FORMAT(timeid,'%Y-%m-%d %H:%i:%s') between concat(#{startTime},' ',#{start}) and
|
||||
concat(#{endTime},' ',#{end})
|
||||
</if>
|
||||
<if test="_databaseId == 'Oracle'">
|
||||
timeid between to_date(#{startTime},'yyyy-mm-DD hh24:mi:ss') and to_date(#{endTime},'yyyy-mm-DD hh24:mi:ss')
|
||||
</if>
|
||||
and lineid = #{lineIndex}
|
||||
group by timeid order by timeid asc
|
||||
</select>
|
||||
|
||||
<select id="getXbYGGl" resultType="historyData">
|
||||
select TIMEID timeId,
|
||||
sum(case when Phasic_Type='A' then P_${number} else 0 end) aAvrValue
|
||||
,sum(case when Phasic_Type='B' then P_${number} else 0 end) bAvrValue
|
||||
,sum(case when Phasic_Type='C' then P_${number} else 0 end) cAvrValue
|
||||
,sum(case when Phasic_Type='A' then P_${number}_MAX else 0 end) aMaxValue
|
||||
,sum(case when Phasic_Type='B' then P_${number}_MAX else 0 end) bMaxValue
|
||||
,sum(case when Phasic_Type='C' then P_${number}_MAX else 0 end) cMaxValue
|
||||
,sum(case when Phasic_Type='A' then P_${number}_MIN else 0 end) aMinValue
|
||||
,sum(case when Phasic_Type='B' then P_${number}_MIN else 0 end) bMinValue
|
||||
,sum(case when Phasic_Type='C' then P_${number}_MIN else 0 end) cMinValue
|
||||
,sum(case when Phasic_Type='A' then P_${number}_CP95 else 0 end) aCP95Value
|
||||
,sum(case when Phasic_Type='B' then P_${number}_CP95 else 0 end) bCP95Value
|
||||
,sum(case when Phasic_Type='C' then P_${number}_CP95 else 0 end) cCP95Value from
|
||||
<choose>
|
||||
<when test="flagday == 1">
|
||||
data_harmpower_p
|
||||
</when>
|
||||
<otherwise>
|
||||
data_harmpower_p_take
|
||||
</otherwise>
|
||||
</choose>
|
||||
where
|
||||
<if test="_databaseId == 'MariaDB'">
|
||||
DATE_FORMAT(timeid,'%Y-%m-%d %H:%i:%s') between concat(#{startTime},' ',#{start}) and
|
||||
concat(#{endTime},' ',#{end})
|
||||
</if>
|
||||
<if test="_databaseId == 'Oracle'">
|
||||
timeid between to_date(#{startTime},'yyyy-mm-DD hh24:mi:ss') and to_date(#{endTime},'yyyy-mm-DD hh24:mi:ss')
|
||||
</if>
|
||||
and lineid = #{lineIndex}
|
||||
group by timeid order by timeid asc
|
||||
</select>
|
||||
|
||||
<select id="getXbWGGl" resultType="historyData">
|
||||
select TIMEID timeId,
|
||||
sum(case when Phasic_Type='A' then Q_${number} else 0 end) aAvrValue
|
||||
,sum(case when Phasic_Type='B' then Q_${number} else 0 end) bAvrValue
|
||||
,sum(case when Phasic_Type='C' then Q_${number} else 0 end) cAvrValue
|
||||
,sum(case when Phasic_Type='A' then Q_${number}_MAX else 0 end) aMaxValue
|
||||
,sum(case when Phasic_Type='B' then Q_${number}_MAX else 0 end) bMaxValue
|
||||
,sum(case when Phasic_Type='C' then Q_${number}_MAX else 0 end) cMaxValue
|
||||
,sum(case when Phasic_Type='A' then Q_${number}_MIN else 0 end) aMinValue
|
||||
,sum(case when Phasic_Type='B' then Q_${number}_MIN else 0 end) bMinValue
|
||||
,sum(case when Phasic_Type='C' then Q_${number}_MIN else 0 end) cMinValue
|
||||
,sum(case when Phasic_Type='A' then Q_${number}_CP95 else 0 end) aCP95Value
|
||||
,sum(case when Phasic_Type='B' then Q_${number}_CP95 else 0 end) bCP95Value
|
||||
,sum(case when Phasic_Type='C' then Q_${number}_CP95 else 0 end) cCP95Value from
|
||||
<choose>
|
||||
<when test="flagday == 1">
|
||||
data_harmpower_Q
|
||||
</when>
|
||||
<otherwise>
|
||||
data_harmpower_Q_take
|
||||
</otherwise>
|
||||
</choose>
|
||||
where
|
||||
<if test="_databaseId == 'MariaDB'">
|
||||
DATE_FORMAT(timeid,'%Y-%m-%d %H:%i:%s') between concat(#{startTime},' ',#{start}) and
|
||||
concat(#{endTime},' ',#{end})
|
||||
</if>
|
||||
<if test="_databaseId == 'Oracle'">
|
||||
timeid between to_date(#{startTime},'yyyy-mm-DD hh24:mi:ss') and to_date(#{endTime},'yyyy-mm-DD hh24:mi:ss')
|
||||
</if>
|
||||
and lineid = #{lineIndex}
|
||||
group by timeid order by timeid asc
|
||||
</select>
|
||||
|
||||
<select id="getXbSZGl" resultType="historyData">
|
||||
select TIMEID timeId,
|
||||
sum(case when Phasic_Type='A' then S_${number} else 0 end) aAvrValue
|
||||
,sum(case when Phasic_Type='B' then S_${number} else 0 end) bAvrValue
|
||||
,sum(case when Phasic_Type='C' then S_${number} else 0 end) cAvrValue
|
||||
,sum(case when Phasic_Type='A' then S_${number}_MAX else 0 end) aMaxValue
|
||||
,sum(case when Phasic_Type='B' then S_${number}_MAX else 0 end) bMaxValue
|
||||
,sum(case when Phasic_Type='C' then S_${number}_MAX else 0 end) cMaxValue
|
||||
,sum(case when Phasic_Type='A' then S_${number}_MIN else 0 end) aMinValue
|
||||
,sum(case when Phasic_Type='B' then S_${number}_MIN else 0 end) bMinValue
|
||||
,sum(case when Phasic_Type='C' then S_${number}_MIN else 0 end) cMinValue
|
||||
,sum(case when Phasic_Type='A' then S_${number}_CP95 else 0 end) aCP95Value
|
||||
,sum(case when Phasic_Type='B' then S_${number}_CP95 else 0 end) bCP95Value
|
||||
,sum(case when Phasic_Type='C' then S_${number}_CP95 else 0 end) cCP95Value from
|
||||
<choose>
|
||||
<when test="flagday == 1">
|
||||
data_harmpower_s
|
||||
</when>
|
||||
<otherwise>
|
||||
data_harmpower_s_take
|
||||
</otherwise>
|
||||
</choose>
|
||||
where
|
||||
<if test="_databaseId == 'MariaDB'">
|
||||
DATE_FORMAT(timeid,'%Y-%m-%d %H:%i:%s') between concat(#{startTime},' ',#{start}) and
|
||||
concat(#{endTime},' ',#{end})
|
||||
</if>
|
||||
<if test="_databaseId == 'Oracle'">
|
||||
timeid between to_date(#{startTime},'yyyy-mm-DD hh24:mi:ss') and to_date(#{endTime},'yyyy-mm-DD hh24:mi:ss')
|
||||
</if>
|
||||
and lineid = #{lineIndex}
|
||||
group by timeid order by timeid asc
|
||||
</select>
|
||||
</mapper>
|
||||
@@ -0,0 +1,124 @@
|
||||
<?xml version='1.0' encoding='UTF-8' ?>
|
||||
<!DOCTYPE mapper
|
||||
PUBLIC '-//mybatis.org//DTD Mapper 3.0//EN'
|
||||
'http://mybatis.org/dtd/mybatis-3-mapper.dtd'>
|
||||
<mapper namespace='com.njcn.mapper.data.IntegrityMapper'>
|
||||
<select id="selectIntegralityByLineIndexAndTime" resultType="simpleValue">
|
||||
SELECT
|
||||
SUM (T1.real) countOnline,
|
||||
SUM (T1.due) countAll
|
||||
FROM
|
||||
PQS_Integrity T1
|
||||
WHERE
|
||||
T1.Line_index in
|
||||
<foreach collection="list" item="item" open="(" close=")" separator=",">
|
||||
#{item}
|
||||
</foreach>
|
||||
AND
|
||||
T1.TIMEID BETWEEN #{startTime} AND #{endTime}
|
||||
</select>
|
||||
|
||||
<select id="selectGwIntegralityByLineIndexAndTime" resultType="simpleValue">
|
||||
SELECT
|
||||
SUM (T1.real) countOnline,
|
||||
SUM (T1.due) countAll
|
||||
FROM
|
||||
PQS_NGCPINTEGRITY T1
|
||||
WHERE
|
||||
T1.Line_index in
|
||||
<foreach collection="list" item="item" open="(" close=")" separator=",">
|
||||
#{item}
|
||||
</foreach>
|
||||
AND
|
||||
T1.TIMEID BETWEEN #{startTime} AND #{endTime}
|
||||
</select>
|
||||
|
||||
<select id="selectGistIntegrality" resultType="simpleValue">
|
||||
SELECT
|
||||
t1.integrality,
|
||||
t2. NAME,
|
||||
T3.NAME devName,
|
||||
t3.ip,
|
||||
t4.name gdName,
|
||||
t5.name subName
|
||||
FROM
|
||||
(
|
||||
SELECT
|
||||
T .*, ROWNUM row_num
|
||||
FROM
|
||||
(
|
||||
SELECT
|
||||
LINE_INDEX,
|
||||
ROUND ( SUM (REAL) / SUM (DUE),4) * 100 integrality
|
||||
FROM
|
||||
PQS_INTEGRITY
|
||||
WHERE
|
||||
LINE_INDEX IN <foreach collection="list" item="item" open="(" close=")" separator=",">#{item}</foreach>
|
||||
AND TIMEID BETWEEN #{startTime} AND #{endTime}
|
||||
GROUP BY
|
||||
LINE_INDEX
|
||||
ORDER BY
|
||||
integrality ASC
|
||||
) T
|
||||
) t1
|
||||
LEFT JOIN PQ_LINE t2 ON t1.LINE_INDEX = t2.LINE_INDEX
|
||||
LEFT JOIN PQ_DEVICE t3 ON t2.dev_index = t3.dev_index
|
||||
LEFT JOIN PQ_GDINFORMATION t4 ON t2.GD_INDEX = t4.GD_INDEX
|
||||
LEFT JOIN PQ_SUBSTATION t5 ON T2.SUB_INDEX = T5.SUB_INDEX
|
||||
WHERE t1.row_num < 20
|
||||
</select>
|
||||
|
||||
<select id="selectIntegrityData" resultType="intergralityTable" >
|
||||
SELECT
|
||||
T6. NAME powerCompany,
|
||||
T7. NAME substation,
|
||||
T3. NAME device,
|
||||
T3.IP deviceIp,
|
||||
T3.UpdateTime updateTime,
|
||||
T3.dev_index devId,
|
||||
T3.Status status,
|
||||
T3.DevFlag devFlag,
|
||||
T5.DIC_NAME company,
|
||||
T8.DIC_NAME voltage,
|
||||
T2.NAME lineName,
|
||||
T2.line_index lineId,
|
||||
T1.integrity integrity,
|
||||
T9.dic_name devType
|
||||
FROM
|
||||
(
|
||||
SELECT
|
||||
T1.LINE_INDEX,
|
||||
ROUND (
|
||||
SUM (T1.REAL) / (
|
||||
SUM (T1.DUE)
|
||||
),
|
||||
4
|
||||
) * 100 integrity
|
||||
FROM
|
||||
PQS_Integrity T1
|
||||
WHERE
|
||||
T1.LINE_INDEX IN <foreach collection="list" item="item" open="(" close=")" separator=",">#{item}</foreach>
|
||||
AND t1.TIMEID BETWEEN #{startTime} AND #{endTime}
|
||||
GROUP BY
|
||||
T1.LINE_INDEX
|
||||
) T1,
|
||||
PQ_LINE T2,
|
||||
PQ_DEVICE T3,
|
||||
PQ_DEVICEDETAIL T4,
|
||||
PQS_DICDATA T5,
|
||||
PQ_GDINFORMATION T6,
|
||||
PQ_SUBSTATION T7,
|
||||
PQS_DICDATA T8,
|
||||
PQS_DICDATA T9
|
||||
WHERE
|
||||
T1.LINE_INDEX = T2.LINE_INDEX
|
||||
AND T2.DEV_INDEX = T3.DEV_INDEX
|
||||
AND T3.DEV_INDEX =T4.DEV_INDEX
|
||||
AND T4.MANUFACTURER=T5.DIC_INDEX
|
||||
AND T2.GD_INDEX=T6.GD_INDEX
|
||||
AND T2.SUB_INDEX=T7.SUB_INDEX
|
||||
AND T2.SCALE=T8.DIC_INDEX
|
||||
AND T9.DIC_INDEX = T3.DEVTYPE
|
||||
</select>
|
||||
|
||||
</mapper>
|
||||
@@ -0,0 +1,495 @@
|
||||
<?xml version='1.0' encoding='UTF-8' ?>
|
||||
<!DOCTYPE mapper
|
||||
PUBLIC '-//mybatis.org//DTD Mapper 3.0//EN'
|
||||
'http://mybatis.org/dtd/mybatis-3-mapper.dtd'>
|
||||
<mapper namespace='com.njcn.mapper.data.LimitRateMapper'>
|
||||
<resultMap type="LimitRate" id="limitRate" autoMapping="true">
|
||||
<id column="PHASIC_TYPE" property="phasicType"/>
|
||||
</resultMap>
|
||||
|
||||
<select id="getsteadyoutoflimit" resultType="ValueOfTargetanaly">
|
||||
select sum(l.alltime) alltime, sum(l.flicket_alltime) fAllTime, NVL(sum(l.freq_dev_overtime),0) rate, NVL(sum(l.voltage_dev_overtime),0) deviationVol,
|
||||
NVL(sum(l.ubalance_overtime),0) unbalanceVol, NVL(sum(l.flicker_overtime),0) flicker, NVL(sum(l.uaberrance_overtime),0) tHDU,
|
||||
NVL(sum(l.uharm_2_overtime+l.uharm_4_overtime+l.uharm_6_overtime+l.uharm_8_overtime+l.uharm_10_overtime+l.uharm_12_overtime+l.uharm_14_overtime+l.uharm_16_overtime+l.uharm_18_overtime+l.uharm_20_overtime+l.uharm_22_overtime+l.uharm_24_overtime)/12,0) evenVol,
|
||||
NVL(sum(l.uharm_3_overtime+l.uharm_5_overtime+l.uharm_7_overtime+l.uharm_9_overtime+l.uharm_11_overtime+l.uharm_13_overtime+l.uharm_15_overtime+l.uharm_17_overtime+l.uharm_19_overtime+l.uharm_21_overtime+l.uharm_23_overtime+l.uharm_25_overtime)/12,0) oddVol,
|
||||
NVL(sum(l.iharm_2_overtime+l.iharm_4_overtime+l.iharm_6_overtime+l.iharm_8_overtime+l.iharm_10_overtime+l.iharm_12_overtime+l.iharm_14_overtime+l.iharm_16_overtime+l.iharm_18_overtime+l.iharm_20_overtime+l.iharm_22_overtime+l.iharm_24_overtime)/12,0) evenele,
|
||||
NVL(sum(l.iharm_3_overtime+l.iharm_5_overtime+l.iharm_7_overtime+l.iharm_9_overtime+l.iharm_11_overtime+l.iharm_13_overtime+l.iharm_15_overtime+l.iharm_17_overtime+l.iharm_19_overtime+l.iharm_21_overtime+l.iharm_23_overtime+l.iharm_25_overtime)/12,0) oddele
|
||||
from limit_rate l
|
||||
where
|
||||
l.myindex=#{lineIndex}
|
||||
and l.timeid between #{startTime} and #{endTime}
|
||||
</select>
|
||||
|
||||
|
||||
<select id="getFrequencyDevitaion" resultType="simpleValue">
|
||||
SELECT
|
||||
SUM(ALLTIME) countAll,
|
||||
SUM(Freq_Dev_OverTime) countOnline
|
||||
FROM
|
||||
LIMIT_RATE
|
||||
WHERE
|
||||
MYINDEX IN
|
||||
<foreach collection="list" open="(" close=")" separator="," item="item">
|
||||
#{item}
|
||||
</foreach>
|
||||
AND TIMEID BETWEEN #{startTime} AND #{endTime}
|
||||
</select>
|
||||
|
||||
|
||||
<select id="getUBalane" resultType="simpleValue">
|
||||
SELECT
|
||||
SUM(ALLTIME) countAll,
|
||||
SUM(UBalance_OverTime) countOnline
|
||||
FROM
|
||||
LIMIT_RATE
|
||||
WHERE
|
||||
MYINDEX IN
|
||||
<foreach collection="list" open="(" close=")" separator="," item="item">
|
||||
#{item}
|
||||
</foreach>
|
||||
AND TIMEID BETWEEN #{startTime} AND #{endTime}
|
||||
</select>
|
||||
|
||||
<select id="getUAberrance" resultType="simpleValue">
|
||||
SELECT
|
||||
SUM(ALLTIME) countAll,
|
||||
SUM(UAberrance_OverTime) countOnline
|
||||
FROM
|
||||
LIMIT_RATE
|
||||
WHERE
|
||||
MYINDEX IN
|
||||
<foreach collection="list" open="(" close=")" separator="," item="item">
|
||||
#{item}
|
||||
</foreach>
|
||||
AND TIMEID BETWEEN #{startTime} AND #{endTime}
|
||||
</select>
|
||||
|
||||
<select id="getVoltageDeviation" resultType="simpleValue">
|
||||
SELECT
|
||||
SUM(ALLTIME) countAll,
|
||||
SUM(Voltage_Dev_OverTime) countOnline
|
||||
FROM
|
||||
LIMIT_RATE
|
||||
WHERE
|
||||
MYINDEX IN
|
||||
<foreach collection="list" open="(" close=")" separator="," item="item">
|
||||
#{item}
|
||||
</foreach>
|
||||
AND TIMEID BETWEEN #{startTime} AND #{endTime}
|
||||
</select>
|
||||
|
||||
<select id="getFlicker" resultType="simpleValue">
|
||||
SELECT
|
||||
SUM(ALLTIME) countAll,
|
||||
SUM(Flicket_AllTime) countOnline
|
||||
FROM
|
||||
LIMIT_RATE
|
||||
WHERE
|
||||
MYINDEX IN
|
||||
<foreach collection="list" open="(" close=")" separator="," item="item">
|
||||
#{item}
|
||||
</foreach>
|
||||
AND TIMEID BETWEEN #{startTime} AND #{endTime}
|
||||
</select>
|
||||
|
||||
<select id="getOddVoltage" resultType="simpleValue">
|
||||
SELECT
|
||||
SUM(ALLTIME) countAll,
|
||||
SUM(GREATEST
|
||||
(UHarm_3_OverTime,UHarm_5_OverTime,UHarm_7_OverTime,UHarm_9_OverTime,UHarm_11_OverTime,UHarm_13_OverTime,UHarm_15_OverTime,UHarm_17_OverTime,UHarm_19_OverTime,UHarm_21_OverTime,UHarm_23_OverTime,UHarm_25_OverTime))
|
||||
countOnline
|
||||
FROM
|
||||
LIMIT_RATE
|
||||
WHERE
|
||||
MYINDEX IN
|
||||
<foreach collection="list" open="(" close=")" separator="," item="item">
|
||||
#{item}
|
||||
</foreach>
|
||||
AND TIMEID BETWEEN #{startTime} AND #{endTime}
|
||||
</select>
|
||||
|
||||
<select id="getEventVoltage" resultType="simpleValue">
|
||||
SELECT
|
||||
SUM(ALLTIME) countAll,
|
||||
SUM(GREATEST
|
||||
(UHarm_2_OverTime,UHarm_4_OverTime,UHarm_6_OverTime,UHarm_8_OverTime,UHarm_10_OverTime,UHarm_12_OverTime,UHarm_14_OverTime,UHarm_16_OverTime,UHarm_18_OverTime,UHarm_20_OverTime,UHarm_22_OverTime,UHarm_24_OverTime))
|
||||
countOnline
|
||||
FROM
|
||||
LIMIT_RATE
|
||||
WHERE
|
||||
MYINDEX IN
|
||||
<foreach collection="list" open="(" close=")" separator="," item="item">
|
||||
#{item}
|
||||
</foreach>
|
||||
AND TIMEID BETWEEN #{startTime} AND #{endTime}
|
||||
</select>
|
||||
|
||||
<select id="getOddElectric" resultType="simpleValue">
|
||||
SELECT
|
||||
SUM(ALLTIME) countAll,
|
||||
SUM(GREATEST
|
||||
(IHarm_3_OverTime,IHarm_5_OverTime,IHarm_7_OverTime,IHarm_9_OverTime,IHarm_11_OverTime,IHarm_13_OverTime,IHarm_15_OverTime,IHarm_17_OverTime,IHarm_19_OverTime,IHarm_21_OverTime,IHarm_23_OverTime,IHarm_25_OverTime))
|
||||
countOnline
|
||||
FROM
|
||||
LIMIT_RATE
|
||||
WHERE
|
||||
MYINDEX IN
|
||||
<foreach collection="list" open="(" close=")" separator="," item="item">
|
||||
#{item}
|
||||
</foreach>
|
||||
AND TIMEID BETWEEN #{startTime} AND #{endTime}
|
||||
</select>
|
||||
|
||||
<select id="getEventElectric" resultType="simpleValue">
|
||||
SELECT
|
||||
SUM(ALLTIME) countAll,
|
||||
SUM(GREATEST
|
||||
(IHarm_2_OverTime,IHarm_4_OverTime,IHarm_6_OverTime,IHarm_8_OverTime,IHarm_10_OverTime,IHarm_12_OverTime,IHarm_14_OverTime,IHarm_16_OverTime,IHarm_18_OverTime,IHarm_20_OverTime,IHarm_20_OverTime,IHarm_24_OverTime))
|
||||
countOnline
|
||||
FROM
|
||||
LIMIT_RATE
|
||||
WHERE
|
||||
MYINDEX IN
|
||||
<foreach collection="list" open="(" close=")" separator="," item="item">
|
||||
#{item}
|
||||
</foreach>
|
||||
AND TIMEID BETWEEN #{startTime} AND #{endTime}
|
||||
</select>
|
||||
|
||||
<select id="getsteadData" resultType="steadyData">
|
||||
SELECT
|
||||
SUM(ALLTIME) allTime,
|
||||
SUM(Freq_Dev_OverTime) frequency,
|
||||
SUM(
|
||||
GREATEST (
|
||||
IHarm_2_OverTime,
|
||||
IHarm_4_OverTime,
|
||||
IHarm_6_OverTime,
|
||||
IHarm_8_OverTime,
|
||||
IHarm_10_OverTime,
|
||||
IHarm_12_OverTime,
|
||||
IHarm_14_OverTime,
|
||||
IHarm_16_OverTime,
|
||||
IHarm_18_OverTime,
|
||||
IHarm_20_OverTime,
|
||||
IHarm_20_OverTime,
|
||||
IHarm_24_OverTime
|
||||
)
|
||||
) evenElectric,
|
||||
SUM(
|
||||
GREATEST (
|
||||
IHarm_3_OverTime,
|
||||
IHarm_5_OverTime,
|
||||
IHarm_7_OverTime,
|
||||
IHarm_9_OverTime,
|
||||
IHarm_11_OverTime,
|
||||
IHarm_13_OverTime,
|
||||
IHarm_15_OverTime,
|
||||
IHarm_17_OverTime,
|
||||
IHarm_19_OverTime,
|
||||
IHarm_21_OverTime,
|
||||
IHarm_23_OverTime,
|
||||
IHarm_25_OverTime
|
||||
)
|
||||
) oddElectric,
|
||||
SUM(
|
||||
GREATEST (
|
||||
UHarm_2_OverTime,
|
||||
UHarm_4_OverTime,
|
||||
UHarm_6_OverTime,
|
||||
UHarm_8_OverTime,
|
||||
UHarm_10_OverTime,
|
||||
UHarm_12_OverTime,
|
||||
UHarm_14_OverTime,
|
||||
UHarm_16_OverTime,
|
||||
UHarm_18_OverTime,
|
||||
UHarm_20_OverTime,
|
||||
UHarm_22_OverTime,
|
||||
UHarm_24_OverTime
|
||||
)
|
||||
) evenVoltage,
|
||||
SUM(
|
||||
GREATEST (
|
||||
UHarm_3_OverTime,
|
||||
UHarm_5_OverTime,
|
||||
UHarm_7_OverTime,
|
||||
UHarm_9_OverTime,
|
||||
UHarm_11_OverTime,
|
||||
UHarm_13_OverTime,
|
||||
UHarm_15_OverTime,
|
||||
UHarm_17_OverTime,
|
||||
UHarm_19_OverTime,
|
||||
UHarm_21_OverTime,
|
||||
UHarm_23_OverTime,
|
||||
UHarm_25_OverTime
|
||||
)
|
||||
) oddVoltage,
|
||||
SUM(Flicket_AllTime) flicker,
|
||||
SUM(Voltage_Dev_OverTime) voltageDeviation,
|
||||
SUM(UAberrance_OverTime) uAberrance,
|
||||
SUM(UBalance_OverTime) uBalance
|
||||
FROM
|
||||
LIMIT_RATE
|
||||
WHERE
|
||||
MYINDEX IN
|
||||
<foreach collection="list" open="(" close=")" separator="," item="item">
|
||||
#{item}
|
||||
</foreach>
|
||||
AND TIMEID BETWEEN #{startTime} AND #{endTime}
|
||||
</select>
|
||||
|
||||
<select id="getSteadyDataByT" resultType="SteadyTable">
|
||||
SELECT
|
||||
T6.NAME powerCompany,
|
||||
T7.NAME substation,
|
||||
T3.NAME device,
|
||||
T3.IP deviceIp,
|
||||
T5.DIC_NAME company,
|
||||
T8.DIC_NAME voltage,
|
||||
T2.NAME lineName,
|
||||
T1.line_index,
|
||||
T1.harmElec,
|
||||
T1.harmVoltage,
|
||||
T1.voltageDeviation,
|
||||
T1.flicker,
|
||||
T1.frequency,
|
||||
T1.uBalance,
|
||||
T1.iNeg,
|
||||
T1.inUharm
|
||||
FROM
|
||||
(
|
||||
SELECT
|
||||
MYINDEX line_index,
|
||||
ROUND(
|
||||
(
|
||||
SUM( ALLTIME ) - SUM( GREATEST( IHarm_2_OverTime, IHarm_4_OverTime, IHarm_6_OverTime, IHarm_8_OverTime, IHarm_10_OverTime, IHarm_12_OverTime, IHarm_14_OverTime, IHarm_16_OverTime, IHarm_18_OverTime, IHarm_20_OverTime, IHarm_20_OverTime, IHarm_24_OverTime ,IHarm_3_OverTime, IHarm_5_OverTime, IHarm_7_OverTime, IHarm_9_OverTime, IHarm_11_OverTime, IHarm_13_OverTime, IHarm_15_OverTime, IHarm_17_OverTime, IHarm_19_OverTime, IHarm_21_OverTime, IHarm_23_OverTime, IHarm_25_OverTime ) )
|
||||
) / SUM( ALLTIME ),
|
||||
4
|
||||
) * 100 harmElec,
|
||||
ROUND(
|
||||
(
|
||||
SUM( ALLTIME ) - SUM( GREATEST( UHarm_2_OverTime, UHarm_4_OverTime, UHarm_6_OverTime, UHarm_8_OverTime, UHarm_10_OverTime, UHarm_12_OverTime, UHarm_14_OverTime, UHarm_16_OverTime, UHarm_18_OverTime, UHarm_20_OverTime, UHarm_22_OverTime, UHarm_24_OverTime,UHarm_3_OverTime, UHarm_5_OverTime, UHarm_7_OverTime, UHarm_9_OverTime, UHarm_11_OverTime, UHarm_13_OverTime, UHarm_15_OverTime, UHarm_17_OverTime, UHarm_19_OverTime, UHarm_21_OverTime, UHarm_23_OverTime, UHarm_25_OverTime ,UAberrance_OverTime) )
|
||||
) / SUM( ALLTIME ),
|
||||
4
|
||||
) * 100 harmVoltage,
|
||||
ROUND( ( SUM( ALLTIME ) - SUM( Freq_Dev_OverTime ) ) / SUM( ALLTIME ), 4 ) * 100 frequency,
|
||||
ROUND( ( SUM( ALLTIME ) - SUM( UBalance_OverTime ) ) / SUM( ALLTIME ), 4 ) * 100 uBalance,
|
||||
ROUND(
|
||||
(
|
||||
CASE
|
||||
|
||||
WHEN SUM( I_NEG_OVERTIME ) IS NULL THEN
|
||||
1 ELSE ( SUM( ALLTIME ) - SUM( I_NEG_OVERTIME ) ) / SUM( ALLTIME )
|
||||
END
|
||||
),
|
||||
4
|
||||
) * 100 iNeg,
|
||||
ROUND(
|
||||
(
|
||||
CASE
|
||||
SUM( Flicket_AllTime )
|
||||
WHEN 0 THEN
|
||||
1 ELSE ( SUM( Flicket_AllTime ) - SUM( Flicker_OverTime ) ) / SUM( Flicket_AllTime )
|
||||
END
|
||||
),
|
||||
4
|
||||
) * 100 flicker,
|
||||
ROUND( ( SUM( ALLTIME ) - SUM( Voltage_Dev_OverTime ) ) / SUM( ALLTIME ), 4 ) * 100 voltageDeviation,
|
||||
ROUND(
|
||||
(
|
||||
CASE
|
||||
|
||||
WHEN SUM(
|
||||
GREATEST(
|
||||
INUHARM_1_OVERTIME,
|
||||
INUHARM_2_OVERTIME,
|
||||
INUHARM_3_OVERTIME,
|
||||
INUHARM_4_OVERTIME,
|
||||
INUHARM_5_OVERTIME,
|
||||
INUHARM_6_OVERTIME,
|
||||
INUHARM_7_OVERTIME,
|
||||
INUHARM_8_OVERTIME,
|
||||
INUHARM_9_OVERTIME,
|
||||
INUHARM_10_OVERTIME,
|
||||
INUHARM_11_OVERTIME,
|
||||
INUHARM_12_OVERTIME,
|
||||
INUHARM_13_OVERTIME,
|
||||
INUHARM_14_OVERTIME,
|
||||
INUHARM_15_OVERTIME,
|
||||
INUHARM_16_OVERTIME
|
||||
)
|
||||
) IS NULL THEN
|
||||
1 ELSE (
|
||||
SUM( ALLTIME ) - SUM(
|
||||
GREATEST(
|
||||
INUHARM_1_OVERTIME,
|
||||
INUHARM_2_OVERTIME,
|
||||
INUHARM_3_OVERTIME,
|
||||
INUHARM_4_OVERTIME,
|
||||
INUHARM_5_OVERTIME,
|
||||
INUHARM_6_OVERTIME,
|
||||
INUHARM_7_OVERTIME,
|
||||
INUHARM_8_OVERTIME,
|
||||
INUHARM_9_OVERTIME,
|
||||
INUHARM_10_OVERTIME,
|
||||
INUHARM_11_OVERTIME,
|
||||
INUHARM_12_OVERTIME,
|
||||
INUHARM_13_OVERTIME,
|
||||
INUHARM_14_OVERTIME,
|
||||
INUHARM_15_OVERTIME,
|
||||
INUHARM_16_OVERTIME
|
||||
)
|
||||
)
|
||||
) / SUM( ALLTIME )
|
||||
END
|
||||
),
|
||||
4
|
||||
) * 100 inUharm
|
||||
FROM
|
||||
LIMIT_RATE
|
||||
WHERE
|
||||
PHASIC_TYPE = 'T'
|
||||
and timeid between #{startTime} and #{endTime}
|
||||
and myindex in
|
||||
<foreach collection="list" item="item" open="(" close=")" separator=",">
|
||||
#{item}
|
||||
</foreach>
|
||||
GROUP BY
|
||||
MYINDEX
|
||||
) T1,
|
||||
PQ_LINE T2,
|
||||
PQ_DEVICE T3,
|
||||
PQ_DEVICEDETAIL T4,
|
||||
PQS_DICDATA T5,
|
||||
PQ_GDINFORMATION T6,
|
||||
PQ_SUBSTATION T7,
|
||||
PQS_DICDATA T8
|
||||
WHERE
|
||||
T1.LINE_INDEX = T2.LINE_INDEX
|
||||
AND T2.DEV_INDEX = T3.DEV_INDEX
|
||||
AND T3.DEV_INDEX = T4.DEV_INDEX
|
||||
AND T4.MANUFACTURER = T5.DIC_INDEX
|
||||
AND T2.GD_INDEX = T6.GD_INDEX
|
||||
AND T2.SUB_INDEX = T7.SUB_INDEX
|
||||
AND T2. SCALE = T8.DIC_INDEX
|
||||
</select>
|
||||
|
||||
|
||||
<select id="getsteadDataByT" resultType="SteadyData">
|
||||
SELECT
|
||||
SUM( ALLTIME ) ALLTIME,
|
||||
SUM( FREQ_DEV_OVERTIME ) FREQUENCY,
|
||||
SUM( UBALANCE_OVERTIME ) UBALANCE,
|
||||
DECODE( SUM( I_NEG_OVERTIME ), NULL, 0, SUM( I_NEG_OVERTIME ) ) iNeg,
|
||||
SUM( GREATEST( IHARM_2_OVERTIME, IHARM_4_OVERTIME, IHARM_6_OVERTIME, IHARM_8_OVERTIME, IHARM_10_OVERTIME, IHARM_12_OVERTIME, IHARM_14_OVERTIME, IHARM_16_OVERTIME, IHARM_18_OVERTIME, IHARM_20_OVERTIME, IHARM_20_OVERTIME, IHARM_24_OVERTIME,IHARM_3_OVERTIME, IHARM_5_OVERTIME, IHARM_7_OVERTIME, IHARM_9_OVERTIME, IHARM_11_OVERTIME, IHARM_13_OVERTIME, IHARM_15_OVERTIME, IHARM_17_OVERTIME, IHARM_19_OVERTIME, IHARM_21_OVERTIME, IHARM_23_OVERTIME, IHARM_25_OVERTIME ) ) harmElec,
|
||||
SUM( GREATEST( UHARM_2_OVERTIME, UHARM_4_OVERTIME, UHARM_6_OVERTIME, UHARM_8_OVERTIME, UHARM_10_OVERTIME, UHARM_12_OVERTIME, UHARM_14_OVERTIME, UHARM_16_OVERTIME, UHARM_18_OVERTIME, UHARM_20_OVERTIME, UHARM_22_OVERTIME, UHARM_24_OVERTIME,UHARM_3_OVERTIME, UHARM_5_OVERTIME, UHARM_7_OVERTIME, UHARM_9_OVERTIME, UHARM_11_OVERTIME, UHARM_13_OVERTIME, UHARM_15_OVERTIME, UHARM_17_OVERTIME, UHARM_19_OVERTIME, UHARM_21_OVERTIME, UHARM_23_OVERTIME, UHARM_25_OVERTIME,UABERRANCE_OVERTIME ) ) harmVoltage,
|
||||
SUM( FLICKER_OVERTIME ) FLICKER,
|
||||
SUM( FLICKET_ALLTIME ) ALLFLICKER,
|
||||
SUM( VOLTAGE_DEV_OVERTIME ) VOLTAGEDEVIATION,
|
||||
DECODE(
|
||||
SUM(
|
||||
GREATEST(
|
||||
INUHARM_1_OVERTIME,
|
||||
INUHARM_2_OVERTIME,
|
||||
INUHARM_3_OVERTIME,
|
||||
INUHARM_4_OVERTIME,
|
||||
INUHARM_5_OVERTIME,
|
||||
INUHARM_6_OVERTIME,
|
||||
INUHARM_7_OVERTIME,
|
||||
INUHARM_8_OVERTIME,
|
||||
INUHARM_9_OVERTIME,
|
||||
INUHARM_10_OVERTIME,
|
||||
INUHARM_11_OVERTIME,
|
||||
INUHARM_12_OVERTIME,
|
||||
INUHARM_13_OVERTIME,
|
||||
INUHARM_14_OVERTIME,
|
||||
INUHARM_15_OVERTIME,
|
||||
INUHARM_16_OVERTIME
|
||||
)
|
||||
),
|
||||
NULL,
|
||||
0,
|
||||
SUM(
|
||||
GREATEST(
|
||||
INUHARM_1_OVERTIME,
|
||||
INUHARM_2_OVERTIME,
|
||||
INUHARM_3_OVERTIME,
|
||||
INUHARM_4_OVERTIME,
|
||||
INUHARM_5_OVERTIME,
|
||||
INUHARM_6_OVERTIME,
|
||||
INUHARM_7_OVERTIME,
|
||||
INUHARM_8_OVERTIME,
|
||||
INUHARM_9_OVERTIME,
|
||||
INUHARM_10_OVERTIME,
|
||||
INUHARM_11_OVERTIME,
|
||||
INUHARM_12_OVERTIME,
|
||||
INUHARM_13_OVERTIME,
|
||||
INUHARM_14_OVERTIME,
|
||||
INUHARM_15_OVERTIME,
|
||||
INUHARM_16_OVERTIME
|
||||
)
|
||||
)
|
||||
) inUharm
|
||||
FROM
|
||||
LIMIT_RATE
|
||||
WHERE
|
||||
PHASIC_TYPE = 'T'
|
||||
AND
|
||||
MYINDEX IN
|
||||
<foreach collection="list" open="(" close=")" separator="," item="item">
|
||||
#{item}
|
||||
</foreach>
|
||||
AND TIMEID BETWEEN #{startTime} AND #{endTime}
|
||||
</select>
|
||||
|
||||
<select id="getHarmonicRate" resultType="HarmonicRateInfo">
|
||||
select nvl(t.harmonicRate, -1) harmonicRate,
|
||||
t.line_index,
|
||||
b.name pointName,
|
||||
c.name bdName,
|
||||
d.name gdName,
|
||||
e.dic_name voltage,
|
||||
f.ip ip
|
||||
from (select nvl(m.harmonicRate, -1) harmonicRate, n.line_index line_index
|
||||
from (select a.lineid lineid,
|
||||
nvl(max(a.v_thd_cp95), -1) harmonicRate
|
||||
from day_v a
|
||||
where a.lineid in
|
||||
<foreach collection="list" open="(" close=")" separator="," item="item">
|
||||
#{item}
|
||||
</foreach>
|
||||
and a.timeid BETWEEN #{start} AND #{end}
|
||||
group by a.lineid
|
||||
order by harmonicRate desc) m
|
||||
right join pq_line n
|
||||
on m.lineid = n.line_index where n.line_index in
|
||||
<foreach collection="list" open="(" close=")" separator="," item="item">
|
||||
#{item}
|
||||
</foreach>
|
||||
) t,
|
||||
pq_line b,
|
||||
pq_substation c,
|
||||
pq_gdinformation d,
|
||||
pqs_dicdata e,
|
||||
pq_device f
|
||||
where t.line_index = b.line_index
|
||||
and b.sub_index = c.sub_index
|
||||
and b.gd_index = d.gd_index
|
||||
and b.scale = e.dic_index
|
||||
and b.dev_index = f.dev_index
|
||||
</select>
|
||||
|
||||
<select id="queryData" resultType="limitRate">
|
||||
SELECT
|
||||
*
|
||||
FROM
|
||||
limit_rate T1
|
||||
WHERE
|
||||
T1.TIMEID BETWEEN to_date(#{startTime}, 'yyyy-MM-dd Hh24:mi::ss')
|
||||
AND to_date(#{endTime}, 'yyyy-MM-dd Hh24:mi::ss')
|
||||
AND T1.MYINDEX = #{lineIndex}
|
||||
</select>
|
||||
|
||||
|
||||
|
||||
</mapper>
|
||||
@@ -0,0 +1,19 @@
|
||||
<?xml version='1.0' encoding='UTF-8' ?>
|
||||
<!DOCTYPE mapper
|
||||
PUBLIC '-//mybatis.org//DTD Mapper 3.0//EN'
|
||||
'http://mybatis.org/dtd/mybatis-3-mapper.dtd'>
|
||||
<mapper namespace='com.njcn.mapper.data.OfflLogMapper'>
|
||||
<select id="getYearByGd" resultType="String">
|
||||
select distinct a.year
|
||||
from offl_log a, pq_line b
|
||||
where a.year is not null and a.line_index = b.line_index
|
||||
and b.line_index in
|
||||
<foreach collection="list" index="index" item="item" open="(" separator="," close=") order by year asc">
|
||||
#{item}
|
||||
</foreach>
|
||||
</select>
|
||||
|
||||
<select id="getSETimeByIndex" resultType="offlLog">
|
||||
select start_time startTime,end_time endTime,year from offl_log where line_index = #{lineIndex} order by startTime asc
|
||||
</select>
|
||||
</mapper>
|
||||
Reference in New Issue
Block a user