From d49707858ddd3ba73ded357bdaf8044c8b4b9c40 Mon Sep 17 00:00:00 2001 From: xiangpei <xiangpei@timesnew.cn> Date: 星期一, 30 六月 2025 20:41:17 +0800 Subject: [PATCH] 视频es --- framework/src/main/resources/mapper/lmk/VideoMapper.xml | 64 ++++++++++++++++++++++++++++++++ 1 files changed, 64 insertions(+), 0 deletions(-) diff --git a/framework/src/main/resources/mapper/lmk/VideoMapper.xml b/framework/src/main/resources/mapper/lmk/VideoMapper.xml index 248411a..c6e1579 100644 --- a/framework/src/main/resources/mapper/lmk/VideoMapper.xml +++ b/framework/src/main/resources/mapper/lmk/VideoMapper.xml @@ -545,4 +545,68 @@ <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="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="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"/> + <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.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' + LIMIT #{start}, #{end} + </select> + </mapper> -- Gitblit v1.8.0