<?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="vip.xiaonuo.disk.mapper.NoticeMapper">


    <select id="selectPageVo" parameterType="vip.xiaonuo.disk.dto.notice.NoticeListDTO"
            resultType="vip.xiaonuo.disk.domain.Notice">
        select * from notice
        <where>
            <if test="noticeListDTO.platform != null and noticeListDTO.platform != ''">
                and PLATFORM = #{noticeListDTO.platform}
            </if>
            <if test="noticeListDTO.publisher != null and noticeListDTO.publisher != ''">
                and PUBLISHER = #{noticeListDTO.publisher}
            </if>
            <if test="noticeListDTO.beginTime != null and noticeListDTO.beginTime != ''">
                and CREATE_TIME &gt;= #{noticeListDTO.beginTime}
            </if>
            <if test="noticeListDTO.endTime != null and noticeListDTO.endTime != ''">
                and CREATE_TIME &lt;= #{noticeListDTO.endTime}
            </if>
            <if test="noticeListDTO.title != null and noticeListDTO.title != ''">
                and TITLE like '%${noticeListDTO.title}%'
            </if>
        </where>
        order by CREATE_TIME desc
    </select>

</mapper>
