<?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.xxfc.platform.app.mapper.BannerMapper">

	<!-- 可根据自己的需求，是否要使用 -->
    <resultMap type="com.xxfc.platform.app.entity.Banner" id="bannerMap">
        <result property="id" column="id"/>
        <result property="title" column="title"/>
        <result property="cover" column="cover"/>
        <result property="crtName" column="crt_name"/>
        <result property="crtTime" column="crt_time"/>
        <result property="updName" column="upd_name"/>
        <result property="updTime" column="upd_time"/>
        <result property="url" column="url"/>
        <result property="isDel" column="is_del"/>
        <result property="location" column="location"/>
        <result property="platform" column="platform"/>
    </resultMap>

    <select id="findBannerListByType" resultMap="bannerMap">
        select * from `banner` where `is_del`=0 and `type`=#{type}
        <if test="location != null">
            and `location`=#{location}
        </if>
        <if test="platform != null">
            and `platform`=#{platform}
        </if>
        order by rank asc
    </select>
</mapper>