<?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.bonus.core.order.common.mapper.OrderRefundDetailMapper">

    <select id="listRefundDetailState" resultType="com.bonus.core.order.weight.vo.RefundDetailStateVO">
        SELECT
        orr.order_refund_id ,
        orr.apply_time ,
        orr.order_id ,
        orr.apply_reason ,
        orr.check_state ,
        orr.resress_picurl ,
        orr.fee_amount,
        orr.real_refund_amount,
        ord.detail_id AS menu_id
        FROM
        order_refund orr
        LEFT JOIN order_refund_detail ord ON orr.order_refund_id = ord.order_refund_id
        <where>
            <if test="orderId != null">
                AND orr.order_id = #{orderId}
            </if>
            <if test="macOrderId != null">
                AND orr.mac_order_id = #{macOrderId}
            </if>
        </where>
    </select>

</mapper>
