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
47
48
49
50
51
52
53
54
55
56
<?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.SpecialtyInspectionStandardDetailMapper">
 
    <select id="getInspectionStandardDetailList"  parameterType="Map" resultType="Map">
        SELECT
        t1.id,
        t1.location,
        t1.photo,
        t2.id AS inspectionProjectId,
        t2.name,
        t2.detection_standard as detectionStandard,
        t2.acceptability_limit as acceptabilityLimit,
        t2.inspection_method AS inspectionMethod,
        t4.item_text as inspectionMethodName,
        t2.inspection_tool AS inspectionTool,
        t3.id AS inspectionCycleId,
        t3.name as inspectionCycleName
        FROM
            mom_eam_specialty_inspection_standard_detail t1
        LEFT JOIN mom_eam_inspection_project t2 ON t1.inspection_project_id = t2.id
        LEFT JOIN mom_eam_inspection_cycle t3 ON t1.inspection_cycle_id = t3.id
        LEFT JOIN ( SELECT * FROM v_sys_dict WHERE dict_code = 'inspection_method' ) t4 ON t4.item_value = t2.inspection_method
        WHERE t1.del_flag = 0
        <if test="inspectionStandardId != null and inspectionStandardId != ''">
            and t1.specialty_inspection_standard_id = #{inspectionStandardId}
        </if>
        ORDER BY t1.create_time desc
    </select>
 
    <select id="getInspectionStandardDetailById"  parameterType="Map" resultType="Map">
        SELECT
            t1.id,
            t1.location,
            t1.photo,
            t2.id AS inspectionProjectId,
            t2.name,
            t2.detection_standard as detectionStandard,
            t2.acceptability_limit as acceptabilityLimit,
            t2.inspection_method AS inspectionMethod,
            t4.item_text as inspectionMethodName,
            t2.inspection_tool AS inspectionTool,
            t3.id AS inspectionCycleId,
            concat( t3.CODE, '/', t3.NAME ) as inspectionCycleName
        FROM
            mom_eam_specialty_inspection_standard_detail t1
        LEFT JOIN mom_eam_inspection_project t2 ON t1.inspection_project_id = t2.id
        LEFT JOIN mom_eam_inspection_cycle t3 ON t1.inspection_cycle_id = t3.id
        LEFT JOIN ( SELECT * FROM v_sys_dict WHERE dict_code = 'inspection_method' ) t4 ON t4.item_value = t2.inspection_method
        WHERE t1.del_flag = 0
        <if test="params.specialtyInspectionStandardId != null and params.specialtyInspectionStandardId != ''">
            and t1.specialty_inspection_standard_id = #{params.specialtyInspectionStandardId}
        </if>
        ORDER BY t1.create_time desc
    </select>
</mapper>