gongchunyi
5 小时以前 bc116c55a44bc344e5575b5bdd4c2591bc0475aa
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
<?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.ProductStructureMapper">
 
    <resultMap id="basicMap" type="com.ruoyi.production.pojo.ProductStructure">
        <id property="id" column="id"/>
        <result property="productModelId" column="product_model_id"/>
        <result property="processId" column="process_id"/>
        <result property="unitQuantity" column="unit_quantity"/>
        <result property="demandedQuantity" column="demanded_quantity"/>
        <result property="unit" column="unit"/>
        <result property="tenantId" column="tenant_id"/>
    </resultMap>
 
    <select id="listByBomId" resultType="com.ruoyi.production.dto.ProductStructureDto">
        SELECT ps.id,
               ps.parent_id,
               ps.bom_id,
               ps.unit_quantity,
               ps.process_id,
               pp.name AS process_name
        FROM product_structure ps
                 LEFT JOIN product_process pp ON ps.process_id = pp.id
        WHERE ps.bom_id = #{bomId}
        ORDER BY ps.id
    </select>
 
    <select id="listByBomAndProcess" resultType="com.ruoyi.production.dto.ProductStructureDto">
        select ps.*,
               pp.name as process_name
        from product_structure ps
                 left join product_process pp on ps.process_id = pp.id
        where ps.bom_id = #{bomId}
          and ps.process_id = #{processId}
        order by ps.id
    </select>
</mapper>