<?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.bootx.platform.notice.core.site.dao.SiteMessageMapper">

    <select id="pageMassage" resultType="cn.bootx.platform.notice.core.site.domain.SiteMessageInfo">
        select
            nsm.id as id,
            nsm.title as title,
            nsm.sender_id as senderId,
            nsm.sender_name as senderName,
            nsm.sender_time as senderTime,
            nsm.receive_type as receiveType,
            nsm.efficient_time as efficientTime,
            nsm.send_state as sendState,
            nsm.cancel_time as cancelTime,
            nsmu.receive_id as receiveId,
            nsmu.have_read as haveRead,
            nsmu.read_time as readTime
        from notice_site_message nsm
                 left join notice_site_message_user nsmu on nsm.id = nsmu.message_id
            ${ew.customSqlSegment}
    </select>

    <select id="countMassage" resultType="java.lang.Integer">
        select count(*)
        from notice_site_message nsm
                 left join notice_site_message_user nsmu on nsm.id = nsmu.message_id
            ${ew.customSqlSegment}
    </select>

</mapper>
