From 3b9e74e575abc3a410cb7951792d49b63842c5da Mon Sep 17 00:00:00 2001
From: xiangpei <xiangpei@timesnew.cn>
Date: 星期二, 03 六月 2025 12:55:18 +0800
Subject: [PATCH] 视频封面
---
framework/src/main/resources/mapper/lmk/VideoCommentMapper.xml | 40 ++++++++++++++++++++++++++++------------
1 files changed, 28 insertions(+), 12 deletions(-)
diff --git a/framework/src/main/resources/mapper/lmk/VideoCommentMapper.xml b/framework/src/main/resources/mapper/lmk/VideoCommentMapper.xml
index 2e64ebc..759dfc5 100644
--- a/framework/src/main/resources/mapper/lmk/VideoCommentMapper.xml
+++ b/framework/src/main/resources/mapper/lmk/VideoCommentMapper.xml
@@ -10,13 +10,16 @@
<result column="reply_id" property="replyId" />
<result column="reply_user_id" property="replyUserId" />
<result column="reply_user_nickname" property="replyUserNickname" />
+ <result column="reply_user_avatar" property="replyUserAvatar" />
<result column="master_comment_id" property="masterCommentId" />
<result column="status" property="status" />
- <result column="create_by" property="userId" />
+ <result column="thumbs_up_num" property="thumbsUpNum" />
+ <result column="userId" property="userId" />
<result column="user_nickname" property="userNickname" />
<result column="user_avatar" property="userAvatar" />
<result column="create_time" property="createTime" />
<result column="replyTotalCount" property="replyTotalCount" />
+ <result column="has_thumbs_up" property="hasThumbsUp" />
</resultMap>
@@ -34,8 +37,9 @@
LVC.reply_user_nickname,
LVC.master_comment_id,
LVC.status,
+ LVC.thumbs_up_num,
LVC.id,
- LVC.create_by,
+ LVC.user_id,
LVC.user_nickname,
LVC.user_avatar,
LVC.create_time
@@ -55,8 +59,9 @@
LVC.reply_user_nickname,
LVC.master_comment_id,
LVC.status,
+ LVC.thumbs_up_num,
LVC.id,
- LVC.create_by,
+ LVC.user_id,
LVC.user_nickname,
LVC.user_avatar,
LVC.create_time
@@ -74,20 +79,24 @@
LVC.reply_id,
LVC.reply_user_id,
LVC.reply_user_nickname,
+ LVC.reply_user_avatar,
LVC.master_comment_id,
LVC.status,
+ LVC.thumbs_up_num,
LVC.id,
- LVC.create_by,
+ LVC.user_id,
LVC.user_nickname,
LVC.user_avatar,
LVC.create_time,
- COUNT(replies.id) as replyTotalCount
+ COUNT(replies.id) as replyTotalCount,
+ CASE
+ WHEN TUC.id IS NOT NULL THEN 1
+ ELSE 0
+ END AS has_thumbs_up
FROM
lmk_video_comment LVC
- LEFT JOIN
- lmk_video_comment replies ON replies.master_comment_id = LVC.id
- AND replies.status = 'normal'
- AND replies.delete_flag = 0
+ LEFT JOIN lmk_video_comment replies ON replies.master_comment_id = LVC.id AND replies.status = 'normal' AND replies.delete_flag = 0
+ LEFT JOIN lmk_thumbs_up_record TUC ON LVC.id = TUC.ref_id AND TUC.thumbs_up_type = 'video_comment' AND TUC.user_id = #{query.userId} AND TUC.delete_flag = 0
WHERE
LVC.master_comment_id IS NULL
AND LVC.video_id = #{query.videoId}
@@ -96,7 +105,7 @@
GROUP BY
LVC.id, LVC.video_id, LVC.comment_content, LVC.reply_id,
LVC.reply_user_id, LVC.reply_user_nickname, LVC.master_comment_id,
- LVC.status, LVC.create_by, LVC.user_nickname, LVC.user_avatar, LVC.create_time
+ LVC.status, LVC.user_id, LVC.user_nickname, LVC.user_avatar, LVC.create_time
ORDER BY
LVC.create_time DESC
</select>
@@ -108,16 +117,23 @@
LVC.reply_id,
LVC.reply_user_id,
LVC.reply_user_nickname,
+ LVC.reply_user_avatar,
LVC.master_comment_id,
LVC.status,
+ LVC.thumbs_up_num,
LVC.id,
- LVC.create_by,
+ LVC.user_id,
LVC.user_nickname,
LVC.user_avatar,
LVC.create_time,
- 0 as replyTotalCount
+ 0 as replyTotalCount,
+ CASE
+ WHEN TUC.id IS NOT NULL THEN 1
+ ELSE 0
+ END AS has_thumbs_up
FROM
lmk_video_comment LVC
+ LEFT JOIN lmk_thumbs_up_record TUC ON LVC.id = TUC.ref_id AND TUC.thumbs_up_type = 'video_comment' AND TUC.user_id = #{query.userId} AND TUC.delete_flag = 0
WHERE
LVC.video_id = #{query.videoId}
AND LVC.master_comment_id = #{query.masterCommentId}
--
Gitblit v1.8.0