123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118 |
- <?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.caimei.mapper.OrderMapper">
- <select id="findOrderList" resultType="com.caimei.model.vo.OrderVo">
- select
- orderID AS orderId,
- organizeID AS organizeId,
- userID AS userId,
- status,
- shopOrderIDs AS shopOrderIds,
- receiptStatus,
- payStatus,
- sendOutStatus
- from cm_order
- where delFlag = '0'
- AND userID = #{userId}
- AND organizeID = #{organizeId}
- <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>
- ORDER BY orderTime DESC
- </select>
- <select id="findLogistics" resultType="com.caimei.model.vo.LogisticsBatchVo">
- SELECT * FROM cm_logistics_batch WHERE orderID= #{orderId}
- </select>
- <select id="findAllShopOrder" resultType="com.caimei.model.vo.ShopOrderVo">
- SELECT
- cso.shopOrderID AS shopOrderId,
- s.name AS shopName,
- s.logo AS shopLogo
- FROM
- cm_shop_order cso
- LEFT JOIN shop s ON cso.shopID = s.shopID
- WHERE
- cso.orderID = #{orderId}
- AND cso.delFlag = '0'
- </select>
- <select id="findOrderProduct" resultType="com.caimei.model.vo.OrderProductVo">
- SELECT
- cop.orderProductID AS orderProductId,
- p.mainImage AS productImage,
- p.productCategory as productCategory
- FROM
- cm_order_product cop
- LEFT JOIN product p ON cop.productID = p.productID
- WHERE
- shopOrderID = #{shopOrderId}
- </select>
- <select id="findOrderPromotionsById" resultType="com.caimei.model.po.PromotionsPo">
- SELECT
- id,
- name,
- description,
- orderId,
- type,
- mode,
- touchPrice,
- reducedPrice,
- beginTime,
- endTime,
- status
- FROM
- cm_promotions_order
- WHERE
- id = #{orderPromotionsId}
- </select>
- <select id="findDiscernReceipt" resultType="com.caimei.model.vo.DiscernReceiptVo">
- SELECT
- cdr.*,cror.associateAmount
- FROM
- cm_receipt_order_relation cror
- LEFT JOIN cm_discern_receipt cdr ON cror.receiptID = cdr.id
- WHERE
- cror.orderID = #{orderID}
- AND cror.relationType = '2'
- AND cror.delFlag = '0'
- AND cdr.delFlag = '0'
- AND cdr.receiptStatus = '3'
- AND cdr.payType != '16'
- ORDER BY
- cdr.receiptDate DESC
- </select>
- <select id="findOfflinePayment" resultType="com.caimei.model.vo.DiscernReceiptVo">
- SELECT
- cdr.*,cror.associateAmount
- FROM
- cm_receipt_order_relation cror
- LEFT JOIN cm_discern_receipt cdr ON cror.receiptID = cdr.id
- WHERE
- cror.orderID = #{orderId}
- AND cror.relationType = '2'
- AND cror.delFlag = '0'
- AND cdr.delFlag = '0'
- AND cdr.receiptStatus IN(2,3)
- AND cdr.payWay = '2'
- LIMIT 1
- </select>
- </mapper>
|