From 62b3e99c68eb75a2c5cd86eb748534bd266ad009 Mon Sep 17 00:00:00 2001
From: peng <peng.com>
Date: 星期五, 01 八月 2025 10:34:19 +0800
Subject: [PATCH] Merge remote-tracking branch 'origin/dev' into dev

---
 framework/src/main/resources/mapper/lmk/VideoMapper.xml |  518 +++++++++++++++++++++++++++++++++++++++++++++++++++++++-
 1 files changed, 501 insertions(+), 17 deletions(-)

diff --git a/framework/src/main/resources/mapper/lmk/VideoMapper.xml b/framework/src/main/resources/mapper/lmk/VideoMapper.xml
index d848b6a..1da37db 100644
--- a/framework/src/main/resources/mapper/lmk/VideoMapper.xml
+++ b/framework/src/main/resources/mapper/lmk/VideoMapper.xml
@@ -11,22 +11,50 @@
         <result column="video_file_key" property="videoFileKey" />
         <result column="video_fit" property="videoFit" />
         <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" />
         <result column="play_num" property="playNum" />
         <result column="collect_num" property="collectNum" />
         <result column="comment_num" property="commentNum" />
+        <result column="thumbs_up_num" property="thumbsUpNum" />
         <result column="weight" property="weight" />
         <result column="audit_pass_time" property="auditPassTime" />
         <result column="update_time" property="updateTime" />
         <result column="video_content_type" property="videoContentType" />
         <result column="video_type" property="videoType" />
         <result column="video_imgs" property="videoImgs" />
+        <collection property="goodsList" column="id" select="getVideoGoods" ofType="cn.lili.modules.lmk.domain.vo.VideoGoodsDetailVO"/>
     </resultMap>
+
+
+    <resultMap id="VideoGoodsMap" type="cn.lili.modules.lmk.domain.vo.VideoGoodsDetailVO">
+        <result column="goods_id" property="goodsId"/>
+        <result column="goods_sku_id" property="id"/>
+        <result column="goods_num" property="goodsNum"/>
+        <result column="goods_name" property="goodsName"/>
+        <result column="thumbnail" property="thumbnail"/>
+        <result column="price" property="price"/>
+    </resultMap>
+
+    <select id="getVideoGoods" parameterType="string" resultMap="VideoGoodsMap">
+        SELECT
+               LVG.goods_id,
+               LVG.goods_sku_id,
+               LVG.goods_num,
+               LVG.order_num,
+               LG.goods_name,
+               LG.thumbnail,
+               LG.price
+        FROM
+             lmk_video_goods LVG
+             INNER JOIN li_goods_sku LG ON LVG.goods_sku_id = LG.id AND LG.market_enable = 'UPPER' AND LG.delete_flag = 0
+        WHERE
+             LVG.video_id = #{id} AND LVG.delete_flag = 0
+        ORDER BY
+            LVG.order_num ASC
+    </select>
+
     <!-- 閫氱敤鏌ヨ鏄犲皠缁撴灉 -->
     <resultMap id="KitchenVideoMap" type="cn.lili.modules.lmk.domain.vo.KitchenVideoVO">
         <id column="id" property="id"/>
@@ -36,7 +64,6 @@
         <result column="video_file_key" property="videoFileKey" />
         <result column="video_fit" property="videoFit" />
         <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" />
@@ -45,6 +72,7 @@
         <result column="play_num" property="playNum" />
         <result column="collect_num" property="collectNum" />
         <result column="comment_num" property="commentNum" />
+        <result column="thumbs_up_num" property="thumbsUpNum" />
         <result column="weight" property="weight" />
         <result column="audit_pass_time" property="auditPassTime" />
         <result column="update_time" property="updateTime" />
@@ -62,15 +90,41 @@
         <result column="cover_url" property="coverFileKey" />
         <result column="video_file_key" property="videoFileKey" />
         <result column="video_fit" property="videoFit" />
+        <result column="video_duration" property="videoDuration" />
         <result column="title" property="title" />
         <result column="collect_num" property="collectNum" />
         <result column="comment_num" property="commentNum" />
+        <result column="thumbs_up_num" property="thumbsUpNum" />
         <result column="status" property="status" />
         <result column="video_content_type" property="videoContentType" />
         <result column="video_type" property="videoType" />
         <result column="video_imgs" property="videoImgs" />
