<?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.liquidnet.service.kylin.mapper.KylinBannersMapper">
    <select id="detail" parameterType="java.lang.String" resultType="com.liquidnet.service.kylin.dao.BannerDetailsDao">
        SELECT
        *
        FROM kylin_banners
        <where>
            banners_id=#{bannersId}
        </where>
    </select>

    <!-- admin banner列表 -->
    <select id="searchBannersList" parameterType="java.util.Map" resultType="com.liquidnet.service.kylin.dao.BannerDetailsListDao">
        SELECT *
        FROM kylin_banners
        <where>
            is_deleted = 1
            <if test="bannersName != ''">
                AND banners_name LIKE concat('%', #{bannersName}, '%')
            </if>
            <if test="targetType != ''">
                AND target_type=${targetType}
            </if>
            <if test="isOnline != '' and isOnline != 88 ">
                AND is_online=${isOnline}
            </if>
            <if test="isOnline == 88 ">
                AND is_online=0
            </if>
            <if test="promotionType != ''">
                AND promotion_type=${promotionType}
            </if>
        </where>
        ORDER BY banners_sort DESC
    </select>

</mapper>
