cuijian
2023-08-19 bdd0875d4b13a3f1ef472f64d4b6a95e0ef64b22
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
<?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.ProjectMaintenanceOrderDetailMapper">
 
    <delete id="deleteByMainId" parameterType="java.lang.String">
        DELETE 
        FROM  mom_eam_project_maintenance_order_detail
        WHERE
            project_maintenance_order_id = #{mainId}
    </delete>
    
    <select id="selectByMainId" parameterType="java.lang.String" resultType="org.jeecg.modules.eam.entity.ProjectMaintenanceOrderDetail">
        SELECT * 
        FROM  mom_eam_project_maintenance_order_detail
        WHERE
            project_maintenance_order_id = #{mainId}
    </select>
 
    <select id="queryProjectMaintenanceOrderDetail" parameterType="java.lang.String" resultType="org.jeecg.modules.eam.entity.ProjectMaintenanceOrderDetail">
        SELECT
        t1.id,
        t1.project_maintenance_order_id projectMaintenanceOrderId,
        t1.task_num taskNum,
        t1.equipment_id equipmentId,
        t1.asset_number assetNumber,
        t1.equipment_status equipmentStatus,
        t1.technology_status technologyStatus,
        t1.supplier_id supplierId,
        t1.maintenance_mode maintenanceMode,
        t1.urgency urgency ,
        t1.item_name itemName,
        t1.team_id teamId,
        t1.user_id userId,
        t1.plan_start_time planStartTime,
        t1.plan_end_time planEndTime,
        t1.actual_start_time actualStartTime,
        t1.actual_end_time actualEndTime ,
        t1.type_status typeStatus,
        t1.create_by ,
        t1.create_time ,
        t1.update_by ,
        t1.update_time,
        t3.item_text typeStatusName,
        t4.item_text urgencyName,
        t5.item_text maintenanceModeName,
        t6.name teamName,
        t7.realname userName,
        t8.num equipmentNum,
        t8.name equipmentName,
        t8.model equipmentModel,
        t9.depart_name departName
        FROM  mom_eam_project_maintenance_order_detail t1
        left join mom_eam_project_maintenance_order t2 on t1.project_maintenance_order_id = t2.id
        left join (select * from v_sys_dict where dict_code = 'type_status') t3 on t1.type_status = t3.item_value
        left join (select * from v_sys_dict where dict_code = 'urgency') t4 on t1.urgency = t4.item_value
        left join (select * from v_sys_dict where dict_code = 'maintenance_method') t5 on t1.maintenance_mode = t5.item_value
        left join mom_base_team t6 on t1.team_id = t6.id
        left join sys_user t7 on t1.user_id  = t7.id
        left join mom_eam_equipment t8 on t1.equipment_id = t8.id
        left join sys_depart t9 on t1.supplier_id  = t9.id
        where t2.audit_status='Approved' and t1.is_create_order=0
    </select>
</mapper>