<?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.com.xingxi.store.data.mapper.WxaStoreReturnOrderMapper">

    <select id="selectReturnOrderListByStatus" resultType="ReturnOrderDTO">
        SELECT t_return_order.* FROM t_order
        INNER JOIN t_return_order ON t_order.orderId = t_return_order.orderId
        <where>
            t_return_order.delFlag = '0'
            AND t_order.buyerId = #{userId}
            AND t_order.sellerId = #{mercId}
            <if test="status !=null and status != ''">
                AND t_return_order.returnStatus = #{status}
            </if>
        </where>
        ORDER BY t_return_order.returnTime desc
    </select>

</mapper>
