lxw
2022-08-27 07df6454911374ab6ffa3f619451f219669c479e
历史版本下载
1个文件已修改
32 ■■■■■ 已修改文件
src/main/resources/mapper/ProductBomHistoryMapper.xml 32 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/resources/mapper/ProductBomHistoryMapper.xml
@@ -29,24 +29,34 @@
        <result property="createDate" column="create_date"></result>
        <result property="version" column="version"></result>
        <result property="dwgUrl" column="dwg_url"></result>
        <collection property="materials" javaType="java.util.ArrayList" ofType="com.whyc.pojo.Material" column="{productId=product_id,subCode=sub_code,version=version}" select="selectMaterial">
        <collection property="materials" javaType="java.util.ArrayList" ofType="com.whyc.pojo.Material" column="{parentCode=parent_code,customCode=custom_code,subCode=sub_code,version=version}" select="selectMaterial">
        </collection>
    </resultMap>
    <select id="getBomHistoryAndMaterial" resultMap="BomHistoryList">
        select distinct *  from  db_doc.tb_product_bom_history
        <where>
            product_id = #{productId}
            and
            version = #{version}
        </where>
        order by id asc
        select distinct tb_product_bom_history.*
        ,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_history,db_doc.tb_product,tb_Material
        where
        tb_product_bom_history.product_id = tb_product.id
        and
        tb_product_bom_history.version = tb_product.version
        and
        tb_Material.sub_code = tb_product_bom_history.sub_code
        and
        tb_product.id = #{productId}
        and
        tb_product.version = #{version}
        order by tb_product_bom_history.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
        where tb_Material.id=tb_material_product_history.material_id
        and tb_material_product_history.product_id=#{productId}
        and tb_material_product_history.sub_code=#{subCode}
        and tb_material_product_history.version=#{version}
          and tb_material_product_history.parent_code=#{parentCode}
          and tb_material_product_history.custom_code=#{customCode}
          and tb_material_product_history.sub_code=#{subCode}
          and tb_material_product_history.s_version&lt;=#{version}
          and tb_material_product_history.e_version>=#{version}
    </select>