|
@@ -20,12 +20,10 @@
|
|
|
a.update_time,
|
|
|
'0' as isFollow
|
|
|
FROM community_collection a
|
|
|
- LEFT JOIN community_collection_article b ON a.id = b.collection_id
|
|
|
- LEFT JOIN community_article c ON b.article_id = c.id
|
|
|
+ LEFT JOIN (select * from community_collection_article where is_delete != '1' OR is_delete IS NULL) b ON a.id = b.collection_id
|
|
|
+ LEFT JOIN (select * from community_article where is_delete != '1' OR is_delete IS NULL) c ON b.article_id = c.id
|
|
|
WHERE a.user_id = #{userId}
|
|
|
AND (a.is_delete != '1' OR a.is_delete IS NULL)
|
|
|
- AND (b.is_delete != '1' OR b.is_delete IS NULL)
|
|
|
- AND (c.is_delete != '1' OR c.is_delete IS NULL)
|
|
|
<if test="articleId != null and articleId != ''">
|
|
|
AND b.article_id = #{articleId}
|
|
|
</if>
|
|
@@ -58,14 +56,11 @@
|
|
|
a.update_time,
|
|
|
'1' as isFollow
|
|
|
FROM community_collection a
|
|
|
- LEFT JOIN community_collection_article b ON a.id = b.collection_id
|
|
|
- LEFT JOIN community_article c ON b.article_id = c.id
|
|
|
- LEFT JOIN community_collection_user d ON d.collection_id = a.id
|
|
|
+ LEFT JOIN (select * from community_collection_article where is_delete != '1' OR is_delete IS NULL) b ON a.id = b.collection_id
|
|
|
+ LEFT JOIN (select * from community_article where is_delete != '1' OR is_delete IS NULL) c ON b.article_id = c.id
|
|
|
+ LEFT JOIN (select * from community_collection_user where is_delete != '1' OR is_delete IS NULL) d ON d.collection_id = a.id
|
|
|
WHERE d.user_id = #{userId} AND d.id is not null
|
|
|
AND (a.is_delete != '1' OR a.is_delete IS NULL)
|
|
|
- AND (b.is_delete != '1' OR b.is_delete IS NULL)
|
|
|
- AND (d.is_delete != '1' OR d.is_delete IS NULL)
|
|
|
- AND (c.is_delete != '1' OR c.is_delete IS NULL)
|
|
|
<if test="articleId != null and articleId != ''">
|
|
|
AND b.article_id = #{articleId}
|
|
|
</if>
|