lxw
2022-08-27 59ca15b2010e0797a4e0e884d58eccb694df26d0
根据产品id和版本查询子件及其关联的物料信息
1个文件已修改
12 ■■■■■ 已修改文件
src/main/resources/mapper/ProductBomMapper.xml 12 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/resources/mapper/ProductBomMapper.xml
@@ -139,17 +139,21 @@
        </collection>
    </resultMap>
    <select id="getBomAndMaterial" resultMap="MaterialList" parameterType="java.lang.Integer">
        select distinct tb_product_bom.*,tb_product.parent_code,tb_product.custom_code  from  db_doc.tb_product_bom,db_doc.tb_product
        <where>
        select distinct tb_product_bom.*
                      ,tb_product.parent_code,tb_product.custom_code
                      ,tb_Material.dwg_url,tb_Material.file_url,tb_Material.picture_url
        from  db_doc.tb_product_bom,db_doc.tb_product,tb_Material
        where
            tb_product_bom.product_id = tb_product.id
            and
            tb_product_bom.version = tb_product.version
            and
            tb_Material.sub_code = tb_product_bom.sub_code
            and
            tb_product.id = #{productId}
            and
            tb_product.version = #{version}
        </where>
        order by id asc
        order by tb_product_bom.id asc
    </select>
    <select id="selectMaterial"  resultType="com.whyc.pojo.Material">
        select DISTINCT tb_Material.*  FROM db_doc.tb_Material,db_doc.tb_material_product_history