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/vo/ArticleCommentVO.java            |   15 ++++++-
 src/main/java/org/springblade/modules/article/mapper/ArticleCommentMapper.xml     |   84 +++++++++++++++++++++++++++++++++++++-----
 src/main/java/org/springblade/modules/system/service/impl/DictBizServiceImpl.java |    2 
 3 files changed, 88 insertions(+), 13 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>
 
 
diff --git a/src/main/java/org/springblade/modules/article/vo/ArticleCommentVO.java b/src/main/java/org/springblade/modules/article/vo/ArticleCommentVO.java
index 7835562..aadabae 100644
--- a/src/main/java/org/springblade/modules/article/vo/ArticleCommentVO.java
+++ b/src/main/java/org/springblade/modules/article/vo/ArticleCommentVO.java
@@ -1,8 +1,10 @@
 package org.springblade.modules.article.vo;
 
+import io.swagger.annotations.ApiModelProperty;
 import lombok.Data;
 import lombok.EqualsAndHashCode;
-import org.springblade.modules.article.entity.ArticleCollectEntity;
+import org.springblade.modules.article.entity.Article;
+import org.springblade.modules.article.entity.ArticleCommentEntity;
 
 /**
  * 通知评论表 视图实体类
@@ -12,7 +14,16 @@
  */
 @Data
 @EqualsAndHashCode(callSuper = true)
-public class ArticleCommentVO extends ArticleCollectEntity {
+public class ArticleCommentVO extends ArticleCommentEntity {
 	private static final long serialVersionUID = 1L;
 
+	@ApiModelProperty(value = "手机号")
+	private String phone;
+
+	@ApiModelProperty(value = "标提")
+	private String title;
+
+	@ApiModelProperty(value = "昵称")
+	private String name;
+
 }
diff --git a/src/main/java/org/springblade/modules/system/service/impl/DictBizServiceImpl.java b/src/main/java/org/springblade/modules/system/service/impl/DictBizServiceImpl.java
index 4639500..dbf0dc6 100644
--- a/src/main/java/org/springblade/modules/system/service/impl/DictBizServiceImpl.java
+++ b/src/main/java/org/springblade/modules/system/service/impl/DictBizServiceImpl.java
@@ -76,7 +76,7 @@
 		LambdaQueryWrapper<DictBiz> lqw = Wrappers.<DictBiz>query().lambda().eq(DictBiz::getCode, dict.getCode()).eq(DictBiz::getDictKey, dict.getDictKey());
 		Long cnt = baseMapper.selectCount((Func.isEmpty(dict.getId())) ? lqw : lqw.notIn(DictBiz::getId, dict.getId()));
 		if (cnt > 0L) {
-			throw new ServiceException("当前字典键值已存在!");
+			throw new ServiceException("当前键值已存在!");
 		}
 		// 修改顶级字典后同步更新下属字典的编号
 		if (Func.isNotEmpty(dict.getId()) && dict.getParentId().longValue() == BladeConstant.TOP_PARENT_ID) {

--
Gitblit v1.9.3