<?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.mall.order.mapper.RefundInfoMapper">

    <!-- 通用查询映射结果 -->
    <resultMap id="BaseResultMap" type="com.mall.order.domain.entity.RefundInfo">
        <id column="id" property="id"/>
        <id column="order_return_id" property="orderReturnId"/>
        <id column="refund" property="refund"/>
        <id column="refund_sn" property="refundSn"/>
        <id column="refund_status" property="refundStatus"/>
        <id column="refund_channel" property="refundChannel"/>
        <id column="refund_content" property="refundContent"/>
    </resultMap>

    <!-- 通用查询结果列 -->
    <sql id="Base_Column_List">
        id,order_return_id,refund,refund_sn,refund_status,refund_channel,refund_content
    </sql>

    <!-- 分页查询退款信息内容 -->
    <select id="selectListByPage" resultType="com.mall.order.domain.vo.RefundInfoVo">
        select
        <include refid="Base_Column_List"/>
        from oms_refund_info
        <where>
            <if test="dto.id != null and dto.id != ''">
                and id like CONCAT('%',#{dto.id},'%')
            </if>
            <if test="dto.orderReturnId != null and dto.orderReturnId != ''">
                and order_return_id like CONCAT('%',#{dto.orderReturnId},'%')
            </if>
            <if test="dto.refund != null and dto.refund != ''">
                and refund like CONCAT('%',#{dto.refund},'%')
            </if>
            <if test="dto.refundSn != null and dto.refundSn != ''">
                and refund_sn like CONCAT('%',#{dto.refundSn},'%')
            </if>
            <if test="dto.refundStatus != null and dto.refundStatus != ''">
                and refund_status like CONCAT('%',#{dto.refundStatus},'%')
            </if>
            <if test="dto.refundChannel != null and dto.refundChannel != ''">
                and refund_channel like CONCAT('%',#{dto.refundChannel},'%')
            </if>
            <if test="dto.refundContent != null and dto.refundContent != ''">
                and refund_content like CONCAT('%',#{dto.refundContent},'%')
            </if>
        </where>
    </select>

</mapper>
