| | |
| | | FROM db_doc.tb_material WHERE sub_model LIKE '${subModel}%' |
| | | ORDER BY create_date DESC |
| | | </select> |
| | | <select id="getMaterialById" resultType="com.whyc.pojo.Material"> |
| | | <resultMap id="materialInfo" type="Material"> |
| | | <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="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="upUserId" column="up_user_id"></result> |
| | | <result property="createDate" column="create_date"></result> |
| | | <result property="updateDate" column="update_date"></result> |
| | | <result property="dwgUrl" column="dwg_url"></result> |
| | | <collection property="products" javaType="java.util.ArrayList" ofType="com.whyc.pojo.Product" column="{id=id}" select="selectInProduct"> |
| | | </collection> |
| | | </resultMap> |
| | | <select id="getMaterialById" resultMap="materialInfo"> |
| | | select * from db_doc.tb_material WHERE id = #{materialId} limit 1 |
| | | </select> |
| | | <select id="selectInProduct" resultType="product"> |
| | | select DISTINCT tb_product.* FROM db_doc.tb_product,db_doc.tb_product_bom |
| | | where tb_product.id=tb_product_bom.product_id |
| | | and tb_product_bom.material_id=#{id} |
| | | </select> |
| | | </mapper> |