From f4d3dd1e4964297648f1b7bb80470d70f1b8fcec Mon Sep 17 00:00:00 2001 From: zxl <763096477@qq.com> Date: 星期三, 04 六月 2025 11:41:35 +0800 Subject: [PATCH] Merge remote-tracking branch 'origin/dev' into dev --- framework/src/main/resources/mapper/lmk/VideoMapper.xml | 129 ++++++++++++++++++++++++++++++++++++++++-- 1 files changed, 121 insertions(+), 8 deletions(-) diff --git a/framework/src/main/resources/mapper/lmk/VideoMapper.xml b/framework/src/main/resources/mapper/lmk/VideoMapper.xml index 6259ce8..066d815 100644 --- a/framework/src/main/resources/mapper/lmk/VideoMapper.xml +++ b/framework/src/main/resources/mapper/lmk/VideoMapper.xml @@ -13,6 +13,7 @@ <result column="title" property="title" /> <result column="goods_id" property="goodsId" /> <result column="goods_view_num" property="goodsViewNum" /> + <result column="video_duration" property="videoDuration" /> <result column="goods_order_num" property="goodsOrderNum" /> <result column="recommend" property="recommend" /> <result column="status" property="status" /> @@ -30,7 +31,7 @@ <result column="author_id" property="authorId" /> <result column="authorName" property="authorName" /> <result column="authorAvatar" property="authorAvatar" /> - <result column="cover_url" property="coverUrl" /> + <result column="cover_url" property="coverFileKey" /> <result column="video_file_key" property="videoFileKey" /> <result column="video_fit" property="videoFit" /> <result column="title" property="title" /> @@ -44,6 +45,7 @@ LV.author_id, LV.cover_url, LV.video_fit, + LV.video_duration, LV.video_file_key, LV.title, LV.goods_id, @@ -72,6 +74,7 @@ LV.author_id, LV.cover_url, LV.video_fit, + LV.video_duration, LV.video_file_key, LV.title, LV.goods_id, @@ -80,13 +83,13 @@ LV.recommend, LV.status, LV.play_num, + LV.collect_num, LV.comment_num, LV.weight, LV.audit_pass_time, LV.update_time, LV.id, - LM.nick_name as authorName, - (SELECT COUNT(*) FROM lmk_my_collect WHERE ref_id = LV.id AND collect_type = 'video' AND delete_flag = 0) as collect_num + LM.nick_name as authorName FROM lmk_video LV LEFT JOIN li_member LM ON LV.author_id = LM.id @@ -100,6 +103,7 @@ LV.author_id, LV.cover_url, LV.video_fit, + LV.video_duration, LV.video_file_key, LV.title, LV.goods_id, @@ -108,13 +112,13 @@ LV.recommend, LV.status, LV.play_num, + LV.collect_num, LV.comment_num, LV.weight, LV.audit_pass_time, LV.update_time, LV.id, - LM.nick_name as authorName, - (SELECT COUNT(*) FROM lmk_my_collect WHERE ref_id = LV.id AND collect_type = 'video' AND delete_flag = 0) as collect_num + LM.nick_name as authorName FROM lmk_video LV LEFT JOIN li_member LM ON LV.author_id = LM.id @@ -139,6 +143,7 @@ LV.author_id, LV.cover_url, LV.video_fit, + LV.video_duration, LV.video_file_key, LV.title, LV.goods_id, @@ -148,13 +153,13 @@ LV.status, LV.play_num, LV.comment_num, + LV.collect_num, LV.weight, LV.audit_pass_time, LV.update_time, LV.id, LM.nick_name as authorName, - LM.face as authorAvatar, - (SELECT COUNT(*) FROM lmk_my_collect WHERE ref_id = LV.id AND collect_type = 'video' AND delete_flag = 0) as collect_num + LM.face as authorAvatar FROM lmk_video LV LEFT JOIN li_member LM ON LV.author_id = LM.id @@ -167,7 +172,7 @@ UPDATE lmk_video SET collect_num = CASE id <foreach collection="list" item="video"> - WHEN #{video.id} THEN #{video.collectNum} + WHEN #{video.id} THEN #{video.countNum} </foreach> ELSE collect_num END @@ -177,4 +182,112 @@ </foreach> </update> + + <update id="updateCommentNumBatch"> + UPDATE lmk_video + SET comment_num = CASE id + <foreach collection="list" item="video"> + WHEN #{video.id} THEN #{video.countNum} + </foreach> + ELSE comment_num + END + WHERE id IN + <foreach collection="list" item="video" open="(" separator="," close=")"> + #{video.id} + </foreach> + </update> + + + <select id="getAuthorInfo" resultType="cn.lili.modules.lmk.domain.vo.VideoAccountVO"> + SELECT + LM.id as userId, + LM.nick_name as nickName, + LM.face as avatar, + LVA.motto, + (SELECT COUNT(*) FROM lmk_my_subscribe WHERE subscribe_user_id = #{authorId} AND delete_flag = 0) as fansNum, + (SELECT COUNT(*) FROM lmk_my_subscribe WHERE user_id = #{authorId} AND delete_flag = 0) as subNum, + (SELECT CASE + WHEN id IS NOT NULL THEN 1 + ELSE 0 + END + FROM lmk_my_subscribe WHERE user_id = #{currentUserId} AND subscribe_user_id = #{authorId} AND delete_flag = 0) as hasSub + FROM + li_member LM + LEFT JOIN lmk_video_account LVA ON LM.id = LVA.user_id + WHERE + LM.id = #{authorId} AND LM.delete_flag = 0 + </select> + + <select id="getVideoIdsByAuthor" parameterType="string" resultType="string"> + SELECT id FROM lmk_video WHERE author_id = #{authorId} AND delete_flag = 0 AND status = '1' + </select> + + <select id="countAuthorVideoCollectNum" resultType="long"> + SELECT COUNT(*) FROM lmk_my_collect WHERE collect_type = 'video' AND delete_flag = 0 AND ref_id IN <foreach + collection="videoIds" open="(" close=")" separator="," item="videoId">#{videoId}</foreach> + </select> + + <select id="getAuthorVideoPage" resultMap="WxResultMap"> + SELECT + LV.author_id, + LV.cover_url, + LV.video_fit, + LV.video_duration, + LV.video_file_key, + LV.title, + LV.goods_id, + LV.goods_view_num, + LV.goods_order_num, + LV.recommend, + LV.status, + LV.play_num, + LV.comment_num, + LV.collect_num, + LV.weight, + LV.audit_pass_time, + LV.update_time, + LV.id, + LM.nick_name as authorName, + LM.face as authorAvatar + FROM + lmk_video LV + LEFT JOIN li_member LM ON LV.author_id = LM.id + WHERE + LV.delete_flag = 0 AND LV.status = '1' AND LV.author_id = #{query.authorId} + ORDER BY + LV.collect_num DESC + </select> + + <select id="getAuthorCollectVideoPage" resultMap="WxResultMap"> + SELECT + LV.author_id, + LV.cover_url, + LV.video_fit, + LV.video_duration, + LV.video_file_key, + LV.title, + LV.goods_id, + LV.goods_view_num, + LV.goods_order_num, + LV.recommend, + LV.status, + LV.play_num, + LV.comment_num, + LV.collect_num, + LV.weight, + LV.audit_pass_time, + LV.update_time, + LV.id, + LM.nick_name as authorName, + LM.face as authorAvatar + FROM + lmk_my_collect LMC + INNER JOIN lmk_video LV ON LMC.ref_id = LV.id AND LV.delete_flag = 0 AND LV.status = '1' + LEFT JOIN li_member LM ON LV.author_id = LM.id + WHERE + LMC.delete_flag = 0 AND LMC.user_id = #{query.authorId} AND LMC.collect_type = 'video' + ORDER BY + LMC.create_time DESC + </select> + </mapper> -- Gitblit v1.8.0