gongchunyi
4 小时以前 eaf6548902e9472fc9b876d531db8508e16c4f2f
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.ruoyi.production.mapper.ProductionOrderStructureMapper">
 
    <!-- 通用查询映射结果 -->
    <resultMap id="BaseResultMap" type="com.ruoyi.production.pojo.ProductionOrderStructure">
        <id column="id" property="id"/>
        <result column="order_id" property="orderId"/>
        <result column="parent_id" property="parentId"/>
        <result column="product_model_id" property="productModelId"/>
        <result column="process_id" property="processId"/>
        <result column="unit_quantity" property="unitQuantity"/>
        <result column="demanded_quantity" property="demandedQuantity"/>
        <result column="unit" property="unit"/>
        <result column="tenant_id" property="tenantId"/>
        <result column="bom_id" property="bomId"/>
    </resultMap>
 
    <select id="listByOrderId" resultType="com.ruoyi.production.dto.ProductionOrderStructureDto"
            parameterType="java.lang.Long">
 
        SELECT s.*,
               pp.name        AS process_name,
               pm.product_name AS product_name,
               sku.model       AS model
        FROM production_order_structure s
                 LEFT JOIN product_process pp ON pp.id = s.process_id
                 LEFT JOIN product_material_sku sku ON sku.id = s.product_model_id
                 LEFT JOIN product_material pm ON pm.id = sku.product_id
        WHERE s.order_id = #{orderId}
 
    </select>
 
 
</mapper>