From 2f68e5600f0b60d6f8d170f4536e1fc410662ea7 Mon Sep 17 00:00:00 2001 From: xiangpei <xiangpei@timesnew.cn> Date: 星期二, 01 七月 2025 11:14:39 +0800 Subject: [PATCH] 视频es处理通过mq异步执行 --- framework/src/main/resources/mapper/lmk/VideoMapper.xml | 151 ++++++++++++++++++++++++++++++++++++++++++++++---- 1 files changed, 139 insertions(+), 12 deletions(-) diff --git a/framework/src/main/resources/mapper/lmk/VideoMapper.xml b/framework/src/main/resources/mapper/lmk/VideoMapper.xml index 8981055..b220b13 100644 --- a/framework/src/main/resources/mapper/lmk/VideoMapper.xml +++ b/framework/src/main/resources/mapper/lmk/VideoMapper.xml @@ -28,6 +28,7 @@ <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"/> @@ -37,6 +38,7 @@ <select id="getVideoGoods" parameterType="string" resultMap="VideoGoodsMap"> SELECT LVG.goods_id, + LVG.goods_sku_id, LVG.goods_num, LVG.order_num, LG.goods_name, @@ -85,6 +87,7 @@ <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" /> @@ -218,6 +221,7 @@ LV.weight, LV.audit_pass_time, LV.update_time, + LV.create_time, LV.video_content_type, LV.video_type, LV.video_imgs, @@ -229,6 +233,74 @@ 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="recommendHealthVideo" 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.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 + 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.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' </select> @@ -372,28 +444,19 @@ <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.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.video_content_type, - LV.video_type, LV.video_imgs, LV.id FROM @@ -482,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 + LIMIT #{start}, #{pageSize} + </select> + </mapper> -- Gitblit v1.8.0