<?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="cn.pluss.platform.mapper.MerchantOrderVOMapper">

<!--    <select id="getOnlineCouponList" resultType="java.util.Map">-->
<!--        SELECT od.`name`, CONCAT(IFNULL(od.`fee`, '0'), '') `fee` FROM tb_pluss_merchant_order mo-->
<!--        LEFT JOIN `syblife`.ims_tiny_wmall_order wo ON mo.orderNumber = wo.transaction_id AND mo.orderType = 10-->
<!--        LEFT JOIN `syblife`.ims_tiny_wmall_order_discount od ON od.oid = wo.id-->
<!--        WHERE mo.orderNumber = #{orderNumber} AND mo.`status` = '1' AND od.fee > 0-->
<!--    </select>-->

    <select id="getOnlineCouponList" resultType="java.util.Map">
        SELECT
            *
        FROM tb_pluss_merchant_order
        WHERE
            orderNumber = #{orderNumber}
    </select>

<!--    <select id="getOfflineCouponList" resultType="java.util.Map">-->
<!--        SELECT CONCAT(IFNULL(IFNULL(no_discount_part, discount_fee), '0'), '') `fee`, IF(acr.id IS NULL, '满减优惠', '代金券') `name`-->
<!--        FROM tb_pluss_merchant_order mo-->
<!--        LEFT JOIN syblife.ims_tiny_wmall_paybill_order wpo ON mo.orderNumber = wpo.transaction_id-->
<!--        LEFT JOIN syblife.ims_tiny_wmall_activity_coupon_record acr ON wpo.id = acr.order_id = #{orderNumber}-->
<!--        WHERE mo.orderNumber = #{orderNumber} AND IFNULL(no_discount_part, discount_fee) > 0;-->
<!--    </select>-->
    <select id="getOfflineCouponList" resultType="java.util.Map">
        SELECT
            *
        FROM tb_pluss_merchant_order
        WHERE
            orderNumber = #{orderNumber}
    </select>
</mapper>
