| | |
| | | <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="createDate" column="create_date"></result> |
| | | <result property="updateDate" column="update_date"></result> |
| | | <result property="dwgUrl" column="dwg_url"></result> |
| | | <collection property="mproductHistorys" javaType="java.util.ArrayList" ofType="com.whyc.pojo.MaterialProductHistory" column="{subCode=sub_code}" select="selectMaterialProductHistory"> |
| | | <collection property="mproductHistorys" javaType="java.util.ArrayList" ofType="com.whyc.pojo.MaterialProductHistory" column="{id=id}" select="selectMaterialProductHistory"> |
| | | </collection> |
| | | <collection property="products" javaType="java.util.ArrayList" ofType="com.whyc.pojo.Product" column="{subCode=sub_code}" select="selectMaterialInProduct"> |
| | | <collection property="products" javaType="java.util.ArrayList" ofType="com.whyc.pojo.Product" column="{id=id}" select="selectMaterialInProduct"> |
| | | </collection> |
| | | </resultMap> |
| | | <update id="updateDwgUrl"> |
| | |
| | | where tb_product.version>=tb_material_product_history.s_version and tb_product.version<=tb_material_product_history.e_version |
| | | and tb_product.parent_code=tb_material_product_history.parent_code |
| | | and tb_product.custom_code=tb_material_product_history.custom_code |
| | | and tb_material_product_history.sub_code=#{subCode} |
| | | and tb_material_product_history.material_id=#{id} |
| | | </select> |
| | | <resultMap id="productIds" type="product"> |
| | | <id property="id" column="id"></id> |
| | |
| | | <result property="createTime" column="create_time"></result> |
| | | <result property="version" column="version"></result> |
| | | <collection property="materialIds" ofType="java.lang.Integer" > |
| | | <result property="materialId" column="material_id"></result> |
| | | <result property="subMaterialId" column="sub_material_id"></result> |
| | | </collection> |
| | | </resultMap> |
| | | <!--<select id="selectMaterialInProduct" resultMap="productIds"> |
| | | select DISTINCT tb_product.*,tb_material_product_history.material_id FROM db_doc.tb_material_product_history,db_doc.tb_product, db_doc.tb_product_bom |
| | | where tb_product.id=tb_product_bom.product_id |
| | | and tb_material_product_history.sub_code=tb_product_bom.sub_code |
| | | and tb_material_product_history.parent_code=tb_product.parent_code |
| | | and tb_material_product_history.custom_code=tb_product.custom_code |
| | | and tb_product.version>=tb_material_product_history.s_version and tb_product.version<=tb_material_product_history.e_version |
| | | and tb_material_product_history.sub_code=#{subCode} |
| | | </select>--> |
| | | |
| | | <select id="selectMaterialInProduct" resultMap="productIds"> |
| | | select DISTINCT tb_product.*,tb_material_product_history.material_id FROM db_doc.tb_product |
| | | select DISTINCT tb_product.*,tb_material_product_history.sub_material_id FROM db_doc.tb_product |
| | | left outer join db_doc.tb_product_bom on tb_product.id=tb_product_bom.product_id |
| | | left outer join db_doc.tb_material_product_history on |
| | | tb_material_product_history.parent_code=tb_product.parent_code and tb_material_product_history.custom_code=tb_product.custom_code |
| | | and tb_product.version>=tb_material_product_history.s_version and tb_product.version<=tb_material_product_history.e_version |
| | | where tb_product_bom.sub_code=#{subCode} |
| | | where tb_product_bom.material_id=#{id} |
| | | </select> |
| | | <select id="getListByCodeList" resultType="java.lang.String"> |
| | | SELECT sub_code FROM db_doc.tb_material where sub_code in |