李林
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
<?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.plan.mapper.MpsStructureComponentMapper">
 
    <resultMap id="planMpsStructureComponentMap" type="com.chinaztt.mes.plan.dto.MpsStructureComponentDTO">
        <id property="id" column="id"/>
        <result property="mpsId" column="mps_id"/>
        <result property="partId" column="part_id"/>
        <result property="qpa" column="qpa"/>
        <result property="operationId" column="operation_id"/>
        <result property="parentId" column="parent_id"/>
        <result property="label" column="part_name"/>
        <result property="partNo" column="part_no"/>
        <result property="unit" column="unit"/>
        <result property="drawingNumber" column="drawing_number"/>
    </resultMap>
 
    <update id="updateActiveById">
        update plan_mps_structure_component set active = true
        where id = #{id}
    </update>
 
    <select id="selectDtoListByMpsId" resultMap="planMpsStructureComponentMap">
        select pmsc.*,
            bp.part_name,
            bp.part_no,
            bp.unit,
            bp.drawing_number
        from plan_mps_structure_component pmsc
        left join basic_part bp on bp."id"=pmsc.part_id
        where pmsc.mps_id=#{id} and pmsc.active=true
    </select>
</mapper>