+        <collection property="goodsList" column="id" select="getVideoGoods" ofType="cn.lili.modules.lmk.domain.vo.VideoGoodsDetailVO"/>
     </resultMap>
 
+    <!-- 鎾斁鍘嗗彶 -->
+    <resultMap id="HistoryMap" type="cn.lili.modules.lmk.domain.vo.VideoHistoryVO">
+        <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="coverFileKey" />
+        <result column="video_file_key" property="videoFileKey" />
+        <result column="video_fit" property="videoFit" />
+        <result column="video_duration" property="videoDuration" />
+        <result column="title" property="title" />
+        <result column="collect_num" property="collectNum" />
+        <result column="comment_num" property="commentNum" />
+        <result column="thumbs_up_num" property="thumbsUpNum" />
+        <result column="status" property="status" />
+        <result column="video_content_type" property="videoContentType" />
+        <result column="video_type" property="videoType" />
+        <result column="video_imgs" property="videoImgs" />
+        <result column="historyId" property="historyId" />
+        <result column="play_at" property="playAt" />
+        <result column="playTime" property="playTime" />
+        <collection property="goodsList" column="id" select="getVideoGoods" ofType="cn.lili.modules.lmk.domain.vo.VideoGoodsDetailVO"/>
+    </resultMap>
 
     <select id="getById" resultMap="BaseResultMap">
         SELECT
@@ -87,6 +141,7 @@
             LV.play_num,
             LV.collect_num,
             LV.comment_num,
+            LV.thumbs_up_num,
             LV.weight,
             LV.audit_pass_time,
             LV.update_time,
@@ -118,6 +173,7 @@
             LV.play_num,
             LV.collect_num,
             LV.comment_num,
+            LV.thumbs_up_num,
             LV.weight,
             LV.audit_pass_time,
             LV.update_time,
@@ -149,6 +205,7 @@
             LV.play_num,
             LV.collect_num,
             LV.comment_num,
+            LV.thumbs_up_num,
             LV.weight,
             LV.audit_pass_time,
             LV.update_time,
@@ -191,9 +248,11 @@
             LV.play_num,
             LV.comment_num,
             LV.collect_num,
+            LV.thumbs_up_num,
             LV.weight,
             LV.audit_pass_time,
             LV.update_time,
+            LV.create_time,
             LV.video_content_type,
             LV.video_type,
             LV.video_imgs,
@@ -205,7 +264,169 @@
             LEFT JOIN li_member LM ON LV.author_id = LM.id
         WHERE
             LV.delete_flag = 0 AND LV.status = '1' AND LV.video_type = #{query.videoType}
+        ORDER BY
+            LV.create_time DESC
     </select>
