<?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="cn.pluss.platform.mapper.NotificationMapper">
    <select id="selectOneTime" resultType="cn.pluss.platform.entity.Notification">
        select id,createTime FROM tb_pluss_notification ORDER BY createTime DESC LIMIT 0,1 ;
    </select>

    <select id="queryNotification" resultType="cn.pluss.platform.entity.Notification" parameterType="java.util.Map">
        select * from tb_pluss_notification
        order by case
                 when status=1 then 0 else 1
		         END,createTime desc limit #{pageSize} offset #{offset}
    </select>

    <update id="updateAll" parameterType="java.lang.String">
        update tb_pluss_notification set status=#{status}
    </update>

</mapper>