From e868be6c913a6a99e1491c088d052a5f58e252f9 Mon Sep 17 00:00:00 2001
From: xiangpei <xiangpei@timesnew.cn>
Date: 星期四, 22 五月 2025 18:08:30 +0800
Subject: [PATCH] xxl-job调整、视频收藏

---
 framework/src/main/resources/mapper/lmk/VideoMapper.xml |   51 +++++++++++++++++++++++++++++++++++++++++++++++----
 1 files changed, 47 insertions(+), 4 deletions(-)

diff --git a/framework/src/main/resources/mapper/lmk/VideoMapper.xml b/framework/src/main/resources/mapper/lmk/VideoMapper.xml
index 417ca5e..1621b0e 100644
--- a/framework/src/main/resources/mapper/lmk/VideoMapper.xml
+++ b/framework/src/main/resources/mapper/lmk/VideoMapper.xml
@@ -24,6 +24,20 @@
         <result column="update_time" property="updateTime" />
     </resultMap>
 
+    <!-- 寰俊鎺ㄨ崘瑙嗛 -->
+    <resultMap id="WxResultMap" type="cn.lili.modules.lmk.domain.vo.WxVideoVO">
+        <id column="id" property="id"/>
+        <result column="author_id" property="authorId" />
+        <result column="authorName" property="authorName" />
+        <result column="authorAvatar" property="authorAvatar" />
+        <result column="cover_url" property="coverUrl" />
+        <result column="video_file_key" property="videoFileKey" />
+        <result column="video_fit" property="videoFit" />
+        <result column="title" property="title" />
+        <result column="collect_num" property="collectNum" />
+        <result column="comment_num" property="commentNum" />
+    </resultMap>
+
 
     <select id="getById" resultMap="BaseResultMap">
         SELECT
@@ -66,13 +80,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
+            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
         FROM
             lmk_video LV
                 LEFT JOIN li_member LM ON LV.author_id = LM.id
@@ -94,13 +108,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
+            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
         FROM
             lmk_video LV
                 LEFT JOIN li_member LM ON LV.author_id = LM.id
@@ -119,4 +133,33 @@
             <if test="query.status != null and query.status != ''">AND LV.status = #{query.status}</if>
     </select>
 
+
+    <select id="recommendVideo" resultMap="WxResultMap">
+        SELECT
+            LV.author_id,
+            LV.cover_url,
+            LV.video_fit,
+            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.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
+        FROM
+            lmk_video LV
+            LEFT JOIN li_member LM ON LV.author_id = LM.id
+        WHERE
+            LV.delete_flag = 0 AND LV.status = '1'
+    </select>
+
 </mapper>

--
Gitblit v1.8.0