|
@@ -5,10 +5,11 @@
|
|
|
<mapper namespace="com.ruoyi.generator.mapper.community.CommunityArticleMapper">
|
|
|
|
|
|
<resultMap type="com.ruoyi.generator.vo.CommunityArticleVo" id="CommunityArticleVoResult">
|
|
|
- <id property="articleId" column="article_id"/>
|
|
|
+ <id property="id" column="article_id"/>
|
|
|
<result property="userId" column="user_id"/>
|
|
|
<result property="title" column="title"/>
|
|
|
<result property="content" column="content"/>
|
|
|
+ <result property="classId" column="class_id"/>
|
|
|
<result property="createBy" column="create_by"/>
|
|
|
<result property="createTime" column="create_time"/>
|
|
|
<result property="updateBy" column="update_by"/>
|
|
@@ -20,7 +21,7 @@
|
|
|
</resultMap>
|
|
|
|
|
|
<resultMap type="CommunityArticleImages" id="CommunityArticleImagesResult">
|
|
|
- <id property="imageId" column="image_id"/>
|
|
|
+ <id property="id" column="image_id"/>
|
|
|
<result property="articleId" column="article_id"/>
|
|
|
<result property="imageUrl" column="image_url"/>
|
|
|
<result property="createBy" column="create_by"/>
|
|
@@ -49,7 +50,7 @@
|
|
|
</resultMap>
|
|
|
|
|
|
<resultMap type="com.ruoyi.generator.vo.CommunityArticleCommentVo" id="CommunityCommentsResult">
|
|
|
- <id property="commentId" column="comment_id"/>
|
|
|
+ <id property="id" column="comment_id"/>
|
|
|
<result property="articleId" column="article_id"/>
|
|
|
<result property="userId" column="user_id"/>
|
|
|
<result property="content" column="comment_content"/>
|
|
@@ -61,7 +62,7 @@
|
|
|
</resultMap>
|
|
|
|
|
|
<resultMap id="CommunityCollectResult" type="CommunityArticleCollect">
|
|
|
- <id property="collectId" column="collect_id"/>
|
|
|
+ <id property="id" column="collect_id"/>
|
|
|
<result property="articleId" column="article_id"/>
|
|
|
<result property="userId" column="user_id"/>
|
|
|
<result property="createBy" column="create_by"/>
|
|
@@ -71,7 +72,7 @@
|
|
|
</resultMap>
|
|
|
|
|
|
<resultMap id="CommunityLikeResult" type="CommunityLike">
|
|
|
- <id property="likeId" column="like_id"/>
|
|
|
+ <id property="id" column="like_id"/>
|
|
|
<result property="articleId" column="article_id"/>
|
|
|
<result property="userId" column="user_id"/>
|
|
|
<result property="createBy" column="create_by"/>
|
|
@@ -81,7 +82,7 @@
|
|
|
</resultMap>
|
|
|
|
|
|
<sql id="selectCommunityArticleVo">
|
|
|
- select article_id,
|
|
|
+ select id as article_id,
|
|
|
user_id,
|
|
|
title,
|
|
|
content,
|
|
@@ -95,17 +96,18 @@
|
|
|
|
|
|
<select id="selectCommunityArticleList" parameterType="CommunityArticle" resultMap="CommunityArticleVoResult">
|
|
|
select
|
|
|
- a.article_id,
|
|
|
+ a.id as article_id,
|
|
|
a.user_id,
|
|
|
a.title,
|
|
|
a.is_comment,
|
|
|
a.content,
|
|
|
+ a.class_id,
|
|
|
a.create_by,
|
|
|
a.create_time,
|
|
|
a.update_by,
|
|
|
a.update_time,
|
|
|
a.remark,
|
|
|
- b.image_id,
|
|
|
+ b.id as image_id,
|
|
|
b.article_id,
|
|
|
b.image_url,
|
|
|
b.create_by,
|
|
@@ -117,7 +119,7 @@
|
|
|
c.nick_name,
|
|
|
c.email,
|
|
|
c.avatar,
|
|
|
- d.comment_id,
|
|
|
+ d.id as comment_id,
|
|
|
d.article_id,
|
|
|
d.user_id,
|
|
|
d.content as comment_content,
|
|
@@ -127,13 +129,19 @@
|
|
|
d.update_time
|
|
|
from
|
|
|
community_article a
|
|
|
- left join community_article_images b on a.article_id = b.article_id
|
|
|
+ left join community_article_images b on a.id = b.id
|
|
|
left join sys_user c on a.user_id = c.user_id
|
|
|
- left join community_article_comment d on d.article_id = a.article_id
|
|
|
+ left join community_article_comment d on d.article_id = a.id
|
|
|
<where>
|
|
|
+ <if test="id != null and id != ''">
|
|
|
+ AND a.id like concat('%', #{id}, '%')
|
|
|
+ </if>
|
|
|
<if test="title != null and title != ''">
|
|
|
AND a.title like concat('%', #{title}, '%')
|
|
|
</if>
|
|
|
+ <if test="classId != null and classId != ''">
|
|
|
+ AND a.class_id like concat('%', #{classId}, '%')
|
|
|
+ </if>
|
|
|
</where>
|
|
|
</select>
|
|
|
|
|
@@ -152,7 +160,7 @@
|
|
|
|
|
|
<!--点赞-->
|
|
|
<select id="selectCommunityArticleLikeById" resultMap="CommunityLikeResult">
|
|
|
- select like_id, article_id, user_id, create_by, create_time, update_by, update_time from
|
|
|
+ select id as like_id, article_id, user_id, create_by, create_time, update_by, update_time from
|
|
|
community_like
|
|
|
<where>
|
|
|
<if test="userId != null and userId != ''">
|
|
@@ -178,7 +186,7 @@
|
|
|
|
|
|
<!--收藏-->
|
|
|
<select id="selectCommunityCollectById" resultMap="CommunityCollectResult" parameterType="communityArticleCollect">
|
|
|
- select collect_id, article_id, user_id, create_by, create_time, update_by, update_time from
|
|
|
+ select id as collect_id, article_id, user_id, create_by, create_time, update_by, update_time from
|
|
|
community_article_collect
|
|
|
<where>
|
|
|
<if test="userId != null and userId != ''">
|