From 86b6fcd12634fbb08a2bd8a2cf44205f7e1d2067 Mon Sep 17 00:00:00 2001
From: zengh <123456>
Date: Sat, 09 Oct 2021 10:34:14 +0800
Subject: [PATCH] 点赞评论相关提交

---
 src/main/java/org/springblade/modules/comment/mapper/CommentMapper.xml |   56 ++++++++++++++++++++++++++++++++++++++++++++++++++------
 1 files changed, 50 insertions(+), 6 deletions(-)

diff --git a/src/main/java/org/springblade/modules/comment/mapper/CommentMapper.xml b/src/main/java/org/springblade/modules/comment/mapper/CommentMapper.xml
index e36445f..a4c69ff 100644
--- a/src/main/java/org/springblade/modules/comment/mapper/CommentMapper.xml
+++ b/src/main/java/org/springblade/modules/comment/mapper/CommentMapper.xml
@@ -3,16 +3,60 @@
 <mapper namespace="org.springblade.modules.comment.mapper.CommentMapper">
 
     <!-- 通用查询映射结果 -->
-    <resultMap id="ulikesResultMap" type="org.springblade.modules.comment.entity.Comment">
-        <id column="id" property="id"/>
-        <result column="name" property="name"/>
-        <result column="identityCard" property="identityCard"/>
-        <result column="ticketCode" property="ticketCode"/>
+    <resultMap id="ulikesResultMap" type="org.springblade.modules.comment.vo.CommentVO">
+
     </resultMap>
 
 
     <select id="selectSurveyPage" resultMap="ulikesResultMap">
-        select * from sys_ulikes
+        SELECT
+            com.*,
+            user.real_name as name
+        FROM
+            sys_comment com
+            LEFT JOIN blade_user user ON com.user_id = user.id
+        where 1=1 and isexamine = 1
+        <if test="comment.article!=null and comment.article!=''">
+            and article = #{comment.article}
+        </if>
+            ORDER BY topping DESC,time DESC
+
+    </select>
+
+    <select id="articlepage" resultMap="ulikesResultMap">
+        SELECT
+        com.*,
+        user.real_name AS name,
+        art.title,
+        art.source_name
+        FROM
+        sys_comment com
+        LEFT JOIN blade_user user ON com.user_id = user.id
+        LEFT JOIN sys_article art on art.id = com.article
+        WHERE
+        1 =1
+        <if test="comment.topping!=null and comment.topping!=''">
+            and topping = #{comment.topping}
+        </if>
+        <if test="comment.isexamine!=null and comment.isexamine!=''">
+            and isexamine = #{comment.isexamine}
+        </if>
+        <if test="comment.sourceName!=null and comment.sourceName!=''">
+            and source_name LIKE CONCAT ('%', #{comment.sourceName},'%')
+        </if>
+        <if test="comment.title!=null and comment.title!=''">
+            and title LIKE CONCAT ('%', #{comment.title},'%')
+        </if>
+        <if test="comment.name!=null and comment.name!=''">
+            and name LIKE CONCAT ('%', #{comment.name},'%')
+        </if>
+        <if test="comment.startTime!=null and comment.startTime!=''">
+            and time&gt;=#{comment.startTime}
+        </if>
+        <if test="comment.endTime!=null and comment.endTime!=''">
+            and time&lt;=#{comment.endTime}
+        </if>
+            ORDER BY isexamine ASC,topping DESC,time DESC
     </select>
 
 

--
Gitblit v1.9.3