<?xml version="1.0" encoding="UTF-8"?>
|
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
<mapper namespace="org.jeecg.modules.eam.mapper.PredictiveWorkPlanSparePartMapper">
|
|
<select id="pagePredictiveWorkPlanSparePart" parameterType="Map" resultType="Map">
|
SELECT
|
t1.*,
|
t1.actual_life actualLife,
|
t1.create_by createBy,
|
t1.life_warning lifeWarning,
|
t1.rated_life ratedLife,
|
t1.work_plan_id workPlanId,
|
t1.supporting_quantity supportingQuantity,
|
t1.spare_part_id sparePartId,
|
t2.num sparePartNum,
|
t2.name sparePartName,
|
t2.model sparePartModel,
|
t2.specification sparePartSpecification,
|
t3.name mainUnitName,
|
t2.constructor_id constructorId,
|
t4.name constructorName
|
FROM mom_eam_predictive_work_plan_spare_part t1
|
LEFT JOIN mom_eam_spare_part t2 ON t1.spare_part_id = t2.id
|
LEFT JOIN mom_base_unit t3 ON t2.main_unit_id = t3.id
|
LEFT JOIN mom_base_constructor t4 ON t4.id = t2.constructor_id
|
WHERE t1.del_flag = 0 and t2.del_flag = 0
|
<if test="params.planId != null and params.planId != ''">
|
and t1.work_plan_id = #{params.planId}
|
</if>
|
ORDER BY t1.create_time desc
|
</select>
|
|
<select id="listPredictiveWorkPlanSparePart" resultType="org.jeecg.modules.eam.entity.PredictiveWorkPlanSparePart">
|
SELECT
|
t1.id,
|
t1.spare_part_id sparePartId,
|
t1.supporting_quantity supportingQuantity,
|
t1.rated_life ratedLife,
|
t1.life_warning lifeWarning,
|
t1.actual_life actualLife,
|
t1.work_plan_id workPlanId,
|
t2.equipment_id equipmentId,
|
t3.num mdcEquipmentId
|
FROM
|
mom_eam_predictive_work_plan_spare_part t1
|
LEFT JOIN mom_eam_predictive_work_plan t2 ON t1.work_plan_id = t2.id
|
LEFT JOIN mom_eam_equipment t3 ON t3.id = t2.equipment_id
|
WHERE
|
t1.del_flag = 0 and t1.work_plan_id = #{predictiveWorkPlanId}
|
</select>
|
|
<select id="listMaintenanceOrderActualMaterial"
|
resultType="org.jeecg.modules.eam.entity.MaintenanceOrderActualMaterial">
|
SELECT
|
t1.id,
|
t1.create_time createTime
|
FROM
|
mom_eam_maintenance_order_actual_material t1
|
WHERE
|
t1.equipment_id = #{equipmentId}
|
AND t1.spare_part_id = #{sparePartId}
|
AND t1.del_flag = 0
|
ORDER BY
|
t1.create_time DESC
|
</select>
|
|
<select id="listMdcEquipmentRunningSectionVo" resultType="org.jeecg.modules.eam.model.MdcEquipmentRunningSectionVo">
|
select t1.equipment_id equipmentId,
|
t1.duration,
|
t1.start_time startTime,
|
t1.start_long startLong,
|
t1.end_time endTime,
|
t1.end_long endLong
|
-- 状态,0:关机,1:开机,2:待机,3:工作,22:报警
|
from mdc_equipment_running_section t1 where t1.status IN (1,2,3,22) t1.equipment_id = #{mdcEquipmentId} order by start_time desc
|
</select>
|
|
|
</mapper>
|