yangkang
2023-09-12 a6d8cfbf89fae62167c99dab7ffddaeb6f2b7de5
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
<?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.start_time startTime,
            t1.start_long startLong
--             状态,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>