|
@@ -84,6 +84,44 @@
|
|
|
order by s.tag_time desc
|
|
|
</select>
|
|
|
|
|
|
+ <select id="getMaxTagTime" parameterType="org.jeecg.modules.history.dto.InterlockHistoryQueryDTO" resultType="java.util.Date">
|
|
|
+ select max(s.tag_time) as max_tag_time
|
|
|
+ from interlock_detail_history d left join interlock_summary_history s on d.summaryid = s.id
|
|
|
+ <where>
|
|
|
+ <if test="interlockSystemId != null and interlockSystemId != ''"> and s.interlock_system_id = #{interlockSystemId}</if>
|
|
|
+ <if test="interlockApparatusId != null and interlockApparatusId != ''"> and s.interlock_apparatus_id = #{interlockApparatusId}</if>
|
|
|
+
|
|
|
+ <if test="interlockname != null and interlockname != ''"> and d.interlockname like concat('%', #{interlockname}, '%')</if>
|
|
|
+ <if test="interlockCondition != null and interlockCondition != ''"> and d.interlock_condition = #{interlockCondition}</if>
|
|
|
+ <if test="interlockConditionTag != null and interlockConditionTag != ''"> and d.interlock_condition_tag like concat('%',#{interlockConditionTag},'%')</if>
|
|
|
+ <if test="instrumentStatus != null and instrumentStatus != ''"> and d.instrument_status = #{instrumentStatus}</if>
|
|
|
+ <if test="controlSystemStatus != null and controlSystemStatus != ''"> and d.control_system_status = #{controlSystemStatus}</if>
|
|
|
+ <if test="interlockStatus != null and interlockStatus != ''"> and s.interlock_status = #{interlockStatus}</if>
|
|
|
+ <if test="loopHealthLevel != null and loopHealthLevel != ''"> and s.loop_health_level = #{loopHealthLevel}</if>
|
|
|
+ <if test="beginTime != null"> and s.tag_time > #{beginTime} </if>
|
|
|
+ <if test="endTime != null"> and s.tag_time < #{endTime} </if>
|
|
|
+ </where>
|
|
|
+ </select>
|
|
|
+
|
|
|
+ <select id="getMinTagTime" parameterType="org.jeecg.modules.history.dto.InterlockHistoryQueryDTO" resultType="java.util.Date">
|
|
|
+ select min(s.tag_time) as min_tag_time
|
|
|
+ from interlock_detail_history d left join interlock_summary_history s on d.summaryid = s.id
|
|
|
+ <where>
|
|
|
+ <if test="interlockSystemId != null and interlockSystemId != ''"> and s.interlock_system_id = #{interlockSystemId}</if>
|
|
|
+ <if test="interlockApparatusId != null and interlockApparatusId != ''"> and s.interlock_apparatus_id = #{interlockApparatusId}</if>
|
|
|
+
|
|
|
+ <if test="interlockname != null and interlockname != ''"> and d.interlockname like concat('%', #{interlockname}, '%')</if>
|
|
|
+ <if test="interlockCondition != null and interlockCondition != ''"> and d.interlock_condition = #{interlockCondition}</if>
|
|
|
+ <if test="interlockConditionTag != null and interlockConditionTag != ''"> and d.interlock_condition_tag like concat('%',#{interlockConditionTag},'%')</if>
|
|
|
+ <if test="instrumentStatus != null and instrumentStatus != ''"> and d.instrument_status = #{instrumentStatus}</if>
|
|
|
+ <if test="controlSystemStatus != null and controlSystemStatus != ''"> and d.control_system_status = #{controlSystemStatus}</if>
|
|
|
+ <if test="interlockStatus != null and interlockStatus != ''"> and s.interlock_status = #{interlockStatus}</if>
|
|
|
+ <if test="loopHealthLevel != null and loopHealthLevel != ''"> and s.loop_health_level = #{loopHealthLevel}</if>
|
|
|
+ <if test="beginTime != null"> and s.tag_time > #{beginTime} </if>
|
|
|
+ <if test="endTime != null"> and s.tag_time < #{endTime} </if>
|
|
|
+ </where>
|
|
|
+ </select>
|
|
|
+
|
|
|
<!-- 日统计 仪表状态(根据联锁id查询对应时间下的联锁条件) -->
|
|
|
<select id="getYbStatusListBySummaryIdAndTagTime" resultType="org.jeecg.modules.history.entity.InterlockDetailHistory">
|
|
|
select * from interlock_detail_history where summaryid = #{id} and tag_time like TO_CHAR(#{yesterday}::timestamp, 'YYYY-MM-DD') || '%'
|