<?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.quinn.mapper.CommentMapper">

    <select id="getSourceCommentList" resultType="com.quinn.pojo.CommentWithUser">
        select a.*,b.username,b.avatar from qn_comment a,qn_user b
        where a.user_id = b.uid and a.topic_category = 'SOURCE'
        and a.topic_id = #{topicId}
        order by a.gmt_create desc
        limit 100
    </select>

    <select id="getBlogCommentList" resultType="com.quinn.pojo.CommentWithUser">
        select a.*,b.username,b.avatar from qn_comment a,qn_user b
        where a.user_id = b.uid and a.topic_category = 'BLOG'
        and a.topic_id = #{topicId}
        order by a.gmt_create desc
        limit 100
    </select>

</mapper>
