李林
2023-10-07 658d4927d468c47208fd012d9128b09249c07eff
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="com.chinaztt.mes.production.mapper.ExaminerMapper">
 
    <resultMap id="baseResultMap" type="com.chinaztt.mes.production.entity.Examiner">
        <id property="id" column="id"/>
        <result property="partNo" column="part_no"/>
        <result property="examiner" column="examiner"/>
        <result property="examinerAfter" column="examiner_after"/>
        <result property="partNoAfter" column="part_no_after"/>
        <result property="updateTime" column="update_time"/>
        <result property="updateUser" column="update_user"/>
        <result property="createTime" column="create_time"/>
        <result property="createUser" column="create_user"/>
    </resultMap>
 
 
    <resultMap id="examinerMap" type="com.chinaztt.mes.production.dto.ExaminerDTO">
        <id property="id" column="id"/>
        <result property="partId" column="part_id"/>
        <result property="partNo" column="part_no"/>
        <result property="partName" column="part_name"/>
        <result property="examiner" column="examiner"/>
        <result property="examinerAfter" column="examiner_after"/>
        <result property="partNoAfter" column="part_no_after"/>
        <result property="updateTime" column="update_time"/>
        <result property="updateUser" column="update_user"/>
        <result property="createTime" column="create_time"/>
        <result property="createUser" column="create_user"/>
        <result property="partIdAfter" column="part_id_after"/>
        <result property="partNameAfter" column="part_name_after"/>
    </resultMap>
 
 
    <select id="getChangeExaminer" resultType="com.chinaztt.mes.production.dto.ExaminerDTO">
        select pe.*,bp.specs,bp.part_model,bp.part_name as partName from production_examiner pe
        left join basic_part bp on pe.part_no_after = bp.part_no
        where pe.examiner_after = #{examinerAfter}
        and pe.part_no = #{partNo}
        limit 1
    </select>
 
 
    <select id="getPage" resultMap="examinerMap">
        select temp.* from(
        select pe.*,bp.id part_id,bp.part_name,bp2.id part_id_after,bp2.part_name part_name_after from production_examiner pe
        left join basic_part bp on pe.part_no = bp.part_no
        left join basic_part bp2 on pe.part_no_after = bp2.part_no
        ) temp
        <if test="ew.emptyOfWhere == false">
            ${ew.customSqlSegment}
        </if>
    </select>
</mapper>