239 lines
8.1 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">
SELECT v.id,
v.member_id,
m.avatar,
m.nickname,
m.phone_encrypted as phone,
v.create_time,
v.title as content,
v.url as url,
v.cover as cover,
v.title,
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
FROM cont_vlog v
LEFT JOIN
ums_member m
ON
v.member_id = m.id
WHERE v.first_frame_img IS NOT NULL
<if test="bo.isPrivate != null">
AND v.is_private = #{bo.isPrivate}
</if>
<if test="bo.status != null">
AND v.status = #{bo.status}
</if>
<if test="bo.cityCode != null and bo.cityCode != ''">
AND v.city_code = #{bo.cityCode}
</if>
2025-09-15 17:29:57 +08:00
<if test="bo.memberId != null and bo.memberId != ''">
AND v.member_id = #{bo.memberId}
</if>
<if test="bo.title != null and bo.title != ''">
AND v.title like '%${bo.title}%'
</if>
<if test="bo.startTime != null">
AND v.create_time >= #{bo.startTime}
</if>
<if test="bo.endTime != null">
AND #{bo.endTime} >= v.create_time
</if>
<if test="bo.mobile != null and bo.mobile != ''">
AND m.phone_encrypted like '%${bo.mobile}%'
</if>
<if test="bo.blockVd != null and bo.blockVd.size() > 0">
2025-05-28 11:07:39 +08:00
AND v.id NOT IN
<foreach collection="bo.blockVd" item="vlogId" open="(" separator="," close=")">
2025-05-28 11:07:39 +08:00
#{vlogId}
</foreach>
</if>
<if test="bo.blockUser != null and bo.blockUser.size() > 0">
2025-08-15 16:51:03 +08:00
AND v.member_id NOT IN
<foreach collection="bo.blockUser" item="memberId" open="(" separator="," close=")">
2025-08-15 19:05:25 +08:00
#{memberId}
2025-05-28 11:07:39 +08:00
</foreach>
</if>
<if test="bo.ids != null and bo.ids.size() > 0">
AND v.id IN
<foreach collection="bo.ids" item="vlogId" open="(" separator="," close=")">
2025-08-28 15:43:21 +08:00
#{vlogId}
</foreach>
</if>
ORDER BY v.create_time
DESC
2025-05-28 11:07:39 +08:00
</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-08-21 15:47:21 +08:00
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-21 15:47:21 +08:00
mlv.user_id = #{paramMap.myId}
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
2025-08-16 11:28:51 +08:00
v.create_time
2025-05-28 11:07:39 +08:00
DESC
</select>
<select id="getMyFollowVlogList" parameterType="map" resultType="com.wzj.soopin.content.domain.vo.IndexVlogVO">
2025-05-28 11:07:39 +08:00
SELECT
2025-08-21 15:47:21 +08:00
v.id AS vlogId,
v.member_id AS memberId,
v.title AS title,
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,
v.id AS Id,
m.avatar AS avatar,
m.nickname AS nickname
2025-05-28 11:07:39 +08:00
FROM
2025-08-21 15:47:21 +08:00
cont_vlog v
LEFT JOIN ums_fans f ON v.member_id = f.vlogger_id
LEFT JOIN ums_member m ON v.member_id = m.id
2025-05-28 11:07:39 +08:00
WHERE
NOT EXISTS ( SELECT 1 FROM cms_vlog_member vm WHERE v.id = vm.vlog_id AND vm.member_id = #{paramMap.myId} )
AND v.is_private = 0
AND v.STATUS = 1
2025-05-28 11:07:39 +08:00
AND v.first_frame_img IS NOT NULL
AND
f.fan_id = #{paramMap.myId}
ORDER BY
2025-08-16 11:28:51 +08:00
v.create_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,
v.member_id AS memberId,
v.title AS title,
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,
v.id AS Id,
m.avatar AS avatar,
m.nickname AS nickname
2025-05-28 11:07:39 +08:00
FROM
cont_vlog v
LEFT JOIN ums_fans f ON v.member_id = f.vlogger_id
LEFT JOIN ums_member m ON v.member_id = m.id
2025-05-28 11:07:39 +08:00
WHERE
v.is_private = 0
AND v.STATUS = 1
2025-05-28 11:07:39 +08:00
AND v.first_frame_img IS NOT NULL
AND f.fan_id = #{paramMap.myId}
AND f.friend_flag = 1
AND NOT EXISTS ( SELECT 1 FROM cms_vlog_member vm WHERE v.id = vm.vlog_id AND vm.member_id= #{paramMap.myId} )
2025-05-28 11:07:39 +08:00
ORDER BY
v.create_time DESC
2025-05-28 11:07:39 +08:00
</select>
</mapper>