<?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 * from tb_notice
        <where>
            <if test="title != null  and title != ''"> and title like concat('%', #{title}, '%')</if>
            <if test="contents != null  and contents != ''"> and contents like concat('%', #{contents}, '%')</if>
            <if test="top != null "> and top = #{top}</if>
            <if test="state != null "> and state = #{state}</if>
            <if test="beginTime != null and beginTime != '' and endTime != null and endTime != ''">
                and (create_time between #{beginTime} and #{endTime})
            </if>
        </where>
    </select>

    <select id="selectisEmpty" resultType="com.ruoyi.web.work.domain.Notice">
        select * from tb_notice
        <where>
            <if test="title != null  and title != ''"> and title =  #{title}</if>
        </where>
    </select>

    <select id="queryList" resultType="com.ruoyi.web.work.domain.Notice">
        select * from tb_notice
        <where>
            and state = 1
        </where>
        ORDER BY top DESC,create_time DESC
    </select>

</mapper>
