|
@@ -4,59 +4,59 @@
|
|
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
|
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
|
<mapper namespace="com.caimei.mapper.OrderMapper">
|
|
<mapper namespace="com.caimei.mapper.OrderMapper">
|
|
<sql id="cm_Order_List">
|
|
<sql id="cm_Order_List">
|
|
- orderID AS orderId,
|
|
|
|
- orderNo,
|
|
|
|
- organizeID AS organizeId,
|
|
|
|
- userID AS userId,
|
|
|
|
- buyUserID AS buyUserId,
|
|
|
|
- status,
|
|
|
|
- shopOrderIDs AS shopOrderIds,
|
|
|
|
- receiptStatus,
|
|
|
|
- payStatus,
|
|
|
|
- sendOutStatus,
|
|
|
|
- refundType,
|
|
|
|
- onlinePayFlag,
|
|
|
|
- payTotalFee,
|
|
|
|
- payableAmount,
|
|
|
|
- balancePayFee,
|
|
|
|
- discountFee,
|
|
|
|
- promotionFullReduction,
|
|
|
|
- note,
|
|
|
|
- orderSource,
|
|
|
|
- orderTime,
|
|
|
|
- productCount,
|
|
|
|
- presentCount,
|
|
|
|
- promotionalGiftsCount,
|
|
|
|
- invoiceFlag,
|
|
|
|
- clauseID AS clauseId,
|
|
|
|
- clauseContent,
|
|
|
|
- clauseName,
|
|
|
|
- freePostFlag,
|
|
|
|
- freight,
|
|
|
|
- closeReason
|
|
|
|
|
|
+ co.orderID AS orderId,
|
|
|
|
+ co.orderNo,
|
|
|
|
+ co.organizeID AS organizeId,
|
|
|
|
+ co.userID AS userId,
|
|
|
|
+ co.buyUserID AS buyUserId,
|
|
|
|
+ co.status,
|
|
|
|
+ co.shopOrderIDs AS shopOrderIds,
|
|
|
|
+ co.receiptStatus,
|
|
|
|
+ co.payStatus,
|
|
|
|
+ co.sendOutStatus,
|
|
|
|
+ co.refundType,
|
|
|
|
+ co.onlinePayFlag,
|
|
|
|
+ co.payTotalFee,
|
|
|
|
+ co.payableAmount,
|
|
|
|
+ co.balancePayFee,
|
|
|
|
+ co.discountFee,
|
|
|
|
+ co.promotionFullReduction,
|
|
|
|
+ co.note,
|
|
|
|
+ co.orderSource,
|
|
|
|
+ co.orderTime,
|
|
|
|
+ co.productCount,
|
|
|
|
+ co.presentCount,
|
|
|
|
+ co.promotionalGiftsCount,
|
|
|
|
+ co.invoiceFlag,
|
|
|
|
+ co.clauseID AS clauseId,
|
|
|
|
+ co.clauseContent,
|
|
|
|
+ co.clauseName,
|
|
|
|
+ co.freePostFlag,
|
|
|
|
+ co.freight,
|
|
|
|
+ co.closeReason
|
|
</sql>
|
|
</sql>
|
|
<select id="findOrderList" resultType="com.caimei.model.vo.OrderVo">
|
|
<select id="findOrderList" resultType="com.caimei.model.vo.OrderVo">
|
|
select
|
|
select
|
|
<include refid="cm_Order_List"></include>
|
|
<include refid="cm_Order_List"></include>
|
|
- from cm_order
|
|
|
|
- where delFlag = '0'
|
|
|
|
- AND orderType = 2
|
|
|
|
|
|
+ from cm_order co
|
|
|
|
+ where co.delFlag = '0'
|
|
|
|
+ AND co.orderType = 2
|
|
<if test="userId != null ">
|
|
<if test="userId != null ">
|
|
- AND userID = #{userId}
|
|
|
|
|
|
+ AND co.userID = #{userId}
|
|
</if>
|
|
</if>
|
|
<if test="orderState == 1 ">
|
|
<if test="orderState == 1 ">
|
|
- AND status IN(11,12,13,21,22,23)
|
|
|
|
|
|
+ AND co.status IN(11,12,13,21,22,23)
|
|
</if>
|
|
</if>
|
|
<if test="orderState == 2 ">
|
|
<if test="orderState == 2 ">
|
|
- AND status IN(11,12,21,22,31,32)
|
|
|
|
|
|
+ AND co.status IN(11,12,21,22,31,32)
|
|
</if>
|
|
</if>
|
|
<if test="orderState == 3 ">
|
|
<if test="orderState == 3 ">
|
|
- AND status IN(12,13,22,23,32,33)
|
|
|
|
|
|
+ AND co.status IN(12,13,22,23,32,33)
|
|
</if>
|
|
</if>
|
|
<if test="orderState == 4 ">
|
|
<if test="orderState == 4 ">
|
|
- AND refundType IN(1,2)
|
|
|
|
|
|
+ AND co.refundType IN(1,2)
|
|
</if>
|
|
</if>
|
|
- ORDER BY orderTime DESC
|
|
|
|
|
|
+ ORDER BY co.orderTime DESC
|
|
</select>
|
|
</select>
|
|
|
|
|
|
<select id="findLogistics" resultType="com.caimei.model.vo.LogisticsBatchVo">
|
|
<select id="findLogistics" resultType="com.caimei.model.vo.LogisticsBatchVo">
|
|
@@ -105,8 +105,6 @@
|
|
cop.shopOrderID AS shopOrderId,
|
|
cop.shopOrderID AS shopOrderId,
|
|
cop.shopID AS shopId,
|
|
cop.shopID AS shopId,
|
|
cop.productID AS productId,
|
|
cop.productID AS productId,
|
|
- cop.organizeProductID AS organizeProductId,
|
|
|
|
- cop.organizeID AS organizeId,
|
|
|
|
cop.num,
|
|
cop.num,
|
|
cop.presentNum,
|
|
cop.presentNum,
|
|
cop.outStoreType,
|
|
cop.outStoreType,
|
|
@@ -130,7 +128,8 @@
|
|
cop.productUnit,
|
|
cop.productUnit,
|
|
cop.productImage,
|
|
cop.productImage,
|
|
cop.productType,
|
|
cop.productType,
|
|
- cop.ladderPriceFlag
|
|
|
|
|
|
+ cop.ladderPriceFlag,
|
|
|
|
+ cop.heUserId
|
|
FROM
|
|
FROM
|
|
cm_order_product cop
|
|
cm_order_product cop
|
|
WHERE
|
|
WHERE
|
|
@@ -176,10 +175,10 @@
|
|
SELECT
|
|
SELECT
|
|
<include refid="cm_Order_List"></include>
|
|
<include refid="cm_Order_List"></include>
|
|
FROM
|
|
FROM
|
|
- cm_order
|
|
|
|
|
|
+ cm_order co
|
|
WHERE
|
|
WHERE
|
|
- orderID = #{orderID}
|
|
|
|
- AND delFlag = '0'
|
|
|
|
|
|
+ co.orderID = #{orderID}
|
|
|
|
+ AND co.delFlag = '0'
|
|
</select>
|
|
</select>
|
|
|
|
|
|
<select id="returnedPurchase" resultType="integer">
|
|
<select id="returnedPurchase" resultType="integer">
|
|
@@ -372,36 +371,7 @@
|
|
|
|
|
|
<select id="searchOrder" resultType="com.caimei.model.vo.OrderVo">
|
|
<select id="searchOrder" resultType="com.caimei.model.vo.OrderVo">
|
|
SELECT
|
|
SELECT
|
|
- co.orderID AS orderId,
|
|
|
|
- co.orderNo,
|
|
|
|
- co.organizeID AS organizeId,
|
|
|
|
- co.userID AS userId,
|
|
|
|
- co.buyUserID AS buyUserId,
|
|
|
|
- co.status,
|
|
|
|
- co.shopOrderIDs AS shopOrderIds,
|
|
|
|
- co.receiptStatus,
|
|
|
|
- co.payStatus,
|
|
|
|
- co.sendOutStatus,
|
|
|
|
- co.refundType,
|
|
|
|
- co.onlinePayFlag,
|
|
|
|
- co.payTotalFee,
|
|
|
|
- co.payableAmount,
|
|
|
|
- co.balancePayFee,
|
|
|
|
- co.discountFee,
|
|
|
|
- co.promotionFullReduction,
|
|
|
|
- co.note,
|
|
|
|
- co.orderSource,
|
|
|
|
- co.orderTime,
|
|
|
|
- co.productCount,
|
|
|
|
- co.presentCount,
|
|
|
|
- co.promotionalGiftsCount,
|
|
|
|
- co.invoiceFlag,
|
|
|
|
- co.clauseID AS clauseId,
|
|
|
|
- co.clauseContent,
|
|
|
|
- co.clauseName,
|
|
|
|
- co.freePostFlag,
|
|
|
|
- co.freight,
|
|
|
|
- co.closeReason
|
|
|
|
|
|
+ <include refid="cm_Order_List"></include>
|
|
FROM
|
|
FROM
|
|
cm_order co
|
|
cm_order co
|
|
LEFT JOIN cm_order_product cop ON co.orderID = cop.orderID
|
|
LEFT JOIN cm_order_product cop ON co.orderID = cop.orderID
|
|
@@ -494,4 +464,64 @@
|
|
AND refundType IN(1,2)
|
|
AND refundType IN(1,2)
|
|
</if>
|
|
</if>
|
|
</select>
|
|
</select>
|
|
|
|
+
|
|
|
|
+ <select id="dealerOrderList" resultType="com.caimei.model.vo.OrderVo">
|
|
|
|
+ SELECT
|
|
|
|
+ <include refid="cm_Order_List"></include>
|
|
|
|
+ FROM
|
|
|
|
+ cm_order co
|
|
|
|
+ LEFT JOIN cm_order_product cop ON co.orderID = cop.orderID
|
|
|
|
+ WHERE
|
|
|
|
+ co.delFlag = '0'
|
|
|
|
+ AND co.orderType = 2
|
|
|
|
+ <if test="orderType == 0">
|
|
|
|
+ AND (
|
|
|
|
+ cop.heUserId = #{userId}
|
|
|
|
+ OR co.userID = #{userId}
|
|
|
|
+ )
|
|
|
|
+ </if>
|
|
|
|
+ <if test="orderType == 1">
|
|
|
|
+ AND cop.heUserId = #{userId}
|
|
|
|
+ AND co.userID != #{userId}
|
|
|
|
+ </if>
|
|
|
|
+ <if test="orderType == 2">
|
|
|
|
+ AND co.userID = #{userId}
|
|
|
|
+ </if>
|
|
|
|
+ <if test="orderState == 1 ">
|
|
|
|
+ AND co.status IN(11,12,13,21,22,23)
|
|
|
|
+ </if>
|
|
|
|
+ <if test="orderState == 2 ">
|
|
|
|
+ AND co.status IN(11,12,21,22,31,32)
|
|
|
|
+ </if>
|
|
|
|
+ <if test="orderState == 3 ">
|
|
|
|
+ AND co.status IN(12,13,22,23,32,33)
|
|
|
|
+ </if>
|
|
|
|
+ <if test="orderState == 4 ">
|
|
|
|
+ AND co.refundType IN(1,2)
|
|
|
|
+ </if>
|
|
|
|
+ <if test="searchWord != null and searchWord != ''">
|
|
|
|
+ AND cop.name LIKE CONCAT('%',#{searchWord},'%')
|
|
|
|
+ </if>
|
|
|
|
+ GROUP BY
|
|
|
|
+ co.orderID
|
|
|
|
+ ORDER BY
|
|
|
|
+ co.orderTime DESC
|
|
|
|
+ </select>
|
|
|
|
+
|
|
|
|
+ <select id="findOrderProductAll" resultType="com.caimei.model.vo.OrderProductVo">
|
|
|
|
+ SELECT
|
|
|
|
+ productID AS productId,
|
|
|
|
+ heUserId,
|
|
|
|
+ name,
|
|
|
|
+ productImage,
|
|
|
|
+ num
|
|
|
|
+ FROM
|
|
|
|
+ cm_order_product
|
|
|
|
+ WHERE
|
|
|
|
+ orderID = #{orderId}
|
|
|
|
+ </select>
|
|
|
|
+
|
|
|
|
+ <select id="findProductStatus" resultType="integer">
|
|
|
|
+ SELECT validFlag FROM cm_hehe_product WHERE productId = #{productId}
|
|
|
|
+ </select>
|
|
</mapper>
|
|
</mapper>
|