<?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.fjhx.mail.mapper.my.MyTagMessageMapper">
    <select id="getPage" resultType="com.fjhx.mail.entity.my.vo.MessageVo">
        select
        m.id,
        m.subject,
        m.from_email,
        m.from_personal_name,
        m.from_type,
        m.send_date,
        mtm.id myTagMessageId,
        m.is_attachments,
        m.uid
        from my_tag_message mtm
        left join
        <if test="type eq 1">
            personal_message
        </if>
        <if test="type eq 2">
            enterprise_message
        </if>
        m on m.id = mtm.message_id
        ${ew.customSqlSegment}
    </select>
</mapper>
