<?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.coupon.mapper.SkuFullReductionMapper">

    <!-- 通用查询映射结果 -->
    <resultMap id="BaseResultMap" type="com.mall.coupon.domain.entity.SkuFullReduction">
            <id column="id" property="id"/>
            <id column="sku_id" property="skuId"/>
            <id column="full_price" property="fullPrice"/>
            <id column="reduce_price" property="reducePrice"/>
            <id column="add_other" property="addOther"/>
    </resultMap>

    <!-- 通用查询结果列 -->
    <sql id="Base_Column_List">
        id,sku_id,full_price,reduce_price,add_other
    </sql>

    <!-- 分页查询商品满减信息内容 -->
    <select id="selectListByPage" resultType="com.mall.coupon.domain.vo.SkuFullReductionVo">
        select
        <include refid="Base_Column_List"/>
        from sms_sku_full_reduction
        <where>
                <if test="dto.id != null and dto.id != ''">
                    and id like CONCAT('%',#{dto.id},'%')
                </if>
                <if test="dto.skuId != null and dto.skuId != ''">
                    and sku_id like CONCAT('%',#{dto.skuId},'%')
                </if>
                <if test="dto.fullPrice != null and dto.fullPrice != ''">
                    and full_price like CONCAT('%',#{dto.fullPrice},'%')
                </if>
                <if test="dto.reducePrice != null and dto.reducePrice != ''">
                    and reduce_price like CONCAT('%',#{dto.reducePrice},'%')
                </if>
                <if test="dto.addOther != null and dto.addOther != ''">
                    and add_other like CONCAT('%',#{dto.addOther},'%')
                </if>
        </where>
    </select>

</mapper>
