123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260 |
- <?xml version="1.0" encoding="UTF-8"?>
- <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
- <mapper namespace="com.caimei365.order.mapper.OrderSellerMapper">
- <update id="updateClubLastCheckOrderDate">
- UPDATE club SET lastCheckOrderDate = #{date} WHERE clubID = #{clubId}
- </update>
- <select id="getClubUserIds" resultType="java.lang.Integer">
- SELECT userID FROM club WHERE spID = #{serviceProviderId}
- </select>
- <select id="getOrderList" resultType="com.caimei365.order.model.vo.OrderVo">
- SELECT
- orderSeen,
- orderID AS orderId,
- shopOrderIds,
- orderSource,
- orderNo,
- userID AS userId,
- clubID AS clubId,
- buyUserID AS buyUserId,
- orderTime,
- updateDate,
- delFlag,
- userBeans,
- orderType,
- orderSubmitType,
- confirmFlag,
- onlinePayFlag,
- splitFlag,
- payFlag,
- receiptStatus,
- payStatus,
- zeroCostFlag,
- sendOutStatus,
- refundType,
- affirmPaymentFlag,
- productCount,
- presentCount,
- promotionalGiftsCount,
- hasActProduct,
- promotionFullReduction,
- secondHandOrderFlag,
- invoiceFlag,
- freePostFlag AS postageFlag,
- freight AS postage,
- productTotalFee,
- orderTotalFee,
- payTotalFee,
- payableAmount,
- balancePayFee,
- discountFee,
- couponAmount,
- status,
- confirmTime,
- payTime,
- rebateFlag,
- clauseID AS clauseId,
- clauseName
- FROM cm_order
- WHERE delFlag = 0 AND userID IN
- <foreach item="userId" index="index" collection="userIds" open="(" separator="," close=")">
- #{userId}
- </foreach>
- <if test="listType == 1 ">
- AND status = '0'
- </if>
- <if test="listType == 2 ">
- AND status IN(11,12,13,21,22,23)
- </if>
- <if test="listType == 3 ">
- AND status IN(11,12,21,22,31,32)
- </if>
- <if test="listType == 4 ">
- AND status IN(12,13,22,23,32,33)
- </if>
- <if test="listType == 5 ">
- AND refundType IN(1,2)
- </if>
- <if test="orderSubmitType == 1">
- AND orderSubmitType IN (0,1,2)
- </if>
- <if test="orderSubmitType == 2">
- AND orderSubmitType IN (3,4)
- </if>
- <if test="orderNo != null and orderNo != '' ">
- AND orderNo = #{orderNo}
- </if>
- ORDER BY orderTime DESC
- </select>
- <select id="getSpIdByClubId" resultType="java.lang.Integer">
- SELECT spID FROM club WHERE clubID = #{clubId}
- </select>
- <select id="getOrderListClub" resultType="com.caimei365.order.model.vo.OrderVo">
- SELECT
- orderID AS orderId,
- shopOrderIds,
- orderSource,
- orderNo,
- userID AS userId,
- clubID AS clubId,
- buyUserID AS buyUserId,
- orderTime,
- updateDate,
- delFlag,
- userBeans,
- orderType,
- orderSubmitType,
- confirmFlag,
- onlinePayFlag,
- splitFlag,
- payFlag,
- receiptStatus,
- payStatus,
- zeroCostFlag,
- sendOutStatus,
- refundType,
- affirmPaymentFlag,
- productCount,
- presentCount,
- promotionalGiftsCount,
- hasActProduct,
- promotionFullReduction,
- secondHandOrderFlag,
- invoiceFlag,
- freePostFlag AS postageFlag,
- freight AS postage,
- productTotalFee,
- orderTotalFee,
- payTotalFee,
- payableAmount,
- balancePayFee,
- discountFee,
- couponAmount,
- status,
- confirmTime,
- payTime,
- rebateFlag,
- clauseID AS clauseId,
- clauseName
- FROM cm_order
- WHERE delFlag = 0 AND clubID = #{clubId}
- <if test="listType == 1 ">
- AND status = '0'
- </if>
- <if test="listType == 2 ">
- AND status IN(11,12,13,21,22,23)
- </if>
- <if test="listType == 3 ">
- AND status IN(11,12,21,22,31,32)
- </if>
- <if test="listType == 4 ">
- AND status IN(12,13,22,23,32,33)
- </if>
- <if test="listType == 5 ">
- AND refundType IN(1,2)
- </if>
- <if test="orderSubmitType == 1">
- AND orderSubmitType IN (0,1,2)
- </if>
- <if test="orderSubmitType == 2">
- AND orderSubmitType IN (3,4)
- </if>
- ORDER BY orderTime DESC
- </select>
- <select id="getUserIdBySpId" resultType="java.lang.Integer">
- SELECT userID FROM serviceprovider WHERE serviceProviderID = #{serviceProviderId}
- </select>
- <select id="getOrderListByKeyword" resultType="com.caimei365.order.model.vo.OrderVo">
- SELECT DISTINCT
- co.orderID AS orderId,
- co.shopOrderIds,
- co.orderSource,
- co.orderNo,
- co.userID AS userId,
- co.clubID AS clubId,
- co.buyUserID AS buyUserId,
- co.orderTime,
- co.updateDate,
- co.delFlag,
- co.userBeans,
- co.orderType,
- co.orderSubmitType,
- co.confirmFlag,
- co.onlinePayFlag,
- co.splitFlag,
- co.payFlag,
- co.receiptStatus,
- co.payStatus,
- co.zeroCostFlag,
- co.sendOutStatus,
- co.refundType,
- co.affirmPaymentFlag,
- co.productCount,
- co.presentCount,
- co.promotionalGiftsCount,
- co.hasActProduct,
- co.promotionFullReduction,
- co.secondHandOrderFlag,
- co.invoiceFlag,
- co.freePostFlag AS postageFlag,
- co.freight AS postage,
- co.productTotalFee,
- co.orderTotalFee,
- co.payTotalFee,
- co.payableAmount,
- co.balancePayFee,
- co.discountFee,
- co.couponAmount,
- co.status,
- co.confirmTime,
- co.payTime,
- co.rebateFlag,
- co.clauseID AS clauseId,
- co.clauseName
- FROM cm_order co
- LEFT JOIN cm_order_product cop ON co.orderID = cop.orderID
- WHERE co.delFlag = 0 AND co.userID IN
- <foreach item="userId" index="index" collection="userIds" open="(" separator="," close=")">
- #{userId}
- </foreach>
- AND cop.name LIKE CONCAT('%',#{searchWord},'%')
- GROUP BY co.orderID, co.orderTime
- ORDER BY co.orderTime DESC
- </select>
- <select id="getClubIdsBySellerId" resultType="java.lang.Integer">
- select userID from club where spID = #{serviceProviderId}
- </select>
- <select id="getSellerOrderCount" resultType="java.lang.Integer">
- SELECT COUNT(*) FROM cm_order
- WHERE delFlag = 0 AND userID IN
- <foreach item="userId" index="index" collection="userIds" open="(" separator="," close=")">
- #{userId}
- </foreach>
- <if test="orderState == 1 ">
- AND status = '0'
- </if>
- <if test="orderState == 2 ">
- AND status IN(11,12,13,21,22,23)
- </if>
- <if test="orderState == 3 ">
- AND status IN(11,12,21,22,31,32)
- </if>
- <if test="orderState == 4 ">
- AND status IN(12,13,22,23,32,33)
- </if>
- <if test="orderState == 5 ">
- AND refundType IN(1,2)
- </if>
- </select>
- <select id="getLastCheckOrderDate" resultType="java.util.Date">
- SELECT lastCheckOrderDate FROM club WHERE userID = #{userId} LIMIT 1
- </select>
- <select id="getUncheckedOrderCount" resultType="java.lang.Integer">
- SELECT COUNT(*) FROM cm_order
- WHERE userID = #{userId}
- AND orderSubmitType IN (0, 1, 2)
- <if test="lastCheckOrderDate != null">
- AND orderTime > #{lastCheckOrderDate}
- </if>
- </select>
- </mapper>
|