+    <select id="recommendVideoByVideoId" resultMap="WxResultMap">
+        SELECT
+            LV.author_id,
+            LV.cover_url,
+            LV.video_fit,
+            LV.video_duration,
+            LV.video_file_key,
+            LV.title,
+            LV.goods_view_num,
+            LV.goods_order_num,
+            LV.recommend,
+            LV.status,
+            LV.play_num,
+            LV.comment_num,
+            LV.collect_num,
+            LV.thumbs_up_num,
+            LV.weight,
+            LV.audit_pass_time,
+            LV.update_time,
+            LV.create_time,
+            LV.video_content_type,
+            LV.video_type,
+            LV.video_imgs,
+            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.id = #{query.videoId}
+        ORDER BY
+            LV.create_time DESC
+    </select>
+    <select id="recommendVideoList" resultMap="WxResultMap">
+        SELECT
+            LV.author_id,
+            LV.cover_url,
+            LV.video_fit,
+            LV.video_duration,
+            LV.video_file_key,
+            LV.title,
+            LV.goods_view_num,
+            LV.goods_order_num,
+            LV.recommend,
+            LV.status,
+            LV.play_num,
+            LV.comment_num,
+            LV.collect_num,
+            LV.thumbs_up_num,
+            LV.weight,
+            LV.audit_pass_time,
+            LV.update_time,
+            LV.create_time,
+            LV.video_content_type,
+            LV.video_type,
+            LV.video_imgs,
+            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.video_type = #{query.videoType}
+        ORDER BY
+            LV.create_time DESC
+    </select>
+
+    <select id="goodsSimilarlyPage" resultMap="WxResultMap">
+        SELECT
+            LV.author_id,
+            LV.cover_url,
+            LV.video_fit,
+            LV.video_duration,
+            LV.video_file_key,
+            LV.title,
+            LV.goods_view_num,
+            LV.goods_order_num,
+            LV.recommend,
+            LV.status,
+            LV.play_num,
+            LV.comment_num,
+            LV.collect_num,
+            LV.thumbs_up_num,
+            LV.weight,
+            LV.audit_pass_time,
+            LV.update_time,
+            LV.create_time,
+            LV.video_content_type,
+            LV.video_type,
+            LV.video_imgs,
+            LV.id,
+            CASE
+                WHEN LM.nick_name IS NOT NULL THEN LM.nick_name
+                WHEN LM.nick_name IS NULL THEN (SELECT nick_name FROM li_admin_user WHERE id = LV.author_id)
+                ELSE ''
+            END as authorName,
+            CASE
+                WHEN LM.face IS NOT NULL THEN LM.face
+                WHEN LM.face IS NULL THEN (SELECT avatar FROM li_admin_user WHERE id = LV.author_id)
+                ELSE ''
+            END as authorAvatar
+        FROM
+            lmk_video LV
+                INNER JOIN lmk_video_goods LVG ON LVG.video_id = LV.id AND LVG.goods_id in <foreach collection="query.goodsIds" open="(" item="goodsId" close=")" separator=",">#{goodsId}</foreach>
+                LEFT JOIN li_member LM ON LV.author_id = LM.id
+        WHERE
+            LV.delete_flag = 0 AND LV.status = '1' AND LV.id != #{query.currentVideoId}
+        ORDER BY
+            LV.create_time DESC
+    </select>
+
+    <select id="getHistoryPage" resultMap="HistoryMap">
+        SELECT
+            LV.author_id,
+            LV.cover_url,
+            LV.video_fit,
+            LV.video_duration,
+            LV.video_file_key,
+            LV.title,
+            LV.goods_view_num,
+            LV.goods_order_num,
+            LV.recommend,
+            LV.status,
+            LV.play_num,
+            LV.comment_num,
+            LV.collect_num,
+            LV.thumbs_up_num,
+            LV.weight,
+            LV.audit_pass_time,
+            LV.update_time,
+            LV.create_time,
+            LV.video_content_type,
+            LV.video_type,
+            LV.video_imgs,
+            LV.id,
+            CASE
+                WHEN LM.nick_name IS NOT NULL THEN LM.nick_name
+                WHEN LM.nick_name IS NULL THEN (SELECT nick_name FROM li_admin_user WHERE id = LV.author_id)
+                ELSE ''
+            END as authorName,
+            CASE
+                WHEN LM.face IS NOT NULL THEN LM.face
+                WHEN LM.face IS NULL THEN (SELECT avatar FROM li_admin_user WHERE id = LV.author_id)
+                ELSE ''
+            END as authorAvatar,
+            LFP.id as historyId,
+            LFP.play_at,
+            LFP.update_time as playTime
+        FROM
+            li_foot_print LFP
+                INNER JOIN lmk_video LV ON LFP.ref_id = LV.id AND LFP.view_type = 'video' AND LFP.delete_flag = 0 AND LFP.member_id = #{query.userId}
+                LEFT JOIN li_member LM ON LV.author_id = LM.id
+        WHERE
+            LV.delete_flag = 0 AND LV.status = '1'
+        ORDER BY
+            LFP.update_time DESC
+    </select>
+
     <select id="recommendHealthVideo" resultMap="WxResultMap">
         SELECT
             LV.author_id,
@@ -221,6 +442,7 @@
             LV.play_num,
             LV.comment_num,
             LV.collect_num,
+            LV.thumbs_up_num,
             LV.weight,
             LV.audit_pass_time,
             LV.update_time,
@@ -233,6 +455,42 @@
         FROM
             lmk_video LV
             LEFT JOIN li_admin_user LAU ON LV.author_id = LAU.id
