Quellcode durchsuchen

fix 联锁查询、详情查询

LLL vor 4 Monaten
Ursprung
Commit
6cf7db2ab2

+ 53 - 18
jeecg-module-interlock/src/main/java/org/jeecg/modules/detail/mapper/xml/InterlockDetailMapper.xml

@@ -5,38 +5,47 @@
     <!-- 联锁详细信息表分页列表查询-->
     <select id="getPage2" parameterType="org.jeecg.modules.detail.dto.InterlockDetailQueryDTO" resultType="org.jeecg.modules.detail.vo.InterlockDetailQueryVO">
         select d.id, d.summaryid, d.interlockname, d.interlock_condition, d.interlock_condition_tag, d.description,
-               d.instrument_status, d.interlock_set_value, d.bypass, d.input_status, d.output_status,
-               d.mp_status, s.ljgx, s.interlock_out_value,
-               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
+        d.instrument_status, d.interlock_set_value, d.bypass, d.input_status, d.output_status,
+        d.mp_status, s.ljgx, s.interlock_out_value,
+        d.mp_status_name, d.input_status_name, d.output_status_name, d.bypass_name
         from interlock_detail d
         left join interlock_summary 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
         <where>
             <if test="dto.summaryid != null and dto.summaryid != ''"> and d.summaryid = #{dto.summaryid}</if>
             <if test="dto.interlockConditionTag != null and dto.interlockConditionTag != ''"> and d.interlock_condition_tag like concat('%',#{dto.interlockConditionTag},'%')</if>
         </where>
         order by d.create_time desc
     </select>
+<!--    <select id="getPage2" parameterType="org.jeecg.modules.detail.dto.InterlockDetailQueryDTO" resultType="org.jeecg.modules.detail.vo.InterlockDetailQueryVO">-->
+<!--        select d.id, d.summaryid, d.interlockname, d.interlock_condition, d.interlock_condition_tag, d.description,-->
+<!--               d.instrument_status, d.interlock_set_value, d.bypass, d.input_status, d.output_status,-->
+<!--               d.mp_status, s.ljgx, s.interlock_out_value,-->
+<!--               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-->
+<!--        from interlock_detail d-->
+<!--        left join interlock_summary 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-->
+<!--        <where>-->
+<!--            <if test="dto.summaryid != null and dto.summaryid != ''"> and d.summaryid = #{dto.summaryid}</if>-->
+<!--            <if test="dto.interlockConditionTag != null and dto.interlockConditionTag != ''"> and d.interlock_condition_tag like concat('%',#{dto.interlockConditionTag},'%')</if>-->
+<!--        </where>-->
+<!--        order by d.create_time desc-->
+<!--    </select>-->
 
     <!-- 联锁总表-分页列表查询(各种逻辑状态)-->
     <select id="getPage" parameterType="org.jeecg.modules.summary.vo.InterlockSummaryVO" resultType="org.jeecg.modules.summary.vo.InterlockSummaryVO">
         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.interlock_apparatus_id, s.interlock_system_id,
-        h1.interlock_status_name , h2.bypass_name ,
-        h3.instrument_status_name , h4.control_system_status_name,
+        s.interlock_status, s.loop_health_level, d.bypass, s.interlock_apparatus_id, s.interlock_system_id,
+        s.interlock_status_name , d.bypass_name ,
+        d.instrument_status_name , d.control_system_status_name,
         h.instrument_status_normal, h.bypass_yes, h.interlock_status_ty, h.control_system_status_normal
         from interlock_detail d
-            left join interlock_summary 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_summary s on d.summaryid = s.id
         left join interlock_base h on h.id = s.interlock_system_id
         <where>
             <if test="interlockSummaryVO.interlockApparatusId != null and interlockSummaryVO.interlockApparatusId != ''"> and s.interlock_apparatus_id = #{interlockSummaryVO.interlockApparatusId}</if>
@@ -51,6 +60,32 @@
         </where>
         order by s.create_time desc
     </select>
+<!--    <select id="getPage" parameterType="org.jeecg.modules.summary.vo.InterlockSummaryVO" resultType="org.jeecg.modules.summary.vo.InterlockSummaryVO">-->
+<!--        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.interlock_apparatus_id, s.interlock_system_id,-->
+<!--        h1.interlock_status_name , h2.bypass_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 d-->
+<!--            left join interlock_summary 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="interlockSummaryVO.interlockApparatusId != null and interlockSummaryVO.interlockApparatusId != ''"> and s.interlock_apparatus_id = #{interlockSummaryVO.interlockApparatusId}</if>-->
+<!--            <if test="interlockSummaryVO.interlockSystemId != null and interlockSummaryVO.interlockSystemId != ''"> and s.interlock_system_id = #{interlockSummaryVO.interlockSystemId}</if>-->
+<!--            <if test="interlockSummaryVO.interlockname != null and interlockSummaryVO.interlockname != ''"> and d.interlockname like concat('%', #{interlockSummaryVO.interlockname}, '%')</if>-->
+<!--            <if test="interlockSummaryVO.interlockConditionTag != null and interlockSummaryVO.interlockConditionTag != ''"> and d.interlock_condition_tag like concat('%', #{interlockSummaryVO.interlockConditionTag}, '%')</if>-->
+<!--            <if test="interlockSummaryVO.instrumentStatus != null and interlockSummaryVO.instrumentStatus != ''"> and d.instrument_status = #{interlockSummaryVO.instrumentStatus}</if>-->
+<!--            <if test="interlockSummaryVO.controlSystemStatus != null and interlockSummaryVO.controlSystemStatus != ''"> and d.control_system_status = #{interlockSummaryVO.controlSystemStatus}</if>-->
+<!--            <if test="interlockSummaryVO.interlockStatus != null and interlockSummaryVO.interlockStatus != ''"> and s.interlock_status = #{interlockSummaryVO.interlockStatus}</if>-->
+<!--            <if test="interlockSummaryVO.loopHealthLevel != null and interlockSummaryVO.loopHealthLevel != ''"> and s.loop_health_level = #{interlockSummaryVO.loopHealthLevel}</if>-->
+<!--            <if test="interlockSummaryVO.bypass != null and interlockSummaryVO.bypass != ''"> and d.bypass = #{interlockSummaryVO.bypass}</if>-->
+<!--        </where>-->
+<!--        order by s.create_time desc-->
+<!--    </select>-->
 
     <select id="getPageBefore" parameterType="org.jeecg.modules.summary.vo.InterlockSummaryVO" resultType="org.jeecg.modules.summary.vo.InterlockSummaryVO">
         select d.id, d.summaryid, d.interlockname, d.interlock_condition, d.interlock_condition_tag, d.instrument_status, d.control_system_status,