INSERT INTO cm_order (orderSeen, orderSource, orderNo, userID, clubID, organizeID, buyUserID, spID, orderTime,
updateDate,
delFlag,
userBeans, orderType, orderSubmitType, confirmFlag, onlinePayFlag, splitFlag, payFlag,
receiptStatus, payStatus, zeroCostFlag, sendOutStatus, refundType, affirmPaymentFlag,
productCount, presentCount, promotionalGiftsCount, hasActProduct, promotionFullReduction,
svipFullReduction, secondHandOrderFlag, invoiceFlag, freePostFlag, freight,
productTotalFee,
orderTotalFee, payTotalFee, payableAmount, balancePayFee, couponAmount, status,
confirmTime,
payTime, rebateFlag, rebateFee, clauseID, clauseName)
VALUES (#{orderSeen}, #{orderSource}, #{orderNo}, #{userId}, #{clubId}, #{organizeId}, #{buyUserId}, #{spId},
#{orderTime},
#{updateDate},
#{delFlag},
#{userBeans}, #{orderType}, #{orderSubmitType}, #{confirmFlag}, #{onlinePayFlag}, #{splitFlag},
#{payFlag},
#{receiptStatus}, #{payStatus}, #{zeroCostFlag}, #{sendOutStatus}, #{refundType}, #{affirmPaymentFlag},
#{productCount}, #{presentCount}, #{promotionalGiftsCount}, #{hasActProduct}, #{promotionFullReduction},
#{svipFullReduction},
#{secondHandOrderFlag}, #{invoiceFlag}, #{postageFlag}, #{postage}, #{productTotalFee},
#{orderTotalFee},
#{payTotalFee}, #{payableAmount}, #{balancePayFee}, #{couponAmount}, #{status}, #{confirmTime},
#{payTime}, #{rebateFlag}, #{rebateFee},
#{clauseId}, #{clauseName})
INSERT INTO cm_shop_order (onlinePayWays, shopOrderNo, orderID, orderNo, organizeID, isColdChina, shopID, note,
userID, clubID, orderType,
spID, orderPromotionsId, promotionFullReduction, svipShopReduction, brokerage,
canRefundAmount, itemCount, shopStatus, accountAmount, useBalanceFlag,
totalAmount, productAmount, needPayAmount, shopProductAmount, shopPostFee,
shopPostFlag,
shopTaxFee, confirmTime,
shouldPayShopAmount, orderTime, orderSubmitType, splitFlag, payStatus,
payedShopAmount, splitCode, realPay, eachDiscount, receiptStatus)
VALUES (#{onlinePayWays}, #{shopOrderNo}, #{orderId}, #{orderNo}, #{organizeId}, #{isColdChina}, #{shopId},
#{note}, #{userId}, #{clubId}, #{orderType},
#{spId}, #{orderPromotionsId}, #{promotionFullReduction}, #{svipShopReduction}, #{brokerage},
#{canRefundAmount}, #{itemCount}, #{shopStatus}, #{accountAmount}, #{useBalanceFlag},
#{totalAmount}, #{productAmount}, #{needPayAmount}, #{shopProductAmount}, #{shopPostFee},
#{shopPostFlag}, #{shopTaxFee}, #{confirmTime},
#{shouldPayShopAmount}, #{orderTime}, #{orderSubmitType}, #{splitFlag}, #{payStatus},
#{payedShopAmount}, #{splitCode}, #{realPay}, #{eachDiscount}, 1)
update cm_order
set freight = #{freight}
where orderId = #{orderId}
INSERT INTO cm_order_product (orderID, orderNo, shopOrderID, shopOrderNo, organizeID, orderPromotionsId,
productId, shopId,
name, organizeCostPrice, cmCostPrice,
productImage, price, shopName, costPrice, normalPrice, ladderPriceFlag,
discountPrice, discount,
totalAmount, totalFee, shouldPayFee, productUnit, num, presentNum, discountFee,
includedTax,
invoiceType, taxRate, addedValueTax, totalAddedValueTax, supplierTaxRate,
singleShouldPayTotalTax, shouldPayTotalTax,
shopProductAmount, singleShopFee, shopFee, singleOtherFee, otherFee, singleCmFee,
cmFee,
payStatus, buyAgainFlag, notOutStore, isActProduct, productType, svipPriceFlag,
svipPriceType,
svipDiscount, svipReduction, skuID, cmPercent, organizePercent, shopPercent)
VALUES (#{orderId}, #{orderNo}, #{shopOrderId}, #{shopOrderNo}, #{organizeId}, #{orderPromotionsId},
#{productId}, #{shopId},
#{name}, #{organizeCostPrice}, #{cmCostPrice},
#{image}, #{price}, #{shopName}, #{costPrice}, #{normalPrice}, #{ladderPriceFlag},
#{discountPrice}, #{discount},
#{totalAmount}, #{totalFee}, #{shouldPayFee}, #{productUnit}, #{num}, #{presentNum}, #{discountFee},
#{includedTax},
#{invoiceType}, #{taxRate}, #{addedValueTax}, #{totalAddedValueTax}, #{shopTaxRate},
#{singleShouldPayTotalTax}, #{shouldPayTotalTax},
#{shopProductAmount}, #{singleShopFee}, #{shopFee}, #{singleOtherFee}, #{otherFee}, #{singleCmFee},
#{cmFee},
#{payStatus}, #{buyAgainFlag}, #{notOutStore}, #{actProduct}, #{productType}, #{svipPriceFlag},
#{svipPriceType}, #{svipDiscount}, #{svipReduction}, #{skuId}, #{cmPercent}, #{organizePercent},
#{shopPercent})
INSERT INTO cm_promotions_order (orderId, promotionsId, name, description, type, mode, touchPrice, reducedPrice,
discount, status, beginTime, endTime)
VALUES (#{orderId}, #{id}, #{name}, #{description}, #{type}, #{mode}, #{touchPrice}, #{reducedPrice},
#{discount},
#{status}, #{beginTime}, #{endTime})
INSERT INTO order_product_ladder_price (orderProductId, ladderNum, buyNum, buyPrice, createDate)
VALUES (#{orderProductId}, #{ladderNum}, #{buyNum}, #{buyPrice}, #{createDate})
UPDATE cm_order
SET shopOrderIDs = #{shopOrderIds}
WHERE orderID = #{orderId}
INSERT INTO bp_order_invoice (orderId, invoiceTitle, type, invoiceContent, invoiceTitleType, corporationTaxNum,
registeredAddress, registeredPhone, bankAccountNo, openBank)
VALUES (#{orderId}, #{invoiceTitle}, #{type}, #{invoiceContent}, #{headingType}, #{corporationTaxNum},
#{registeredAddress}, #{registeredPhone}, #{bankAccountNo}, #{openBank})
INSERT INTO bp_order_userinfo (orderId, clubId, userId, name, shouHuoRen, mobile,
townId, province, city, town, address)
VALUES (#{orderId}, #{clubId}, #{userId}, #{name}, #{receiver}, #{mobile},
#{townId}, #{province}, #{city}, #{town}, #{address})
INSERT INTO cm_coupon_order_record (orderId, clubCouponId, couponType, couponAmount, touchPrice, createDate)
VALUES (#{orderId}, #{clubCouponId}, #{couponType}, #{couponAmount}, #{touchPrice}, #{createDate})
UPDATE USER
SET userMoney = #{userMoney},
ableUserMoney = #{ableUserMoney}
WHERE userID = #{userId}
UPDATE bp_order_invoice SET orderId=#{orderId},
invoiceTitle = #{invoiceTitle},
type = #{type,jdbcType=CHAR},
invoiceContent = #{invoiceContent},
invoiceTitleType = #{invoiceTitleType},
corporationTaxNum = #{corporationTaxNum},
registeredAddress = #{registeredAddress},
registeredPhone = #{registeredPhone},
bankAccountNo = #{bankAccountNo},
openBank = #{openBank},
WHERE id = #{id}
UPDATE cm_order
SET onlinePayFlag = #{onlinePayFlag}
WHERE orderID = #{orderId}
UPDATE cm_shop_order
SET onlinePayWays = #{onlinePayWays}
WHERE orderID = #{orderId}
update cm_order_product
set price = #{price},
discountPrice = #{price},
costPrice = #{costPrice},
organizeCostPrice = #{organizeCostPrice},
cmCostPrice = #{cmCostPrice},
totalAmount = #{totalAmount},
totalFee = #{totalFee},
shouldPayFee = #{shouldPayFee},
ladderPriceFlag = #{ladderPriceFlag},
taxRate = #{taxRate},
addedValueTax = #{addedValueTax},
totalAddedValueTax = #{totalAddedValueTax},
shouldPayTotalTax = #{shouldPayTotalTax},
singleShouldPayTotalTax = #{singleShouldPayTotalTax},
shopProductAmount = #{shopProductAmount},
singleShopFee = #{singleShopFee},
shopFee = #{shopFee}
where orderProductId = #{orderProductId}
update cm_shop_order
set
shopStatus = #{status},
realPay = #{realNeedPay},
receiptAmount = #{receiptAmount},
accountAmount = #{accountAmount},
productAmount = #{productAmount},
totalAmount = #{totalAmount},
needPayAmount = #{needPayAmount},
promotionFullReduction = #{promotionFullReduction},
receiptStatus = #{receiptStatus},
shopProductAmount = #{shopProductAmount},
shopTaxFee = #{shopTaxFee},
shouldPayShopAmount = #{shouldPayShopAmount}
where shopOrderId = #{shopOrderId}
update user
set userMoney = userMoney + #{change},
ableUserMoney = ableUserMoney + #{change}
where userId = #{userId}
update cm_shop_order
set needPayAmount = #{needPayAmount},
totalAmount = #{totalAmount},
couponAmount = #{couponAmount},
couponClubId = #{couponClubId},
realPay = #{realPay},
shopProductAmount = #{shopProductAmount},
shouldPayShopAmount = #{shouldPayShopAmount}
where shopOrderId = #{shopOrderId}