239 lines
7.3 KiB
XML
Raw Normal View History

2025-05-28 11:07:39 +08:00
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" >
<mapper namespace="com.wzj.soopin.content.mapper.VlogMapperCustom" >
2025-05-28 11:07:39 +08:00
<select id="getIndexVlogList" parameterType="map" resultType="com.wzj.soopin.content.domain.vo.IndexVlogVO">
2025-05-28 11:07:39 +08:00
SELECT
2025-08-15 19:05:25 +08:00
v.id,
v.member_id,
m.avatar,
m.nickname,
2025-05-28 11:07:39 +08:00
v.title as content,
v.url as url,
v.cover as cover,
2025-08-15 19:05:25 +08:00
v.title,
2025-05-28 11:07:39 +08:00
v.width as width,
v.height as height,
v.like_counts as likeCounts,
v.comments_counts as commentsCounts,
v.is_private as isPrivate,
v.city_code as cityCode,
v.reason as reason,
v.file_id as fileId,
v.status as status,
v.first_frame_img as firstFrameImg,
v.id as vlogId
2025-05-28 11:07:39 +08:00
FROM
2025-08-13 17:29:13 +08:00
cont_vlog v
2025-05-28 11:07:39 +08:00
LEFT JOIN
2025-08-15 16:51:03 +08:00
ums_member m
2025-05-28 11:07:39 +08:00
ON
2025-08-15 16:51:03 +08:00
v.member_id = m.id
2025-05-28 11:07:39 +08:00
WHERE
v.is_private = 0
<choose>
<when test="paramMap.status != null and paramMap.status!=''">
AND v.status = #{paramMap.status}
</when>
<otherwise>
AND v.status = 1
</otherwise>
</choose>
AND v.first_frame_img IS NOT NULL
<if test="paramMap.cityCode != null and paramMap.cityCode != ''">
AND v.city_code = #{paramMap.cityCode}
</if>
<if test="paramMap.search != null and paramMap.search != ''">
AND v.title like '%${paramMap.search}%'
</if>
<if test="paramMap.blockVd != null and paramMap.blockVd.size() > 0">
AND v.id NOT IN
<foreach collection="paramMap.blockVd" item="vlogId" open="(" separator="," close=")">
#{vlogId}
</foreach>
</if>
<if test="paramMap.blockUser != null and paramMap.blockUser.size() > 0">
2025-08-15 16:51:03 +08:00
AND v.member_id NOT IN
2025-08-15 19:05:25 +08:00
<foreach collection="paramMap.blockUser" item="memberId" open="(" separator="," close=")">
#{memberId}
2025-05-28 11:07:39 +08:00
</foreach>
</if>
ORDER BY
v.created_time
DESC
</select>
<select id="getVlogDetailById" parameterType="map" resultType="com.wzj.soopin.content.domain.vo.IndexVlogVO">
2025-05-28 11:07:39 +08:00
SELECT
v.id as vlogId,
2025-08-15 16:51:03 +08:00
v.member_id as vlogerId,
m.avatar as vlogerFace,
m.nickname as vlogerName,
2025-05-28 11:07:39 +08:00
v.title as content,
v.url as url,
v.cover as cover,
v.width as width,
v.height as height,
v.like_counts as likeCounts,
v.comments_counts as commentsCounts,
v.is_private as isPrivate,
v.city_code as cityCode,
v.reason as reason,
v.file_id as fileId,
v.status as status,
v.first_frame_img as firstFrameImg,
v.id as vlogId
2025-05-28 11:07:39 +08:00
FROM
2025-08-13 17:29:13 +08:00
cont_vlog v
2025-05-28 11:07:39 +08:00
LEFT JOIN
2025-08-15 16:51:03 +08:00
ums_member m
2025-05-28 11:07:39 +08:00
ON
2025-08-15 16:51:03 +08:00
v.member_id = m.id
2025-05-28 11:07:39 +08:00
WHERE
v.id = #{paramMap.vlogId}
AND v.status = 1
AND v.first_frame_img IS NOT NULL
</select>
<select id="getMyLikedVlogList" parameterType="map" resultType="com.wzj.soopin.content.domain.vo.IndexVlogVO">
2025-05-28 11:07:39 +08:00
SELECT
v.id as vlogId,
2025-08-15 19:05:25 +08:00
v.member_id as memberId,
v.title as title,
2025-05-28 11:07:39 +08:00
v.title as content,
v.url as url,
v.cover as cover,
v.width as width,
v.height as height,
v.like_counts as likeCounts,
v.comments_counts as commentsCounts,
v.is_private as isPrivate,
v.city_code as cityCode,
v.reason as reason,
v.status as status,
v.file_id as fileId,
v.first_frame_img as firstFrameImg,
2025-08-15 19:05:25 +08:00
v.id as Id,
m.avatar as avatar,
m.nickname as nickname
2025-05-28 11:07:39 +08:00
FROM
2025-08-13 17:29:13 +08:00
cont_vlog v
2025-05-28 11:07:39 +08:00
LEFT JOIN
2025-08-13 17:29:13 +08:00
cont_my_liked_vlog mlv
2025-05-28 11:07:39 +08:00
ON
v.id = mlv.vlog_id
LEFT JOIN
2025-08-15 16:51:03 +08:00
ums_member m
2025-05-28 11:07:39 +08:00
ON
2025-08-15 19:05:25 +08:00
v.member_id = m.id
2025-05-28 11:07:39 +08:00
WHERE
2025-08-15 19:05:25 +08:00
mlv.user_id = #{paramMap.userId}
2025-05-28 11:07:39 +08:00
AND v.status = 1
AND v.first_frame_img IS NOT NULL
AND v.is_private = 0
<if test="paramMap.blockVd != null and paramMap.blockVd.size() > 0">
AND v.id NOT IN
<foreach collection="paramMap.blockVd" item="vlogId" open="(" separator="," close=")">
#{vlogId}
</foreach>
</if>
<if test="paramMap.blockUser != null and paramMap.blockUser.size() > 0">
2025-08-15 16:51:03 +08:00
AND v.member_id NOT IN
2025-05-28 11:07:39 +08:00
<foreach collection="paramMap.blockUser" item="vlogerId" open="(" separator="," close=")">
#{vlogerId}
</foreach>
</if>
ORDER BY
v.created_time
DESC
</select>
<select id="getMyFollowVlogList" parameterType="map" resultType="com.wzj.soopin.content.domain.vo.IndexVlogVO">
2025-05-28 11:07:39 +08:00
SELECT
v.id as vlogId,
2025-08-15 19:05:25 +08:00
v.member_id as memberId,
v.title as title,
2025-05-28 11:07:39 +08:00
v.title as content,
v.url as url,
v.cover as cover,
v.width as width,
v.height as height,
v.like_counts as likeCounts,
v.comments_counts as commentsCounts,
v.is_private as isPrivate,
v.city_code as cityCode,
v.reason as reason,
v.status as status,
v.file_id as fileId,
v.first_frame_img as firstFrameImg,
2025-08-15 19:05:25 +08:00
v.id as Id,
m.avatar as avatar,
m.nickname as nickname
2025-05-28 11:07:39 +08:00
FROM
2025-08-15 19:05:25 +08:00
cont_vlog v
2025-05-28 11:07:39 +08:00
LEFT JOIN
2025-08-15 19:05:25 +08:00
cont_fans f
2025-05-28 11:07:39 +08:00
ON
2025-08-15 19:05:25 +08:00
v.member_id = f.vloger_id
2025-05-28 11:07:39 +08:00
LEFT JOIN
2025-08-15 19:05:25 +08:00
ums_member m
2025-05-28 11:07:39 +08:00
ON
2025-08-15 19:05:25 +08:00
v.member_id = m.id
2025-05-28 11:07:39 +08:00
WHERE
2025-08-15 19:05:25 +08:00
v.is_private = 0
2025-05-28 11:07:39 +08:00
AND v.status = 1
AND v.first_frame_img IS NOT NULL
AND
f.fan_id = #{paramMap.myId}
ORDER BY
2025-08-15 19:05:25 +08:00
v.created_time
2025-05-28 11:07:39 +08:00
DESC
</select>
<select id="getMyFriendVlogList" parameterType="map" resultType="com.wzj.soopin.content.domain.vo.IndexVlogVO">
2025-05-28 11:07:39 +08:00
SELECT
v.id as vlogId,
2025-08-15 19:05:25 +08:00
v.member_id as memberId,
v.title as title,
2025-05-28 11:07:39 +08:00
v.title as content,
v.url as url,
v.cover as cover,
v.width as width,
v.height as height,
v.like_counts as likeCounts,
v.comments_counts as commentsCounts,
v.is_private as isPrivate,
v.city_code as cityCode,
v.reason as reason,
v.status as status,
v.file_id as fileId,
v.first_frame_img as firstFrameImg,
2025-08-15 19:05:25 +08:00
v.id as Id,
m.avatar as avatar,
m.nickname as nickname
2025-05-28 11:07:39 +08:00
FROM
2025-08-15 19:05:25 +08:00
cont_vlog v
2025-05-28 11:07:39 +08:00
LEFT JOIN
2025-08-15 19:05:25 +08:00
ums_fans f
2025-05-28 11:07:39 +08:00
ON
2025-08-15 19:05:25 +08:00
v.member_id = f.fan_id
2025-05-28 11:07:39 +08:00
LEFT JOIN
2025-08-15 19:05:25 +08:00
ums_member m
2025-05-28 11:07:39 +08:00
ON
2025-08-15 19:05:25 +08:00
v.member_id = m.id
2025-05-28 11:07:39 +08:00
WHERE
2025-08-15 19:05:25 +08:00
v.is_private = 0
2025-05-28 11:07:39 +08:00
AND v.status = 1
AND v.first_frame_img IS NOT NULL
AND
f.vloger_id = #{paramMap.myId}
AND
f.is_fan_friend_of_mine = 1
ORDER BY
2025-08-15 19:05:25 +08:00
v.created_time
2025-05-28 11:07:39 +08:00
DESC
</select>
</mapper>