|
@@ -121,7 +121,7 @@
|
|
|
SET status = 1,
|
|
|
updateDate = NOW(),
|
|
|
receiptTime = NOW()
|
|
|
- WHERE orderID = #{orderId}
|
|
|
+ WHERE orderID = #{orderId} and shopOrderId = #{shopOrderId}
|
|
|
</update>
|
|
|
<update id="updateOrderShareCode">
|
|
|
UPDATE cm_mall_order_share_code
|
|
@@ -423,43 +423,43 @@
|
|
|
</foreach>
|
|
|
</select>
|
|
|
<select id="getOrderCount" resultType="java.lang.Integer">
|
|
|
- SELECT COUNT(*) FROM cm_order
|
|
|
+ SELECT COUNT(*) FROM cm_shop_order
|
|
|
WHERE delFlag = 0 AND userID = #{userId}
|
|
|
<if test="orderState == 1 ">
|
|
|
- AND status = '0'
|
|
|
+ AND shopStatus = 0
|
|
|
</if>
|
|
|
<if test="orderState == 2 ">
|
|
|
- AND status IN(11,12,13,21,22,23)
|
|
|
+ AND receiptStatus = 1 AND shopStatus not in (4,5)
|
|
|
</if>
|
|
|
<if test="orderState == 3 ">
|
|
|
- AND status IN(11,12,21,22,31,32)
|
|
|
+ AND sendOutStatus = 1 AND shopStatus not in (4,5)
|
|
|
</if>
|
|
|
<if test="orderState == 4 ">
|
|
|
- AND status IN(12,13,22,23,32,33)
|
|
|
+ AND sendOutStatus = 3 AND shopStatus not in (4,5)
|
|
|
</if>
|
|
|
<if test="orderState == 5 ">
|
|
|
- AND refundType IN(1,2)
|
|
|
+ AND (orderStatusFlag in (2, 3) or refundStatus = 3) AND shopStatus not in (4,5)
|
|
|
</if>
|
|
|
</select>
|
|
|
<select id="getOrderSeenCount" resultType="java.lang.Integer">
|
|
|
- SELECT COUNT(*) FROM cm_order
|
|
|
- WHERE delFlag = 0 AND userID = #{userId}
|
|
|
+ SELECT COUNT(*) FROM cm_shop_order cso left join cm_order co on cso.orderId = co.orderId
|
|
|
+ WHERE cso.delFlag = 0 AND cso.userID = #{userId}
|
|
|
<if test="orderState == 1 ">
|
|
|
- AND status = '0'
|
|
|
+ AND cso.shopStatus = 0
|
|
|
</if>
|
|
|
<if test="orderState == 2 ">
|
|
|
- AND status IN(11,12,13,21,22,23)
|
|
|
+ AND cso.receiptStatus = 1 AND cso.shopStatus not in (4,5)
|
|
|
</if>
|
|
|
<if test="orderState == 3 ">
|
|
|
- AND status IN(11,12,21,22,31,32)
|
|
|
+ AND cso.sendOutStatus = 1 AND cso.shopStatus not in (4,5)
|
|
|
</if>
|
|
|
<if test="orderState == 4 ">
|
|
|
- AND status IN(12,13,22,23,32,33)
|
|
|
+ AND cso.sendOutStatus = 3 AND cso.shopStatus not in (4,5)
|
|
|
</if>
|
|
|
<if test="orderState == 5 ">
|
|
|
- AND refundType IN(1,2)
|
|
|
+ AND (cso.orderStatusFlag in (2, 3) or cso.refundStatus = 3) AND cso.shopStatus not in (4,5)
|
|
|
</if>
|
|
|
- AND orderSeen = 2
|
|
|
+ AND co.orderSeen = 2
|
|
|
</select>
|
|
|
<select id="getOrderList" resultType="com.caimei365.order.model.vo.OrderVo">
|
|
|
SELECT
|
|
@@ -592,16 +592,16 @@
|
|
|
AND cso.shopStatus = 0
|
|
|
</if>
|
|
|
<if test="status == 2 ">
|
|
|
- AND cso.payStatus = 1
|
|
|
+ AND cso.receiptStatus = 1 AND shopStatus not in (4,5)
|
|
|
</if>
|
|
|
<if test="status == 3 ">
|
|
|
- AND cso.sendOutStatus = 1
|
|
|
+ AND cso.sendOutStatus = 1 AND shopStatus not in (4,5)
|
|
|
</if>
|
|
|
<if test="status == 4 ">
|
|
|
- AND cso.sendOutStatus = 3
|
|
|
+ AND cso.sendOutStatus = 3 AND shopStatus not in (4,5)
|
|
|
</if>
|
|
|
<if test="status == 5 ">
|
|
|
- AND (cso.orderStatusFlag in (2, 3) or cso.refundStatus = 2)
|
|
|
+ AND (cso.orderStatusFlag in (2, 3) or cso.refundStatus = 3) AND cso.shopStatus not in (4,5)
|
|
|
</if>
|
|
|
<if test="shopOrderNo != null and shopOrderNo != '' ">
|
|
|
AND cso.shopOrderNo = #{shopOrderNo}
|