<?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="top.charles7c.continew.admin.system.mapper.AnnouncementMapper">

    <select id="selectDashboardList"
            resultType="top.charles7c.continew.admin.system.model.resp.DashboardAnnouncementResp">
        SELECT
            `id`, `title`, `type`
        FROM `sys_announcement`
        WHERE (`effective_time` IS NULL OR NOW() > `effective_time`)
          AND (`terminate_time` IS NULL OR `terminate_time` > NOW())
        ORDER BY `sort` ASC, `effective_time` DESC
        LIMIT 5
    </select>
</mapper>