|
@@ -131,20 +131,38 @@ public interface FsUserVideoMapper
|
|
|
@Update("update fs_user_video set favorite_num=favorite_num-1 where video_id=#{videoId}")
|
|
@Update("update fs_user_video set favorite_num=favorite_num-1 where video_id=#{videoId}")
|
|
|
int minusFavorite(Long videoId);
|
|
int minusFavorite(Long videoId);
|
|
|
|
|
|
|
|
- @Select({"<script> " +
|
|
|
|
|
- "select v.video_id as id,v.title,v.description as msg,t.user_id,t.nick_name as username,t.avatar as headImg, " +
|
|
|
|
|
- "v.thumbnail as cover,v.url as src,v.likes as likeNum,v.comments as smsNum,v.favorite_num," +
|
|
|
|
|
- "v.create_time,v.views as playNumber,v.product_id,p.img_url,p.package_name,v.upload_type,v.shares,v.add_num from fs_user_video v " +
|
|
|
|
|
- "left join fs_user_talent t on t.talent_id = v.talent_id " +
|
|
|
|
|
- " left join fs_package p on p.package_id = v.product_id " +
|
|
|
|
|
- "where v.is_del = 0 and v.status = 1 " +
|
|
|
|
|
- " and v.is_audit = 1 " +
|
|
|
|
|
- "<if test = ' maps.keyword!=null and maps.keyword != \"\" '> " +
|
|
|
|
|
- "and v.title like CONCAT('%',#{maps.keyword},'%') " +
|
|
|
|
|
- "</if>" +
|
|
|
|
|
- " order by RAND() "+
|
|
|
|
|
- "</script>"})
|
|
|
|
|
- List<FsUserVideoListUVO> selectFsUserVideoListUVO(@Param("maps") FsUserVideoListUParam param);
|
|
|
|
|
|
|
+// @Select({"<script> " +
|
|
|
|
|
+// "select v.video_id as id,v.title,v.description as msg,t.user_id,t.nick_name as username,t.avatar as headImg, " +
|
|
|
|
|
+// "v.thumbnail as cover,v.url as src,v.likes as likeNum,v.comments as smsNum,v.favorite_num," +
|
|
|
|
|
+// "v.create_time,v.views as playNumber,v.product_id,p.img_url,p.package_name,v.upload_type,v.shares,v.add_num from fs_user_video v " +
|
|
|
|
|
+// "left join fs_user_talent t on t.talent_id = v.talent_id " +
|
|
|
|
|
+// " left join fs_package p on p.package_id = v.product_id " +
|
|
|
|
|
+// "where v.is_del = 0 and v.status = 1 " +
|
|
|
|
|
+// " and v.is_audit = 1 " +
|
|
|
|
|
+// "<if test = ' maps.keyword!=null and maps.keyword != \"\" '> " +
|
|
|
|
|
+// "and v.title like CONCAT('%',#{maps.keyword},'%') " +
|
|
|
|
|
+// "</if>" +
|
|
|
|
|
+// " order by RAND() "+
|
|
|
|
|
+// "</script>"})
|
|
|
|
|
+// List<FsUserVideoListUVO> selectFsUserVideoListUVO(@Param("maps") FsUserVideoListUParam param);
|
|
|
|
|
+@Select({"<script> " +
|
|
|
|
|
+ "select v.video_id as id,v.talent_id as talentId,t.user_id as userId,v.title,v.description as msg,t.nick_name as username,t.avatar as headImg, " +
|
|
|
|
|
+ "v.thumbnail as cover,v.url as src,v.likes as likeNum,v.comments as smsNum,v.favorite_num as favoriteNum," +
|
|
|
|
|
+ "v.create_time,v.views as playNumber,v.product_id,p.img_url,p.package_name,v.upload_type,v.shares,v.add_num " +
|
|
|
|
|
+ "<if test = 'maps.userId != null'> " +
|
|
|
|
|
+ ",CASE WHEN EXISTS (SELECT 1 FROM fs_user_talent_follow tf WHERE tf.talent_id = v.talent_id AND tf.user_id = #{maps.userId}) THEN '1' ELSE '0' END as isFollow " +
|
|
|
|
|
+ "</if> " +
|
|
|
|
|
+ "from fs_user_video v " +
|
|
|
|
|
+ "left join fs_user_talent t on t.talent_id = v.talent_id " +
|
|
|
|
|
+ " left join fs_package p on p.package_id = v.product_id " +
|
|
|
|
|
+ "where v.is_del = 0 and v.status = 1 " +
|
|
|
|
|
+ " and v.is_audit = 1 " +
|
|
|
|
|
+ "<if test = ' maps.keyword!=null and maps.keyword != \"\" '> " +
|
|
|
|
|
+ "and v.title like CONCAT('%',#{maps.keyword},'%') " +
|
|
|
|
|
+ "</if>" +
|
|
|
|
|
+ " order by v.create_time desc "+
|
|
|
|
|
+ "</script>"})
|
|
|
|
|
+List<FsUserVideoListUVO> selectFsUserVideoListUVO(@Param("maps") FsUserVideoListUParam param);
|
|
|
|
|
|
|
|
@Update("UPDATE fs_user_video SET comments = comments+#{commentCount} WHERE video_id = #{videoId}")
|
|
@Update("UPDATE fs_user_video SET comments = comments+#{commentCount} WHERE video_id = #{videoId}")
|
|
|
void updateCommentCount(@Param("videoId") Long videoId, @Param("commentCount") Integer commentCount);
|
|
void updateCommentCount(@Param("videoId") Long videoId, @Param("commentCount") Integer commentCount);
|
|
@@ -251,10 +269,31 @@ public interface FsUserVideoMapper
|
|
|
"where v.is_del = 0 and v.status = 1 and f.user_id = #{userId}")
|
|
"where v.is_del = 0 and v.status = 1 and f.user_id = #{userId}")
|
|
|
int countFavoriteVideos(@Param("userId") Long userId);
|
|
int countFavoriteVideos(@Param("userId") Long userId);
|
|
|
|
|
|
|
|
|
|
+// @Select({"<script> " +
|
|
|
|
|
+// "select v.video_id as id,v.title,v.description as msg,t.nick_name as username,t.avatar as headImg, " +
|
|
|
|
|
+// "v.thumbnail as cover,v.url as src,v.likes as likeNum,v.comments as smsNum,v.favorite_num," +
|
|
|
|
|
+// "v.create_time,v.views as playNumber,v.product_id,p.img_url,p.package_name,v.upload_type,v.shares,v.add_num,v.is_audit,v.status from fs_user_video v " +
|
|
|
|
|
+// "left join fs_user_talent t on t.talent_id = v.talent_id " +
|
|
|
|
|
+// " left join fs_package p on p.package_id = v.product_id " +
|
|
|
|
|
+// "where v.is_del = 0 and (" +
|
|
|
|
|
+// "(#{oneSelf} = true and (v.is_audit = -1 or v.is_audit = 0 or v.is_audit = 1)) or " +
|
|
|
|
|
+// "(#{oneSelf} = false and v.is_audit = 1 and v.status = 1)" +
|
|
|
|
|
+// ") " +
|
|
|
|
|
+// "<if test = ' talentId!=null and talentId != \"\" '> " +
|
|
|
|
|
+// "and v.talent_id = #{talentId}" +
|
|
|
|
|
+// " order by v.create_time" +
|
|
|
|
|
+// "</if>" +
|
|
|
|
|
+// "</script>"})
|
|
|
|
|
+// List<FsUserVideoListUVO> selectFsUserVideoListUVOByUser(@Param("talentId") Long talentId, @Param("oneSelf") boolean oneSelf);
|
|
|
|
|
+
|
|
|
@Select({"<script> " +
|
|
@Select({"<script> " +
|
|
|
- "select v.video_id as id,v.title,v.description as msg,t.nick_name as username,t.avatar as headImg, " +
|
|
|
|
|
- "v.thumbnail as cover,v.url as src,v.likes as likeNum,v.comments as smsNum,v.favorite_num," +
|
|
|
|
|
- "v.create_time,v.views as playNumber,v.product_id,p.img_url,p.package_name,v.upload_type,v.shares,v.add_num,v.is_audit,v.status from fs_user_video v " +
|
|
|
|
|
|
|
+ "select v.video_id as id,v.talent_id as talentId,t.user_id as userId,v.title,v.description as msg,t.nick_name as username,t.avatar as headImg, " +
|
|
|
|
|
+ "v.thumbnail as cover,v.url as src,v.likes as likeNum,v.comments as smsNum,v.favorite_num as favoriteNum," +
|
|
|
|
|
+ "v.create_time,v.views as playNumber,v.product_id,p.img_url,p.package_name,v.upload_type,v.shares,v.add_num,v.is_audit,v.fail_reason,v.status" +
|
|
|
|
|
+ "<if test = 'userId != null'> " +
|
|
|
|
|
+ ",CASE WHEN EXISTS (SELECT 1 FROM fs_user_talent_follow tf WHERE tf.talent_id = v.talent_id AND tf.user_id = #{userId}) THEN '1' ELSE '0' END as isFollow " +
|
|
|
|
|
+ "</if> " +
|
|
|
|
|
+ "from fs_user_video v " +
|
|
|
"left join fs_user_talent t on t.talent_id = v.talent_id " +
|
|
"left join fs_user_talent t on t.talent_id = v.talent_id " +
|
|
|
" left join fs_package p on p.package_id = v.product_id " +
|
|
" left join fs_package p on p.package_id = v.product_id " +
|
|
|
"where v.is_del = 0 and (" +
|
|
"where v.is_del = 0 and (" +
|
|
@@ -266,6 +305,6 @@ public interface FsUserVideoMapper
|
|
|
" order by v.create_time" +
|
|
" order by v.create_time" +
|
|
|
"</if>" +
|
|
"</if>" +
|
|
|
"</script>"})
|
|
"</script>"})
|
|
|
- List<FsUserVideoListUVO> selectFsUserVideoListUVOByUser(@Param("talentId") Long talentId, @Param("oneSelf") boolean oneSelf);
|
|
|
|
|
|
|
+ List<FsUserVideoListUVO> selectFsUserVideoListUVOByUser(@Param("talentId") Long talentId, @Param("oneSelf") boolean oneSelf, @Param("userId") Long userId);
|
|
|
}
|
|
}
|
|
|
|
|
|