| | |
| | | <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"/> |
| | |
| | | <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> |
| | | |
| | | </mapper> |