<?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.OrderReturnReasonMapper">

    <!-- 通用查询映射结果 -->
    <resultMap id="BaseResultMap" type="com.mall.order.domain.entity.OrderReturnReason">
        <id column="id" property="id"/>
        <id column="name" property="name"/>
        <id column="sort" property="sort"/>
        <id column="status" property="status"/>
        <id column="create_time" property="createTime"/>
    </resultMap>

    <!-- 通用查询结果列 -->
    <sql id="Base_Column_List">
        id,name,sort,status,create_time
    </sql>

    <!-- 分页查询退货原因内容 -->
    <select id="selectListByPage" resultType="com.mall.order.domain.vo.OrderReturnReasonVo">
        select
        <include refid="Base_Column_List"/>
        from oms_order_return_reason
        <where>
            <if test="dto.id != null and dto.id != ''">
                and id like CONCAT('%',#{dto.id},'%')
            </if>
            <if test="dto.name != null and dto.name != ''">
                and name like CONCAT('%',#{dto.name},'%')
            </if>
            <if test="dto.sort != null and dto.sort != ''">
                and sort like CONCAT('%',#{dto.sort},'%')
            </if>
            <if test="dto.status != null and dto.status != ''">
                and status like CONCAT('%',#{dto.status},'%')
            </if>
            <if test="dto.createTime != null and dto.createTime != ''">
                and create_time like CONCAT('%',#{dto.createTime},'%')
            </if>
        </where>
    </select>

</mapper>
