1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798 |
- <?xml version="1.0" encoding="UTF-8" ?>
- <!DOCTYPE mapper
- PUBLIC
- "-//mybatis.org//DTD Mapper 3.0//EN"
- "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
- <!-- 命名,每一个映射对象不一样
- namespace:必须与对应的接口全类名一致
- -->
- <mapper namespace="com.iamberry.wechat.service.mapper.AgentPurchaseOrderMapper">
- <sql id="agentOrderItem">
- item_id itemId,
- agent_orderid agentOrderid,
- product_id productId,
- color_id colorId,
- product_type productType,
- product_rent_type productRentType,
- item_num itemNum,
- item_total itemTotal,
- item_create_date itemCreateDate,
- item_product_name itemProductName,
- item_color_name itemColorName,
- item_product_discount itemProductDiscount,
- item_product_price itemProductPrice,
- item_product_pic itemProductPic
- </sql>
- <insert id="addAgentOrder" parameterType="AgentOrder">
- insert into tb_iamberry_agent_order (`agent_orderid` ,`agent_id` ,`agent_yet_amount` ,`agent_amount` ,`agent_create_date`,`agent_status` ,`agent_address_info` ,`agent_address_postnum` ,`agent_address_tel` ,`agent_address_name` ,`agent_admin_remark` )
- values (#{agentOrderid},#{agentId},#{agentYetAmount},#{agentAmount},#{agentCreateDate},#{agentStatus},#{agentAddressInfo},#{agentAddressPostnum},#{agentAddressTel},#{agentAddressName},#{agentAdminRemark})
- </insert>
- <insert id="addAgentOrderItemList" parameterType="AgentOrderItem" useGeneratedKeys="true">
- insert into tb_iamberry_agent_order_item (`agent_orderid` ,`product_id` ,`color_id` ,`product_type`
- ,`product_rent_type` ,`item_num` ,`item_total` ,`item_product_name` ,`item_color_name` ,`item_product_discount`
- ,`item_product_price` ,`item_product_pic` )
- values
- <foreach collection="list" item="item" index="index" separator="," open="" close="">
- (#{item.agentOrderid},#{item.productId},#{item.colorId},#{item.productType},#{item.productRentType},#{item.itemNum},#{item.itemTotal},#{item.itemProductName},#{item.itemColorName},#{item.itemProductDiscount},#{item.itemProductPrice},#{item.itemProductPic})
- </foreach>
- </insert>
- <select id="listAgentOrderItem" parameterType="AgentOrderItem" resultType="AgentOrderItem">
- SELECT
- <include refid="agentOrderItem"></include>
- FROM
- tb_iamberry_agent_order_item
- WHERE
- agent_orderid = #{agentOrderid}
- ORDER BY item_id DESC
- </select>
- <update id="updateAgentPurchaseOrder" parameterType="AgentOrder" >
- update
- tb_iamberry_agent_order
- <set>
- <if test="agentPostNum !=null and agentPostNum !=''">
- agent_post_num = #{agentPostNum},
- </if>
- <if test="agentPostFirm !=null and agentPostFirm !=''">
- agent_post_firm = #{agentPostFirm},
- </if>
- <if test="agentStatus !=null and agentStatus !=''">
- agent_status = #{agentStatus},
- </if>
- <if test="agentSendDate !=null and agentSendDate !=''">
- agent_send_date = #{agentSendDate},
- </if>
- <if test="agentAddressInfo !=null and agentAddressInfo !=''">
- agent_address_info = #{agentAddressInfo},
- </if>
- <if test="agentAddressPostnum !=null and agentAddressPostnum !=''">
- agent_address_postnum = #{agentAddressPostnum},
- </if>
- <if test="agentAddressTel !=null and agentAddressTel !=''">
- agent_address_tel = #{agentAddressTel},
- </if>
- <if test="agentAddressName !=null and agentAddressName !=''">
- agent_address_name = #{agentAddressName},
- </if>
- <if test="agentAdminRemark !=null and agentAdminRemark !=''">
- agent_admin_remark = #{agentAdminRemark},
- </if>
- <if test="agentTransactionId !=null and agentTransactionId !=''">
- agent_transaction_id = #{agentTransactionId},
- </if>
- <if test="agentTransactionDate !=null and agentTransactionDate !=''">
- agent_transaction_date = #{agentTransactionDate},
- </if>
- </set>
- where
- agent_orderid = #{agentOrderid}
- </update>
- </mapper>
|