| | |
| | | MAX ( l.Oporation ) Oporation, |
| | | k.id, |
| | | k.equipment_status, |
| | | k.equipment_status_remark, |
| | | k.equipment_type equipmentType, |
| | | k.equipment_type_pictures |
| | | FROM |
| | |
| | | MAX ( m.CollectTime ) CollectTime, |
| | | id, |
| | | equipment_status, |
| | | equipment_status_remark, |
| | | equipment_type, |
| | | equipment_type_pictures |
| | | FROM |
| | | ( SELECT equipment_id EquipmentID, equipment_Name equipmentName, id, equipment_type, equipment_status, equipment_status_remark FROM mdc_equipment WHERE equipment_id IN |
| | | ( SELECT equipment_id EquipmentID, equipment_Name equipmentName, id, equipment_type, equipment_status FROM mdc_equipment WHERE equipment_id IN |
| | | <foreach collection="equipmentIds" index="index" item="id" open="(" separator="," close=")"> |
| | | #{id} |
| | | </foreach> |
| | |
| | | id, |
| | | equipment_type, |
| | | equipment_status, |
| | | equipment_status_remark, |
| | | equipment_type_pictures |
| | | ) k |
| | | LEFT JOIN ( SELECT EquipmentID, CollectTime, Oporation FROM EquipmentLog WHERE Oporation <![CDATA[ <> ]]> 23 ) l ON k.CollectTime= l.CollectTime |
| | |
| | | k.equipmentName, |
| | | k.id, |
| | | k.equipment_status, |
| | | k.equipment_status_remark, |
| | | k.equipment_type, |
| | | k.equipment_type_pictures |
| | | ORDER BY |
| | |
| | | <if test="mdcEquipment.driveType != null and mdcEquipment.driveType != '' "> |
| | | AND t1.drive_type = #{mdcEquipment.driveType} |
| | | </if> |
| | | <if test="mdcEquipment.productionName != null and mdcEquipment.productionName != '' "> |
| | | AND t3.production_name LIKE CONCAT(CONCAT('%',#{mdcEquipment.productionName}),'%') |
| | | <if test="mdcEquipment.productionIds != null and mdcEquipment.productionIds.size() > 0 "> |
| | | AND t3.id IN |
| | | <foreach collection="mdcEquipment.productionIds" index="index" item="id" open="(" separator="," close=")"> |
| | | #{id} |
| | | </foreach> |
| | | </if> |
| | | </where> |
| | | order by t1.sort_no |
| | | </select> |
| | | |
| | | <select id="exportXlsList" resultType="org.jeecg.modules.mdc.entity.MdcEquipment"> |
| | | SELECT |
| | | t1.* |
| | | FROM |
| | | mdc_equipment t1 |
| | | LEFT JOIN mdc_production_equipment t2 ON t1.id = t2.equipment_id |
| | | LEFT JOIN mdc_production t3 ON t2.production_id = t3.id |
| | | <where> |
| | | <if test="mdcEquipment.equipmentId != null and mdcEquipment.equipmentId != '' "> |
| | | AND t1.equipment_id LIKE CONCAT(CONCAT('%',#{mdcEquipment.equipmentId}),'%') |
| | | </if> |
| | | <if test="mdcEquipment.equipmentName != null and mdcEquipment.equipmentName != '' "> |
| | | AND t1.equipment_name LIKE CONCAT(CONCAT('%',#{mdcEquipment.equipmentName}),'%') |
| | | </if> |
| | | <if test="mdcEquipment.equipmentModel != null and mdcEquipment.equipmentModel != '' "> |
| | | AND t1.equipment_name = #{mdcEquipment.equipmentModel} |
| | | </if> |
| | | <if test="mdcEquipment.equipmentType != null and mdcEquipment.equipmentType != '' "> |
| | | AND t1.equipment_type = #{mdcEquipment.equipmentType} |
| | | </if> |
| | | <if test="mdcEquipment.driveType != null and mdcEquipment.driveType != '' "> |
| | | AND t1.drive_type = #{mdcEquipment.driveType} |
| | | </if> |
| | | <if test="mdcEquipment.productionIds != null and mdcEquipment.productionIds.size() > 0 "> |
| | | AND t3.id IN |
| | | <foreach collection="mdcEquipment.productionIds" index="index" item="id" open="(" separator="," close=")"> |
| | | #{id} |
| | | </foreach> |
| | | </if> |
| | | </where> |
| | | 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> |