|
@@ -10,13 +10,15 @@
|
|
|
h1.control_system_status_name as mp_status_name,
|
|
|
h2.control_system_status_name as input_status_name,
|
|
|
h3.control_system_status_name as output_status_name,
|
|
|
- h4.bypass_name
|
|
|
+ h4.bypass_name,
|
|
|
+ h.instrument_status_normal, h.bypass_yes, h.interlock_status_ty, h.control_system_status_normal
|
|
|
from interlock_detail_history d
|
|
|
left join interlock_summary_history s on d.summaryid = s.id
|
|
|
left join interlock_base_hy h1 on h1.control_system_status = d.mp_status and h1.interlock_system_id = s.interlock_system_id
|
|
|
left join interlock_base_hy h2 on h2.control_system_status = d.input_status and h2.interlock_system_id = s.interlock_system_id
|
|
|
left join interlock_base_hy h3 on h3.control_system_status = d.output_status and h3.interlock_system_id = s.interlock_system_id
|
|
|
left join interlock_base_hy h4 on h4.bypass = d.bypass and h4.interlock_system_id = s.interlock_system_id
|
|
|
+ left join interlock_base h on h.id = s.interlock_system_id
|
|
|
<where>
|
|
|
<if test="dto.summaryid != null and dto.summaryid != ''"> and d.summaryid = #{dto.summaryid}</if>
|
|
|
<if test="dto.summaryOriginId != null and dto.summaryOriginId != ''"> and d.summary_origin_id = #{dto.summaryOriginId}</if>
|
|
@@ -30,13 +32,15 @@
|
|
|
select d.id, d.summaryid, d.interlockname, d.interlock_condition, d.interlock_condition_tag, d.instrument_status, d.control_system_status,
|
|
|
s.interlock_status, s.loop_health_level, d.bypass, s.tag_time, d.summary_origin_id, s.interlock_apparatus_id, s.interlock_system_id,
|
|
|
h1.interlock_status_name, h2.bypass_name,
|
|
|
- h3.instrument_status_name, h4.control_system_status_name
|
|
|
+ h3.instrument_status_name, h4.control_system_status_name,
|
|
|
+ h.instrument_status_normal, h.bypass_yes, h.interlock_status_ty, h.control_system_status_normal
|
|
|
from interlock_detail_history d
|
|
|
left join interlock_summary_history s on d.summaryid = s.id
|
|
|
left join interlock_base_hy h1 on h1.interlock_status = s.interlock_status and h1.interlock_system_id = s.interlock_system_id
|
|
|
left join interlock_base_hy h2 on h2.bypass = d.bypass and h2.interlock_system_id = s.interlock_system_id
|
|
|
left join interlock_base_hy h3 on h3.instrument_status = d.instrument_status and h3.interlock_system_id = s.interlock_system_id
|
|
|
left join interlock_base_hy h4 on h4.control_system_status = d.control_system_status and h4.interlock_system_id = s.interlock_system_id
|
|
|
+ left join interlock_base h on h.id = s.interlock_system_id
|
|
|
<where>
|
|
|
<if test="dto.interlockSystemId != null and dto.interlockSystemId != ''"> and s.interlock_system_id = #{dto.interlockSystemId}</if>
|
|
|
<if test="dto.interlockApparatusId != null and dto.interlockApparatusId != ''"> and s.interlock_apparatus_id = #{dto.interlockApparatusId}</if>
|