| | |
| | | <mapper namespace="com.whyc.mapper.ProductBomHistoryMapper" > |
| | | |
| | | <resultMap id="Map_ProductBomHistory" type="productBomHistory"> |
| | | <id property="id" column="id"></id> |
| | | <result property="type" column="type"></result> |
| | | <result property="category" column="category"></result> |
| | | <result property="subCode" column="sub_code"></result> |
| | | <result property="subName" column="sub_name"></result> |
| | | <result property="subModel" column="sub_model"></result> |
| | | <result property="unit" column="unit"></result> |
| | | <result property="quantity" column="quantity"></result> |
| | | <result property="producer" column="producer"></result> |
| | | <result property="material" column="material"></result> |
| | | <result property="thickness" column="thickness"></result> |
| | | <result property="surfaceDetail" column="surface_detail"></result> |
| | | <result property="notes" column="notes"></result> |
| | | <result property="pictureUrl" column="picture_url"></result> |
| | | <result property="fileUrl" column="file_url"></result> |
| | | <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="{parentCode=parent_code,customCode=custom_code,subCode=sub_code,version=version}" select="selectMaterial"> |
| | | </collection> |
| | | <result property="productId" column="product_id" /> |
| | | <result property="materialId" column="material_id" /> |
| | | <result property="quantity" column="quantity"/> |
| | | <association property="materialObj" javaType="com.whyc.pojo.Material"> |
| | | <id property="id" column="id" /> |
| | | <result property="type" column="type" /> |
| | | <result property="category" column="category"/> |
| | | <result property="subCode" column="sub_code"/> |
| | | <result property="subName" column="sub_name"/> |
| | | <result property="subModel" column="sub_model"/> |
| | | <result property="unit" column="unit"/> |
| | | <result property="producer" column="producer"/> |
| | | <result property="material" column="material"/> |
| | | <result property="thickness" column="thickness"/> |
| | | <result property="surfaceDetail" column="surface_detail"/> |
| | | <result property="notes" column="notes"/> |
| | | <result property="pictureUrl" column="picture_url"/> |
| | | <result property="fileUrl" column="file_url"/> |
| | | <result property="dwgUrl" column="dwg_url"/> |
| | | <result property="createDate" column="create_date"/> |
| | | </association> |
| | | </resultMap> |
| | | |
| | | <update id="updateVersionBatch"> |
| | |
| | | and tb_product_history.id=#{productId} |
| | | </select> |
| | | <select id="getBomListByProductIdAndSubVersion" resultMap="Map_ProductBomHistory"> |
| | | SELECT * FROM db_doc.tb_product_bom_history h,db_doc.tb_material m |
| | | SELECT h.product_id,h.material_id,h.quantity,m.* |
| | | FROM db_doc.tb_product_bom_history h,db_doc.tb_material m |
| | | where product_id = #{productId} |
| | | and sub_s_version <= #{subVersion} |
| | | and sub_e_version >= #{subVersion} |