<?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.cslg.ppa.mapper.ReportMapper">

    <select id="selectAssoReportArticleList" resultType="com.cslg.ppa.vo.SelectAssoReportArticleVO">
        select ara.id as assoId,
               ara.report_id,
               ara.article_id,
               ai.title,
               ai.digest,
               ai.category_id,
               ca.name as categoryName,
               ai.public_time,
               ai.article_url,
               ai.source_id,
               si.source_name,
               si.source_type
        from asso_report_article ara
        left join article_info ai on ai.id = ara.article_id
        left join category ca on ca.id = ai.category_id
        left join source_info si on si.id = ai.source_id
        where ara.report_id = #{reportId} and ara.if_use = 1
        order by ai.public_time desc
    </select>
</mapper>
