|
@@ -6,14 +6,14 @@
|
|
|
|
|
|
<resultMap type="com.ruoyi.generator.vo.CommunityArticleVo" id="CommunityArticleVoResult">
|
|
<resultMap type="com.ruoyi.generator.vo.CommunityArticleVo" id="CommunityArticleVoResult">
|
|
<id property="id" 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"/>
|
|
|
|
- <result property="updateTime" column="update_time"/>
|
|
|
|
|
|
+ <result property="userId" column="article_user_id"/>
|
|
|
|
+ <result property="title" column="article_title"/>
|
|
|
|
+ <result property="content" column="article_content"/>
|
|
|
|
+ <result property="classId" column="article_class_id"/>
|
|
|
|
+ <result property="createBy" column="article_create_by"/>
|
|
|
|
+ <result property="createTime" column="article_create_time"/>
|
|
|
|
+ <result property="updateBy" column="article_update_by"/>
|
|
|
|
+ <result property="updateTime" column="article_update_time"/>
|
|
<result property="remark" column="remark"/>
|
|
<result property="remark" column="remark"/>
|
|
<collection property="imageList" javaType="java.util.List" resultMap="CommunityArticleImagesResult"/>
|
|
<collection property="imageList" javaType="java.util.List" resultMap="CommunityArticleImagesResult"/>
|
|
<collection property="sysUsers" resultMap="SysUserResult"/>
|
|
<collection property="sysUsers" resultMap="SysUserResult"/>
|
|
@@ -22,13 +22,12 @@
|
|
|
|
|
|
<resultMap type="CommunityArticleImages" id="CommunityArticleImagesResult">
|
|
<resultMap type="CommunityArticleImages" id="CommunityArticleImagesResult">
|
|
<id property="id" column="image_id"/>
|
|
<id property="id" column="image_id"/>
|
|
- <result property="articleId" column="article_id"/>
|
|
|
|
|
|
+ <result property="articleId" column="images_article_id"/>
|
|
<result property="imageUrl" column="image_url"/>
|
|
<result property="imageUrl" column="image_url"/>
|
|
- <result property="createBy" column="create_by"/>
|
|
|
|
- <result property="createTime" column="create_time"/>
|
|
|
|
- <result property="updateBy" column="update_by"/>
|
|
|
|
- <result property="updateTime" column="update_time"/>
|
|
|
|
- <result property="remark" column="remark"/>
|
|
|
|
|
|
+ <result property="createBy" column="images_create_by"/>
|
|
|
|
+ <result property="createTime" column="images_create_time"/>
|
|
|
|
+ <result property="updateBy" column="images_update_by"/>
|
|
|
|
+ <result property="updateTime" column="images_update_time"/>
|
|
</resultMap>
|
|
</resultMap>
|
|
|
|
|
|
<resultMap type="SysUser" id="SysUserResult">
|
|
<resultMap type="SysUser" id="SysUserResult">
|
|
@@ -51,14 +50,14 @@
|
|
|
|
|
|
<resultMap type="com.ruoyi.generator.vo.CommunityArticleCommentVo" id="CommunityCommentsResult">
|
|
<resultMap type="com.ruoyi.generator.vo.CommunityArticleCommentVo" id="CommunityCommentsResult">
|
|
<id property="id" column="comment_id"/>
|
|
<id property="id" column="comment_id"/>
|
|
- <result property="articleId" column="article_id"/>
|
|
|
|
- <result property="userId" column="user_id"/>
|
|
|
|
|
|
+ <result property="articleId" column="comment_article_id"/>
|
|
|
|
+ <result property="userId" column="comment_user_id"/>
|
|
<result property="content" column="comment_content"/>
|
|
<result property="content" column="comment_content"/>
|
|
- <result property="createBy" column="create_by"/>
|
|
|
|
- <result property="createTime" column="create_time"/>
|
|
|
|
- <result property="updateBy" column="update_by"/>
|
|
|
|
- <result property="updateTime" column="update_time"/>
|
|
|
|
- <result property="remark" column="remark"/>
|
|
|
|
|
|
+ <result property="createBy" column="comment_create_by"/>
|
|
|
|
+ <result property="createTime" column="comment_create_time"/>
|
|
|
|
+ <result property="updateBy" column="comment_update_by"/>
|
|
|
|
+ <result property="updateTime" column="comment_update_time"/>
|
|
|
|
+ <result property="remark" column="comment_remark"/>
|
|
</resultMap>
|
|
</resultMap>
|
|
|
|
|
|
<resultMap id="CommunityCollectResult" type="CommunityArticleCollect">
|
|
<resultMap id="CommunityCollectResult" type="CommunityArticleCollect">
|
|
@@ -97,50 +96,48 @@
|
|
<select id="selectCommunityArticleList" parameterType="CommunityArticle" resultMap="CommunityArticleVoResult">
|
|
<select id="selectCommunityArticleList" parameterType="CommunityArticle" resultMap="CommunityArticleVoResult">
|
|
select
|
|
select
|
|
a.id as 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,
|
|
|
|
|
|
+ a.user_id as article_user_id,
|
|
|
|
+ a.title as article_title,
|
|
|
|
+ a.is_comment as article_is_comment,
|
|
|
|
+ a.content as article_content,
|
|
|
|
+ a.class_id as article_class_id,
|
|
|
|
+ a.create_by as article_create_by,
|
|
|
|
+ a.create_time as article_create_time,
|
|
|
|
+ a.update_by as article_update_by,
|
|
|
|
+ a.update_time as article_update_time,
|
|
b.id as image_id,
|
|
b.id as image_id,
|
|
- b.article_id,
|
|
|
|
- b.image_url,
|
|
|
|
- b.create_by,
|
|
|
|
- b.create_time,
|
|
|
|
- b.update_by,
|
|
|
|
- b.update_time,
|
|
|
|
- b.remark,
|
|
|
|
- c.user_name,
|
|
|
|
- c.nick_name,
|
|
|
|
- c.email,
|
|
|
|
- c.avatar,
|
|
|
|
|
|
+ b.article_id as images_article_id,
|
|
|
|
+ b.image_url as image_url,
|
|
|
|
+ b.create_by as images_create_by,
|
|
|
|
+ b.create_time as images_create_time,
|
|
|
|
+ b.update_by as images_update_by,
|
|
|
|
+ b.update_time as images_update_time,
|
|
|
|
+ c.user_name as user_name,
|
|
|
|
+ c.nick_name as nick_name,
|
|
|
|
+ c.email as email,
|
|
|
|
+ c.avatar as avatar,
|
|
d.id as comment_id,
|
|
d.id as comment_id,
|
|
- d.article_id,
|
|
|
|
- d.user_id,
|
|
|
|
|
|
+ d.article_id as comment_article_id,
|
|
|
|
+ d.user_id as comment_user_id,
|
|
d.content as comment_content,
|
|
d.content as comment_content,
|
|
- d.create_by,
|
|
|
|
- d.create_time,
|
|
|
|
- d.update_by,
|
|
|
|
- d.update_time
|
|
|
|
|
|
+ d.create_by as comment_create_by,
|
|
|
|
+ d.create_time as comment_create_time,
|
|
|
|
+ d.update_by as comment_update_by,
|
|
|
|
+ d.update_time as comment_update_time
|
|
from
|
|
from
|
|
community_article a
|
|
community_article a
|
|
- left join community_article_images b on a.id = b.id
|
|
|
|
|
|
+ left join community_article_images b on a.id = b.article_id
|
|
left join sys_user c on a.user_id = c.user_id
|
|
left join sys_user c on a.user_id = c.user_id
|
|
left join community_article_comment d on d.article_id = a.id
|
|
left join community_article_comment d on d.article_id = a.id
|
|
<where>
|
|
<where>
|
|
<if test="id != null and id != ''">
|
|
<if test="id != null and id != ''">
|
|
- AND a.id like concat('%', #{id}, '%')
|
|
|
|
|
|
+ AND a.id = #{id}
|
|
</if>
|
|
</if>
|
|
<if test="title != null and title != ''">
|
|
<if test="title != null and title != ''">
|
|
AND a.title like concat('%', #{title}, '%')
|
|
AND a.title like concat('%', #{title}, '%')
|
|
</if>
|
|
</if>
|
|
<if test="classId != null and classId != ''">
|
|
<if test="classId != null and classId != ''">
|
|
- AND a.class_id like concat('%', #{classId}, '%')
|
|
|
|
|
|
+ AND a.class_id = #{classId}
|
|
</if>
|
|
</if>
|
|
</where>
|
|
</where>
|
|
</select>
|
|
</select>
|