From 35354c49e03a79045e546b9f4ad1594f8fc802cd Mon Sep 17 00:00:00 2001 From: zxl <763096477@qq.com> Date: 星期四, 14 八月 2025 16:03:37 +0800 Subject: [PATCH] 活动问题 --- framework/src/main/resources/mapper/lmk/VideoCommentMapper.xml | 60 ++++++++++++++++++++++++++++++++++++++++++++++++++++++------ 1 files changed, 54 insertions(+), 6 deletions(-) diff --git a/framework/src/main/resources/mapper/lmk/VideoCommentMapper.xml b/framework/src/main/resources/mapper/lmk/VideoCommentMapper.xml index 759dfc5..eb8528b 100644 --- a/framework/src/main/resources/mapper/lmk/VideoCommentMapper.xml +++ b/framework/src/main/resources/mapper/lmk/VideoCommentMapper.xml @@ -14,7 +14,7 @@ <result column="master_comment_id" property="masterCommentId" /> <result column="status" property="status" /> <result column="thumbs_up_num" property="thumbsUpNum" /> - <result column="userId" property="userId" /> + <result column="user_id" property="userId" /> <result column="user_nickname" property="userNickname" /> <result column="user_avatar" property="userAvatar" /> <result column="create_time" property="createTime" /> @@ -49,6 +49,38 @@ LVC.id = #{id} AND LVC.delete_flag = 0 </select> + <select id="getManagerPage" resultMap="BaseResultMap"> + SELECT + LVC.video_id, + LVC.comment_content, + LVC.reply_id, + LVC.reply_user_id, + LVC.reply_user_nickname, + LVC.master_comment_id, + LVC.status, + LVC.thumbs_up_num, + LVC.id, + LVC.user_id, + LVC.user_nickname, + LVC.user_avatar, + LVC.create_time + FROM + lmk_video_comment LVC + WHERE + LVC.video_id = #{query.videoId} AND LVC.delete_flag = 0 + <if test="query.commentContent != null and query.commentContent !=''"> + AND LVC.comment_content like concat('%',#{query.commentContent},'%') + </if> + <if test="query.nickName != null and query.nickName !=''"> + AND LVC.user_nickname like concat('%',#{query.nickName},'%') + </if> + <if test="query.startTime != null"> + AND LVC.create_time >= #{query.startTime} + </if> + <if test="query.endTime != null"> + AND LVC.create_time <= #{query.endTime} + </if> + </select> <select id="getPage" resultMap="BaseResultMap"> SELECT @@ -145,14 +177,30 @@ <select id="countNumGroupByVideo" resultType="cn.lili.modules.lmk.domain.vo.CollectTypeNumVO"> SELECT - video_id as id, - COUNT(*) as countNum + LV.id as id, + COUNT(LVC.video_id) as countNum FROM - lmk_video_comment + lmk_video LV + LEFT JOIN lmk_video_comment LVC ON LVC.video_id = LV.id AND LVC.delete_flag = 0 AND LVC.status = 'normal' WHERE - delete_flag = 0 AND status = 'normal' + LV.comment_num_job = 1 AND LV.delete_flag = 0 AND LV.status = '1' GROUP BY - video_id + LVC.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