<?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.yida.data.school.news.mapper.EduNoticeSystemMapper">
  <select id="listNoticePage" resultType="com.yida.data.school.vo.news.SysNoticeInfoVO">
    select b.content, b.create_date,a.id msgId
    from edu_notice_system_user a
    inner join edu_notice_system b on a.notice_id = b.id
    where a.user_id = #{userId}
  </select>

  <select id="existNewMsg" resultType="java.lang.Integer">
    select 1
    from (select notice_id from edu_notice_system_user where user_id=#{userId} and read_flag=0) a
    inner join edu_notice_system b on a.notice_id = b.id
    limit 1
  </select>
</mapper>