+        WHERE
+            LV.delete_flag = 0 AND LV.status = '1' AND LV.video_type = #{query.videoType}
+        AND LV.video_content_type = 'video'
+    </select>
+
+    <select id="wxKitchenVideoQuery" resultMap="WxResultMap">
+        SELECT
+            LV.author_id,
+            LV.cover_url,
+            LV.video_fit,
+            LV.video_duration,
+            LV.video_file_key,
+            LV.title,
+            LV.goods_view_num,
+            LV.goods_order_num,
+            LV.recommend,
+            LV.status,
+            LV.play_num,
+            LV.comment_num,
+            LV.collect_num,
+            LV.thumbs_up_num,
+            LV.weight,
+            LV.audit_pass_time,
+            LV.update_time,
+            LV.video_content_type,
+            LV.video_type,
+            LV.video_imgs,
+            LV.id,
+            LAU.nick_name AS authorName,
+            LAU.avatar AS authorAvatar
+        FROM
+            lmk_video LV
+            LEFT JOIN li_admin_user LAU ON LV.author_id = LAU.id
+        <if test="query.kitchenTypeId !=null and query.kitchenTypeId !=''">
+            JOIN (SELECT DISTINCT video_id FROM lmk_kitchen_video_type_ref WHERE kitchen_type_id = #{query.kitchenTypeId}) VT ON VT.video_id = LV.id
+        </if>
         WHERE
             LV.delete_flag = 0 AND LV.status = '1' AND LV.video_type = #{query.videoType}
         AND LV.video_content_type = 'video'
@@ -261,6 +519,20 @@
             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>
+
+    <update id="updateThumbsUpNumBatch">
+        UPDATE lmk_video
+        SET thumbs_up_num = CASE id
+        <foreach collection="list" item="video">
+            WHEN #{video.id} THEN #{video.countNum}
+        </foreach>
+        ELSE thumbs_up_num
         END
         WHERE id IN
         <foreach collection="list" item="video" open="(" separator="," close=")">
@@ -313,6 +585,7 @@
             LV.play_num,
             LV.comment_num,
             LV.collect_num,
+            LV.thumbs_up_num,
             LV.weight,
             LV.audit_pass_time,
             LV.update_time,
@@ -351,6 +624,7 @@
             LV.play_num,
             LV.comment_num,
             LV.collect_num,
+            LV.thumbs_up_num,
             LV.weight,
             LV.audit_pass_time,
             LV.update_time,
@@ -370,19 +644,7 @@
             LMC.create_time DESC
     </select>
 
-
-    <!-- 寰俊瑙嗛缂栬緫璇︽儏 -->
-    <resultMap id="WxEditResultMap" type="cn.lili.modules.lmk.domain.vo.WxEditVideoVO">
-        <id column="id" property="id"/>
-        <result column="cover_url" property="coverFileKey" />
-        <result column="video_file_key" property="videoFileKey" />
-        <result column="video_fit" property="videoFit" />
-        <result column="title" property="title" />
-        <result column="video_duration" property="videoDuration" />
-        <result column="goods_id" property="goodsId" />
-    </resultMap>
-
-    <select id="wxDetail" resultMap="WxEditResultMap">
+    <select id="getAuthorLikeVideoPage" resultMap="WxResultMap">
         SELECT
             LV.author_id,
             LV.cover_url,
@@ -397,11 +659,48 @@
             LV.play_num,
             LV.comment_num,
             LV.collect_num,
+            LV.thumbs_up_num,
             LV.weight,
             LV.audit_pass_time,
             LV.update_time,
             LV.video_content_type,
             LV.video_type,
+            LV.video_imgs,
+            LV.id,
+            LM.nick_name as authorName,
+            LM.face as authorAvatar
+        FROM
+            lmk_thumbs_up_record 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.thumbs_up_type = 'video' AND LV.video_type = #{query.videoType}
+        ORDER BY
+            LMC.create_time DESC
+    </select>
+
+
+    <!-- 寰俊瑙嗛缂栬緫璇︽儏 -->
+    <resultMap id="WxEditResultMap" type="cn.lili.modules.lmk.domain.vo.WxEditVideoVO">
+        <id column="id" property="id"/>
+        <result column="cover_url" property="coverFileKey" />
+        <result column="video_file_key" property="videoFileKey" />
+        <result column="video_fit" property="videoFit" />
+        <result column="title" property="title" />
+        <result column="video_duration" property="videoDuration" />
+        <result column="video_imgs" property="videoImgs" />
+        <result column="video_content_type" property="videoContentType" />
+        <collection property="goodsList" column="id" select="getVideoGoods" ofType="cn.lili.modules.lmk.domain.vo.VideoGoodsDetailVO"/>
+    </resultMap>
+
+    <select id="wxDetail" resultMap="WxEditResultMap">
+        SELECT
+            LV.cover_url,
+            LV.video_fit,
+            LV.video_duration,
+            LV.video_file_key,
+            LV.title,
+            LV.video_content_type,
             LV.video_imgs,
             LV.id
         FROM
@@ -424,6 +723,7 @@
         LV.play_num,
         LV.collect_num,
         LV.comment_num,
+        LV.thumbs_up_num,
         LV.weight,
         LV.audit_pass_time,
         LV.update_time,
@@ -465,6 +765,7 @@
         LV.play_num,
         LV.collect_num,
         LV.comment_num,
+        LV.thumbs_up_num,
         LV.weight,
         LV.audit_pass_time,
         LV.update_time,
@@ -490,4 +791,187 @@
         <if test="query.authorId != null and query.authorId != ''">AND LV.author_id = #{query.authorId}</if>
         <if test="query.status != null and query.status != ''">AND LV.status = #{query.status}</if>
     </select>
+
+
+    <resultMap id="videoFootMap" type="cn.lili.modules.lmk.domain.vo.VideoFootVO">
+        <id column="id" property="id"/>
+        <result column="author_id" property="authorId" />
+        <result column="authorName" property="authorName" />
+        <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="video_duration" property="videoDuration" />
+        <result column="recommend" property="recommend" />
+        <result column="status" property="status" />
+        <result column="play_num" property="playNum" />
+        <result column="collect_num" property="collectNum" />
+        <result column="comment_num" property="commentNum" />
+        <result column="weight" property="weight" />
+        <result column="audit_pass_time" property="auditPassTime" />
+        <result column="update_time" property="updateTime" />
+        <result column="video_content_type" property="videoContentType" />
+        <result column="video_type" property="videoType" />
+        <result column="video_imgs" property="videoImgs" />
+        <result column="view_duration" property="viewDuration"/>
+        <result column="play_at" property="playAt"/>
+
+        <collection property="goodsList" column="id" select="getVideoGoods" ofType="cn.lili.modules.lmk.domain.vo.VideoGoodsDetailVO"/>
+        <collection property="tagList" column="id" select="getVideoTags" ofType="cn.lili.modules.lmk.domain.vo.SimpleVideoTagVO"/>
+
+    </resultMap>
+
+    <select id="videoFootPage" resultMap="videoFootMap">
+        SELECT
+            LFP.view_duration,
+            LFP.play_at,
+            LV.*
+        from
+            li_foot_print LFP
+                INNER JOIN lmk_video LV
+                          ON LFP.ref_id = lV.id AND LV.delete_flag = 0
+        where LFP.member_id = #{query.memberId}
+          AND LFP.ref_id IS NOT NULL
+          AND LFP.delete_flag = 0
+
+          AND LFP.view_type = 'video'
+    </select>
+    <select id="videoFoot" resultMap="videoFootMap">
+        SELECT
+            LFP.view_duration,
+            LFP.play_at,
+            LV.*
+        from
+            li_foot_print LFP
+                INNER JOIN lmk_video LV
+                           ON LFP.ref_id = lV.id AND LV.delete_flag = 0
+        where LFP.member_id = #{query.memberId}
+          AND LFP.ref_id IS NOT NULL
+          AND LFP.delete_flag = 0
+
+          AND LFP.view_type = 'video'
+    </select>
+
+    <resultMap id="videoFootInfo" type="cn.lili.modules.lmk.domain.vo.VideoFootInfoVo">
+        <result column="total_duration" property="totalDuration"/>
+        <result column="video_count" property="videoCount"/>
+        <result column="avg_completion_rate" property="avgCompletionRate"/>
+    </resultMap>
+
+    <resultMap id="videoTagMap" type="cn.lili.modules.lmk.domain.vo.SimpleVideoTagVO">
+        <id property="id" column="id"/>
+        <result property="tagName" column="tag_name"/>
+
+    </resultMap>
+
+<!--    <select id="getVideoTags" parameterType="String" resultMap="videoTagMap">-->
+<!--        SELECT LVT.id,-->
+<!--               LVT.tag_name-->
+<!--        from lmk_video_tag_ref LVTR-->
+<!--                 LEFT JOIN lmk_video_tag LVT ON LVT.id = LVTR.video_tag_id  and LVT.delete_flag = 0-->
+<!--        WHERE LVTR.video_id = #{id}-->
+
+<!--    </select>-->
+
+    <select id="getVideoFootInfo" resultMap="videoFootInfo">
+        SELECT
+            SUM(LFP.view_duration) AS total_duration,
+            ROUND(AVG(CASE
+                          WHEN LV.video_duration > 0 THEN LFP.play_at / LV.video_duration
+                          ELSE 0
+                END),2) AS avg_completion_rate,
+            COUNT(*) AS video_count
+        from
+            li_foot_print LFP
+                INNER JOIN lmk_video LV
+                          ON LFP.ref_id = lV.id AND LV.delete_flag = 0
+        where LFP.member_id = #{id}
+          AND LFP.ref_id IS NOT NULL
+          AND LFP.delete_flag = 0
+          AND LFP.view_type = 'video'
+          AND LV.id IS NOT NULL
+        GROUP BY
+            LFP.member_id
+    </select>
+
+
+    <resultMap id="EsResultMap" type="cn.lili.modules.lmk.domain.es.VideoIndex">
+        <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="coverFileKey" />
+        <result column="video_file_key" property="videoFileKey" />
+        <result column="video_fit" property="videoFit" />
+        <result column="video_duration" property="videoDuration" />
+        <result column="title" property="title" />
+        <result column="status" property="status" />
+        <result column="recommend" property="recommend" />
+        <result column="audit_pass_time" property="publishTime" />
+        <result column="video_content_type" property="videoContentType" />
+        <result column="video_type" property="videoType" />
+        <result column="video_imgs" property="videoImgs" />
+        <result column="collect_num" property="collectNum" />
+        <result column="thumbs_up_num" property="thumbsUpNum" />
+        <result column="comment_num" property="commentNum" />
+        <collection property="goodsList" column="id" select="getVideoGoods" ofType="cn.lili.modules.lmk.domain.vo.VideoGoodsDetailVO"/>
+        <collection property="tagList" column="id" select="getVideoTags" ofType="cn.lili.modules.lmk.domain.vo.SimpleVideoTagVO"/>
+    </resultMap>
+
+    <select id="getVideoTags" resultType="cn.lili.modules.lmk.domain.vo.SimpleVideoTagVO">
+        SELECT
+               LVT.id,
+               LVT.tag_name as tagName
+        FROM
+             lmk_video_tag_ref LVTR
+                 INNER JOIN lmk_video_tag LVT ON LVTR.video_tag_id = LVT.id AND LVT.delete_flag = 0
+        WHERE
+             LVTR.video_id = #{id}
+    </select>
+
+    <select id="getEsPage" parameterType="int" resultMap="EsResultMap">
+        SELECT
+            LV.author_id,
+            LV.cover_url,
+            LV.video_fit,
+            LV.video_duration,
+            LV.video_file_key,
+            LV.title,
+            LV.goods_view_num,
+            LV.goods_order_num,
+            LV.recommend,
+            LV.status,
+            LV.play_num,
+            LV.comment_num,
+            LV.collect_num,
+            LV.thumbs_up_num,
+            LV.weight,
+            CASE
+                WHEN LV.audit_pass_time IS NOT NULL THEN LV.audit_pass_time
+                ELSE LV.create_time
+            END as audit_pass_time,
+            LV.update_time,
+            LV.create_time,
+            LV.video_content_type,
+            LV.video_type,
+            LV.video_imgs,
+            LV.id,
+            CASE
+                WHEN LM.nick_name IS NOT NULL THEN LM.nick_name
+                WHEN LM.nick_name IS NULL THEN (SELECT nick_name FROM li_admin_user WHERE id = LV.author_id)
+                ELSE ''
+            END as authorName,
+            CASE
+                WHEN LM.face IS NOT NULL THEN LM.face
+                WHEN LM.face IS NULL THEN (SELECT avatar FROM li_admin_user WHERE id = LV.author_id)
+                ELSE ''
+                END as authorAvatar
+        FROM
+            lmk_video LV
+                LEFT JOIN li_member LM ON LV.author_id = LM.id
+        WHERE
+            LV.delete_flag = 0
+        LIMIT #{start}, #{pageSize}
+    </select>
+
 </mapper>

--
Gitblit v1.8.0