liyong
5 小时以前 1ca5584d7e3200a9af65a099bd26d3593e2ba702
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
<?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.technology.mapper.TechnologyBomStructureMapper">
 
    <!-- 通用查询映射结果 -->
    <resultMap id="BaseResultMap" type="com.ruoyi.technology.pojo.TechnologyBomStructure">
        <id column="id" property="id" />
        <result column="parent_id" property="parentId" />
        <result column="product_model_id" property="productModelId" />
        <result column="operation_id" property="operationId" />
        <result column="unit_quantity" property="unitQuantity" />
        <result column="demanded_quantity" property="demandedQuantity" />
        <result column="unit" property="unit" />
        <result column="bom_id" property="bomId" />
        <result column="create_user" property="createUser" />
        <result column="dept_id" property="deptId" />
    </resultMap>
 
    <select id="listByBomId" resultType="com.ruoyi.technology.bean.vo.TechnologyBomStructureVo">
        select tbs.*,
               p.product_name as productName,
               pm.product_id as productId,
               pm.model,
               top1.name as operationName
        from technology_bom_structure tbs
        left join product_model pm on tbs.product_model_id = pm.id
        left join product p on pm.product_id = p.id
        left join technology_operation top1 on tbs.operation_id = top1.id
        where tbs.bom_id = #{bomId}
        order by tbs.id
    </select>
</mapper>