From de08c257416dc91d64e6b4f28506dafdd88c0a0d Mon Sep 17 00:00:00 2001
From: linwe <872216996@qq.com>
Date: Wed, 22 Nov 2023 14:22:35 +0800
Subject: [PATCH] 文章分类+评论

---
 src/main/java/org/springblade/modules/article/mapper/ArticleCommentMapper.xml |   84 +++++++++++++++++++++++++++++++++++++-----
 1 files changed, 74 insertions(+), 10 deletions(-)

diff --git a/src/main/java/org/springblade/modules/article/mapper/ArticleCommentMapper.xml b/src/main/java/org/springblade/modules/article/mapper/ArticleCommentMapper.xml
index 8632c50..63b1422 100644
--- a/src/main/java/org/springblade/modules/article/mapper/ArticleCommentMapper.xml
+++ b/src/main/java/org/springblade/modules/article/mapper/ArticleCommentMapper.xml
@@ -3,20 +3,84 @@
 <mapper namespace="org.springblade.modules.article.mapper.ArticleCommentMapper">
 
     <!-- 通用查询映射结果 -->
-    <resultMap id="articleCommentResultMap" type="org.springblade.modules.article.entity.ArticleCommentEntity">
-        <result column="id" property="id"/>
-        <result column="article_id" property="articleId"/>
-        <result column="content" property="content"/>
-        <result column="user_id" property="userId"/>
-        <result column="reply_id" property="replyId"/>
-        <result column="reply_time" property="replyTime"/>
-        <result column="topping" property="topping"/>
-        <result column="isexamine" property="isexamine"/>
+    <resultMap id="articleCommentResultMap" type="org.springblade.modules.article.vo.ArticleCommentVO">
+        <result property="id" column="id"/>
+        <result property="articleId" column="article_id"/>
+        <result property="content" column="content"/>
+        <result property="userId" column="user_id"/>
+        <result property="replyId" column="reply_id"/>
+        <result property="replyTime" column="reply_time"/>
+        <result property="topping" column="topping"/>
+        <result property="isexamine" column="isexamine"/>
+        <result property="checkUser" column="check_user"/>
+        <result property="checkTime" column="check_time"/>
+        <result property="checkStatus" column="check_status"/>
+        <result property="checkRemark" column="check_remark"/>
+        <result property="createTime" column="create_time"/>
+        <result property="isDeleted" column="is_deleted"/>
     </resultMap>
+
+    <sql id="selectArticleComment">
+        select id,
+               article_id,
+               content,
+               user_id,
+               reply_id,
+               reply_time,
+               topping,
+               isexamine,
+               check_user,
+               check_time,
+               check_status,
+               check_remark,
+               create_time,
+               is_deleted
+        from jczz_article_comment
+    </sql>
 
 
     <select id="selectArticleCommentPage" resultMap="articleCommentResultMap">
-        select * from jczz_article_comment where is_deleted = 0
+        SELECT
+        jac.id,
+        jac.article_id,
+        jac.content,
+        jac.user_id,
+        jac.reply_id,
+        jac.reply_time,
+        jac.topping,
+        jac.isexamine,
+        jac.check_user,
+        jac.check_time,
+        jac.check_status,
+        jac.check_remark,
+        jac.create_time,
+        jac.is_deleted,
+        bu.`name`,
+        ja.title
+        FROM
+        jczz_article_comment jac
+        LEFT JOIN blade_user bu ON jac.user_id = bu.id
+        LEFT JOIN jczz_article ja ON ja.id = jac.article_id
+        <where>
+            <if test="noticeComment.id != null ">and  jac.id = #{noticeComment.id}</if>
+            <if test="noticeComment.articleId != null ">and jac.article_id = #{noticeComment.articleId}</if>
+            <if test="noticeComment.content != null  and noticeComment.content != ''">and jac.content = #{noticeComment.content}</if>
+            <if test="noticeComment.userId != null ">and jac.user_id = #{noticeComment.userId}</if>
+            <if test="noticeComment.replyId != null ">and jac.reply_id = #{noticeComment.replyId}</if>
+            <if test="noticeComment.replyTime != null ">and jac.reply_time = #{noticeComment.replyTime}</if>
+            <if test="noticeComment.topping != null ">and jac.topping = #{noticeComment.topping}</if>
+            <if test="noticeComment.isexamine != null ">and jac.isexamine = #{noticeComment.isexamine}</if>
+            <if test="noticeComment.checkUser != null ">and jac.check_user = #{noticeComment.checkUser}</if>
+            <if test="noticeComment.checkTime != null ">and jac.check_time = #{noticeComment.checkTime}</if>
+            <if test="noticeComment.checkStatus != null ">and jac.check_status = #{noticeComment.checkStatus}</if>
+            <if test="noticeComment.checkRemark != null  and noticeComment.checkRemark != ''">and jac.check_remark = #{noticeComment.checkRemark}</if>
+            <if test="noticeComment.createTime != null ">and jac.create_time = #{noticeComment.createTime}</if>
+            <if test="noticeComment.isDeleted != null ">and jac.is_deleted = #{noticeComment.isDeleted}</if>
+
+            <if test="noticeComment.phone != null ">and bu.phone like concat('%',#{noticeComment.phone},'%')</if>
+            <if test="noticeComment.name != null ">and bu.name like concat('%',#{noticeComment.name},'%')</if>
+            <if test="noticeComment.title != null ">and ja.title  like concat('%',#{noticeComment.title},'%') </if>
+        </where>
     </select>
 
 

--
Gitblit v1.9.3