소스 검색

优化代码

fangqing 1 개월 전
부모
커밋
280f08db40
1개의 변경된 파일3개의 추가작업 그리고 0개의 파일을 삭제
  1. 3 0
      ruoyi-generator/src/main/resources/mapper/community/ArticleMapper.xml

+ 3 - 0
ruoyi-generator/src/main/resources/mapper/community/ArticleMapper.xml

@@ -211,6 +211,9 @@
             <if test="communityArticle.isDraft != null and communityArticle.isDraft != '' ">
             <if test="communityArticle.isDraft != null and communityArticle.isDraft != '' ">
                 AND IFNULL(a.is_Draft,0) = #{communityArticle.isDraft}
                 AND IFNULL(a.is_Draft,0) = #{communityArticle.isDraft}
             </if>
             </if>
+            <if test="searchType == 3">
+                and   EXISTS (select 1 from community_article_recommend car  where car.article_id = a.id and car.is_delete != 1 or car.is_delete is null)
+            </if>
             and (a.is_delete != 1 or a.is_delete is null)
             and (a.is_delete != 1 or a.is_delete is null)
             and (f.is_delete != 1 or f.is_delete is null)
             and (f.is_delete != 1 or f.is_delete is null)
             and a.user_id not in (select distinct peer_id from community_user_block where user_id = #{loginId} and is_block = 1 )
             and a.user_id not in (select distinct peer_id from community_user_block where user_id = #{loginId} and is_block = 1 )