From be0fc5c20dde87d7abb53f6537ba64743cd4cf52 Mon Sep 17 00:00:00 2001 From: zhanghua <314079846@qq.com> Date: 星期一, 23 六月 2025 21:03:34 +0800 Subject: [PATCH] Merge branch 'dev' of http://42.193.1.25:9521/r/lmk-shop-java into dev --- framework/src/main/resources/mapper/lmk/VideoMapper.xml | 481 ++++++++++++++++++++++++++++++++++++++++++++++++++++- 1 files changed, 472 insertions(+), 9 deletions(-) diff --git a/framework/src/main/resources/mapper/lmk/VideoMapper.xml b/framework/src/main/resources/mapper/lmk/VideoMapper.xml index de55ef3..d4ce727 100644 --- a/framework/src/main/resources/mapper/lmk/VideoMapper.xml +++ b/framework/src/main/resources/mapper/lmk/VideoMapper.xml @@ -6,12 +6,62 @@ <resultMap id="BaseResultMap" type="cn.lili.modules.lmk.domain.vo.VideoVO"> <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="goods_id" property="goodsId" /> + <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" /> + <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_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_num, + LVG.order_num, + LG.goods_name, + LG.thumbnail, + LG.price + FROM + lmk_video_goods LVG + INNER JOIN li_goods LG ON LVG.goods_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"/> + <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="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" /> @@ -20,12 +70,31 @@ <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" /> </resultMap> - - - - + <!-- 寰俊鎺ㄨ崘瑙嗛 --> + <resultMap id="WxResultMap" type="cn.lili.modules.lmk.domain.vo.WxVideoVO"> + <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="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> <select id="getById" resultMap="BaseResultMap"> @@ -33,9 +102,9 @@ LV.author_id, LV.cover_url, LV.video_fit, + LV.video_duration, LV.video_file_key, LV.title, - LV.goods_id, LV.goods_view_num, LV.goods_order_num, LV.recommend, @@ -45,9 +114,15 @@ LV.comment_num, LV.weight, LV.audit_pass_time, - LV.id + LV.update_time, + LV.video_content_type, + LV.video_type, + LV.video_imgs, + LV.id, + LM.nick_name as authorName FROM lmk_video LV + LEFT JOIN li_member LM ON LV.author_id = LM.id WHERE LV.id = #{id} AND LV.delete_flag = 0 </select> @@ -58,9 +133,9 @@ LV.author_id, LV.cover_url, LV.video_fit, + LV.video_duration, LV.video_file_key, LV.title, - LV.goods_id, LV.goods_view_num, LV.goods_order_num, LV.recommend, @@ -70,11 +145,399 @@ LV.comment_num, LV.weight, LV.audit_pass_time, - LV.id + LV.update_time, + LV.video_content_type, + LV.video_type, + LV.video_imgs, + LV.id, + LM.nick_name as authorName FROM lmk_video LV + LEFT JOIN li_member LM ON LV.author_id = LM.id WHERE LV.delete_flag = 0 </select> + + <select id="managerPage" resultMap="BaseResultMap"> + 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.collect_num, + LV.comment_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 + FROM + lmk_video LV + LEFT JOIN li_member LM ON LV.author_id = LM.id + <if test="query.tagList != null and query.tagList.size > 0"> + INNER JOIN ( + SELECT DISTINCT video_id + FROM lmk_video_tag_ref + WHERE video_tag_id IN + <foreach collection="query.tagList" open="(" item="tagId" close=")" separator=",">#{tagId}</foreach> + ) AS LVT ON LV.id = LVT.video_id + </if> + WHERE + LV.delete_flag = 0 AND LV.video_type = #{query.videoType} + <if test="query.title != null and query.title != ''">AND LV.title LIKE CONCAT('%', #{query.title}, '%')</if> + <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> + + + <select id="recommendVideo" 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, + 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} + </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> + + + <update id="updateCollectNumBatch"> + UPDATE lmk_video + SET collect_num = CASE id + <foreach collection="list" item="video"> + WHEN #{video.id} THEN #{video.countNum} + </foreach> + ELSE collect_num + END + WHERE id IN + <foreach collection="list" item="video" open="(" separator="," close=")"> + #{video.id} + </foreach> + </update> + + + <update id="updateCommentNumBatch"> + UPDATE lmk_video + SET comment_num = CASE id + <foreach collection="list" item="video"> + 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> + + + <select id="getAuthorInfo" resultType="cn.lili.modules.lmk.domain.vo.VideoAccountVO"> + SELECT + LM.id as userId, + LM.nick_name as nickName, + LM.face as avatar, + LVA.motto, + (SELECT COUNT(*) FROM lmk_my_subscribe WHERE subscribe_user_id = #{authorId} AND delete_flag = 0) as fansNum, + (SELECT COUNT(*) FROM lmk_my_subscribe WHERE user_id = #{authorId} AND delete_flag = 0) as subNum, + (SELECT CASE + WHEN id IS NOT NULL THEN 1 + ELSE 0 + END + FROM lmk_my_subscribe WHERE user_id = #{currentUserId} AND subscribe_user_id = #{authorId} AND delete_flag = 0) as hasSub + FROM + li_member LM + LEFT JOIN lmk_video_account LVA ON LM.id = LVA.user_id + WHERE + LM.id = #{authorId} AND LM.delete_flag = 0 + </select> + + <select id="getVideoIdsByAuthor" parameterType="string" resultType="string"> + SELECT id FROM lmk_video WHERE author_id = #{authorId} AND delete_flag = 0 AND status = '1' + </select> + + <select id="countAuthorVideoCollectNum" resultType="long"> + SELECT COUNT(*) FROM lmk_my_collect WHERE collect_type = 'video' AND delete_flag = 0 AND ref_id IN <foreach + collection="videoIds" open="(" close=")" separator="," item="videoId">#{videoId}</foreach> + </select> + + <select id="getAuthorVideoPage" 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, + 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 + <if test="!query.authorSelf"> + AND LV.status = '1' + </if> + AND LV.author_id = #{query.authorId} + AND LV.video_type = #{query.videoType} + ORDER BY + LV.collect_num DESC + </select> + + <select id="getAuthorCollectVideoPage" 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, + LM.nick_name as authorName, + LM.face as authorAvatar + FROM + lmk_my_collect 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.collect_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 + lmk_video LV + WHERE + LV.delete_flag = 0 AND LV.id = #{id} + </select> + <select id="healthPage" resultMap="BaseResultMap"> + 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.collect_num, + LV.comment_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 + FROM + lmk_video LV + LEFT JOIN li_member LM ON LV.author_id = LM.id + <if test="query.tagList != null and query.tagList.size > 0"> + INNER JOIN ( + SELECT DISTINCT video_id + FROM lmk_video_tag_ref + WHERE video_tag_id IN + <foreach collection="query.tagList" open="(" item="tagId" close=")" separator=",">#{tagId}</foreach> + ) AS LVT ON LV.id = LVT.video_id + </if> + WHERE + LV.delete_flag = 0 AND LV.video_type = #{query.videoType} + <if test="query.title != null and query.title != ''">AND LV.title LIKE CONCAT('%', #{query.title}, '%')</if> + <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> + + <select id="kitchenPage" resultMap="KitchenVideoMap"> + 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.collect_num, + LV.comment_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 + FROM + lmk_video LV + LEFT JOIN li_member LM ON LV.author_id = LM.id + <if test="query.typeList != null and query.typeList.size > 0"> + INNER JOIN ( + SELECT DISTINCT video_id + FROM lmk_kitchen_video_type_ref + WHERE kitchen_type_id IN + <foreach collection="query.typeList" open="(" item="tagId" close=")" separator=",">#{tagId}</foreach> + ) AS LVT ON LV.id = LVT.video_id + </if> + WHERE + LV.delete_flag = 0 AND LV.video_type = #{query.videoType} + <if test="query.title != null and query.title != ''">AND LV.title LIKE CONCAT('%', #{query.title}, '%')</if> + <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> </mapper> -- Gitblit v1.8.0