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
<?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.CalibrationOrderDetailMapper">
 
    <delete id="deleteByMainId" parameterType="java.lang.String">
        DELETE
        FROM mom_eam_calibration_order_detail
        WHERE calibration_order_id = #{mainId}    </delete>
 
    <select id="selectByMainId" parameterType="java.lang.String"
            resultType="org.jeecg.modules.eam.entity.CalibrationOrderDetail">
        SELECT *
        FROM mom_eam_calibration_order_detail
        WHERE calibration_order_id = #{mainId}    </select>
 
 
    <select id="getCalibrationOrderDetailList"  parameterType="Map" resultType="Map">
        SELECT
            t1.id,
            t3.num,
            t3.name,
            t4.name as unitName,
            t2.upper_limit as upperLimit,
            t2.lower_limit as lowerLimit,
            t2.actual_value as actualValue,
            t1.judgment_result AS judgmentResult,
            t1.calibration_item_result as calibrationItemResult
        FROM
            mom_eam_calibration_order_detail t1
        LEFT JOIN mom_eam_equipment_precision_parameters t2 ON t1.equipment_precision_parameters_id = t2.id
        LEFT JOIN mom_eam_precision_parameters t3 ON t1.precision_parameters_id = t3.id
        LEFT JOIN mom_base_unit t4 ON t3.unit_id = t4.id
        WHERE t1.del_flag = 0 and t2.del_flag = 0 and t3.del_flag = 0
        <if test="params.calibrationOrderId != null and params.calibrationOrderId != ''">
            and t1.calibration_order_id = #{params.calibrationOrderId}
        </if>
        ORDER BY t1.create_time desc
    </select>
</mapper>