|
@@ -140,6 +140,7 @@
|
|
|
WHERE category1 = #{category1} and lastupdatetime >= #{lastupdatetime}
|
|
|
order by lastupdatetime desc
|
|
|
</select>
|
|
|
+
|
|
|
<select id="getLatest" parameterType="java.util.Map" resultType="com.gyee.wisdom.riskcalc.entity.AlarmSnapInfo">
|
|
|
SELECT
|
|
|
s.id as id,
|
|
@@ -147,20 +148,28 @@
|
|
|
s.stationid as stationId,
|
|
|
s.alertvalue as alertValue,
|
|
|
s.stationname as stationName,
|
|
|
- s.windturbineid as windturbineId,
|
|
|
+ s.windturbineid as windturbineId,
|
|
|
+ s.category1 as alarmType,
|
|
|
s.isopened as isOpened,
|
|
|
s.lastupdatetime as lastUpdateTime,
|
|
|
s.rank as rank,
|
|
|
r.id as ruleId
|
|
|
from
|
|
|
alarmsnap s
|
|
|
- left join alertrule2 r on s.alertvalue = r.ednavalue
|
|
|
+ <if test="ruleType !=null and ruleType !=''">
|
|
|
+ <if test="ruleType=='custom'">
|
|
|
+ left join alertrule2 r on s.alertvalue = r.ednavalue
|
|
|
+ </if>
|
|
|
+ <if test="ruleType=='windturbine'">
|
|
|
+ left join warning2 r on s.alertvalue = r.ednavalue
|
|
|
+ </if>
|
|
|
+ </if>
|
|
|
where
|
|
|
1=1
|
|
|
<if test="ruleType!= null">
|
|
|
and s.category1 =#{ruleType}
|
|
|
</if>
|
|
|
- <if test="category1 !=null and category1 !=''">
|
|
|
+ <if test="ruleIdList !=null and ruleIdList.size>0">
|
|
|
and r.id in
|
|
|
<foreach item="item" index="index" collection="ruleIdList" open="(" separator="," close=")">
|
|
|
#{item}
|