Lius
2025-01-14 f69452a6d1afcb710880b6ad172663316e3b3610
lxzn-module-mdc/src/main/java/org/jeecg/modules/mdc/mapper/xml/MdcEquipmentRunningSectionMapper.xml
@@ -38,6 +38,7 @@
            mdc_equipment_running_section
        WHERE
            equipment_id = #{ equipmentId }
            AND status <![CDATA[ <> ]]> '22'
            AND  (start_long &lt;= #{ endLong } AND end_long &gt;= #{ startLong })
        ORDER BY
            start_time
@@ -86,6 +87,7 @@
            </if>
            AND (start_time &lt;= #{ vo.endDate } AND end_time &gt;= #{ vo.startDate })
            AND status = '22'
            AND alarm != ''
        </where>
        ORDER BY
            start_time
@@ -100,7 +102,7 @@
        <where>
            AND status = '22'
            AND alarm = #{ alarmCode }
            AND (start_time &lt;= #{ vo.endDate } AND end_time &gt;= #{ vo.startDate })
            AND (start_time &lt;= #{ endDate } AND end_time &gt;= #{ startDate })
            AND equipment_id = #{ equipmentId }
        </where>
    </select>
@@ -114,7 +116,7 @@
        <where>
            AND status = '22'
            AND alarm = #{ vo.alarmCode }
            AND (start_time &lt;= #{ vo.endDate } AND end_time &gt;= #{ vo.startDate })
            AND (start_time &lt;= #{ endDate } AND end_time &gt;= #{ startDate })
            <if test="vo.equipmentIdList != null and vo.equipmentIdList.size() > 0 ">
                AND equipment_id IN
                <foreach collection="vo.equipmentIdList" item="id" index="index" open="(" close=")" separator=",">
@@ -124,5 +126,53 @@
        </where>
    </select>
    <!--查询时间段内运行数据-->
    <select id="selectRunningData" resultType="org.jeecg.modules.mdc.entity.MdcEquipmentRunningSection">
        SELECT
            *
        FROM
            mdc_equipment_running_section
        WHERE
            equipment_id = #{ equipmentId }
          AND status = '3'
          AND  (start_time &lt;= #{ endDate } AND end_time &gt;= #{ startDate })
        ORDER BY
            start_time
    </select>
    <!--查询报警号报警详细信息-->
    <select id="selectAlarmList" resultType="org.jeecg.modules.mdc.dto.MdcAlarmListDto">
        SELECT
            t1.equipment_id,
            t2.equipment_name,
            t1.start_time,
            t1.end_time,
            t1.duration
        FROM
            mdc_equipment_running_section t1 LEFT JOIN mdc_equipment t2 ON t1.equipment_id = t2.equipment_id
        <where>
            AND t1.status = '22'
            AND t1.alarm = #{ vo.alarmCode }
            AND (t1.start_time &lt;= #{ endDate } AND t1.end_time &gt;= #{ startDate })
            <if test="vo.equipmentIdList != null and vo.equipmentIdList.size() > 0 ">
                AND t1.equipment_id IN
                <foreach collection="vo.equipmentIdList" item="id" index="index" open="(" close=")" separator=",">
                    #{ id }
                </foreach>
            </if>
        </where>
    </select>
    <select id="getDataList" resultType="java.lang.Integer">
        SELECT
            status
        FROM
            mdc_equipment_running_section
        WHERE
            equipment_id = #{ equipmentId }
          AND start_time &gt; #{date}
          AND status IS NOT NULL
    </select>
</mapper>