123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990 |
- <?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.kmall.schedule.dao.QzOrderMapper">
- <select id="queryrderUnEvaluateList" resultType="map">
- SELECT
- a.id AS order_id,
- a.order_sn,
- c.goods_name,
- a.form_id,
- u.weixin_openid AS open_id
- FROM
- mall_order a
- LEFT JOIN mall_comment b ON a.id = b.order_id
- LEFT JOIN mall_order_goods c ON c.order_id = a.id
- LEFT JOIN mall_user u ON a.user_id = u.id
- WHERE
- b.id IS NULL
- AND a.confirm_time > date_add(now(), INTERVAL - 1 DAY)
- AND a.confirm_time IS NOT NULL
- </select>
- <select id="queryPastOrderList" resultType="map">
- SELECT b.product_id,b.number,c.stock_num,c.id as storeRelaId
- FROM mall_order a
- LEFT JOIN mall_order_goods b ON a.id = b.order_id
- LEFT JOIN mall_product_store_rela c ON b.product_id = c.product_id
- AND c.store_id = a.store_id
- WHERE 1 = 1
- AND a.add_time <![CDATA[ < ]]> DATE_ADD(now(),INTERVAL -15 MINUTE)
- AND a.order_status in (0,100) and a.order_type = 1
- </select>
- <update id="unpayPastUpdate">
- UPDATE mall_order a
- SET order_status=101,shipping_status=0,pay_status=0
- WHERE 1 = 1
- AND a.add_time <![CDATA[ < ]]> DATE_ADD(now(),INTERVAL -10 MINUTE)
- AND a.order_status = 0 and a.order_type = 1
- </update>
- <update id="updateStockNum" parameterType="map">
- update mall_product_store_rela a
- <set>
- <if test="stock_num != null">a.`stock_num` = #{stock_num},</if>
- </set>
- where a.id = #{id}
- </update>
- <select id="queryRefundOrderList" resultType="map">
- select a.pay_transaction_id,a.merch_order_sn,a.order_sn,a.order_status,a.pay_status,f.out_refund_no,f.refund_id,f.order_id,f.id 'orderRefundId'
- from mall_order a
- inner join mall_order_refund f on a.id = f.order_id where (f.out_refund_no is null or f.refund_id is null
- or f.refund_time is null or f.wechat_refund_status_des is null) and a.order_status = '401' and f.refund_status
- in (2,5)
- </select>
- <select id="queryPayingOrderList" resultType="map">
- select a.pay_transaction_id,a.order_sn,a.order_status,a.pay_status,a.id 'order_id',a.merch_order_sn
- from mall_order a where (a.order_status in ('100','201') and a.pay_status in (1,2))
- and (a.pay_transaction_id = '' or a.pay_transaction_id is null or a.pay_time is null or a.pay_time = '')
- </select>
- <update id="updateOrderInfo" parameterType="map">
- UPDATE mall_order a
- <set>
- <if test="orderStatus != null">a.order_status = #{orderStatus},</if>
- <if test="payStatus != null">a.pay_status = #{payStatus},</if>
- <if test="payTransactionId != null">a.pay_transaction_id = #{payTransactionId},</if>
- <if test="payTime != null">a.pay_time = #{payTime},</if>
- </set>
- WHERE 1 = 1
- AND a.id = #{orderId}
- </update>
- <update id="updateOrderRefund" parameterType="map">
- UPDATE mall_order_refund a
- <set>
- <if test="refundId != null">a.refund_id = #{refundId},</if>
- <if test="refundMoney != null">a.refund_money = #{refundMoney},</if>
- <if test="refundStatus != null">a.refund_status = #{refundStatus},</if>
- <if test="refundRecvAccout != null">a.refund_recv_accout = #{refundRecvAccout},</if>
- <if test="refundTime != null">a.refund_time = #{refundTime},</if>
- <if test="wechat_refund_status_des != null">a.wechat_refund_status_des = #{wechat_refund_status_des},</if>
- </set>
- WHERE 1 = 1
- AND a.out_refund_no = #{orderRefundId}
- </update>
- </mapper>
|