package com.xxfc.platform.app.mapper;

import com.xxfc.platform.app.entity.Banner;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import org.springframework.stereotype.Repository;
import tk.mybatis.mapper.common.Mapper;

import java.util.List;


/**
 * 首页banner图
 * 
 * @author zjw
 * @email nishijjo@qq.com
 * @date 2019-06-06 11:41:51
 */
@Repository
public interface BannerMapper extends Mapper<Banner> {

    @Select("<script> select * from `banner` where is_del=#{isDel} and `platform`=#{platform}  " +
            " <when test='status != null'> and `status`=#{status} </when > " +
            " <when test='location != null'> and `location`=#{location} </when > " +
            "order by rank ASC </script>")
    List<Banner> findBannerListByisDelOrderByRank(Banner banner);



    List<Banner> findBannerListByType(@Param("type") Integer type,@Param("location") Integer location, @Param("multiLocation") String multiLocation, @Param("platform") Integer platform, @Param("status") Integer status);
}
