<?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.yonge.cooleshow.biz.dal.dao.BannerDao">

<select id="selectBanner" resultType="com.yonge.cooleshow.biz.dal.entity.SysNewsInformation">

	SELECT sni.*
	, su.username_ as updateName
	, snt.name_ as subTypeName
	FROM sys_news_information sni
	left join sys_news_type snt on snt.id_ = sni.sub_type_
	left join sys_user su on sni.update_by_ = su.id_
		where
		sni.del_flag_=0 and sni.type_ = 4  and if(sni.online_time_ is not null,sni.online_time_ &lt;= now(),1=1)
	  and if(sni.offline_time_ is not null,sni.offline_time_ &gt;= now(),1=1)
	  and sni.status_ = 1 and sni.client_type_ = 'WEBSITE'
	order by sni.status_ desc,sni.order_,sni.update_time_ desc

	</select>
</mapper>