zenglf
2023-08-18 499d6294b4b7881c5797a59a183c5fc0105599dd
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
<?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.SpecialtyInspectionPlanDetailMapper">
 
    <select id="getSpecialtyInspectionPlanDetailList"  parameterType="Map" resultType="Map">
        SELECT
            t1.id,
            t1.specialty_inspection_standard_id as specialtyInspectionStandardId,
            t2.num,
            t2.version,
            t3.id AS equipmentId,
            t3.num AS equipmentNum,
            t3.NAME AS equipmentName,
            t3.model AS equipmentModel
        FROM
            mom_eam_specialty_inspection_plan_detail t1
        LEFT JOIN mom_eam_specialty_inspection_standard t2 ON t1.specialty_inspection_standard_id = t2.id
        LEFT JOIN mom_eam_equipment t3 ON t1.equipment_id = t3.id
        WHERE t1.del_flag = 0  AND t2.del_flag = 0 AND t3.del_flag = 0
        <if test="specialtyInspectionPlanId != null and specialtyInspectionPlanId != ''">
            and t1.specialty_inspection_plan_id = #{specialtyInspectionPlanId}
        </if>
        ORDER BY t1.create_time desc
    </select>
 
    <select id="getSpecialtyInspectionPlanDetailById"  parameterType="Map" resultType="Map">
        SELECT
            t1.id,
            t1.specialty_inspection_standard_id as specialtyInspectionStandardId,
            t2.num,
            t2.version,
            t3.id AS equipmentId,
            t3.num AS equipmentNum,
            t3.NAME AS equipmentName,
            t3.model AS equipmentModel
        FROM
            mom_eam_specialty_inspection_plan_detail t1
        LEFT JOIN mom_eam_specialty_inspection_standard t2 ON t1.specialty_inspection_standard_id = t2.id
        LEFT JOIN mom_eam_equipment t3 ON t1.equipment_id = t3.id
        WHERE t1.del_flag = 0  AND t2.del_flag = 0 AND t3.del_flag = 0
        <if test="params.specialtyInspectionPlanId != null and params.specialtyInspectionPlanId != ''">
            and t1.specialty_inspection_plan_id = #{params.specialtyInspectionPlanId}
        </if>
        ORDER BY t1.create_time desc
    </select>
</mapper>