|
@@ -290,6 +290,7 @@
|
|
</where>
|
|
</where>
|
|
</select>
|
|
</select>
|
|
|
|
|
|
|
|
+
|
|
<insert id="insertCommunityCollectById" parameterType="communityArticleCollect">
|
|
<insert id="insertCommunityCollectById" parameterType="communityArticleCollect">
|
|
insert into community_article_collect (article_id, user_id, create_by, create_time, update_by, update_time)
|
|
insert into community_article_collect (article_id, user_id, create_by, create_time, update_by, update_time)
|
|
values (#{articleId}, #{userId}, #{userId}, now(), #{userId}, now());
|
|
values (#{articleId}, #{userId}, #{userId}, now(), #{userId}, now());
|
|
@@ -301,4 +302,25 @@
|
|
where user_id = #{userId}
|
|
where user_id = #{userId}
|
|
and article_id = #{articleId};
|
|
and article_id = #{articleId};
|
|
</delete>
|
|
</delete>
|
|
|
|
+
|
|
|
|
+ <select id="selectTrendingTopByContent" resultType="com.ruoyi.generator.domain.Community.TrendingTop">
|
|
|
|
+ SELECT
|
|
|
|
+ type, content
|
|
|
|
+ FROM (
|
|
|
|
+ SELECT
|
|
|
|
+ 'article' as type, title as content
|
|
|
|
+ FROM community_article
|
|
|
|
+ WHERE title LIKE CONCAT( #{content}, '%') AND is_delete != '1'
|
|
|
|
+ UNION ALL
|
|
|
|
+ SELECT
|
|
|
|
+ 'tag' as type, tag_name
|
|
|
|
+ FROM community_tag
|
|
|
|
+ WHERE tag_name LIKE CONCAT( #{content}, '%') AND is_delete != '1'
|
|
|
|
+ UNION ALL
|
|
|
|
+ SELECT
|
|
|
|
+ 'user' as type, nick_name
|
|
|
|
+ FROM sys_user
|
|
|
|
+ WHERE nick_name LIKE CONCAT( #{content}, '%') AND status = '0'
|
|
|
|
+ ) AS A
|
|
|
|
+ </select>
|
|
</mapper>
|
|
</mapper>
|