From 13faa6b31d14566d7505b4feb8b5742cc681fcf6 Mon Sep 17 00:00:00 2001
From: peng <peng.com>
Date: 星期三, 23 七月 2025 17:55:13 +0800
Subject: [PATCH] 后台发布视频
---
framework/src/main/resources/mapper/lmk/VideoMapper.xml | 104 ++++++++++++++++++++++++++++++++++++++++++++++++++++
1 files changed, 104 insertions(+), 0 deletions(-)
diff --git a/framework/src/main/resources/mapper/lmk/VideoMapper.xml b/framework/src/main/resources/mapper/lmk/VideoMapper.xml
index 30a55b7..ca87dfc 100644
--- a/framework/src/main/resources/mapper/lmk/VideoMapper.xml
+++ b/framework/src/main/resources/mapper/lmk/VideoMapper.xml
@@ -27,6 +27,7 @@
<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"/>
@@ -723,6 +724,109 @@
<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" />
--
Gitblit v1.8.0