Lius
2024-03-14 1292cf73f7db223f35ab450eabeeedbf8802eb5a
lxzn-module-mdc/src/main/java/org/jeecg/modules/mdc/mapper/xml/MdcEquipmentMapper.xml
@@ -248,11 +248,6 @@
        order by t1.sort_no
    </select>
    <select id="getWorkLineLast" resultType="org.jeecg.modules.mdc.dto.MdcEquipmentDto">
        select top 1 spindlespeed, actualspindlespeed from [${tableName}] order by CollectTime  desc
    </select>
    <select id="exportXlsList" resultType="org.jeecg.modules.mdc.entity.MdcEquipment">
        SELECT
            t1.*
@@ -271,7 +266,7 @@
                AND t1.equipment_name = #{mdcEquipment.equipmentModel}
            </if>
            <if test="mdcEquipment.equipmentType != null and mdcEquipment.equipmentType != '' ">
                AND t1.equipmentType = #{mdcEquipment.equipmentType}
                AND t1.equipment_type = #{mdcEquipment.equipmentType}
            </if>
            <if test="mdcEquipment.driveType != null and mdcEquipment.driveType != '' ">
                AND t1.drive_type = #{mdcEquipment.driveType}
@@ -286,4 +281,25 @@
        order by t1.sort_no
    </select>
    <!--查询单表数据-->
    <select id="findWorkLineLast" resultType="org.jeecg.modules.mdc.dto.MdcEquipmentDto">
        select top 1 spindlespeed, actualspindlespeed from [${tableName}] order by CollectTime  desc
    </select>
    <!--查询设备最新一条数据-->
    <select id="getEquipmentStatusList" resultType="org.jeecg.modules.mdc.entity.EquipmentLog">
        SELECT
            t1.*
        FROM
            EquipmentLog t1
            INNER JOIN ( SELECT MAX ( CollectTime ) AS CollectTime, EquipmentID FROM EquipmentLog GROUP BY EquipmentID ) t2 ON t1.CollectTime= t2.CollectTime
            AND t1.EquipmentID= t2.EquipmentID
        <if test="equipmentIdList != null and equipmentIdList.size() > 0">
            AND t1.EquipmentID IN
            <foreach collection="equipmentIdList" index="index" item="id" open="(" separator="," close=")">
                #{id}
            </foreach>
        </if>
    </select>
</mapper>