<?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.hotent.portal.persistence.dao.PortalNewsNoticeReadDao">

    <resultMap id="PortalNewsNoticeRead" type="com.hotent.portal.model.PortalNewsNoticeRead">
        <id property="id" column="id_" jdbcType="VARCHAR"/>
        <result property="msgId" column="msg_id_" jdbcType="VARCHAR"/>
        <result property="receiverId" column="receiver_id_" jdbcType="VARCHAR"/>
        <result property="receiver" column="receiver_" jdbcType="VARCHAR"/>
        <result property="receiverTime" column="receiver_time_" jdbcType="TIMESTAMP"/>
    </resultMap>

    <select id="getReadByUser" resultMap="PortalNewsNoticeRead" parameterType="java.util.Map">
		select * from PORTAL_NEWS_NOTICE_READ a
		where a.receiver_id_=#{userId}
		and a.msg_id_=#{msgId}
	</select>

    <select id="getByMessageId" resultMap="PortalNewsNoticeRead">
		select * from PORTAL_NEWS_NOTICE_READ a
		where a.msg_id_=#{messageId}
	</select>

</mapper>