<?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.hotwj.platform.noticeManagerment.notificationIssue.mapper.HotNotificationIssueMapper">

    <select id="selectPageList"
            resultType="com.hotwj.platform.noticeManagerment.notificationIssue.domain.vo.HotNotificationIssueVo">
        SELECT *,
               (SELECT count(*)
                FROM hot_admin_notice sub
                WHERE sub.notice_id = hot_notification_issue.id
                  AND sub.is_received = 1
                  AND sub.is_deleted = 0)                                               as read_count,
               (SELECT count(*)
                FROM hot_admin_notice sub
                WHERE sub.notice_id = hot_notification_issue.id AND sub.is_deleted = 0) as total_count,
               (SELECT count(*)
                FROM hot_admin_notice sub
                WHERE sub.notice_id = hot_notification_issue.id
                  AND sub.status = 1
                  AND sub.is_deleted = 0)                                               as pass_count
        FROM hot_notification_issue ${ew.customSqlSegment}
    </select>
</mapper>
