<?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.HotSearchDao">

<select id="selectPage" resultType="com.yonge.cooleshow.biz.dal.vo.HotSearchVo">
    select
    hs.* ,
        su.username_ as updateName
    from hot_search hs
    left join sys_user su on hs.update_by_ = su.id_
        <where>
            <if test="query.status != null">
                and hs.status_ = #{query.status}
            </if>
            <if test="query.search != null and query.search != ''">
                and (hs.key_ like concat('%',#{query.search},'%') or hs.id_ like concat('%',#{query.search},'%'))
            </if>
            <if test="query.type != null">
                and hs.type_ = #{query.type}
            </if>
        </where>
    order by  hs.order_ ,hs.id_ desc
    </select>
</mapper>