cloudroam
2025-06-05 f7bb788026db3bb43e1156ce71b82ecaf8e75c32
src/main/resources/mapper/film/CommentPoExMapper.xml
@@ -14,41 +14,41 @@
    </resultMap>
    <sql id="Base_Column_List">
        fs_comment.id, fs_comment.parent_id, fs_comment.content, fs_comment.film_id, fs_comment.`state`, fs_comment.deleted,
        fs_comment.create_by, fs_comment.create_time, fs_comment.update_time
        film_comments.id, film_comments.parent_id, film_comments.content, film_comments.film_id, film_comments.`state`, film_comments.deleted,
        film_comments.create_by, film_comments.create_time, film_comments.update_time
    </sql>
    <select id="selectLatestComments" resultMap="BaseResultMap">
        select
        <include refid="Base_Column_List"/>
        from fs_comment left join fs_article on fs_comment.film_id = fs_article.id
        where fs_comment.deleted = 0
        and fs_comment.state = 1
        and fs_article.state = 1
        and fs_article.deleted = 0
        order by fs_comment.id desc
        from film_comments left join film_works on film_comments.film_id = film_works.id  and film_works.status = 'published'
        and film_works.deleted = 0
        where film_comments.deleted = 0
        and film_comments.state = 1
        order by film_comments.id desc
    </select>
    <select id="getAllArticleComment" resultMap="BaseResultMap">
        select
        <include refid="Base_Column_List"/>
        from fs_comment left join fs_article on fs_comment.film_id = fs_article.id
        where fs_comment.deleted = 0
        and fs_comment.state = 1
        from film_comments left join fs_article on film_comments.film_id = fs_article.id
        where film_comments.deleted = 0
        and film_comments.state = 1
        and fs_article.state = 1
        and fs_comment.create_time between #{startTime} and #{endTime}
        and fs_comment.parent_id = 0
        and film_comments.create_time between #{startTime} and #{endTime}
        and film_comments.parent_id = 0
    </select>
    <select id="getAllCommentReply" resultMap="BaseResultMap">
        select
        <include refid="Base_Column_List"/>
        from fs_comment left join fs_article on fs_comment.film_id = fs_article.id
        where fs_comment.deleted = 0
        and fs_comment.state = 1
        from film_comments left join fs_article on film_comments.film_id = fs_article.id
        where film_comments.deleted = 0
        and film_comments.state = 1
        and fs_article.state = 1
        and fs_comment.create_time between #{startTime} and #{endTime}
        and fs_comment.parent_id != 0
        and film_comments.create_time between #{startTime} and #{endTime}
        and film_comments.parent_id != 0
    </select>
</mapper>