|
@@ -4,7 +4,6 @@
|
|
|
|
|
|
<sql id="shopOrderColumns">
|
|
|
co.rebateFee as rebateFee,
|
|
|
- co.couponAmount as couponAmount,
|
|
|
co.userBeans as userBeans,
|
|
|
a.shopOrderID AS shopOrderID,
|
|
|
a.shopStatus AS status,
|
|
@@ -69,7 +68,7 @@
|
|
|
a.payStatus AS payStatus,
|
|
|
a.sendOutStatus AS sendOutStatus,
|
|
|
a.shopProductAmount AS shopProductAmount,
|
|
|
- a.shopPostFee AS shopPostFee,
|
|
|
+ ifnull(a.shopPostFee, 0) AS shopPostFee,
|
|
|
a.shopTaxFee AS shopTaxFee,
|
|
|
a.shouldPayShopAmount AS shouldPayShopAmount,
|
|
|
a.payedShopAmount AS payedShopAmount,
|
|
@@ -82,7 +81,8 @@
|
|
|
a.differenceType AS differenceType,
|
|
|
a.differencePrice AS differencePrice,
|
|
|
a.proportional AS proportional,
|
|
|
- a.promotionFullReduction As promotionFullReduction,
|
|
|
+ ifnull(a.promotionFullReduction, 0) As promotionFullReduction,
|
|
|
+ ifnull(a.couponAmount, 0) As couponAmount,
|
|
|
a.zeroCostFlag AS zeroCostFlag
|
|
|
</sql>
|
|
|
|
|
@@ -225,6 +225,14 @@
|
|
|
where a.shopOrderID = #{shopOrderID}
|
|
|
</select>
|
|
|
|
|
|
+ <select id="findByPayShopID" resultType="java.lang.Double">
|
|
|
+ SELECT SUM(cpsr.payAmount)
|
|
|
+ FROM cm_pay_shop cps
|
|
|
+ LEFT JOIN cm_pay_shop_record cpsr ON cpsr.payShopID = cps.id
|
|
|
+ WHERE cpsr.delFlag = 0
|
|
|
+ AND cps.delFlag = 0
|
|
|
+ AND cpsr.shopOrderId = #{shopOrderID}
|
|
|
+ </select>
|
|
|
<select id="findList" resultType="newShopOrder">
|
|
|
SELECT
|
|
|
<include refid="shopOrderColumns"/>
|
|
@@ -263,7 +271,8 @@
|
|
|
SELECT<include refid="shopOrderColumns"/>,
|
|
|
b.name as shopName,
|
|
|
oa.id as orderArchiveId,
|
|
|
- co.receiptStatus
|
|
|
+ co.receiptStatus,
|
|
|
+ (SELECT SUM(num) FROM cm_order_product WHERE shoporderid=29760 AND productType = 2) as presentNum
|
|
|
FROM cm_shop_order a
|
|
|
left join shop b on a.shopID = b.shopID
|
|
|
left join cm_order_archive oa on a.shopOrderID = oa.shopOrderId
|
|
@@ -271,8 +280,23 @@
|
|
|
WHERE a.orderID = #{orderID} ORDER BY a.shopOrderNo DESC
|
|
|
</select>
|
|
|
|
|
|
+ <select id="getFreightAmount" resultType="java.lang.Double">
|
|
|
+ SELECT ifnull(SUM(cfr.freightAmount), 0)
|
|
|
+ FROM cm_freight_rule cfr
|
|
|
+ LEFT JOIN cm_freight_template cft ON cft.id = cfr.freightId
|
|
|
+ LEFT JOIN product p ON p.freightTemplateId = cft.id
|
|
|
+ WHERE productId = #{productId} and cft.delFlag = 0
|
|
|
+ </select>
|
|
|
+
|
|
|
+ <select id="getShopOrderId" resultType="com.caimei.modules.product.entity.Shop">
|
|
|
+ select shopId, AccountOwnership, bankAccount from shop where shopId = #{shopId}
|
|
|
+ </select>
|
|
|
+
|
|
|
<select id="findCommercialCode" resultType="String">
|
|
|
- select commercialCode FROM cm_shop_order a left join cm_shop_splitcode css on a.shopID = css.shopId WHERE a.orderID = #{orderID}
|
|
|
+ select commercialCode
|
|
|
+ FROM cm_shop_order a
|
|
|
+ left join cm_shop_splitcode css on a.shopID = css.shopId
|
|
|
+ WHERE a.orderID = #{orderID}
|
|
|
</select>
|
|
|
|
|
|
<update id="update" parameterType="newShopOrder">
|
|
@@ -284,6 +308,9 @@
|
|
|
<if test="status != null and status != ''">
|
|
|
shopStatus = #{status},
|
|
|
</if>
|
|
|
+ <if test="confirmTime != null and confirmTime != ''">
|
|
|
+ confirmTime = #{confirmTime},
|
|
|
+ </if>
|
|
|
<if test="shopOrderNo != null and shopOrderNo != ''">
|
|
|
orderID = #{orderID},
|
|
|
</if>
|
|
@@ -703,6 +730,91 @@
|
|
|
left join shop s on s.shopID = a.shopID
|
|
|
LEFT JOIN club c ON c.userID = a.userID
|
|
|
<where>
|
|
|
+ (s.shopId = 1161 OR s.AccountOwnership = 0 OR a.splitCode = 'E1807059160' or a.ordertype = 2)
|
|
|
+ and a.shopStatus not in (4, 5)
|
|
|
+ <if test="startTime != null and startTime != ''">
|
|
|
+ AND (a.orderTime > #{startTime} OR a.orderTime = #{startTime})
|
|
|
+ </if>
|
|
|
+ <if test="endTime != null and endTime != ''">
|
|
|
+ AND (a.orderTime < #{endTime} OR a.orderTime = #{endTime})
|
|
|
+ </if>
|
|
|
+ <if test="orderID != null and orderID != ''">
|
|
|
+ AND a.orderID = #{orderID}
|
|
|
+ </if>
|
|
|
+ <if test="organizeID != null and organizeID != 9999">
|
|
|
+ AND co.organizeID = #{organizeID}
|
|
|
+ </if>
|
|
|
+ <if test="organizeID == 9999 ">
|
|
|
+ AND co.orderType = 2
|
|
|
+ </if>
|
|
|
+ <if test="orderNo != null and orderNo != ''">
|
|
|
+ AND a.orderNo like concat('%', #{orderNo} ,'%')
|
|
|
+ </if>
|
|
|
+ <if test="ps != null and ps.length>0 ">
|
|
|
+ AND a.payStatus in
|
|
|
+ <foreach item="item" index="index" collection="ps" open="(" close=")" separator=",">
|
|
|
+ #{item}
|
|
|
+ </foreach>
|
|
|
+ </if>
|
|
|
+ <if test="shopName != null and shopName != ''">
|
|
|
+ AND s.name like concat('%', #{shopName} ,'%')
|
|
|
+ </if>
|
|
|
+ <if test="buyer != null and buyer != ''">
|
|
|
+ AND bou.name like concat('%', #{buyer} ,'%')
|
|
|
+ </if>
|
|
|
+ <if test="clubName != null and clubName != ''">
|
|
|
+ AND c.name like concat('%', #{clubName} ,'%')
|
|
|
+ </if>
|
|
|
+ <if test="shopOrderID != null and shopOrderID != ''">
|
|
|
+ AND a.shopOrderID = #{shopOrderID}
|
|
|
+ </if>
|
|
|
+ <if test="shopOrderNo != null and shopOrderNo != ''">
|
|
|
+ AND a.shopOrderNo like concat('%', #{shopOrderNo} ,'%')
|
|
|
+ </if>
|
|
|
+ <if test="operatingMode != null and operatingMode == '1'.toString()">
|
|
|
+ and a.payStatus != 3 and co.status NOT IN (6,7)
|
|
|
+ </if>
|
|
|
+ <if test="operatingMode != null and operatingMode == '2'.toString()">
|
|
|
+ and a.payStatus != 1 and co.status != 6
|
|
|
+ </if>
|
|
|
+ <if test="operatingMode != null and operatingMode == '3'.toString()">
|
|
|
+ and a.payStatus = 3 and co.status NOT IN (6,7)
|
|
|
+ </if>
|
|
|
+ and a.shopStatus != 0
|
|
|
+ and co.delFlag = 0
|
|
|
+ -- and not (co.secondHandOrderFlag=1 AND co.rebateFlag=1)
|
|
|
+ and a.delFlag = 0
|
|
|
+ and (a.organizeID!=4 or a.organizeID is null)
|
|
|
+ and a.shopID != 998
|
|
|
+ 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
|
|
|
+ )
|
|
|
+ </where>
|
|
|
+ group by a.shopOrderID
|
|
|
+ ORDER BY a.shopOrderID DESC
|
|
|
+ </select>
|
|
|
+
|
|
|
+ <select id="payThirdParties" resultType="newShopOrder">
|
|
|
+ select<include refid="shopOrderColumns"/>,
|
|
|
+ co.payTotalFee AS payTotalFee,
|
|
|
+ bou.name AS buyer,
|
|
|
+ s.name AS shopName,
|
|
|
+ c.name AS clubName,
|
|
|
+ cdr.payWay AS payWay
|
|
|
+ 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>
|
|
|
+ s.name NOT LIKE '%综合供应商%'
|
|
|
+ AND s.AccountOwnership = 1
|
|
|
+ AND cdr.payWay = 2
|
|
|
+ AND a.receiptStatus != 1
|
|
|
<if test="startTime != null and startTime != ''">
|
|
|
AND (a.orderTime > #{startTime} OR a.orderTime = #{startTime})
|
|
|
</if>
|
|
@@ -753,7 +865,87 @@
|
|
|
and a.payStatus = 3 and co.status NOT IN (6,7)
|
|
|
</if>
|
|
|
and co.delFlag = 0
|
|
|
--- and not (co.secondHandOrderFlag=1 AND co.rebateFlag=1)
|
|
|
+ -- and not (co.secondHandOrderFlag=1 AND co.rebateFlag=1)
|
|
|
+ and a.delFlag = 0
|
|
|
+ and (a.organizeID!=4 or a.organizeID is null)
|
|
|
+ and a.shopID != 998
|
|
|
+ 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
|
|
|
+ )
|
|
|
+ </where>
|
|
|
+ group by a.shopOrderID
|
|
|
+ ORDER BY a.shopOrderID DESC
|
|
|
+ </select>
|
|
|
+
|
|
|
+ <select id="findShopOrderList" resultType="newShopOrder">
|
|
|
+ select<include refid="shopOrderColumns"/>,
|
|
|
+ co.payTotalFee AS payTotalFee,
|
|
|
+ bou.name AS buyer,
|
|
|
+ s.name AS shopName,
|
|
|
+ c.name AS clubName,
|
|
|
+ cdr.payWay AS payWay
|
|
|
+ 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>
|
|
|
+ (s.shopId = 1161 OR s.AccountOwnership = 0 OR a.splitCode = 'E1807059160' or a.ordertype = 2)
|
|
|
+ and a.shopStatus not in (4, 5)
|
|
|
+ <if test="startTime != null and startTime != ''">
|
|
|
+ AND (a.orderTime > #{startTime} OR a.orderTime = #{startTime})
|
|
|
+ </if>
|
|
|
+ <if test="endTime != null and endTime != ''">
|
|
|
+ AND (a.orderTime < #{endTime} OR a.orderTime = #{endTime})
|
|
|
+ </if>
|
|
|
+ <if test="orderID != null and orderID != ''">
|
|
|
+ AND a.orderID = #{orderID}
|
|
|
+ </if>
|
|
|
+ <if test="organizeID != null and organizeID != 9999">
|
|
|
+ AND co.organizeID = #{organizeID}
|
|
|
+ </if>
|
|
|
+ <if test="organizeID == 9999 ">
|
|
|
+ AND co.orderType = 2
|
|
|
+ </if>
|
|
|
+ <if test="orderNo != null and orderNo != ''">
|
|
|
+ AND a.orderNo like concat('%', #{orderNo} ,'%')
|
|
|
+ </if>
|
|
|
+ <if test="ps != null and ps.length>0 ">
|
|
|
+ AND a.payStatus in
|
|
|
+ <foreach item="item" index="index" collection="ps" open="(" close=")" separator=",">
|
|
|
+ #{item}
|
|
|
+ </foreach>
|
|
|
+ </if>
|
|
|
+ <if test="receiptStatus != null and receiptStatus!= ''">
|
|
|
+ AND a.receiptStatus = #{receiptStatus}
|
|
|
+ </if>
|
|
|
+ <if test="refundStatus !=null and refundStatus != ''">
|
|
|
+ AND a.refundStatus = #{refundStatus}
|
|
|
+ </if>
|
|
|
+ <if test="settleStatus != null and settleStatus!= ''">
|
|
|
+ AND a.settleStatus = #{settleStatus}
|
|
|
+ </if>
|
|
|
+ <if test="shopName != null and shopName != ''">
|
|
|
+ AND s.name like concat('%', #{shopName} ,'%')
|
|
|
+ </if>
|
|
|
+ <if test="buyer != null and buyer != ''">
|
|
|
+ AND bou.name like concat('%', #{buyer} ,'%')
|
|
|
+ </if>
|
|
|
+ <if test="clubName != null and clubName != ''">
|
|
|
+ AND c.name like concat('%', #{clubName} ,'%')
|
|
|
+ </if>
|
|
|
+ <if test="shopOrderID != null and shopOrderID != ''">
|
|
|
+ AND a.shopOrderID = #{shopOrderID}
|
|
|
+ </if>
|
|
|
+ <if test="shopOrderNo != null and shopOrderNo != ''">
|
|
|
+ AND a.shopOrderNo like concat('%', #{shopOrderNo} ,'%')
|
|
|
+ </if>
|
|
|
+ and co.delFlag = 0
|
|
|
+ -- and not (co.secondHandOrderFlag=1 AND co.rebateFlag=1)
|
|
|
and a.delFlag = 0
|
|
|
and (a.organizeID!=4 or a.organizeID is null)
|
|
|
and a.shopID != 998
|
|
@@ -766,6 +958,40 @@
|
|
|
ORDER BY a.shopOrderID DESC
|
|
|
</select>
|
|
|
|
|
|
+ <select id="payAmountByShopOrderId" resultType="java.lang.Double">
|
|
|
+ SELECT IFNULL(SUM(cpsr.payAmount), 0)
|
|
|
+ FROM cm_pay_shop cps
|
|
|
+ LEFT JOIN cm_pay_shop_record cpsr ON cps.id = cpsr.payShopID
|
|
|
+ WHERE cps.delFlag = 0 AND cpsr.delFlag = 0
|
|
|
+ AND cpsr.shopOrderID = #{shopOrderId}
|
|
|
+ </select>
|
|
|
+
|
|
|
+ <select id="settleAmountByShopOrderId" resultType="java.lang.Double">
|
|
|
+ SELECT IFNULL(SUM(settleAmount), 0)
|
|
|
+ FROM cm_settle_record
|
|
|
+ WHERE shopOrderId = #{shopOrderId}
|
|
|
+ </select>
|
|
|
+
|
|
|
+ <select id="payShopAmountShopOrderId" resultType="java.lang.Double">
|
|
|
+ SELECT IFNULL(SUM(cpsr.payCmAmount), 0)
|
|
|
+ FROM cm_pay_shop cps
|
|
|
+ LEFT JOIN cm_pay_shop_record cpsr ON cps.id = cpsr.payShopID
|
|
|
+ WHERE cpsr.delFlag = 0 AND cpsr.shopOrderID = 29478
|
|
|
+ </select>
|
|
|
+
|
|
|
+ <select id="returnedPurchaseFeeByShopOrderId" resultType="java.lang.Double">
|
|
|
+ SELECT
|
|
|
+ IFNULL(SUM(crp.returnedPurchaseFee), 0)
|
|
|
+ FROM cm_returned_purchase crp
|
|
|
+ LEFT JOIN cm_returned_purchase_product crpp ON crp.id = crpp.returnedID
|
|
|
+ WHERE crp.delFlag = 0 AND crp.status = 2
|
|
|
+ AND crp.shopOrderId = #{shopOrderId}
|
|
|
+ </select>
|
|
|
+ <select id="findSplitCount" resultType="java.lang.Integer">
|
|
|
+ SELECT COUNT(*)
|
|
|
+ FROM cm_split_account
|
|
|
+ WHERE shopOrderId = #{shopOrderId}
|
|
|
+ </select>
|
|
|
<select id="findPayOrderListByIDs" resultType="newShopOrder">
|
|
|
select distinct<include refid="shopOrderColumns"/>,
|
|
|
co.payTotalFee AS payTotalFee,
|
|
@@ -934,17 +1160,15 @@
|
|
|
|
|
|
<select id="findIncome" resultType="java.lang.Double">
|
|
|
SELECT ROUND(IFNULL((
|
|
|
- co.payTotalFee - (IFNULL((
|
|
|
- SELECT ROUND(SUM((IFNULL(op.costPrice, 0) *
|
|
|
- (IFNULL(op.num, 0) + IFNULL(op.presentNum, 0))) +
|
|
|
- IFNULL(op.shouldPayTotalTax, 0)),
|
|
|
- 2)
|
|
|
- FROM cm_order_product op
|
|
|
- LEFT JOIN cm_shop_order cso ON cso.shopOrderID = op.shopOrderID
|
|
|
- WHERE cso.orderID = co.orderID
|
|
|
- AND op.productID != 999
|
|
|
- GROUP BY cso.orderID
|
|
|
- ), 0))
|
|
|
+ co.payTotalFee - (IFNULL((SELECT ROUND(SUM((IFNULL(op.costPrice, 0) *
|
|
|
+ (IFNULL(op.num, 0) + IFNULL(op.presentNum, 0))) +
|
|
|
+ IFNULL(op.shouldPayTotalTax, 0)),
|
|
|
+ 2)
|
|
|
+ FROM cm_order_product op
|
|
|
+ LEFT JOIN cm_shop_order cso ON cso.shopOrderID = op.shopOrderID
|
|
|
+ WHERE cso.orderID = co.orderID
|
|
|
+ AND op.productID != 999
|
|
|
+ GROUP BY cso.orderID), 0))
|
|
|
- (SELECT IFNULL(SUM(cso.shopOtherFee), 0)
|
|
|
FROM cm_shop_order cso
|
|
|
WHERE cso.orderID = co.orderID)
|
|
@@ -959,7 +1183,7 @@
|
|
|
WHERE cso.orderID = co.orderID)
|
|
|
AND cpsr.delFlag = 0
|
|
|
AND (cpsr.`status` = 1 OR cpsr.`status` = 0)), 0)
|
|
|
- +IFNULL(co.rebateFee,0)
|
|
|
+ + IFNULL(co.rebateFee, 0)
|
|
|
), 0), 2) AS "采美总佣金"
|
|
|
FROM cm_order co
|
|
|
WHERE co.orderID = #{orderID}
|
|
@@ -1054,38 +1278,33 @@
|
|
|
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
|
|
|
- LEFT JOIN cm_order_product cop ON a.shopOrderID = cop.shopOrderID
|
|
|
- LEFT JOIN product p ON cop.productID = p.productID
|
|
|
+ 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 a.refundStatus = 1
|
|
|
AND co.delFlag = 0
|
|
|
AND co.orderType != 2
|
|
|
AND a.delFlag = 0
|
|
|
AND a.shopID != 998
|
|
|
- AND (a.organizeID!=4 or a.organizeID is null)
|
|
|
+ AND (a.organizeID != 4 or a.organizeID is null)
|
|
|
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 a.receiptStatus=3
|
|
|
- -- AND p.splitCode != 'E1807059160'
|
|
|
- AND co.orderID NOT IN (SELECT orderID FROM cm_order_product cops LEFT JOIN product ps ON cops.productID = ps.productID WHERE ps.splitCode = 'E1807059160' AND cops.orderID = cop.orderID)
|
|
|
- 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
|
|
|
- )
|
|
|
+ AND a.receiptStatus = 3
|
|
|
+ AND a.splitCode != 'E1807059160'
|
|
|
+ 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>
|
|
@@ -1097,11 +1316,15 @@
|
|
|
</select>
|
|
|
|
|
|
<select id="FromUnionId" resultType="java.lang.String">
|
|
|
- SELECT unionID FROM `cm_order` WHERE orderID=#{orderId}
|
|
|
+ SELECT unionID
|
|
|
+ FROM `cm_order`
|
|
|
+ WHERE orderID = #{orderId}
|
|
|
</select>
|
|
|
|
|
|
<select id="UnionId" resultType="java.lang.String">
|
|
|
- SELECT unionID FROM `cm_order` WHERE userID=#{userID}
|
|
|
+ SELECT unionID
|
|
|
+ FROM `cm_order`
|
|
|
+ WHERE userID = #{userID}
|
|
|
ORDER BY orderID DESC
|
|
|
LIMIT 1
|
|
|
</select>
|
|
@@ -1113,90 +1336,90 @@
|
|
|
</select>
|
|
|
|
|
|
<select id="payWay" resultType="java.lang.Integer">
|
|
|
- SELECT cdr.payWay
|
|
|
+ SELECT cdr.payWay
|
|
|
FROM cm_shop_order a
|
|
|
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
|
|
|
- WHERE a.shopOrderID = #{shopOrderID}
|
|
|
+ WHERE a.shopOrderID = #{shopOrderID}
|
|
|
</select>
|
|
|
|
|
|
<select id="findSettlementList" resultType="com.caimei.modules.order.entity.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,
|
|
|
- a.settleStatus AS settleStatus,
|
|
|
- co.payTotalFee AS payTotalFee,
|
|
|
- co.status AS STATUS,
|
|
|
- bou.name AS buyer,
|
|
|
- s.name AS shopName,
|
|
|
- c.name AS clubName
|
|
|
+ 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,
|
|
|
+ a.settleStatus AS settleStatus,
|
|
|
+ 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
|
|
@@ -1206,25 +1429,23 @@
|
|
|
LEFT JOIN cm_split_account csa on csa.shopOrderId = a.shopOrderID
|
|
|
LEFT JOIN shop s ON s.shopID = a.shopID
|
|
|
LEFT JOIN club c ON c.userID = a.userID
|
|
|
- LEFT JOIN cm_order_product cop ON a.shopOrderID = cop.shopOrderID
|
|
|
- LEFT JOIN product p ON cop.productID = p.productID
|
|
|
WHERE co.organizeID = 0
|
|
|
- AND co.refundType != 2
|
|
|
- AND co.delFlag = 0
|
|
|
- AND co.orderType != 2
|
|
|
- AND co.receiptStatus = 3
|
|
|
- AND a.delFlag = 0
|
|
|
- AND a.shopID != 998
|
|
|
- AND (a.organizeID!=4 or a.organizeID is null)
|
|
|
- AND cdr.payWay = 1
|
|
|
- AND cror.relationType = 2
|
|
|
- AND a.settleStatus in (1,2)
|
|
|
- AND csa.settleStatus = 0
|
|
|
- AND cror.delFlag = 0
|
|
|
- AND cror.mbOrderId IS NOT NULL
|
|
|
- AND cror.splitStatus = 1
|
|
|
- -- AND p.splitCode != 'E1807059160'
|
|
|
- AND co.orderID NOT IN (SELECT orderID FROM cm_order_product cops LEFT JOIN product ps ON cops.productID = ps.productID WHERE ps.splitCode = 'E1807059160' AND cops.orderID = cop.orderID)
|
|
|
+ AND co.refundType != 2
|
|
|
+ AND co.delFlag = 0
|
|
|
+ AND co.orderType != 2
|
|
|
+ AND co.receiptStatus = 3
|
|
|
+ AND a.delFlag = 0
|
|
|
+ AND a.refundStatus = 1
|
|
|
+ AND a.shopID != 998
|
|
|
+ AND (a.organizeID!=4 or a.organizeID is null)
|
|
|
+ AND cdr.payWay = 1
|
|
|
+ AND cror.relationType = 2
|
|
|
+ AND a.settleStatus in (1,2)
|
|
|
+ AND csa.settleStatus = 0
|
|
|
+ AND cror.delFlag = 0
|
|
|
+ AND cror.mbOrderId IS NOT NULL
|
|
|
+ AND cror.splitStatus = 1
|
|
|
+ AND a.splitCode != 'E1807059160'
|
|
|
<if test="startTime != null and startTime != ''">
|
|
|
AND (a.orderTime > #{startTime} OR a.orderTime = #{startTime})
|
|
|
</if>
|
|
@@ -1260,7 +1481,7 @@
|
|
|
</select>
|
|
|
|
|
|
<select id="findSettleRecord" resultType="com.caimei.modules.order.entity.SettleRecord">
|
|
|
- select settleAmount,settleType,settleTime
|
|
|
+ select settleAmount, settleType, settleTime
|
|
|
from cm_settle_record
|
|
|
where shopOrderId = #{shopOrderID}
|
|
|
</select>
|
|
@@ -1277,4 +1498,1158 @@
|
|
|
WHERE a.shopOrderId = #{onlineShopOrderId}
|
|
|
ORDER BY a.shopOrderNo DESC
|
|
|
</select>
|
|
|
+
|
|
|
+ <resultMap type="com.caimei.modules.order.entity.NewShopOrder" id="CmShopOrderResult">
|
|
|
+ <result property="shopOrderID" column="shopOrderID"/>
|
|
|
+ <result property="shopOrderNo" column="shopOrderNo"/>
|
|
|
+ <result property="orderNo" column="orderNo"/>
|
|
|
+ <result property="orderID" column="orderID"/>
|
|
|
+ <result property="organizeID" column="organizeID"/>
|
|
|
+ <result property="isColdChina" column="isColdChina"/>
|
|
|
+ <result property="userID" column="userID"/>
|
|
|
+ <result property="shopID" column="shopID"/>
|
|
|
+ <result property="orderPromotionsId" column="orderPromotionsId"/>
|
|
|
+ <result property="orderType" column="orderType"/>
|
|
|
+ <result property="orderSubmitType" column="orderSubmitType"/>
|
|
|
+ <result property="presentNum" column="presentNum"/>
|
|
|
+ <result property="itemCount" column="itemCount"/>
|
|
|
+ <result property="outStoreNum" column="outStoreNum"/>
|
|
|
+ <result property="outStoreTimes" column="outStoreTimes"/>
|
|
|
+ <result property="townID" column="townID"/>
|
|
|
+ <result property="note" column="note"/>
|
|
|
+ <result property="eachDiscount" column="eachDiscount"/>
|
|
|
+ <result property="realPay" column="realPay"/>
|
|
|
+ <result property="receiptAmount" column="receiptAmount"/>
|
|
|
+ <result property="accountAmount" column="accountAmount"/>
|
|
|
+ <result property="productAmount" column="productAmount"/>
|
|
|
+ <result property="totalAmount" column="totalAmount"/>
|
|
|
+ <result property="needPayAmount" column="needPayAmount"/>
|
|
|
+ <result property="discountAmount" column="discountAmount"/>
|
|
|
+ <result property="preferential" column="preferential"/>
|
|
|
+ <result property="promotionFullReduction" column="promotionFullReduction"/>
|
|
|
+ <result property="payFlag" column="payFlag"/>
|
|
|
+ <result property="orderTime" column="orderTime"/>
|
|
|
+ <result property="payTime" column="payTime"/>
|
|
|
+ <result property="finishTime" column="finishTime"/>
|
|
|
+ <result property="autoOverTimeMills" column="autoOverTimeMills"/>
|
|
|
+ <result property="settleStatus" column="settleStatus"/>
|
|
|
+ <result property="payStatus" column="payStatus"/>
|
|
|
+ <result property="receiptStatus" column="receiptStatus"/>
|
|
|
+ <result property="sendOutStatus" column="sendOutStatus"/>
|
|
|
+ <result property="refundStatus" column="refundStatus"/>
|
|
|
+ <result property="returnGoodsStatus" column="returnGoodsStatus"/>
|
|
|
+ <result property="receiveGoodsTime" column="receiveGoodsTime"/>
|
|
|
+ <result property="autoReceiveTimeMills" column="autoReceiveTimeMills"/>
|
|
|
+ <result property="totalAddedValueTax" column="totalAddedValueTax"/>
|
|
|
+ <result property="canRefundAmount" column="canRefundAmount"/>
|
|
|
+ <result property="refundAmount" column="refundAmount"/>
|
|
|
+ <result property="clubID" column="clubID"/>
|
|
|
+ <result property="spID" column="spID"/>
|
|
|
+ <result property="mainSpID" column="mainSpID"/>
|
|
|
+ <result property="orderBeanAmount" column="orderBeanAmount"/>
|
|
|
+ <result property="useBeanAmount" column="useBeanAmount"/>
|
|
|
+ <result property="useBeanFlag" column="useBeanFlag"/>
|
|
|
+ <result property="canRefundFlag" column="canRefundFlag"/>
|
|
|
+ <result property="useBalanceFlag" column="useBalanceFlag"/>
|
|
|
+ <result property="canRefundBeans" column="canRefundBeans"/>
|
|
|
+ <result property="freePostageFee" column="freePostageFee"/>
|
|
|
+ <result property="freePostageTicketID" column="freePostageTicketID"/>
|
|
|
+ <result property="brokerage" column="brokerage"/>
|
|
|
+ <result property="delFlag" column="delFlag"/>
|
|
|
+ <result property="refundsAmount" column="refundsAmount"/>
|
|
|
+ <result property="orderStatusFlag" column="orderStatusFlag"/>
|
|
|
+ <result property="buyStatus" column="buyStatus"/>
|
|
|
+ <result property="deliveryTimeMills" column="deliveryTimeMills"/>
|
|
|
+ <result property="orderDeliveryID" column="orderDeliveryID"/>
|
|
|
+ <result property="splitFlag" column="splitFlag"/>
|
|
|
+ <result property="paying" column="paying"/>
|
|
|
+ <result property="shopProductAmount" column="shopProductAmount"/>
|
|
|
+ <result property="shopPostFee" column="shopPostFee"/>
|
|
|
+ <result property="shopPostFlag" column="shopPostFlag"/>
|
|
|
+ <result property="shopTaxFee" column="shopTaxFee"/>
|
|
|
+ <result property="payCmAmount" column="payCmAmount"/>
|
|
|
+ <result property="shouldPayShopAmount" column="shouldPayShopAmount"/>
|
|
|
+ <result property="payedShopAmount" column="payedShopAmount"/>
|
|
|
+ <result property="shopOtherFee" column="shopOtherFee"/>
|
|
|
+ <result property="receiptedFlag" column="receiptedFlag"/>
|
|
|
+ <result property="receiptedType" column="receiptedType"/>
|
|
|
+ <result property="costType" column="costType"/>
|
|
|
+ <result property="proportional" column="proportional"/>
|
|
|
+ <result property="modifyShouldPayNote" column="modifyShouldPayNote"/>
|
|
|
+ <result property="modifyShouldPayUserID" column="modifyShouldPayUserID"/>
|
|
|
+ <result property="modifyShouldPayDate" column="modifyShouldPayDate"/>
|
|
|
+ <result property="zeroCostFlag" column="zeroCostFlag"/>
|
|
|
+ <result property="differenceType" column="differenceType"/>
|
|
|
+ <result property="differencePrice" column="differencePrice"/>
|
|
|
+ <result property="svipShopReduction" column="svipShopReduction"/>
|
|
|
+ <result property="splitCode" column="splitCode"/>
|
|
|
+ <result property="paySuccessCounter" column="paySuccessCounter"/>
|
|
|
+ <result property="onlinePayWays" column="onlinePayWays"/>
|
|
|
+ <result property="status" column="shopStatus"/>
|
|
|
+ </resultMap>
|
|
|
+
|
|
|
+ <sql id="selectCmShopOrderVo">
|
|
|
+ select cm_shop_order.shopOrderID,
|
|
|
+ cm_shop_order.shopOrderNo,
|
|
|
+ cm_shop_order.orderNo,
|
|
|
+ cm_shop_order.orderID,
|
|
|
+ cm_shop_order.organizeID,
|
|
|
+ cm_shop_order.isColdChina,
|
|
|
+ cm_shop_order.userID,
|
|
|
+ cm_shop_order.shopID,
|
|
|
+ cm_shop_order.orderPromotionsId,
|
|
|
+ cm_shop_order.orderType,
|
|
|
+ cm_shop_order.orderSubmitType,
|
|
|
+ cm_shop_order.presentNum,
|
|
|
+ cm_shop_order.itemCount,
|
|
|
+ cm_shop_order.outStoreNum,
|
|
|
+ cm_shop_order.outStoreTimes,
|
|
|
+ cm_shop_order.townID,
|
|
|
+ cm_shop_order.note,
|
|
|
+ ifnull(cm_shop_order.accountAmount, 0) AS accountAmount,
|
|
|
+ ifnull(cm_shop_order.productAmount, 0) AS productAmount,
|
|
|
+ ifnull(cm_shop_order.totalAmount, 0) AS totalAmount,
|
|
|
+ ifnull(cm_shop_order.needPayAmount, 0) AS needPayAmount,
|
|
|
+ ifnull(cm_shop_order.discountAmount, 0) AS discountAmount,
|
|
|
+ ifnull(cm_shop_order.preferential, 0) AS preferential,
|
|
|
+ ifnull(cm_shop_order.promotionFullReduction, 0) AS promotionFullReduction,
|
|
|
+ cm_shop_order.payFlag,
|
|
|
+ cm_shop_order.orderTime,
|
|
|
+ cm_shop_order.payTime,
|
|
|
+ cm_shop_order.finishTime,
|
|
|
+ cm_shop_order.autoOverTimeMills,
|
|
|
+ cm_shop_order.settleStatus,
|
|
|
+ cm_shop_order.payStatus,
|
|
|
+ cm_shop_order.sendOutStatus,
|
|
|
+ cm_shop_order.refundStatus,
|
|
|
+ cm_shop_order.shopStatus,
|
|
|
+ cm_shop_order.returnGoodsStatus,
|
|
|
+ cm_shop_order.receiveGoodsTime,
|
|
|
+ cm_shop_order.autoReceiveTimeMills,
|
|
|
+ ifnull(cm_shop_order.totalAddedValueTax, 0) AS totalAddedValueTax,
|
|
|
+ cm_shop_order.canRefundAmount,
|
|
|
+ cm_shop_order.refundAmount,
|
|
|
+ cm_shop_order.clubID,
|
|
|
+ cm_shop_order.spID,
|
|
|
+ cm_shop_order.mainSpID,
|
|
|
+ cm_shop_order.orderBeanAmount,
|
|
|
+ cm_shop_order.useBeanAmount,
|
|
|
+ cm_shop_order.useBeanFlag,
|
|
|
+ cm_shop_order.canRefundFlag,
|
|
|
+ cm_shop_order.useBalanceFlag,
|
|
|
+ cm_shop_order.canRefundBeans,
|
|
|
+ ifnull(cm_shop_order.freePostageFee, 0) AS freePostageFee,
|
|
|
+ cm_shop_order.freePostageTicketID,
|
|
|
+ ifnull(cm_shop_order.brokerage, 0) AS brokerage,
|
|
|
+ cm_shop_order.delFlag,
|
|
|
+ ifnull(cm_shop_order.refundsAmount, 0) AS refundsAmount,
|
|
|
+ cm_shop_order.orderStatusFlag,
|
|
|
+ cm_shop_order.buyStatus,
|
|
|
+ cm_shop_order.deliveryTimeMills,
|
|
|
+ cm_shop_order.confirmTime,
|
|
|
+ cm_shop_order.updateTime,
|
|
|
+ cm_shop_order.orderDeliveryID,
|
|
|
+ cm_shop_order.splitFlag,
|
|
|
+ cm_shop_order.receiptedFlag,
|
|
|
+ cm_shop_order.receiptedType,
|
|
|
+ cm_shop_order.paying,
|
|
|
+ ifnull(cm_shop_order.shopProductAmount, 0) AS shopProductAmount,
|
|
|
+ ifnull(cm_shop_order.shopPostFee, 0) AS shopPostFee,
|
|
|
+ cm_shop_order.shopPostFlag,
|
|
|
+ ifnull(cm_shop_order.shopTaxFee, 0) AS shopTaxFee,
|
|
|
+ ifnull(cm_shop_order.payCmAmount, 0) AS payCmAmount,
|
|
|
+ ifnull(cm_shop_order.shouldPayShopAmount, 0) AS shouldPayShopAmount,
|
|
|
+ ifnull(cm_shop_order.payedShopAmount, 0) AS payedShopAmount,
|
|
|
+ ifnull(cm_shop_order.shopOtherFee, 0) AS shopOtherFee,
|
|
|
+ cm_shop_order.costType,
|
|
|
+ ifnull(cm_shop_order.proportional, 0) AS proportional,
|
|
|
+ cm_shop_order.modifyShouldPayNote,
|
|
|
+ cm_shop_order.modifyShouldPayUserID,
|
|
|
+ cm_shop_order.modifyShouldPayDate,
|
|
|
+ cm_shop_order.zeroCostFlag,
|
|
|
+ cm_shop_order.differenceType,
|
|
|
+ ifnull(cm_shop_order.differencePrice, 0) AS differencePrice,
|
|
|
+ ifnull(cm_shop_order.svipShopReduction, 0) AS svipShopReduction,
|
|
|
+ ifnull(cm_shop_order.shopRefundAmount, 0) AS shopRefundAmount,
|
|
|
+ cm_shop_order.splitCode,
|
|
|
+ cm_shop_order.paySuccessCounter,
|
|
|
+ cm_shop_order.onlinePayWays,
|
|
|
+ cm_shop_order.receiptStatus,
|
|
|
+ ifnull(cm_shop_order.receiptAmount, 0) AS receiptAmount,
|
|
|
+ ifnull(cm_shop_order.eachDiscount, 0) AS eachDiscount,
|
|
|
+ ifnull(cm_shop_order.realPay, 0) AS realPay,
|
|
|
+ cm_shop_order.discountFee,
|
|
|
+ cm_shop_order.fee
|
|
|
+ </sql>
|
|
|
+
|
|
|
+ <select id="getByCmShopOrder" parameterType="com.caimei.modules.order.entity.NewShopOrder"
|
|
|
+ resultMap="CmShopOrderResult">
|
|
|
+ <include refid="selectCmShopOrderVo"/>
|
|
|
+ from cm_shop_order AS cm_shop_order
|
|
|
+ <where>cm_shop_order.delFlag = 0
|
|
|
+ <if test="shopOrderID != null and shopOrderID != ''">
|
|
|
+ and cm_shop_order.shopOrderID
|
|
|
+ = #{shopOrderID}
|
|
|
+ </if>
|
|
|
+ <if test="shopOrderID.toString().toUpperCase().indexOf('=')!=-1">
|
|
|
+ <if test="shopOrderID.toString().toUpperCase().indexOf('NOT')!=-1">not</if>
|
|
|
+ <if test="shopOrderID.toString().toUpperCase().indexOf('IN')!=-1">in</if>
|
|
|
+ <foreach item="shopOrderIDIn"
|
|
|
+ collection="shopOrderID.toString().substring(shopOrderID.toUpperCase().toString().indexOf('=')+1,shopOrderID.toString().length()).trim().split(',')"
|
|
|
+ open="(" separator="," close=")">
|
|
|
+ #{shopOrderIDIn}
|
|
|
+ </foreach>
|
|
|
+ </if>
|
|
|
+ <if test="shopOrderNo != null and shopOrderNo != ''">and cm_shop_order.shopOrderNo = #{shopOrderNo}</if>
|
|
|
+ <if test="orderNo != null and orderNo != ''">and cm_shop_order.orderNo = #{orderNo}</if>
|
|
|
+ <if test="orderID != null ">and cm_shop_order.orderID = #{orderID}</if>
|
|
|
+ <if test="organizeID != null ">and cm_shop_order.organizeID = #{organizeID}</if>
|
|
|
+ <if test="isColdChina != null ">and cm_shop_order.isColdChina = #{isColdChina}</if>
|
|
|
+ <if test="userID != null ">and cm_shop_order.userID = #{userID}</if>
|
|
|
+ <if test="shopID != null ">and cm_shop_order.shopID = #{shopID}</if>
|
|
|
+ <if test="orderPromotionsId != null ">and cm_shop_order.orderPromotionsId = #{orderPromotionsId}</if>
|
|
|
+ <if test="orderType != null ">and cm_shop_order.orderType = #{orderType}</if>
|
|
|
+ <if test="orderSubmitType != null ">and cm_shop_order.orderSubmitType = #{orderSubmitType}</if>
|
|
|
+ <if test="presentNum != null ">and cm_shop_order.presentNum = #{presentNum}</if>
|
|
|
+ <if test="itemCount != null ">and cm_shop_order.itemCount = #{itemCount}</if>
|
|
|
+ <if test="outStoreNum != null ">and cm_shop_order.outStoreNum = #{outStoreNum}</if>
|
|
|
+ <if test="outStoreTimes != null ">and cm_shop_order.outStoreTimes = #{outStoreTimes}</if>
|
|
|
+ <if test="townID != null ">and cm_shop_order.townID = #{townID}</if>
|
|
|
+ <if test="note != null and note != ''">and cm_shop_order.note = #{note}</if>
|
|
|
+ <if test="eachDiscount != null ">and cm_shop_order.eachDiscount = #{eachDiscount}</if>
|
|
|
+ <if test="realPay != null ">and cm_shop_order.realPay = #{realPay}</if>
|
|
|
+ <if test="receiptAmount != null ">and cm_shop_order.receiptAmount = #{receiptAmount}</if>
|
|
|
+ <if test="accountAmount != null ">and cm_shop_order.accountAmount = #{accountAmount}</if>
|
|
|
+ <if test="productAmount != null ">and cm_shop_order.productAmount = #{productAmount}</if>
|
|
|
+ <if test="totalAmount != null ">and cm_shop_order.totalAmount = #{totalAmount}</if>
|
|
|
+ <if test="needPayAmount != null ">and cm_shop_order.needPayAmount = #{needPayAmount}</if>
|
|
|
+ <if test="discountAmount != null ">and cm_shop_order.discountAmount = #{discountAmount}</if>
|
|
|
+ <if test="preferential != null ">and cm_shop_order.preferential = #{preferential}</if>
|
|
|
+ <if test="promotionFullReduction != null ">and cm_shop_order.promotionFullReduction =
|
|
|
+ #{promotionFullReduction}
|
|
|
+ </if>
|
|
|
+ <if test="payFlag != null and payFlag != ''">and cm_shop_order.payFlag = #{payFlag}</if>
|
|
|
+ <if test="orderTime != null and orderTime != ''">and cm_shop_order.orderTime = #{orderTime}</if>
|
|
|
+ <if test="payTime != null and payTime != ''">and cm_shop_order.payTime = #{payTime}</if>
|
|
|
+ <if test="finishTime != null and finishTime != ''">and cm_shop_order.finishTime = #{finishTime}</if>
|
|
|
+ <if test="autoOverTimeMills != null ">and cm_shop_order.autoOverTimeMills = #{autoOverTimeMills}</if>
|
|
|
+ <if test="settleStatus != null and settleStatus != ''">and cm_shop_order.settleStatus = #{settleStatus}
|
|
|
+ </if>
|
|
|
+ <if test="payStatus != null and payStatus != ''">and cm_shop_order.payStatus = #{payStatus}</if>
|
|
|
+ <if test="receiptStatus != null and receiptStatus != ''">and cm_shop_order.receiptStatus =
|
|
|
+ #{receiptStatus}
|
|
|
+ </if>
|
|
|
+ <if test="sendOutStatus != null and sendOutStatus != ''">and cm_shop_order.sendOutStatus =
|
|
|
+ #{sendOutStatus}
|
|
|
+ </if>
|
|
|
+ <if test="refundStatus != null ">and cm_shop_order.refundStatus = #{refundStatus}</if>
|
|
|
+ <if test="returnGoodsStatus != null ">and cm_shop_order.returnGoodsStatus = #{returnGoodsStatus}</if>
|
|
|
+ <if test="receiveGoodsTime != null and receiveGoodsTime != ''">and cm_shop_order.receiveGoodsTime =
|
|
|
+ #{receiveGoodsTime}
|
|
|
+ </if>
|
|
|
+ <if test="autoReceiveTimeMills != null ">and cm_shop_order.autoReceiveTimeMills = #{autoReceiveTimeMills}
|
|
|
+ </if>
|
|
|
+ <if test="totalAddedValueTax != null ">and cm_shop_order.totalAddedValueTax = #{totalAddedValueTax}</if>
|
|
|
+ <if test="canRefundAmount != null ">and cm_shop_order.canRefundAmount = #{canRefundAmount}</if>
|
|
|
+ <if test="refundAmount != null ">and cm_shop_order.refundAmount = #{refundAmount}</if>
|
|
|
+ <if test="clubID != null ">and cm_shop_order.clubID = #{clubID}</if>
|
|
|
+ <if test="spID != null ">and cm_shop_order.spID = #{spID}</if>
|
|
|
+ <if test="mainSpID != null ">and cm_shop_order.mainSpID = #{mainSpID}</if>
|
|
|
+ <if test="orderBeanAmount != null ">and cm_shop_order.orderBeanAmount = #{orderBeanAmount}</if>
|
|
|
+ <if test="useBeanAmount != null ">and cm_shop_order.useBeanAmount = #{useBeanAmount}</if>
|
|
|
+ <if test="useBeanFlag != null ">and cm_shop_order.useBeanFlag = #{useBeanFlag}</if>
|
|
|
+ <if test="canRefundFlag != null ">and cm_shop_order.canRefundFlag = #{canRefundFlag}</if>
|
|
|
+ <if test="useBalanceFlag != null ">and cm_shop_order.useBalanceFlag = #{useBalanceFlag}</if>
|
|
|
+ <if test="canRefundBeans != null ">and cm_shop_order.canRefundBeans = #{canRefundBeans}</if>
|
|
|
+ <if test="freePostageFee != null ">and cm_shop_order.freePostageFee = #{freePostageFee}</if>
|
|
|
+ <if test="freePostageTicketID != null ">and cm_shop_order.freePostageTicketID = #{freePostageTicketID}</if>
|
|
|
+ <if test="brokerage != null ">and cm_shop_order.brokerage = #{brokerage}</if>
|
|
|
+ <if test="delFlag != null and delFlag != ''">and cm_shop_order.delFlag = #{delFlag}</if>
|
|
|
+ <if test="refundsAmount != null ">and cm_shop_order.refundsAmount = #{refundsAmount}</if>
|
|
|
+ <if test="orderStatusFlag != null and orderStatusFlag != ''">and cm_shop_order.orderStatusFlag =
|
|
|
+ #{orderStatusFlag}
|
|
|
+ </if>
|
|
|
+ <if test="buyStatus != null and buyStatus != ''">and cm_shop_order.buyStatus = #{buyStatus}</if>
|
|
|
+ <if test="deliveryTimeMills != null and deliveryTimeMills != ''">and cm_shop_order.deliveryTimeMills =
|
|
|
+ #{deliveryTimeMills}
|
|
|
+ </if>
|
|
|
+ <if test="orderDeliveryID != null ">and cm_shop_order.orderDeliveryID = #{orderDeliveryID}</if>
|
|
|
+ <if test="splitFlag != null and splitFlag != ''">and cm_shop_order.splitFlag = #{splitFlag}</if>
|
|
|
+ <if test="paying != null and paying != ''">and cm_shop_order.paying = #{paying}</if>
|
|
|
+ <if test="shopProductAmount != null ">and cm_shop_order.shopProductAmount = #{shopProductAmount}</if>
|
|
|
+ <if test="shopPostFee != null ">and cm_shop_order.shopPostFee = #{shopPostFee}</if>
|
|
|
+ <if test="shopPostFlag != null and shopPostFlag != ''">and cm_shop_order.shopPostFlag = #{shopPostFlag}
|
|
|
+ </if>
|
|
|
+ <if test="shopTaxFee != null ">and cm_shop_order.shopTaxFee = #{shopTaxFee}</if>
|
|
|
+ <if test="payCmAmount != null ">and cm_shop_order.payCmAmount = #{payCmAmount}</if>
|
|
|
+ <if test="shouldPayShopAmount != null ">and cm_shop_order.shouldPayShopAmount = #{shouldPayShopAmount}</if>
|
|
|
+ <if test="payedShopAmount != null ">and cm_shop_order.payedShopAmount = #{payedShopAmount}</if>
|
|
|
+ <if test="shopOtherFee != null ">and cm_shop_order.shopOtherFee = #{shopOtherFee}</if>
|
|
|
+ <if test="receiptedFlag != null and receiptedFlag != ''">and cm_shop_order.receiptedFlag =
|
|
|
+ #{receiptedFlag}
|
|
|
+ </if>
|
|
|
+ <if test="receiptedType != null and receiptedType != ''">and cm_shop_order.receiptedType =
|
|
|
+ #{receiptedType}
|
|
|
+ </if>
|
|
|
+ <if test="costType != null and costType != ''">and cm_shop_order.costType = #{costType}</if>
|
|
|
+ <if test="proportional != null ">and cm_shop_order.proportional = #{proportional}</if>
|
|
|
+ <if test="modifyShouldPayNote != null and modifyShouldPayNote != ''">and cm_shop_order.modifyShouldPayNote
|
|
|
+ = #{modifyShouldPayNote}
|
|
|
+ </if>
|
|
|
+ <if test="modifyShouldPayUserID != null ">and cm_shop_order.modifyShouldPayUserID =
|
|
|
+ #{modifyShouldPayUserID}
|
|
|
+ </if>
|
|
|
+ <if test="modifyShouldPayDate != null ">and cm_shop_order.modifyShouldPayDate = #{modifyShouldPayDate}</if>
|
|
|
+ <if test="zeroCostFlag != null ">and cm_shop_order.zeroCostFlag = #{zeroCostFlag}</if>
|
|
|
+ <if test="differenceType != null and differenceType != ''">and cm_shop_order.differenceType =
|
|
|
+ #{differenceType}
|
|
|
+ </if>
|
|
|
+ <if test="differencePrice != null ">and cm_shop_order.differencePrice = #{differencePrice}</if>
|
|
|
+ <if test="svipShopReduction != null ">and cm_shop_order.svipShopReduction = #{svipShopReduction}</if>
|
|
|
+ <if test="splitCode != null and splitCode != ''">and cm_shop_order.splitCode = #{splitCode}</if>
|
|
|
+ <if test="paySuccessCounter != null ">and cm_shop_order.paySuccessCounter = #{paySuccessCounter}</if>
|
|
|
+ <if test="onlinePayWays != null and onlinePayWays != ''">and cm_shop_order.onlinePayWays =
|
|
|
+ #{onlinePayWays}
|
|
|
+ </if>
|
|
|
+ <if test="status != null and status != ''">and cm_shop_order.shopStatus = #{status}</if>
|
|
|
+ </where>
|
|
|
+ group by cm_shop_order.shopOrderID
|
|
|
+ order by cm_shop_order.orderTime desc
|
|
|
+ limit 0,1
|
|
|
+ </select>
|
|
|
+
|
|
|
+ <select id="getCmShopOrderList" parameterType="com.caimei.modules.order.entity.NewShopOrder"
|
|
|
+ resultMap="CmShopOrderResult">
|
|
|
+ <include refid="selectCmShopOrderVo"/>
|
|
|
+ from cm_shop_order AS cm_shop_order
|
|
|
+ <where>cm_shop_order.delFlag = 0
|
|
|
+ <if test="shopOrderID != null and shopOrderID != ''">
|
|
|
+ and cm_shop_order.shopOrderID
|
|
|
+ = #{shopOrderID}
|
|
|
+ </if>
|
|
|
+ <if test="shopOrderID.toString().toUpperCase().indexOf('=')!=-1">
|
|
|
+ <if test="shopOrderID.toString().toUpperCase().indexOf('NOT')!=-1">not</if>
|
|
|
+ <if test="shopOrderID.toString().toUpperCase().indexOf('IN')!=-1">in</if>
|
|
|
+ <foreach item="shopOrderIDIn"
|
|
|
+ collection="shopOrderID.toString().substring(shopOrderID.toUpperCase().toString().indexOf('=')+1,shopOrderID.toString().length()).trim().split(',')"
|
|
|
+ open="(" separator="," close=")">
|
|
|
+ #{shopOrderIDIn}
|
|
|
+ </foreach>
|
|
|
+ </if>
|
|
|
+ <if test="shopOrderNo != null and shopOrderNo != ''">and cm_shop_order.shopOrderNo = #{shopOrderNo}</if>
|
|
|
+ <if test="orderNo != null and orderNo != ''">and cm_shop_order.orderNo = #{orderNo}</if>
|
|
|
+ <if test="orderID != null ">and cm_shop_order.orderID = #{orderID}</if>
|
|
|
+ <if test="organizeID != null ">and cm_shop_order.organizeID = #{organizeID}</if>
|
|
|
+ <if test="isColdChina != null ">and cm_shop_order.isColdChina = #{isColdChina}</if>
|
|
|
+ <if test="userID != null ">and cm_shop_order.userID = #{userID}</if>
|
|
|
+ <if test="shopID != null ">and cm_shop_order.shopID = #{shopID}</if>
|
|
|
+ <if test="orderPromotionsId != null ">and cm_shop_order.orderPromotionsId = #{orderPromotionsId}</if>
|
|
|
+ <if test="orderType != null ">and cm_shop_order.orderType = #{orderType}</if>
|
|
|
+ <if test="orderSubmitType != null ">and cm_shop_order.orderSubmitType = #{orderSubmitType}</if>
|
|
|
+ <if test="presentNum != null ">and cm_shop_order.presentNum = #{presentNum}</if>
|
|
|
+ <if test="itemCount != null ">and cm_shop_order.itemCount = #{itemCount}</if>
|
|
|
+ <if test="outStoreNum != null ">and cm_shop_order.outStoreNum = #{outStoreNum}</if>
|
|
|
+ <if test="outStoreTimes != null ">and cm_shop_order.outStoreTimes = #{outStoreTimes}</if>
|
|
|
+ <if test="townID != null ">and cm_shop_order.townID = #{townID}</if>
|
|
|
+ <if test="note != null and note != ''">and cm_shop_order.note = #{note}</if>
|
|
|
+ <if test="eachDiscount != null ">and cm_shop_order.eachDiscount = #{eachDiscount}</if>
|
|
|
+ <if test="realPay != null ">and cm_shop_order.realPay = #{realPay}</if>
|
|
|
+ <if test="receiptAmount != null ">and cm_shop_order.receiptAmount = #{receiptAmount}</if>
|
|
|
+ <if test="accountAmount != null ">and cm_shop_order.accountAmount = #{accountAmount}</if>
|
|
|
+ <if test="productAmount != null ">and cm_shop_order.productAmount = #{productAmount}</if>
|
|
|
+ <if test="totalAmount != null ">and cm_shop_order.totalAmount = #{totalAmount}</if>
|
|
|
+ <if test="needPayAmount != null ">and cm_shop_order.needPayAmount = #{needPayAmount}</if>
|
|
|
+ <if test="discountAmount != null ">and cm_shop_order.discountAmount = #{discountAmount}</if>
|
|
|
+ <if test="preferential != null ">and cm_shop_order.preferential = #{preferential}</if>
|
|
|
+ <if test="promotionFullReduction != null ">and cm_shop_order.promotionFullReduction =
|
|
|
+ #{promotionFullReduction}
|
|
|
+ </if>
|
|
|
+ <if test="payFlag != null and payFlag != ''">and cm_shop_order.payFlag = #{payFlag}</if>
|
|
|
+ <if test="orderTime != null and orderTime != ''">and cm_shop_order.orderTime = #{orderTime}</if>
|
|
|
+ <if test="payTime != null and payTime != ''">and cm_shop_order.payTime = #{payTime}</if>
|
|
|
+ <if test="finishTime != null and finishTime != ''">and cm_shop_order.finishTime = #{finishTime}</if>
|
|
|
+ <if test="autoOverTimeMills != null ">and cm_shop_order.autoOverTimeMills = #{autoOverTimeMills}</if>
|
|
|
+ <if test="settleStatus != null and settleStatus != ''">and cm_shop_order.settleStatus = #{settleStatus}
|
|
|
+ </if>
|
|
|
+ <if test="payStatus != null and payStatus != ''">and cm_shop_order.payStatus = #{payStatus}</if>
|
|
|
+ <if test="receiptStatus != null and receiptStatus != ''">and cm_shop_order.receiptStatus =
|
|
|
+ #{receiptStatus}
|
|
|
+ </if>
|
|
|
+ <if test="sendOutStatus != null and sendOutStatus != ''">and cm_shop_order.sendOutStatus =
|
|
|
+ #{sendOutStatus}
|
|
|
+ </if>
|
|
|
+ <if test="refundStatus != null ">and cm_shop_order.refundStatus = #{refundStatus}</if>
|
|
|
+ <if test="returnGoodsStatus != null ">and cm_shop_order.returnGoodsStatus = #{returnGoodsStatus}</if>
|
|
|
+ <if test="receiveGoodsTime != null and receiveGoodsTime != ''">and cm_shop_order.receiveGoodsTime =
|
|
|
+ #{receiveGoodsTime}
|
|
|
+ </if>
|
|
|
+ <if test="autoReceiveTimeMills != null ">and cm_shop_order.autoReceiveTimeMills = #{autoReceiveTimeMills}
|
|
|
+ </if>
|
|
|
+ <if test="totalAddedValueTax != null ">and cm_shop_order.totalAddedValueTax = #{totalAddedValueTax}</if>
|
|
|
+ <if test="canRefundAmount != null ">and cm_shop_order.canRefundAmount = #{canRefundAmount}</if>
|
|
|
+ <if test="refundAmount != null ">and cm_shop_order.refundAmount = #{refundAmount}</if>
|
|
|
+ <if test="clubID != null ">and cm_shop_order.clubID = #{clubID}</if>
|
|
|
+ <if test="spID != null ">and cm_shop_order.spID = #{spID}</if>
|
|
|
+ <if test="mainSpID != null ">and cm_shop_order.mainSpID = #{mainSpID}</if>
|
|
|
+ <if test="orderBeanAmount != null ">and cm_shop_order.orderBeanAmount = #{orderBeanAmount}</if>
|
|
|
+ <if test="useBeanAmount != null ">and cm_shop_order.useBeanAmount = #{useBeanAmount}</if>
|
|
|
+ <if test="useBeanFlag != null ">and cm_shop_order.useBeanFlag = #{useBeanFlag}</if>
|
|
|
+ <if test="canRefundFlag != null ">and cm_shop_order.canRefundFlag = #{canRefundFlag}</if>
|
|
|
+ <if test="useBalanceFlag != null ">and cm_shop_order.useBalanceFlag = #{useBalanceFlag}</if>
|
|
|
+ <if test="canRefundBeans != null ">and cm_shop_order.canRefundBeans = #{canRefundBeans}</if>
|
|
|
+ <if test="freePostageFee != null ">and cm_shop_order.freePostageFee = #{freePostageFee}</if>
|
|
|
+ <if test="freePostageTicketID != null ">and cm_shop_order.freePostageTicketID = #{freePostageTicketID}</if>
|
|
|
+ <if test="brokerage != null ">and cm_shop_order.brokerage = #{brokerage}</if>
|
|
|
+ <if test="delFlag != null and delFlag != ''">and cm_shop_order.delFlag = #{delFlag}</if>
|
|
|
+ <if test="refundsAmount != null ">and cm_shop_order.refundsAmount = #{refundsAmount}</if>
|
|
|
+ <if test="orderStatusFlag != null and orderStatusFlag != ''">and cm_shop_order.orderStatusFlag =
|
|
|
+ #{orderStatusFlag}
|
|
|
+ </if>
|
|
|
+ <if test="buyStatus != null and buyStatus != ''">and cm_shop_order.buyStatus = #{buyStatus}</if>
|
|
|
+ <if test="deliveryTimeMills != null and deliveryTimeMills != ''">and cm_shop_order.deliveryTimeMills =
|
|
|
+ #{deliveryTimeMills}
|
|
|
+ </if>
|
|
|
+ <if test="orderDeliveryID != null ">and cm_shop_order.orderDeliveryID = #{orderDeliveryID}</if>
|
|
|
+ <if test="splitFlag != null and splitFlag != ''">and cm_shop_order.splitFlag = #{splitFlag}</if>
|
|
|
+ <if test="paying != null and paying != ''">and cm_shop_order.paying = #{paying}</if>
|
|
|
+ <if test="shopProductAmount != null ">and cm_shop_order.shopProductAmount = #{shopProductAmount}</if>
|
|
|
+ <if test="shopPostFee != null ">and cm_shop_order.shopPostFee = #{shopPostFee}</if>
|
|
|
+ <if test="shopPostFlag != null and shopPostFlag != ''">and cm_shop_order.shopPostFlag = #{shopPostFlag}
|
|
|
+ </if>
|
|
|
+ <if test="shopTaxFee != null ">and cm_shop_order.shopTaxFee = #{shopTaxFee}</if>
|
|
|
+ <if test="payCmAmount != null ">and cm_shop_order.payCmAmount = #{payCmAmount}</if>
|
|
|
+ <if test="shouldPayShopAmount != null ">and cm_shop_order.shouldPayShopAmount = #{shouldPayShopAmount}</if>
|
|
|
+ <if test="payedShopAmount != null ">and cm_shop_order.payedShopAmount = #{payedShopAmount}</if>
|
|
|
+ <if test="shopOtherFee != null ">and cm_shop_order.shopOtherFee = #{shopOtherFee}</if>
|
|
|
+ <if test="receiptedFlag != null and receiptedFlag != ''">and cm_shop_order.receiptedFlag =
|
|
|
+ #{receiptedFlag}
|
|
|
+ </if>
|
|
|
+ <if test="receiptedType != null and receiptedType != ''">and cm_shop_order.receiptedType =
|
|
|
+ #{receiptedType}
|
|
|
+ </if>
|
|
|
+ <if test="costType != null and costType != ''">and cm_shop_order.costType = #{costType}</if>
|
|
|
+ <if test="proportional != null ">and cm_shop_order.proportional = #{proportional}</if>
|
|
|
+ <if test="modifyShouldPayNote != null and modifyShouldPayNote != ''">and cm_shop_order.modifyShouldPayNote
|
|
|
+ = #{modifyShouldPayNote}
|
|
|
+ </if>
|
|
|
+ <if test="modifyShouldPayUserID != null ">and cm_shop_order.modifyShouldPayUserID =
|
|
|
+ #{modifyShouldPayUserID}
|
|
|
+ </if>
|
|
|
+ <if test="modifyShouldPayDate != null ">and cm_shop_order.modifyShouldPayDate = #{modifyShouldPayDate}</if>
|
|
|
+ <if test="zeroCostFlag != null ">and cm_shop_order.zeroCostFlag = #{zeroCostFlag}</if>
|
|
|
+ <if test="differenceType != null and differenceType != ''">and cm_shop_order.differenceType =
|
|
|
+ #{differenceType}
|
|
|
+ </if>
|
|
|
+ <if test="differencePrice != null ">and cm_shop_order.differencePrice = #{differencePrice}</if>
|
|
|
+ <if test="svipShopReduction != null ">and cm_shop_order.svipShopReduction = #{svipShopReduction}</if>
|
|
|
+ <if test="splitCode != null and splitCode != ''">and cm_shop_order.splitCode = #{splitCode}</if>
|
|
|
+ <if test="paySuccessCounter != null ">and cm_shop_order.paySuccessCounter = #{paySuccessCounter}</if>
|
|
|
+ <if test="onlinePayWays != null and onlinePayWays != ''">and cm_shop_order.onlinePayWays =
|
|
|
+ #{onlinePayWays}
|
|
|
+ </if>
|
|
|
+ <if test="status != null and status != ''">and cm_shop_order.shopStatus = #{status}</if>
|
|
|
+ </where>
|
|
|
+ group by cm_shop_order.shopOrderID
|
|
|
+ order by cm_shop_order.orderTime desc
|
|
|
+ </select>
|
|
|
+ <select id="getCmShopOrderCount" parameterType="com.caimei.modules.order.entity.NewShopOrder" resultType="String">
|
|
|
+ select count(1)
|
|
|
+ from cm_shop_order AS cm_shop_order
|
|
|
+ <where>cm_shop_order.delFlag = 0
|
|
|
+ <if test="shopOrderID != null and shopOrderID != ''">
|
|
|
+ and cm_shop_order.shopOrderID
|
|
|
+ = #{shopOrderID}
|
|
|
+ </if>
|
|
|
+ <if test="shopOrderID.toString().toUpperCase().indexOf('=')!=-1">
|
|
|
+ <if test="shopOrderID.toString().toUpperCase().indexOf('NOT')!=-1">not</if>
|
|
|
+ <if test="shopOrderID.toString().toUpperCase().indexOf('IN')!=-1">in</if>
|
|
|
+ <foreach item="shopOrderIDIn"
|
|
|
+ collection="shopOrderID.toString().substring(shopOrderID.toUpperCase().toString().indexOf('=')+1,shopOrderID.toString().length()).trim().split(',')"
|
|
|
+ open="(" separator="," close=")">
|
|
|
+ #{shopOrderIDIn}
|
|
|
+ </foreach>
|
|
|
+ </if>
|
|
|
+ <if test="shopOrderNo != null and shopOrderNo != ''">and cm_shop_order.shopOrderNo = #{shopOrderNo}</if>
|
|
|
+ <if test="orderNo != null and orderNo != ''">and cm_shop_order.orderNo = #{orderNo}</if>
|
|
|
+ <if test="orderID != null ">and cm_shop_order.orderID = #{orderID}</if>
|
|
|
+ <if test="organizeID != null ">and cm_shop_order.organizeID = #{organizeID}</if>
|
|
|
+ <if test="isColdChina != null ">and cm_shop_order.isColdChina = #{isColdChina}</if>
|
|
|
+ <if test="userID != null ">and cm_shop_order.userID = #{userID}</if>
|
|
|
+ <if test="shopID != null ">and cm_shop_order.shopID = #{shopID}</if>
|
|
|
+ <if test="orderPromotionsId != null ">and cm_shop_order.orderPromotionsId = #{orderPromotionsId}</if>
|
|
|
+ <if test="orderType != null ">and cm_shop_order.orderType = #{orderType}</if>
|
|
|
+ <if test="orderSubmitType != null ">and cm_shop_order.orderSubmitType = #{orderSubmitType}</if>
|
|
|
+ <if test="presentNum != null ">and cm_shop_order.presentNum = #{presentNum}</if>
|
|
|
+ <if test="itemCount != null ">and cm_shop_order.itemCount = #{itemCount}</if>
|
|
|
+ <if test="outStoreNum != null ">and cm_shop_order.outStoreNum = #{outStoreNum}</if>
|
|
|
+ <if test="outStoreTimes != null ">and cm_shop_order.outStoreTimes = #{outStoreTimes}</if>
|
|
|
+ <if test="townID != null ">and cm_shop_order.townID = #{townID}</if>
|
|
|
+ <if test="note != null and note != ''">and cm_shop_order.note = #{note}</if>
|
|
|
+ <if test="eachDiscount != null ">and cm_shop_order.eachDiscount = #{eachDiscount}</if>
|
|
|
+ <if test="realPay != null ">and cm_shop_order.realPay = #{realPay}</if>
|
|
|
+ <if test="receiptAmount != null ">and cm_shop_order.receiptAmount = #{receiptAmount}</if>
|
|
|
+ <if test="accountAmount != null ">and cm_shop_order.accountAmount = #{accountAmount}</if>
|
|
|
+ <if test="productAmount != null ">and cm_shop_order.productAmount = #{productAmount}</if>
|
|
|
+ <if test="totalAmount != null ">and cm_shop_order.totalAmount = #{totalAmount}</if>
|
|
|
+ <if test="needPayAmount != null ">and cm_shop_order.needPayAmount = #{needPayAmount}</if>
|
|
|
+ <if test="discountAmount != null ">and cm_shop_order.discountAmount = #{discountAmount}</if>
|
|
|
+ <if test="preferential != null ">and cm_shop_order.preferential = #{preferential}</if>
|
|
|
+ <if test="promotionFullReduction != null ">and cm_shop_order.promotionFullReduction =
|
|
|
+ #{promotionFullReduction}
|
|
|
+ </if>
|
|
|
+ <if test="payFlag != null and payFlag != ''">and cm_shop_order.payFlag = #{payFlag}</if>
|
|
|
+ <if test="orderTime != null and orderTime != ''">and cm_shop_order.orderTime = #{orderTime}</if>
|
|
|
+ <if test="payTime != null and payTime != ''">and cm_shop_order.payTime = #{payTime}</if>
|
|
|
+ <if test="finishTime != null and finishTime != ''">and cm_shop_order.finishTime = #{finishTime}</if>
|
|
|
+ <if test="autoOverTimeMills != null ">and cm_shop_order.autoOverTimeMills = #{autoOverTimeMills}</if>
|
|
|
+ <if test="settleStatus != null and settleStatus != ''">and cm_shop_order.settleStatus = #{settleStatus}
|
|
|
+ </if>
|
|
|
+ <if test="payStatus != null and payStatus != ''">and cm_shop_order.payStatus = #{payStatus}</if>
|
|
|
+ <if test="receiptStatus != null and receiptStatus != ''">and cm_shop_order.receiptStatus =
|
|
|
+ #{receiptStatus}
|
|
|
+ </if>
|
|
|
+ <if test="sendOutStatus != null and sendOutStatus != ''">and cm_shop_order.sendOutStatus =
|
|
|
+ #{sendOutStatus}
|
|
|
+ </if>
|
|
|
+ <if test="refundStatus != null ">and cm_shop_order.refundStatus = #{refundStatus}</if>
|
|
|
+ <if test="returnGoodsStatus != null ">and cm_shop_order.returnGoodsStatus = #{returnGoodsStatus}</if>
|
|
|
+ <if test="receiveGoodsTime != null and receiveGoodsTime != ''">and cm_shop_order.receiveGoodsTime =
|
|
|
+ #{receiveGoodsTime}
|
|
|
+ </if>
|
|
|
+ <if test="autoReceiveTimeMills != null ">and cm_shop_order.autoReceiveTimeMills = #{autoReceiveTimeMills}
|
|
|
+ </if>
|
|
|
+ <if test="totalAddedValueTax != null ">and cm_shop_order.totalAddedValueTax = #{totalAddedValueTax}</if>
|
|
|
+ <if test="canRefundAmount != null ">and cm_shop_order.canRefundAmount = #{canRefundAmount}</if>
|
|
|
+ <if test="refundAmount != null ">and cm_shop_order.refundAmount = #{refundAmount}</if>
|
|
|
+ <if test="clubID != null ">and cm_shop_order.clubID = #{clubID}</if>
|
|
|
+ <if test="spID != null ">and cm_shop_order.spID = #{spID}</if>
|
|
|
+ <if test="mainSpID != null ">and cm_shop_order.mainSpID = #{mainSpID}</if>
|
|
|
+ <if test="orderBeanAmount != null ">and cm_shop_order.orderBeanAmount = #{orderBeanAmount}</if>
|
|
|
+ <if test="useBeanAmount != null ">and cm_shop_order.useBeanAmount = #{useBeanAmount}</if>
|
|
|
+ <if test="useBeanFlag != null ">and cm_shop_order.useBeanFlag = #{useBeanFlag}</if>
|
|
|
+ <if test="canRefundFlag != null ">and cm_shop_order.canRefundFlag = #{canRefundFlag}</if>
|
|
|
+ <if test="useBalanceFlag != null ">and cm_shop_order.useBalanceFlag = #{useBalanceFlag}</if>
|
|
|
+ <if test="canRefundBeans != null ">and cm_shop_order.canRefundBeans = #{canRefundBeans}</if>
|
|
|
+ <if test="freePostageFee != null ">and cm_shop_order.freePostageFee = #{freePostageFee}</if>
|
|
|
+ <if test="freePostageTicketID != null ">and cm_shop_order.freePostageTicketID = #{freePostageTicketID}</if>
|
|
|
+ <if test="brokerage != null ">and cm_shop_order.brokerage = #{brokerage}</if>
|
|
|
+ <if test="delFlag != null and delFlag != ''">and cm_shop_order.delFlag = #{delFlag}</if>
|
|
|
+ <if test="refundsAmount != null ">and cm_shop_order.refundsAmount = #{refundsAmount}</if>
|
|
|
+ <if test="orderStatusFlag != null and orderStatusFlag != ''">and cm_shop_order.orderStatusFlag =
|
|
|
+ #{orderStatusFlag}
|
|
|
+ </if>
|
|
|
+ <if test="buyStatus != null and buyStatus != ''">and cm_shop_order.buyStatus = #{buyStatus}</if>
|
|
|
+ <if test="deliveryTimeMills != null and deliveryTimeMills != ''">and cm_shop_order.deliveryTimeMills =
|
|
|
+ #{deliveryTimeMills}
|
|
|
+ </if>
|
|
|
+ <if test="orderDeliveryID != null ">and cm_shop_order.orderDeliveryID = #{orderDeliveryID}</if>
|
|
|
+ <if test="splitFlag != null and splitFlag != ''">and cm_shop_order.splitFlag = #{splitFlag}</if>
|
|
|
+ <if test="paying != null and paying != ''">and cm_shop_order.paying = #{paying}</if>
|
|
|
+ <if test="shopProductAmount != null ">and cm_shop_order.shopProductAmount = #{shopProductAmount}</if>
|
|
|
+ <if test="shopPostFee != null ">and cm_shop_order.shopPostFee = #{shopPostFee}</if>
|
|
|
+ <if test="shopPostFlag != null and shopPostFlag != ''">and cm_shop_order.shopPostFlag = #{shopPostFlag}
|
|
|
+ </if>
|
|
|
+ <if test="shopTaxFee != null ">and cm_shop_order.shopTaxFee = #{shopTaxFee}</if>
|
|
|
+ <if test="payCmAmount != null ">and cm_shop_order.payCmAmount = #{payCmAmount}</if>
|
|
|
+ <if test="shouldPayShopAmount != null ">and cm_shop_order.shouldPayShopAmount = #{shouldPayShopAmount}</if>
|
|
|
+ <if test="payedShopAmount != null ">and cm_shop_order.payedShopAmount = #{payedShopAmount}</if>
|
|
|
+ <if test="shopOtherFee != null ">and cm_shop_order.shopOtherFee = #{shopOtherFee}</if>
|
|
|
+ <if test="receiptedFlag != null and receiptedFlag != ''">and cm_shop_order.receiptedFlag =
|
|
|
+ #{receiptedFlag}
|
|
|
+ </if>
|
|
|
+ <if test="receiptedType != null and receiptedType != ''">and cm_shop_order.receiptedType =
|
|
|
+ #{receiptedType}
|
|
|
+ </if>
|
|
|
+ <if test="costType != null and costType != ''">and cm_shop_order.costType = #{costType}</if>
|
|
|
+ <if test="proportional != null ">and cm_shop_order.proportional = #{proportional}</if>
|
|
|
+ <if test="modifyShouldPayNote != null and modifyShouldPayNote != ''">and cm_shop_order.modifyShouldPayNote
|
|
|
+ = #{modifyShouldPayNote}
|
|
|
+ </if>
|
|
|
+ <if test="modifyShouldPayUserID != null ">and cm_shop_order.modifyShouldPayUserID =
|
|
|
+ #{modifyShouldPayUserID}
|
|
|
+ </if>
|
|
|
+ <if test="modifyShouldPayDate != null ">and cm_shop_order.modifyShouldPayDate = #{modifyShouldPayDate}</if>
|
|
|
+ <if test="zeroCostFlag != null ">and cm_shop_order.zeroCostFlag = #{zeroCostFlag}</if>
|
|
|
+ <if test="differenceType != null and differenceType != ''">and cm_shop_order.differenceType =
|
|
|
+ #{differenceType}
|
|
|
+ </if>
|
|
|
+ <if test="differencePrice != null ">and cm_shop_order.differencePrice = #{differencePrice}</if>
|
|
|
+ <if test="svipShopReduction != null ">and cm_shop_order.svipShopReduction = #{svipShopReduction}</if>
|
|
|
+ <if test="splitCode != null and splitCode != ''">and cm_shop_order.splitCode = #{splitCode}</if>
|
|
|
+ <if test="paySuccessCounter != null ">and cm_shop_order.paySuccessCounter = #{paySuccessCounter}</if>
|
|
|
+ <if test="onlinePayWays != null and onlinePayWays != ''">and cm_shop_order.onlinePayWays =
|
|
|
+ #{onlinePayWays}
|
|
|
+ </if>
|
|
|
+ <if test="status != null and status != ''">and cm_shop_order.shopStatus = #{status}</if>
|
|
|
+ </where>
|
|
|
+ group by cm_shop_order.shopOrderID
|
|
|
+ </select>
|
|
|
+
|
|
|
+ <select id="getCmShopOrderByShopOrderID" parameterType="String" resultMap="CmShopOrderResult">
|
|
|
+ <include refid="selectCmShopOrderVo"/>
|
|
|
+ from cm_shop_order AS cm_shop_order
|
|
|
+ where cm_shop_order.delFlag = 0 and cm_shop_order.shopOrderID = #{shopOrderID}
|
|
|
+ </select>
|
|
|
+
|
|
|
+ <select id="getByIds" parameterType="com.caimei.modules.order.entity.NewShopOrder" resultType="String">
|
|
|
+ select shopOrderID
|
|
|
+ from cm_shop_order AS cm_shop_order
|
|
|
+ <where>cm_shop_order.delFlag = 0
|
|
|
+ <if test="shopOrderID != null and shopOrderID != ''">
|
|
|
+ and cm_shop_order.shopOrderID
|
|
|
+ = #{shopOrderID}
|
|
|
+ </if>
|
|
|
+ <if test="shopOrderID.toString().toUpperCase().indexOf('=')!=-1">
|
|
|
+ <if test="shopOrderID.toString().toUpperCase().indexOf('NOT')!=-1">not</if>
|
|
|
+ <if test="shopOrderID.toString().toUpperCase().indexOf('IN')!=-1">in</if>
|
|
|
+ <foreach item="shopOrderIDIn"
|
|
|
+ collection="shopOrderID.toString().substring(shopOrderID.toUpperCase().toString().indexOf('=')+1,shopOrderID.toString().length()).trim().split(',')"
|
|
|
+ open="(" separator="," close=")">
|
|
|
+ #{shopOrderIDIn}
|
|
|
+ </foreach>
|
|
|
+ </if>
|
|
|
+ <if test="shopOrderNo != null and shopOrderNo != ''">and cm_shop_order.shopOrderNo = #{shopOrderNo}</if>
|
|
|
+ <if test="orderNo != null and orderNo != ''">and cm_shop_order.orderNo = #{orderNo}</if>
|
|
|
+ <if test="orderID != null ">and cm_shop_order.orderID = #{orderID}</if>
|
|
|
+ <if test="organizeID != null ">and cm_shop_order.organizeID = #{organizeID}</if>
|
|
|
+ <if test="isColdChina != null ">and cm_shop_order.isColdChina = #{isColdChina}</if>
|
|
|
+ <if test="userID != null ">and cm_shop_order.userID = #{userID}</if>
|
|
|
+ <if test="shopID != null ">and cm_shop_order.shopID = #{shopID}</if>
|
|
|
+ <if test="orderPromotionsId != null ">and cm_shop_order.orderPromotionsId = #{orderPromotionsId}</if>
|
|
|
+ <if test="orderType != null ">and cm_shop_order.orderType = #{orderType}</if>
|
|
|
+ <if test="orderSubmitType != null ">and cm_shop_order.orderSubmitType = #{orderSubmitType}</if>
|
|
|
+ <if test="presentNum != null ">and cm_shop_order.presentNum = #{presentNum}</if>
|
|
|
+ <if test="itemCount != null ">and cm_shop_order.itemCount = #{itemCount}</if>
|
|
|
+ <if test="outStoreNum != null ">and cm_shop_order.outStoreNum = #{outStoreNum}</if>
|
|
|
+ <if test="outStoreTimes != null ">and cm_shop_order.outStoreTimes = #{outStoreTimes}</if>
|
|
|
+ <if test="townID != null ">and cm_shop_order.townID = #{townID}</if>
|
|
|
+ <if test="note != null and note != ''">and cm_shop_order.note = #{note}</if>
|
|
|
+ <if test="eachDiscount != null ">and cm_shop_order.eachDiscount = #{eachDiscount}</if>
|
|
|
+ <if test="realPay != null ">and cm_shop_order.realPay = #{realPay}</if>
|
|
|
+ <if test="receiptAmount != null ">and cm_shop_order.receiptAmount = #{receiptAmount}</if>
|
|
|
+ <if test="accountAmount != null ">and cm_shop_order.accountAmount = #{accountAmount}</if>
|
|
|
+ <if test="productAmount != null ">and cm_shop_order.productAmount = #{productAmount}</if>
|
|
|
+ <if test="totalAmount != null ">and cm_shop_order.totalAmount = #{totalAmount}</if>
|
|
|
+ <if test="needPayAmount != null ">and cm_shop_order.needPayAmount = #{needPayAmount}</if>
|
|
|
+ <if test="discountAmount != null ">and cm_shop_order.discountAmount = #{discountAmount}</if>
|
|
|
+ <if test="preferential != null ">and cm_shop_order.preferential = #{preferential}</if>
|
|
|
+ <if test="promotionFullReduction != null ">and cm_shop_order.promotionFullReduction =
|
|
|
+ #{promotionFullReduction}
|
|
|
+ </if>
|
|
|
+ <if test="payFlag != null and payFlag != ''">and cm_shop_order.payFlag = #{payFlag}</if>
|
|
|
+ <if test="orderTime != null and orderTime != ''">and cm_shop_order.orderTime = #{orderTime}</if>
|
|
|
+ <if test="payTime != null and payTime != ''">and cm_shop_order.payTime = #{payTime}</if>
|
|
|
+ <if test="finishTime != null and finishTime != ''">and cm_shop_order.finishTime = #{finishTime}</if>
|
|
|
+ <if test="autoOverTimeMills != null ">and cm_shop_order.autoOverTimeMills = #{autoOverTimeMills}</if>
|
|
|
+ <if test="settleStatus != null and settleStatus != ''">and cm_shop_order.settleStatus = #{settleStatus}
|
|
|
+ </if>
|
|
|
+ <if test="payStatus != null and payStatus != ''">and cm_shop_order.payStatus = #{payStatus}</if>
|
|
|
+ <if test="receiptStatus != null and receiptStatus != ''">and cm_shop_order.receiptStatus =
|
|
|
+ #{receiptStatus}
|
|
|
+ </if>
|
|
|
+ <if test="sendOutStatus != null and sendOutStatus != ''">and cm_shop_order.sendOutStatus =
|
|
|
+ #{sendOutStatus}
|
|
|
+ </if>
|
|
|
+ <if test="refundStatus != null ">and cm_shop_order.refundStatus = #{refundStatus}</if>
|
|
|
+ <if test="returnGoodsStatus != null ">and cm_shop_order.returnGoodsStatus = #{returnGoodsStatus}</if>
|
|
|
+ <if test="receiveGoodsTime != null and receiveGoodsTime != ''">and cm_shop_order.receiveGoodsTime =
|
|
|
+ #{receiveGoodsTime}
|
|
|
+ </if>
|
|
|
+ <if test="autoReceiveTimeMills != null ">and cm_shop_order.autoReceiveTimeMills = #{autoReceiveTimeMills}
|
|
|
+ </if>
|
|
|
+ <if test="totalAddedValueTax != null ">and cm_shop_order.totalAddedValueTax = #{totalAddedValueTax}</if>
|
|
|
+ <if test="canRefundAmount != null ">and cm_shop_order.canRefundAmount = #{canRefundAmount}</if>
|
|
|
+ <if test="refundAmount != null ">and cm_shop_order.refundAmount = #{refundAmount}</if>
|
|
|
+ <if test="clubID != null ">and cm_shop_order.clubID = #{clubID}</if>
|
|
|
+ <if test="spID != null ">and cm_shop_order.spID = #{spID}</if>
|
|
|
+ <if test="mainSpID != null ">and cm_shop_order.mainSpID = #{mainSpID}</if>
|
|
|
+ <if test="orderBeanAmount != null ">and cm_shop_order.orderBeanAmount = #{orderBeanAmount}</if>
|
|
|
+ <if test="useBeanAmount != null ">and cm_shop_order.useBeanAmount = #{useBeanAmount}</if>
|
|
|
+ <if test="useBeanFlag != null ">and cm_shop_order.useBeanFlag = #{useBeanFlag}</if>
|
|
|
+ <if test="canRefundFlag != null ">and cm_shop_order.canRefundFlag = #{canRefundFlag}</if>
|
|
|
+ <if test="useBalanceFlag != null ">and cm_shop_order.useBalanceFlag = #{useBalanceFlag}</if>
|
|
|
+ <if test="canRefundBeans != null ">and cm_shop_order.canRefundBeans = #{canRefundBeans}</if>
|
|
|
+ <if test="freePostageFee != null ">and cm_shop_order.freePostageFee = #{freePostageFee}</if>
|
|
|
+ <if test="freePostageTicketID != null ">and cm_shop_order.freePostageTicketID = #{freePostageTicketID}</if>
|
|
|
+ <if test="brokerage != null ">and cm_shop_order.brokerage = #{brokerage}</if>
|
|
|
+ <if test="delFlag != null and delFlag != ''">and cm_shop_order.delFlag = #{delFlag}</if>
|
|
|
+ <if test="refundsAmount != null ">and cm_shop_order.refundsAmount = #{refundsAmount}</if>
|
|
|
+ <if test="orderStatusFlag != null and orderStatusFlag != ''">and cm_shop_order.orderStatusFlag =
|
|
|
+ #{orderStatusFlag}
|
|
|
+ </if>
|
|
|
+ <if test="buyStatus != null and buyStatus != ''">and cm_shop_order.buyStatus = #{buyStatus}</if>
|
|
|
+ <if test="deliveryTimeMills != null and deliveryTimeMills != ''">and cm_shop_order.deliveryTimeMills =
|
|
|
+ #{deliveryTimeMills}
|
|
|
+ </if>
|
|
|
+ <if test="orderDeliveryID != null ">and cm_shop_order.orderDeliveryID = #{orderDeliveryID}</if>
|
|
|
+ <if test="splitFlag != null and splitFlag != ''">and cm_shop_order.splitFlag = #{splitFlag}</if>
|
|
|
+ <if test="paying != null and paying != ''">and cm_shop_order.paying = #{paying}</if>
|
|
|
+ <if test="shopProductAmount != null ">and cm_shop_order.shopProductAmount = #{shopProductAmount}</if>
|
|
|
+ <if test="shopPostFee != null ">and cm_shop_order.shopPostFee = #{shopPostFee}</if>
|
|
|
+ <if test="shopPostFlag != null and shopPostFlag != ''">and cm_shop_order.shopPostFlag = #{shopPostFlag}
|
|
|
+ </if>
|
|
|
+ <if test="shopTaxFee != null ">and cm_shop_order.shopTaxFee = #{shopTaxFee}</if>
|
|
|
+ <if test="payCmAmount != null ">and cm_shop_order.payCmAmount = #{payCmAmount}</if>
|
|
|
+ <if test="shouldPayShopAmount != null ">and cm_shop_order.shouldPayShopAmount = #{shouldPayShopAmount}</if>
|
|
|
+ <if test="payedShopAmount != null ">and cm_shop_order.payedShopAmount = #{payedShopAmount}</if>
|
|
|
+ <if test="shopOtherFee != null ">and cm_shop_order.shopOtherFee = #{shopOtherFee}</if>
|
|
|
+ <if test="receiptedFlag != null and receiptedFlag != ''">and cm_shop_order.receiptedFlag =
|
|
|
+ #{receiptedFlag}
|
|
|
+ </if>
|
|
|
+ <if test="receiptedType != null and receiptedType != ''">and cm_shop_order.receiptedType =
|
|
|
+ #{receiptedType}
|
|
|
+ </if>
|
|
|
+ <if test="costType != null and costType != ''">and cm_shop_order.costType = #{costType}</if>
|
|
|
+ <if test="proportional != null ">and cm_shop_order.proportional = #{proportional}</if>
|
|
|
+ <if test="modifyShouldPayNote != null and modifyShouldPayNote != ''">and cm_shop_order.modifyShouldPayNote
|
|
|
+ = #{modifyShouldPayNote}
|
|
|
+ </if>
|
|
|
+ <if test="modifyShouldPayUserID != null ">and cm_shop_order.modifyShouldPayUserID =
|
|
|
+ #{modifyShouldPayUserID}
|
|
|
+ </if>
|
|
|
+ <if test="modifyShouldPayDate != null ">and cm_shop_order.modifyShouldPayDate = #{modifyShouldPayDate}</if>
|
|
|
+ <if test="zeroCostFlag != null ">and cm_shop_order.zeroCostFlag = #{zeroCostFlag}</if>
|
|
|
+ <if test="differenceType != null and differenceType != ''">and cm_shop_order.differenceType =
|
|
|
+ #{differenceType}
|
|
|
+ </if>
|
|
|
+ <if test="differencePrice != null ">and cm_shop_order.differencePrice = #{differencePrice}</if>
|
|
|
+ <if test="svipShopReduction != null ">and cm_shop_order.svipShopReduction = #{svipShopReduction}</if>
|
|
|
+ <if test="splitCode != null and splitCode != ''">and cm_shop_order.splitCode = #{splitCode}</if>
|
|
|
+ <if test="paySuccessCounter != null ">and cm_shop_order.paySuccessCounter = #{paySuccessCounter}</if>
|
|
|
+ <if test="onlinePayWays != null and onlinePayWays != ''">and cm_shop_order.onlinePayWays =
|
|
|
+ #{onlinePayWays}
|
|
|
+ </if>
|
|
|
+ <if test="status != null and status != ''">and cm_shop_order.shopStatus = #{status}</if>
|
|
|
+ </where>
|
|
|
+ group by cm_shop_order.shopOrderID
|
|
|
+ </select>
|
|
|
+ <select id="getById" parameterType="com.caimei.modules.order.entity.NewShopOrder" resultType="String">
|
|
|
+ select shopOrderID
|
|
|
+ from cm_shop_order AS cm_shop_order
|
|
|
+ <where>cm_shop_order.delFlag = 0
|
|
|
+ <if test="shopOrderID != null and shopOrderID != ''">
|
|
|
+ and cm_shop_order.shopOrderID
|
|
|
+ = #{shopOrderID}
|
|
|
+ </if>
|
|
|
+ <if test="shopOrderID.toString().toUpperCase().indexOf('=')!=-1">
|
|
|
+ <if test="shopOrderID.toString().toUpperCase().indexOf('NOT')!=-1">not</if>
|
|
|
+ <if test="shopOrderID.toString().toUpperCase().indexOf('IN')!=-1">in</if>
|
|
|
+ <foreach item="shopOrderIDIn"
|
|
|
+ collection="shopOrderID.toString().substring(shopOrderID.toUpperCase().toString().indexOf('=')+1,shopOrderID.toString().length()).trim().split(',')"
|
|
|
+ open="(" separator="," close=")">
|
|
|
+ #{shopOrderIDIn}
|
|
|
+ </foreach>
|
|
|
+ </if>
|
|
|
+ <if test="shopOrderNo != null and shopOrderNo != ''">and cm_shop_order.shopOrderNo = #{shopOrderNo}</if>
|
|
|
+ <if test="orderNo != null and orderNo != ''">and cm_shop_order.orderNo = #{orderNo}</if>
|
|
|
+ <if test="orderID != null ">and cm_shop_order.orderID = #{orderID}</if>
|
|
|
+ <if test="organizeID != null ">and cm_shop_order.organizeID = #{organizeID}</if>
|
|
|
+ <if test="isColdChina != null ">and cm_shop_order.isColdChina = #{isColdChina}</if>
|
|
|
+ <if test="userID != null ">and cm_shop_order.userID = #{userID}</if>
|
|
|
+ <if test="shopID != null ">and cm_shop_order.shopID = #{shopID}</if>
|
|
|
+ <if test="orderPromotionsId != null ">and cm_shop_order.orderPromotionsId = #{orderPromotionsId}</if>
|
|
|
+ <if test="orderType != null ">and cm_shop_order.orderType = #{orderType}</if>
|
|
|
+ <if test="orderSubmitType != null ">and cm_shop_order.orderSubmitType = #{orderSubmitType}</if>
|
|
|
+ <if test="presentNum != null ">and cm_shop_order.presentNum = #{presentNum}</if>
|
|
|
+ <if test="itemCount != null ">and cm_shop_order.itemCount = #{itemCount}</if>
|
|
|
+ <if test="outStoreNum != null ">and cm_shop_order.outStoreNum = #{outStoreNum}</if>
|
|
|
+ <if test="outStoreTimes != null ">and cm_shop_order.outStoreTimes = #{outStoreTimes}</if>
|
|
|
+ <if test="townID != null ">and cm_shop_order.townID = #{townID}</if>
|
|
|
+ <if test="note != null and note != ''">and cm_shop_order.note = #{note}</if>
|
|
|
+ <if test="eachDiscount != null ">and cm_shop_order.eachDiscount = #{eachDiscount}</if>
|
|
|
+ <if test="realPay != null ">and cm_shop_order.realPay = #{realPay}</if>
|
|
|
+ <if test="receiptAmount != null ">and cm_shop_order.receiptAmount = #{receiptAmount}</if>
|
|
|
+ <if test="accountAmount != null ">and cm_shop_order.accountAmount = #{accountAmount}</if>
|
|
|
+ <if test="productAmount != null ">and cm_shop_order.productAmount = #{productAmount}</if>
|
|
|
+ <if test="totalAmount != null ">and cm_shop_order.totalAmount = #{totalAmount}</if>
|
|
|
+ <if test="needPayAmount != null ">and cm_shop_order.needPayAmount = #{needPayAmount}</if>
|
|
|
+ <if test="discountAmount != null ">and cm_shop_order.discountAmount = #{discountAmount}</if>
|
|
|
+ <if test="preferential != null ">and cm_shop_order.preferential = #{preferential}</if>
|
|
|
+ <if test="promotionFullReduction != null ">and cm_shop_order.promotionFullReduction =
|
|
|
+ #{promotionFullReduction}
|
|
|
+ </if>
|
|
|
+ <if test="payFlag != null and payFlag != ''">and cm_shop_order.payFlag = #{payFlag}</if>
|
|
|
+ <if test="orderTime != null and orderTime != ''">and cm_shop_order.orderTime = #{orderTime}</if>
|
|
|
+ <if test="payTime != null and payTime != ''">and cm_shop_order.payTime = #{payTime}</if>
|
|
|
+ <if test="finishTime != null and finishTime != ''">and cm_shop_order.finishTime = #{finishTime}</if>
|
|
|
+ <if test="autoOverTimeMills != null ">and cm_shop_order.autoOverTimeMills = #{autoOverTimeMills}</if>
|
|
|
+ <if test="settleStatus != null and settleStatus != ''">and cm_shop_order.settleStatus = #{settleStatus}
|
|
|
+ </if>
|
|
|
+ <if test="payStatus != null and payStatus != ''">and cm_shop_order.payStatus = #{payStatus}</if>
|
|
|
+ <if test="receiptStatus != null and receiptStatus != ''">and cm_shop_order.receiptStatus =
|
|
|
+ #{receiptStatus}
|
|
|
+ </if>
|
|
|
+ <if test="sendOutStatus != null and sendOutStatus != ''">and cm_shop_order.sendOutStatus =
|
|
|
+ #{sendOutStatus}
|
|
|
+ </if>
|
|
|
+ <if test="refundStatus != null ">and cm_shop_order.refundStatus = #{refundStatus}</if>
|
|
|
+ <if test="returnGoodsStatus != null ">and cm_shop_order.returnGoodsStatus = #{returnGoodsStatus}</if>
|
|
|
+ <if test="receiveGoodsTime != null and receiveGoodsTime != ''">and cm_shop_order.receiveGoodsTime =
|
|
|
+ #{receiveGoodsTime}
|
|
|
+ </if>
|
|
|
+ <if test="autoReceiveTimeMills != null ">and cm_shop_order.autoReceiveTimeMills = #{autoReceiveTimeMills}
|
|
|
+ </if>
|
|
|
+ <if test="totalAddedValueTax != null ">and cm_shop_order.totalAddedValueTax = #{totalAddedValueTax}</if>
|
|
|
+ <if test="canRefundAmount != null ">and cm_shop_order.canRefundAmount = #{canRefundAmount}</if>
|
|
|
+ <if test="refundAmount != null ">and cm_shop_order.refundAmount = #{refundAmount}</if>
|
|
|
+ <if test="clubID != null ">and cm_shop_order.clubID = #{clubID}</if>
|
|
|
+ <if test="spID != null ">and cm_shop_order.spID = #{spID}</if>
|
|
|
+ <if test="mainSpID != null ">and cm_shop_order.mainSpID = #{mainSpID}</if>
|
|
|
+ <if test="orderBeanAmount != null ">and cm_shop_order.orderBeanAmount = #{orderBeanAmount}</if>
|
|
|
+ <if test="useBeanAmount != null ">and cm_shop_order.useBeanAmount = #{useBeanAmount}</if>
|
|
|
+ <if test="useBeanFlag != null ">and cm_shop_order.useBeanFlag = #{useBeanFlag}</if>
|
|
|
+ <if test="canRefundFlag != null ">and cm_shop_order.canRefundFlag = #{canRefundFlag}</if>
|
|
|
+ <if test="useBalanceFlag != null ">and cm_shop_order.useBalanceFlag = #{useBalanceFlag}</if>
|
|
|
+ <if test="canRefundBeans != null ">and cm_shop_order.canRefundBeans = #{canRefundBeans}</if>
|
|
|
+ <if test="freePostageFee != null ">and cm_shop_order.freePostageFee = #{freePostageFee}</if>
|
|
|
+ <if test="freePostageTicketID != null ">and cm_shop_order.freePostageTicketID = #{freePostageTicketID}</if>
|
|
|
+ <if test="brokerage != null ">and cm_shop_order.brokerage = #{brokerage}</if>
|
|
|
+ <if test="delFlag != null and delFlag != ''">and cm_shop_order.delFlag = #{delFlag}</if>
|
|
|
+ <if test="refundsAmount != null ">and cm_shop_order.refundsAmount = #{refundsAmount}</if>
|
|
|
+ <if test="orderStatusFlag != null and orderStatusFlag != ''">and cm_shop_order.orderStatusFlag =
|
|
|
+ #{orderStatusFlag}
|
|
|
+ </if>
|
|
|
+ <if test="buyStatus != null and buyStatus != ''">and cm_shop_order.buyStatus = #{buyStatus}</if>
|
|
|
+ <if test="deliveryTimeMills != null and deliveryTimeMills != ''">and cm_shop_order.deliveryTimeMills =
|
|
|
+ #{deliveryTimeMills}
|
|
|
+ </if>
|
|
|
+ <if test="orderDeliveryID != null ">and cm_shop_order.orderDeliveryID = #{orderDeliveryID}</if>
|
|
|
+ <if test="splitFlag != null and splitFlag != ''">and cm_shop_order.splitFlag = #{splitFlag}</if>
|
|
|
+ <if test="paying != null and paying != ''">and cm_shop_order.paying = #{paying}</if>
|
|
|
+ <if test="shopProductAmount != null ">and cm_shop_order.shopProductAmount = #{shopProductAmount}</if>
|
|
|
+ <if test="shopPostFee != null ">and cm_shop_order.shopPostFee = #{shopPostFee}</if>
|
|
|
+ <if test="shopPostFlag != null and shopPostFlag != ''">and cm_shop_order.shopPostFlag = #{shopPostFlag}
|
|
|
+ </if>
|
|
|
+ <if test="shopTaxFee != null ">and cm_shop_order.shopTaxFee = #{shopTaxFee}</if>
|
|
|
+ <if test="payCmAmount != null ">and cm_shop_order.payCmAmount = #{payCmAmount}</if>
|
|
|
+ <if test="shouldPayShopAmount != null ">and cm_shop_order.shouldPayShopAmount = #{shouldPayShopAmount}</if>
|
|
|
+ <if test="payedShopAmount != null ">and cm_shop_order.payedShopAmount = #{payedShopAmount}</if>
|
|
|
+ <if test="shopOtherFee != null ">and cm_shop_order.shopOtherFee = #{shopOtherFee}</if>
|
|
|
+ <if test="receiptedFlag != null and receiptedFlag != ''">and cm_shop_order.receiptedFlag =
|
|
|
+ #{receiptedFlag}
|
|
|
+ </if>
|
|
|
+ <if test="receiptedType != null and receiptedType != ''">and cm_shop_order.receiptedType =
|
|
|
+ #{receiptedType}
|
|
|
+ </if>
|
|
|
+ <if test="costType != null and costType != ''">and cm_shop_order.costType = #{costType}</if>
|
|
|
+ <if test="proportional != null ">and cm_shop_order.proportional = #{proportional}</if>
|
|
|
+ <if test="modifyShouldPayNote != null and modifyShouldPayNote != ''">and cm_shop_order.modifyShouldPayNote
|
|
|
+ = #{modifyShouldPayNote}
|
|
|
+ </if>
|
|
|
+ <if test="modifyShouldPayUserID != null ">and cm_shop_order.modifyShouldPayUserID =
|
|
|
+ #{modifyShouldPayUserID}
|
|
|
+ </if>
|
|
|
+ <if test="modifyShouldPayDate != null ">and cm_shop_order.modifyShouldPayDate = #{modifyShouldPayDate}</if>
|
|
|
+ <if test="zeroCostFlag != null ">and cm_shop_order.zeroCostFlag = #{zeroCostFlag}</if>
|
|
|
+ <if test="differenceType != null and differenceType != ''">and cm_shop_order.differenceType =
|
|
|
+ #{differenceType}
|
|
|
+ </if>
|
|
|
+ <if test="differencePrice != null ">and cm_shop_order.differencePrice = #{differencePrice}</if>
|
|
|
+ <if test="svipShopReduction != null ">and cm_shop_order.svipShopReduction = #{svipShopReduction}</if>
|
|
|
+ <if test="splitCode != null and splitCode != ''">and cm_shop_order.splitCode = #{splitCode}</if>
|
|
|
+ <if test="paySuccessCounter != null ">and cm_shop_order.paySuccessCounter = #{paySuccessCounter}</if>
|
|
|
+ <if test="onlinePayWays != null and onlinePayWays != ''">and cm_shop_order.onlinePayWays =
|
|
|
+ #{onlinePayWays}
|
|
|
+ </if>
|
|
|
+ <if test="status != null and status != ''">and cm_shop_order.shopStatus = #{status}</if>
|
|
|
+ </where>
|
|
|
+ group by cm_shop_order.shopOrderID
|
|
|
+ limit 0,1
|
|
|
+ </select>
|
|
|
+
|
|
|
+ <insert id="addCmShopOrder" parameterType="com.caimei.modules.order.entity.NewShopOrder" useGeneratedKeys="true"
|
|
|
+ keyProperty="shopOrderID">
|
|
|
+ insert into cm_shop_order
|
|
|
+ <trim prefix="(" suffix=")" suffixOverrides=",">
|
|
|
+ <if test="shopOrderID != null and shopOrderID != ''">shopOrderID,</if>
|
|
|
+ <if test="shopOrderNo != null and shopOrderNo != ''">shopOrderNo,</if>
|
|
|
+ <if test="orderNo != null and orderNo != ''">orderNo,</if>
|
|
|
+ <if test="orderID != null">orderID,</if>
|
|
|
+ <if test="organizeID != null">organizeID,</if>
|
|
|
+ <if test="isColdChina != null">isColdChina,</if>
|
|
|
+ <if test="userID != null">userID,</if>
|
|
|
+ <if test="shopID != null">shopID,</if>
|
|
|
+ <if test="orderPromotionsId != null">orderPromotionsId,</if>
|
|
|
+ <if test="orderType != null">orderType,</if>
|
|
|
+ <if test="orderSubmitType != null">orderSubmitType,</if>
|
|
|
+ <if test="presentNum != null">presentNum,</if>
|
|
|
+ <if test="itemCount != null">itemCount,</if>
|
|
|
+ <if test="outStoreNum != null">outStoreNum,</if>
|
|
|
+ <if test="outStoreTimes != null">outStoreTimes,</if>
|
|
|
+ <if test="townID != null">townID,</if>
|
|
|
+ <if test="note != null and note != ''">note,</if>
|
|
|
+ <if test="eachDiscount != null">eachDiscount,</if>
|
|
|
+ <if test="realPay != null">realPay,</if>
|
|
|
+ <if test="receiptAmount != null">receiptAmount,</if>
|
|
|
+ <if test="accountAmount != null">accountAmount,</if>
|
|
|
+ <if test="productAmount != null">productAmount,</if>
|
|
|
+ <if test="totalAmount != null">totalAmount,</if>
|
|
|
+ <if test="needPayAmount != null">needPayAmount,</if>
|
|
|
+ <if test="discountAmount != null">discountAmount,</if>
|
|
|
+ <if test="preferential != null">preferential,</if>
|
|
|
+ <if test="promotionFullReduction != null">promotionFullReduction,</if>
|
|
|
+ <if test="payFlag != null and payFlag != ''">payFlag,</if>
|
|
|
+ <if test="orderTime != null and orderTime != ''">orderTime,</if>
|
|
|
+ <if test="payTime != null and payTime != ''">payTime,</if>
|
|
|
+ <if test="finishTime != null and finishTime != ''">finishTime,</if>
|
|
|
+ <if test="autoOverTimeMills != null">autoOverTimeMills,</if>
|
|
|
+ <if test="settleStatus != null and settleStatus != ''">settleStatus,</if>
|
|
|
+ <if test="payStatus != null and payStatus != ''">payStatus,</if>
|
|
|
+ <if test="receiptStatus != null and receiptStatus != ''">receiptStatus,</if>
|
|
|
+ <if test="sendOutStatus != null and sendOutStatus != ''">sendOutStatus,</if>
|
|
|
+ <if test="refundStatus != null">refundStatus,</if>
|
|
|
+ <if test="returnGoodsStatus != null">returnGoodsStatus,</if>
|
|
|
+ <if test="receiveGoodsTime != null and receiveGoodsTime != ''">receiveGoodsTime,</if>
|
|
|
+ <if test="autoReceiveTimeMills != null">autoReceiveTimeMills,</if>
|
|
|
+ <if test="totalAddedValueTax != null">totalAddedValueTax,</if>
|
|
|
+ <if test="canRefundAmount != null">canRefundAmount,</if>
|
|
|
+ <if test="refundAmount != null">refundAmount,</if>
|
|
|
+ <if test="clubID != null">clubID,</if>
|
|
|
+ <if test="spID != null">spID,</if>
|
|
|
+ <if test="mainSpID != null">mainSpID,</if>
|
|
|
+ <if test="orderBeanAmount != null">orderBeanAmount,</if>
|
|
|
+ <if test="useBeanAmount != null">useBeanAmount,</if>
|
|
|
+ <if test="useBeanFlag != null">useBeanFlag,</if>
|
|
|
+ <if test="canRefundFlag != null">canRefundFlag,</if>
|
|
|
+ <if test="useBalanceFlag != null">useBalanceFlag,</if>
|
|
|
+ <if test="canRefundBeans != null">canRefundBeans,</if>
|
|
|
+ <if test="freePostageFee != null">freePostageFee,</if>
|
|
|
+ <if test="freePostageTicketID != null">freePostageTicketID,</if>
|
|
|
+ <if test="brokerage != null">brokerage,</if>
|
|
|
+ <if test="delFlag != null and delFlag != ''">delFlag,</if>
|
|
|
+ <if test="refundsAmount != null">refundsAmount,</if>
|
|
|
+ <if test="orderStatusFlag != null and orderStatusFlag != ''">orderStatusFlag,</if>
|
|
|
+ <if test="buyStatus != null and buyStatus != ''">buyStatus,</if>
|
|
|
+ <if test="deliveryTimeMills != null and deliveryTimeMills != ''">deliveryTimeMills,</if>
|
|
|
+ <if test="orderDeliveryID != null">orderDeliveryID,</if>
|
|
|
+ <if test="splitFlag != null and splitFlag != ''">splitFlag,</if>
|
|
|
+ <if test="paying != null and paying != ''">paying,</if>
|
|
|
+ <if test="shopProductAmount != null">shopProductAmount,</if>
|
|
|
+ <if test="shopPostFee != null">shopPostFee,</if>
|
|
|
+ <if test="shopPostFlag != null and shopPostFlag != ''">shopPostFlag,</if>
|
|
|
+ <if test="shopTaxFee != null">shopTaxFee,</if>
|
|
|
+ <if test="payCmAmount != null">payCmAmount,</if>
|
|
|
+ <if test="shouldPayShopAmount != null">shouldPayShopAmount,</if>
|
|
|
+ <if test="payedShopAmount != null">payedShopAmount,</if>
|
|
|
+ <if test="shopOtherFee != null">shopOtherFee,</if>
|
|
|
+ <if test="receiptedFlag != null and receiptedFlag != ''">receiptedFlag,</if>
|
|
|
+ <if test="receiptedType != null and receiptedType != ''">receiptedType,</if>
|
|
|
+ <if test="costType != null and costType != ''">costType,</if>
|
|
|
+ <if test="proportional != null">proportional,</if>
|
|
|
+ <if test="modifyShouldPayNote != null and modifyShouldPayNote != ''">modifyShouldPayNote,</if>
|
|
|
+ <if test="modifyShouldPayUserID != null">modifyShouldPayUserID,</if>
|
|
|
+ <if test="modifyShouldPayDate != null">modifyShouldPayDate,</if>
|
|
|
+ <if test="zeroCostFlag != null">zeroCostFlag,</if>
|
|
|
+ <if test="differenceType != null and differenceType != ''">differenceType,</if>
|
|
|
+ <if test="differencePrice != null">differencePrice,</if>
|
|
|
+ <if test="svipShopReduction != null">svipShopReduction,</if>
|
|
|
+ <if test="splitCode != null and splitCode != ''">splitCode,</if>
|
|
|
+ <if test="paySuccessCounter != null">paySuccessCounter,</if>
|
|
|
+ <if test="onlinePayWays != null and onlinePayWays != ''">onlinePayWays,</if>
|
|
|
+ <if test="status != null and status != ''">shopStatus,</if>
|
|
|
+ </trim>
|
|
|
+ <trim prefix="values (" suffix=")" suffixOverrides=",">
|
|
|
+ <if test="shopOrderID != null and shopOrderID != ''">#{shopOrderID},</if>
|
|
|
+ <if test="shopOrderNo != null and shopOrderNo != ''">#{shopOrderNo},</if>
|
|
|
+ <if test="orderNo != null and orderNo != ''">#{orderNo},</if>
|
|
|
+ <if test="orderID != null">#{orderID},</if>
|
|
|
+ <if test="organizeID != null">#{organizeID},</if>
|
|
|
+ <if test="isColdChina != null">#{isColdChina},</if>
|
|
|
+ <if test="userID != null">#{userID},</if>
|
|
|
+ <if test="shopID != null">#{shopID},</if>
|
|
|
+ <if test="orderPromotionsId != null">#{orderPromotionsId},</if>
|
|
|
+ <if test="orderType != null">#{orderType},</if>
|
|
|
+ <if test="orderSubmitType != null">#{orderSubmitType},</if>
|
|
|
+ <if test="presentNum != null">#{presentNum},</if>
|
|
|
+ <if test="itemCount != null">#{itemCount},</if>
|
|
|
+ <if test="outStoreNum != null">#{outStoreNum},</if>
|
|
|
+ <if test="outStoreTimes != null">#{outStoreTimes},</if>
|
|
|
+ <if test="townID != null">#{townID},</if>
|
|
|
+ <if test="note != null and note != ''">#{note},</if>
|
|
|
+ <if test="eachDiscount != null">#{eachDiscount},</if>
|
|
|
+ <if test="realPay != null">#{realPay},</if>
|
|
|
+ <if test="receiptAmount != null">#{receiptAmount},</if>
|
|
|
+ <if test="accountAmount != null">#{accountAmount},</if>
|
|
|
+ <if test="productAmount != null">#{productAmount},</if>
|
|
|
+ <if test="totalAmount != null">#{totalAmount},</if>
|
|
|
+ <if test="needPayAmount != null">#{needPayAmount},</if>
|
|
|
+ <if test="discountAmount != null">#{discountAmount},</if>
|
|
|
+ <if test="preferential != null">#{preferential},</if>
|
|
|
+ <if test="promotionFullReduction != null">#{promotionFullReduction},</if>
|
|
|
+ <if test="payFlag != null and payFlag != ''">#{payFlag},</if>
|
|
|
+ <if test="orderTime != null and orderTime != ''">#{orderTime},</if>
|
|
|
+ <if test="payTime != null and payTime != ''">#{payTime},</if>
|
|
|
+ <if test="finishTime != null and finishTime != ''">#{finishTime},</if>
|
|
|
+ <if test="autoOverTimeMills != null">#{autoOverTimeMills},</if>
|
|
|
+ <if test="settleStatus != null and settleStatus != ''">#{settleStatus},</if>
|
|
|
+ <if test="payStatus != null and payStatus != ''">#{payStatus},</if>
|
|
|
+ <if test="receiptStatus != null and receiptStatus != ''">#{receiptStatus},</if>
|
|
|
+ <if test="sendOutStatus != null and sendOutStatus != ''">#{sendOutStatus},</if>
|
|
|
+ <if test="refundStatus != null">#{refundStatus},</if>
|
|
|
+ <if test="returnGoodsStatus != null">#{returnGoodsStatus},</if>
|
|
|
+ <if test="receiveGoodsTime != null and receiveGoodsTime != ''">#{receiveGoodsTime},</if>
|
|
|
+ <if test="autoReceiveTimeMills != null">#{autoReceiveTimeMills},</if>
|
|
|
+ <if test="totalAddedValueTax != null">#{totalAddedValueTax},</if>
|
|
|
+ <if test="canRefundAmount != null">#{canRefundAmount},</if>
|
|
|
+ <if test="refundAmount != null">#{refundAmount},</if>
|
|
|
+ <if test="clubID != null">#{clubID},</if>
|
|
|
+ <if test="spID != null">#{spID},</if>
|
|
|
+ <if test="mainSpID != null">#{mainSpID},</if>
|
|
|
+ <if test="orderBeanAmount != null">#{orderBeanAmount},</if>
|
|
|
+ <if test="useBeanAmount != null">#{useBeanAmount},</if>
|
|
|
+ <if test="useBeanFlag != null">#{useBeanFlag},</if>
|
|
|
+ <if test="canRefundFlag != null">#{canRefundFlag},</if>
|
|
|
+ <if test="useBalanceFlag != null">#{useBalanceFlag},</if>
|
|
|
+ <if test="canRefundBeans != null">#{canRefundBeans},</if>
|
|
|
+ <if test="freePostageFee != null">#{freePostageFee},</if>
|
|
|
+ <if test="freePostageTicketID != null">#{freePostageTicketID},</if>
|
|
|
+ <if test="brokerage != null">#{brokerage},</if>
|
|
|
+ <if test="delFlag != null and delFlag != ''">#{delFlag},</if>
|
|
|
+ <if test="refundsAmount != null">#{refundsAmount},</if>
|
|
|
+ <if test="orderStatusFlag != null and orderStatusFlag != ''">#{orderStatusFlag},</if>
|
|
|
+ <if test="buyStatus != null and buyStatus != ''">#{buyStatus},</if>
|
|
|
+ <if test="deliveryTimeMills != null and deliveryTimeMills != ''">#{deliveryTimeMills},</if>
|
|
|
+ <if test="orderDeliveryID != null">#{orderDeliveryID},</if>
|
|
|
+ <if test="splitFlag != null and splitFlag != ''">#{splitFlag},</if>
|
|
|
+ <if test="paying != null and paying != ''">#{paying},</if>
|
|
|
+ <if test="shopProductAmount != null">#{shopProductAmount},</if>
|
|
|
+ <if test="shopPostFee != null">#{shopPostFee},</if>
|
|
|
+ <if test="shopPostFlag != null and shopPostFlag != ''">#{shopPostFlag},</if>
|
|
|
+ <if test="shopTaxFee != null">#{shopTaxFee},</if>
|
|
|
+ <if test="payCmAmount != null">#{payCmAmount},</if>
|
|
|
+ <if test="shouldPayShopAmount != null">#{shouldPayShopAmount},</if>
|
|
|
+ <if test="payedShopAmount != null">#{payedShopAmount},</if>
|
|
|
+ <if test="shopOtherFee != null">#{shopOtherFee},</if>
|
|
|
+ <if test="receiptedFlag != null and receiptedFlag != ''">#{receiptedFlag},</if>
|
|
|
+ <if test="receiptedType != null and receiptedType != ''">#{receiptedType},</if>
|
|
|
+ <if test="costType != null and costType != ''">#{costType},</if>
|
|
|
+ <if test="proportional != null">#{proportional},</if>
|
|
|
+ <if test="modifyShouldPayNote != null and modifyShouldPayNote != ''">#{modifyShouldPayNote},</if>
|
|
|
+ <if test="modifyShouldPayUserID != null">#{modifyShouldPayUserID},</if>
|
|
|
+ <if test="modifyShouldPayDate != null">#{modifyShouldPayDate},</if>
|
|
|
+ <if test="zeroCostFlag != null">#{zeroCostFlag},</if>
|
|
|
+ <if test="differenceType != null and differenceType != ''">#{differenceType},</if>
|
|
|
+ <if test="differencePrice != null">#{differencePrice},</if>
|
|
|
+ <if test="svipShopReduction != null">#{svipShopReduction},</if>
|
|
|
+ <if test="splitCode != null and splitCode != ''">#{splitCode},</if>
|
|
|
+ <if test="paySuccessCounter != null">#{paySuccessCounter},</if>
|
|
|
+ <if test="onlinePayWays != null and onlinePayWays != ''">#{onlinePayWays},</if>
|
|
|
+ <if test="status != null and status != ''">#{status},</if>
|
|
|
+ </trim>
|
|
|
+ </insert>
|
|
|
+
|
|
|
+ <update id="updateCmShopOrder" parameterType="com.caimei.modules.order.entity.NewShopOrder">
|
|
|
+ update cm_shop_order
|
|
|
+ <trim prefix="SET" suffixOverrides=",">
|
|
|
+ <if test="shopOrderNo != null and shopOrderNo != ''">shopOrderNo = #{shopOrderNo},</if>
|
|
|
+ <if test="orderNo != null and orderNo != ''">orderNo = #{orderNo},</if>
|
|
|
+ <if test="orderID != null">orderID = #{orderID},</if>
|
|
|
+ <if test="organizeID != null">organizeID = #{organizeID},</if>
|
|
|
+ <if test="isColdChina != null">isColdChina = #{isColdChina},</if>
|
|
|
+ <if test="userID != null">userID = #{userID},</if>
|
|
|
+ <if test="shopID != null">shopID = #{shopID},</if>
|
|
|
+ <if test="orderPromotionsId != null">orderPromotionsId = #{orderPromotionsId},</if>
|
|
|
+ <if test="orderType != null">orderType = #{orderType},</if>
|
|
|
+ <if test="orderSubmitType != null">orderSubmitType = #{orderSubmitType},</if>
|
|
|
+ <if test="presentNum != null">presentNum = #{presentNum},</if>
|
|
|
+ <if test="itemCount != null">itemCount = #{itemCount},</if>
|
|
|
+ <if test="outStoreNum != null">outStoreNum = #{outStoreNum},</if>
|
|
|
+ <if test="outStoreTimes != null">outStoreTimes = #{outStoreTimes},</if>
|
|
|
+ <if test="townID != null">townID = #{townID},</if>
|
|
|
+ <if test="note != null and note != ''">note = #{note},</if>
|
|
|
+ <if test="eachDiscount != null">eachDiscount = #{eachDiscount},</if>
|
|
|
+ <if test="realPay != null">realPay = #{realPay},</if>
|
|
|
+ <if test="receiptAmount != null">receiptAmount = #{receiptAmount},</if>
|
|
|
+ <if test="accountAmount != null">accountAmount = #{accountAmount},</if>
|
|
|
+ <if test="productAmount != null">productAmount = #{productAmount},</if>
|
|
|
+ <if test="totalAmount != null">totalAmount = #{totalAmount},</if>
|
|
|
+ <if test="needPayAmount != null">needPayAmount = #{needPayAmount},</if>
|
|
|
+ <if test="discountAmount != null">discountAmount = #{discountAmount},</if>
|
|
|
+ <if test="preferential != null">preferential = #{preferential},</if>
|
|
|
+ <if test="promotionFullReduction != null">promotionFullReduction = #{promotionFullReduction},</if>
|
|
|
+ <if test="payFlag != null and payFlag != ''">payFlag = #{payFlag},</if>
|
|
|
+ <if test="orderTime != null and orderTime != ''">orderTime = #{orderTime},</if>
|
|
|
+ <if test="payTime != null and payTime != ''">payTime = #{payTime},</if>
|
|
|
+ <if test="finishTime != null and finishTime != ''">finishTime = #{finishTime},</if>
|
|
|
+ <if test="autoOverTimeMills != null">autoOverTimeMills = #{autoOverTimeMills},</if>
|
|
|
+ <if test="settleStatus != null and settleStatus != ''">settleStatus = #{settleStatus},</if>
|
|
|
+ <if test="payStatus != null and payStatus != ''">payStatus = #{payStatus},</if>
|
|
|
+ <if test="receiptStatus != null and receiptStatus != ''">receiptStatus = #{receiptStatus},</if>
|
|
|
+ <if test="sendOutStatus != null and sendOutStatus != ''">sendOutStatus = #{sendOutStatus},</if>
|
|
|
+ <if test="refundStatus != null">refundStatus = #{refundStatus},</if>
|
|
|
+ <if test="returnGoodsStatus != null">returnGoodsStatus = #{returnGoodsStatus},</if>
|
|
|
+ <if test="receiveGoodsTime != null and receiveGoodsTime != ''">receiveGoodsTime = #{receiveGoodsTime},</if>
|
|
|
+ <if test="autoReceiveTimeMills != null">autoReceiveTimeMills = #{autoReceiveTimeMills},</if>
|
|
|
+ <if test="totalAddedValueTax != null">totalAddedValueTax = #{totalAddedValueTax},</if>
|
|
|
+ <if test="canRefundAmount != null">canRefundAmount = #{canRefundAmount},</if>
|
|
|
+ <if test="refundAmount != null">refundAmount = #{refundAmount},</if>
|
|
|
+ <if test="clubID != null">clubID = #{clubID},</if>
|
|
|
+ <if test="spID != null">spID = #{spID},</if>
|
|
|
+ <if test="mainSpID != null">mainSpID = #{mainSpID},</if>
|
|
|
+ <if test="orderBeanAmount != null">orderBeanAmount = #{orderBeanAmount},</if>
|
|
|
+ <if test="useBeanAmount != null">useBeanAmount = #{useBeanAmount},</if>
|
|
|
+ <if test="useBeanFlag != null">useBeanFlag = #{useBeanFlag},</if>
|
|
|
+ <if test="canRefundFlag != null">canRefundFlag = #{canRefundFlag},</if>
|
|
|
+ <if test="useBalanceFlag != null">useBalanceFlag = #{useBalanceFlag},</if>
|
|
|
+ <if test="canRefundBeans != null">canRefundBeans = #{canRefundBeans},</if>
|
|
|
+ <if test="freePostageFee != null">freePostageFee = #{freePostageFee},</if>
|
|
|
+ <if test="freePostageTicketID != null">freePostageTicketID = #{freePostageTicketID},</if>
|
|
|
+ <if test="brokerage != null">brokerage = #{brokerage},</if>
|
|
|
+ <if test="delFlag != null and delFlag != ''">delFlag = #{delFlag},</if>
|
|
|
+ <if test="refundsAmount != null">refundsAmount = #{refundsAmount},</if>
|
|
|
+ <if test="orderStatusFlag != null and orderStatusFlag != ''">orderStatusFlag = #{orderStatusFlag},</if>
|
|
|
+ <if test="buyStatus != null and buyStatus != ''">buyStatus = #{buyStatus},</if>
|
|
|
+ <if test="deliveryTimeMills != null and deliveryTimeMills != ''">deliveryTimeMills = #{deliveryTimeMills},
|
|
|
+ </if>
|
|
|
+ <if test="orderDeliveryID != null">orderDeliveryID = #{orderDeliveryID},</if>
|
|
|
+ <if test="splitFlag != null and splitFlag != ''">splitFlag = #{splitFlag},</if>
|
|
|
+ <if test="paying != null and paying != ''">paying = #{paying},</if>
|
|
|
+ <if test="shopProductAmount != null">shopProductAmount = #{shopProductAmount},</if>
|
|
|
+ <if test="shopPostFee != null">shopPostFee = #{shopPostFee},</if>
|
|
|
+ <if test="shopPostFlag != null and shopPostFlag != ''">shopPostFlag = #{shopPostFlag},</if>
|
|
|
+ <if test="shopTaxFee != null">shopTaxFee = #{shopTaxFee},</if>
|
|
|
+ <if test="payCmAmount != null">payCmAmount = #{payCmAmount},</if>
|
|
|
+ <if test="shouldPayShopAmount != null">shouldPayShopAmount = #{shouldPayShopAmount},</if>
|
|
|
+ <if test="payedShopAmount != null">payedShopAmount = #{payedShopAmount},</if>
|
|
|
+ <if test="shopOtherFee != null">shopOtherFee = #{shopOtherFee},</if>
|
|
|
+ <if test="receiptedFlag != null and receiptedFlag != ''">receiptedFlag = #{receiptedFlag},</if>
|
|
|
+ <if test="receiptedType != null and receiptedType != ''">receiptedType = #{receiptedType},</if>
|
|
|
+ <if test="costType != null and costType != ''">costType = #{costType},</if>
|
|
|
+ <if test="proportional != null">proportional = #{proportional},</if>
|
|
|
+ <if test="modifyShouldPayNote != null and modifyShouldPayNote != ''">modifyShouldPayNote =
|
|
|
+ #{modifyShouldPayNote},
|
|
|
+ </if>
|
|
|
+ <if test="modifyShouldPayUserID != null">modifyShouldPayUserID = #{modifyShouldPayUserID},</if>
|
|
|
+ <if test="modifyShouldPayDate != null">modifyShouldPayDate = #{modifyShouldPayDate},</if>
|
|
|
+ <if test="zeroCostFlag != null">zeroCostFlag = #{zeroCostFlag},</if>
|
|
|
+ <if test="differenceType != null and differenceType != ''">differenceType = #{differenceType},</if>
|
|
|
+ <if test="differencePrice != null">differencePrice = #{differencePrice},</if>
|
|
|
+ <if test="svipShopReduction != null">svipShopReduction = #{svipShopReduction},</if>
|
|
|
+ <if test="splitCode != null and splitCode != ''">splitCode = #{splitCode},</if>
|
|
|
+ <if test="paySuccessCounter != null">paySuccessCounter = #{paySuccessCounter},</if>
|
|
|
+ <if test="onlinePayWays != null and onlinePayWays != ''">onlinePayWays = #{onlinePayWays},</if>
|
|
|
+ <if test="status != null and status != ''">shopStatus = #{status},</if>
|
|
|
+ </trim>
|
|
|
+ where shopOrderID = #{shopOrderID}
|
|
|
+ </update>
|
|
|
+
|
|
|
+ <update id="updateDelCmShopOrderByShopOrderIDs" parameterType="String">
|
|
|
+ update cm_shop_order set delFlag=#{delFlag} where shopOrderID in
|
|
|
+ <foreach item="shopOrderID" collection="shopOrderIDs" open="(" separator="," close=")">
|
|
|
+ #{shopOrderID}
|
|
|
+ </foreach>
|
|
|
+ </update>
|
|
|
+
|
|
|
+ <delete id="delCmShopOrderByShopOrderID" parameterType="String">
|
|
|
+ delete
|
|
|
+ from cm_shop_order
|
|
|
+ where shopOrderID = #{shopOrderID}
|
|
|
+ </delete>
|
|
|
+
|
|
|
+ <delete id="delCmShopOrderByShopOrderIDs" parameterType="String">
|
|
|
+ delete from cm_shop_order where shopOrderID in
|
|
|
+ <foreach item="shopOrderID" collection="shopOrderIDs" open="(" separator="," close=")">
|
|
|
+ #{shopOrderID}
|
|
|
+ </foreach>
|
|
|
+ </delete>
|
|
|
</mapper>
|