<?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.MoStructureComponentMapper">
|
|
<resultMap id="moStructureComponentMap" type="com.chinaztt.mes.plan.dto.MoStructureComponentDTO">
|
<id property="id" column="id"/>
|
<result property="planManufacturingOrderId" column="plan_manufacturing_order_id"/>
|
<result property="partId" column="part_id"/>
|
<result property="qpa" column="qpa"/>
|
<result property="routingOperationId" column="routing_operation_id"/>
|
<result property="remark" column="remark"/>
|
<result property="partNo" column="part_no"/>
|
<result property="partName" column="part_name"/>
|
<result property="operationNo" column="operation_no"/>
|
<result property="operationName" column="operation_name"/>
|
<result property="parent" column="parent"/>
|
<result property="discNum" column="disc_num"/>
|
<result property="unit" column="unit"/>
|
<result property="planningMethod" column="planning_method"/>
|
<result property="materialType" column="material_type"/>
|
<result property="operationId" column="operation_id"/>
|
</resultMap>
|
|
<select id="selectListByManufacturingOrderId" resultMap="moStructureComponentMap">
|
SELECT pmsc.*,
|
bp.part_name,
|
bp.part_no,
|
bp.unit,
|
teo.operation_no,
|
teo."name" operation_name
|
FROM plan_mo_structure_component pmsc
|
LEFT JOIN basic_part bp ON bp."id" = pmsc.part_id
|
LEFT JOIN technology_routing_operation tro ON tro."id" = pmsc.routing_operation_id
|
LEFT JOIN technology_operation teo ON teo."id" = pmsc.operation_id
|
WHERE pmsc.plan_manufacturing_order_id = #{id}
|
</select>
|
|
|
<select id="selectBomComponents" resultMap="moStructureComponentMap">
|
SELECT A.part_id,
|
A.qpa,
|
b.part_no,
|
b.part_name,
|
A.parent
|
FROM
|
technology_bom_component A,
|
basic_part b
|
WHERE
|
A.bom_id = #{bomId}
|
AND A.part_id = b.ID
|
</select>
|
|
<select id="selectMoComponents" resultMap="moStructureComponentMap">
|
SELECT
|
a.*,
|
b.part_no,
|
b.part_name,
|
b.planning_method,
|
b.material_type
|
FROM
|
plan_mo_structure_component A
|
LEFT JOIN basic_part b ON A.part_id = b."id"
|
WHERE
|
A.plan_manufacturing_order_id = #{moId}
|
</select>
|
|
|
<select id="selectQpaByManufacturingOrderIdAndPartId" resultMap="moStructureComponentMap">
|
SELECT qpa,disc_num,parent
|
FROM plan_mo_structure_component
|
WHERE plan_manufacturing_order_id = #{id}
|
AND part_id = #{partId}
|
</select>
|
</mapper>
|