diff --git a/src/main/resources/mapper/UserCommentClinicalArticleMapper.xml b/src/main/resources/mapper/UserCommentClinicalArticleMapper.xml index 061e766..eab48dd 100644 --- a/src/main/resources/mapper/UserCommentClinicalArticleMapper.xml +++ b/src/main/resources/mapper/UserCommentClinicalArticleMapper.xml @@ -27,6 +27,7 @@ FROM user_comment_clinical_article a LEFT JOIN user b ON a.user_id = b.user_id WHERE a.status = 1 + AND a.article_id = #{articleId} AND a.root_id = #{rootId} @@ -49,6 +50,7 @@ LEFT JOIN user b ON a.user_id = b.user_id WHERE a.status = 1 AND a.root_id = #{rootId} + AND a.article_id = #{articleId} ORDER BY a.is_top desc , a.created_at DESC limit #{limit} @@ -68,6 +70,9 @@ LEFT JOIN case_clinical_article b ON a.article_id = b.article_id WHERE a.status = 1 AND b.article_status = 1 + + AND a.user_id = #{userId} + ORDER BY a.created_at DESC diff --git a/src/main/resources/mapper/UserCommentClinicalVideoMapper.xml b/src/main/resources/mapper/UserCommentClinicalVideoMapper.xml index 3681ab0..361b495 100644 --- a/src/main/resources/mapper/UserCommentClinicalVideoMapper.xml +++ b/src/main/resources/mapper/UserCommentClinicalVideoMapper.xml @@ -9,6 +9,7 @@ FROM user_comment_clinical_video a LEFT JOIN user b ON a.user_id = b.user_id WHERE a.status = 1 + AND a.video_id = #{videoId} AND a.root_id = #{rootId} @@ -50,6 +51,9 @@ LEFT JOIN case_clinical_video b ON a.video_id = b.video_id WHERE a.status = 1 AND b.video_status = 1 + + AND a.user_id = #{userId} + ORDER BY a.created_at DESC diff --git a/src/main/resources/mapper/UserCommentExchangeMapper.xml b/src/main/resources/mapper/UserCommentExchangeMapper.xml index 22a55ef..88fc148 100644 --- a/src/main/resources/mapper/UserCommentExchangeMapper.xml +++ b/src/main/resources/mapper/UserCommentExchangeMapper.xml @@ -10,6 +10,7 @@ FROM user_comment_exchange a LEFT JOIN user b ON a.user_id = b.user_id WHERE a.status = 1 + AND a.exchange_id = #{exchangeId} AND a.root_id = #{rootId} @@ -32,6 +33,7 @@ LEFT JOIN user b ON a.user_id = b.user_id WHERE a.status = 1 AND a.root_id = #{rootId} + AND a.exchange_id = #{exchangeId} ORDER BY a.is_top desc , a.created_at DESC limit #{limit}