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

    <!-- 通用查询映射结果 -->
    <resultMap id="BaseResultMap" type="com.mall.order.domain.entity.OrderSetting">
        <id column="id" property="id"/>
        <id column="flash_order_overtime" property="flashOrderOvertime"/>
        <id column="normal_order_overtime" property="normalOrderOvertime"/>
        <id column="confirm_overtime" property="confirmOvertime"/>
        <id column="finish_overtime" property="finishOvertime"/>
        <id column="comment_overtime" property="commentOvertime"/>
        <id column="member_level" property="memberLevel"/>
    </resultMap>

    <!-- 通用查询结果列 -->
    <sql id="Base_Column_List">
        id,flash_order_overtime,normal_order_overtime,confirm_overtime,finish_overtime,comment_overtime,member_level
    </sql>

    <!-- 分页查询订单配置信息内容 -->
    <select id="selectListByPage" resultType="com.mall.order.domain.vo.OrderSettingVo">
        select
        <include refid="Base_Column_List"/>
        from oms_order_setting
        <where>
            <if test="dto.id != null and dto.id != ''">
                and id like CONCAT('%',#{dto.id},'%')
            </if>
            <if test="dto.flashOrderOvertime != null and dto.flashOrderOvertime != ''">
                and flash_order_overtime like CONCAT('%',#{dto.flashOrderOvertime},'%')
            </if>
            <if test="dto.normalOrderOvertime != null and dto.normalOrderOvertime != ''">
                and normal_order_overtime like CONCAT('%',#{dto.normalOrderOvertime},'%')
            </if>
            <if test="dto.confirmOvertime != null and dto.confirmOvertime != ''">
                and confirm_overtime like CONCAT('%',#{dto.confirmOvertime},'%')
            </if>
            <if test="dto.finishOvertime != null and dto.finishOvertime != ''">
                and finish_overtime like CONCAT('%',#{dto.finishOvertime},'%')
            </if>
            <if test="dto.commentOvertime != null and dto.commentOvertime != ''">
                and comment_overtime like CONCAT('%',#{dto.commentOvertime},'%')
            </if>
            <if test="dto.memberLevel != null and dto.memberLevel != ''">
                and member_level like CONCAT('%',#{dto.memberLevel},'%')
            </if>
        </where>
    </select>

</mapper>
