From 654f4eebf519f015506b90d71637e6aad75e5b5c Mon Sep 17 00:00:00 2001 From: xiangpei <xiangpei@timesnew.cn> Date: 星期三, 25 六月 2025 14:33:26 +0800 Subject: [PATCH] 视频评论点赞通过mq异步添加数据库,点赞数缓存redis --- framework/src/main/resources/mapper/lmk/VideoCommentMapper.xml | 15 +++++++++++++++ 1 files changed, 15 insertions(+), 0 deletions(-) diff --git a/framework/src/main/resources/mapper/lmk/VideoCommentMapper.xml b/framework/src/main/resources/mapper/lmk/VideoCommentMapper.xml index 759dfc5..2c1c43a 100644 --- a/framework/src/main/resources/mapper/lmk/VideoCommentMapper.xml +++ b/framework/src/main/resources/mapper/lmk/VideoCommentMapper.xml @@ -155,4 +155,19 @@ video_id </select> + + <update id="updateCommentThumbsUpNumBatch"> + UPDATE lmk_video_comment + SET thumbs_up_num = CASE id + <foreach collection="list" item="comment"> + WHEN #{comment.id} THEN #{comment.countNum} + </foreach> + ELSE thumbs_up_num + END + WHERE id IN + <foreach collection="list" item="comment" open="(" separator="," close=")"> + #{comment.id} + </foreach> + </update> + </mapper> -- Gitblit v1.8.0