<?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.zfire.mall.manager.commonmapper.NoticeRecordBeanMapper">

    <select id="readCount" resultType="com.zfire.mall.manager.bean.admin.NoticeRecordReadBean">
        select
             a.notice_id  'noticeId',
             count(a.notice_id) 'readCount'
        from
            notice_record a
        where
            read_flag = true
        and
            notice_id  in
        <foreach item="item" index="index" collection="noticeIds" open="(" separator=","
                 close=")">
            #{item}
        </foreach>
        group  by
            a.notice_id
    </select>

</mapper>