|
@@ -1002,4 +1002,109 @@
|
|
|
differencePrice = #{differencePrice}
|
|
|
WHERE shopOrderID = #{shopOrderId}
|
|
|
</update>
|
|
|
+
|
|
|
+ <select id="findSplitList" resultType="newShopOrder">
|
|
|
+ SELECT
|
|
|
+ co.couponAmount AS couponAmount,
|
|
|
+ co.userBeans AS userBeans,
|
|
|
+ a.shopOrderID AS shopOrderID,
|
|
|
+ a.orderID AS orderID,
|
|
|
+ a.organizeID AS organizeID,
|
|
|
+ a.shopOrderNo AS shopOrderNo,
|
|
|
+ a.orderNo AS orderNo,
|
|
|
+ a.userID AS userID,
|
|
|
+ a.shopID AS shopID,
|
|
|
+ a.itemCount AS itemCount,
|
|
|
+ a.townID AS townID,
|
|
|
+ a.productAmount AS productAmount,
|
|
|
+ a.discountAmount AS discountAmount,
|
|
|
+ a.accountAmount AS accountAmount,
|
|
|
+ a.totalAmount AS totalAmount,
|
|
|
+ a.payFlag AS payFlag,
|
|
|
+ a.payTime AS payTime,
|
|
|
+ a.finishTime AS finishTime,
|
|
|
+ a.refundStatus AS refundStatus,
|
|
|
+ a.needPayAmount AS needPayAmount,
|
|
|
+ a.canRefundAmount AS canRefundAmount,
|
|
|
+ a.refundAmount AS refundAmount,
|
|
|
+ a.clubID AS clubID,
|
|
|
+ a.spID AS spID,
|
|
|
+ a.mainSpID AS mainSpID,
|
|
|
+ a.orderBeanAmount AS orderBeanAmount,
|
|
|
+ a.useBeanAmount AS useBeanAmount,
|
|
|
+ a.useBeanFlag AS useBeanFlag,
|
|
|
+ a.canRefundFlag AS canRefundFlag,
|
|
|
+ a.useBalanceFlag AS useBalanceFlag,
|
|
|
+ a.canRefundBeans AS canRefundBeans,
|
|
|
+ a.freePostageFee AS freePostageFee,
|
|
|
+ a.freePostageTicketID AS freePostageTicketID,
|
|
|
+ a.brokerage AS brokerage,
|
|
|
+ a.delFlag AS delFlag,
|
|
|
+ a.refundsAmount AS refundsAmount,
|
|
|
+ a.orderStatusFlag AS orderStatusFlag,
|
|
|
+ a.buyStatus AS buyStatus,
|
|
|
+ a.orderSubmitType AS orderSubmitType,
|
|
|
+ a.orderType AS orderType,
|
|
|
+ a.orderTime AS orderTime,
|
|
|
+ a.deliveryTimeMills AS deliveryTimeMills,
|
|
|
+ a.presentNum AS presentNum,
|
|
|
+ a.preferential AS preferential,
|
|
|
+ a.outStoreNum AS outStoreNum,
|
|
|
+ IFNULL(a.outStoreTimes, 0) AS outStoreTimes,
|
|
|
+ a.splitFlag AS splitFlag,
|
|
|
+ a.autoReceiveTimeMills AS autoReceiveTimeMills,
|
|
|
+ a.autoOverTimeMills AS autoOverTimeMills,
|
|
|
+ a.receiveGoodsTime AS receiveGoodsTime,
|
|
|
+ a.totalAddedValueTax AS totalAddedValueTax,
|
|
|
+ a.note AS note,
|
|
|
+ a.payStatus AS payStatus,
|
|
|
+ a.sendOutStatus AS sendOutStatus,
|
|
|
+ a.shopProductAmount AS shopProductAmount,
|
|
|
+ a.shopPostFee AS shopPostFee,
|
|
|
+ a.shopTaxFee AS shopTaxFee,
|
|
|
+ a.shouldPayShopAmount AS shouldPayShopAmount,
|
|
|
+ a.payedShopAmount AS payedShopAmount,
|
|
|
+ a.shopOtherFee AS shopOtherFee,
|
|
|
+ a.paying AS paying,
|
|
|
+ a.costType AS costType,
|
|
|
+ a.modifyShouldPayNote AS modifyShouldPayNote,
|
|
|
+ a.orderPromotionsId AS orderPromotionsId,
|
|
|
+ a.differenceType AS differenceType,
|
|
|
+ a.differencePrice AS differencePrice,
|
|
|
+ a.proportional AS proportional,
|
|
|
+ a.promotionFullReduction AS promotionFullReduction,
|
|
|
+ a.zeroCostFlag AS zeroCostFlag,
|
|
|
+ co.payTotalFee AS payTotalFee,
|
|
|
+ co.status AS STATUS,
|
|
|
+ bou.name AS buyer,
|
|
|
+ s.name AS shopName,
|
|
|
+ c.name AS clubName
|
|
|
+ FROM cm_shop_order a
|
|
|
+ LEFT JOIN cm_pay_shop_record cpsr ON a.shopOrderID = cpsr.shopOrderID
|
|
|
+ LEFT JOIN bp_order_userinfo bou ON bou.orderId = a.orderID
|
|
|
+ LEFT JOIN cm_order co ON co.orderID = a.orderID
|
|
|
+ LEFT JOIN cm_receipt_order_relation cror ON cror.orderId = co.orderId
|
|
|
+ LEFT JOIN cm_discern_receipt cdr ON cror.receiptID = cdr.id
|
|
|
+ LEFT JOIN shop s ON s.shopID = a.shopID
|
|
|
+ LEFT JOIN club c ON c.userID = a.userID
|
|
|
+ WHERE
|
|
|
+ co.organizeID = 0
|
|
|
+ AND co.orderType != 2
|
|
|
+ AND co.refundType != 2
|
|
|
+ AND co.delFlag = 0
|
|
|
+ AND a.delFlag = 0
|
|
|
+ AND a.shopID != 998
|
|
|
+ AND cdr.payWay = 1
|
|
|
+ AND cdr.receiptDate <![CDATA[ <= ]]> NOW()
|
|
|
+ AND cror.relationType = 2
|
|
|
+ AND cror.delFlag = 0
|
|
|
+ AND cror.mbOrderId IS NOT NULL
|
|
|
+ AND cror.splitStatus = 0
|
|
|
+ AND co.orderID NOT IN (
|
|
|
+ SELECT orderID FROM cm_order_product WHERE productID IN
|
|
|
+ (6060, 6061, 6062, 6063, 6064, 6065, 6066, 6067, 6068, 6069) GROUP BY orderID
|
|
|
+ )
|
|
|
+ GROUP BY a.shopOrderID
|
|
|
+ ORDER BY a.shopOrderID DESC
|
|
|
+ </select>
|
|
|
</mapper>
|