<?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="org.jeecg.modules.system.mapper.SysAnnouncementSendMapper">

    <select id="queryAnnouncementById" resultType="org.jeecg.modules.system.entity.SysAnnouncementSend">
        SELECT
            sas.id AS id,
            sas.read_flag AS readFlag,
            sas.read_time AS readTime,
            sa.titile AS titile,
            sa.msg_content AS msgContent,
            sa.start_time AS startTime,
            sa.end_time AS endTime,
            sa.sender AS sender,
            sa.priority As priority,
            sa.msg_type AS msgType,
            sa.send_status AS sendStatus,
            sa.cancel_time AS cancelTime,
            sa.user_ids AS userIds
        FROM
            sys_announcement_send sas
        LEFT JOIN
            sys_announcement sa
        ON
            sas.annt_id = sa.id
        where
            sas.id = #{id}
    </select>

    <select id="getPageList" resultType="org.jeecg.modules.system.entity.SysAnnouncementSend">
        SELECT
            sas.id,
            sa.titile,
            sa.msg_content,
            sa.sender,
            sa.create_time,
            sas.user_id,
            sas.read_flag
        FROM
            sys_announcement_send sas
            LEFT JOIN sys_announcement sa ON sa.id = sas.annt_id
            ${ew.customSqlSegment}
    </select>
</mapper>