<?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.ruoyi.web.work.mapper.NoticeMapper">
    
    <select id="selectList" resultType="com.ruoyi.web.work.domain.Notice">
        select id,title,top,state,create_time,create_by from tb_notice
        <where>
            <if test="title != null  and title != ''"> and title like concat('%', #{title}, '%')</if>
            <if test="top != null "> and top = #{top}</if>
            <if test="state != null "> and state = #{state}</if>
        </where>
    </select>

    <select id="indexList" resultType="com.ruoyi.web.work.domain.vo.NoticeVoList">
        SELECT id,top,title,create_time FROM tb_notice WHERE state=0 ORDER BY top DESC,id DESC LIMIT 5
    </select>

</mapper>