| | |
| | | <resultMap id="orderGlassDetailMap" type="com.example.erp.entity.sd.OrderGlassDetail" > |
| | | <id column="id" property="id"/> |
| | | <result column="order_id" property="orderId"/> |
| | | <result column="order_number" property="orderNumber"/> |
| | | <result column="glass_address" property="glassAddress"/> |
| | | <result column="technology_number" property="technologyNumber"/> |
| | | <result column="glass_child" property="glassChild"/> |
| | |
| | | <result column="process" property="process"/> |
| | | <!--接收其他外键实体类数据--> |
| | | <association property="orderDetail" javaType="com.example.erp.entity.sd.OrderDetail"> |
| | | <result column="order_number" property="orderNumber"/> |
| | | |
| | | <result column="building_number" property="buildingNumber"/> |
| | | |
| | | <result column="product_name" property="productName"/> |
| | |
| | | <select id="selectOrderGlassDetailByOrderId" resultMap="orderGlassDetailMap"> |
| | | select |
| | | a.order_id, |
| | | b.order_number, |
| | | a.order_number, |
| | | b.building_number, |
| | | b.product_name, |
| | | a.glass_address, |
| | |
| | | where a.order_id = #{orderId} |
| | | order by a.order_number,a.technology_number |
| | | </select> |
| | | |
| | | <update id="updateSizeAndProcess" parameterType="java.util.List"> |
| | | <foreach collection="orderGlassDetails" item="item" index="index" open="" close="" separator=";"> |
| | | update order_glass_detail |
| | | set |
| | | child_width = #{item.childWidth}, |
| | | child_height = #{item.childHeight}, |
| | | process = #{item.process} |
| | | where |
| | | order_id = #{item.orderId} |
| | | and order_number = #{item.orderNumber} |
| | | and technology_number = #{item.technologyNumber} |
| | | </foreach> |
| | | |
| | | </update> |
| | | </mapper> |