From f7bb788026db3bb43e1156ce71b82ecaf8e75c32 Mon Sep 17 00:00:00 2001
From: cloudroam <cloudroam>
Date: 星期四, 05 六月 2025 09:27:20 +0800
Subject: [PATCH] fix:用户查询
---
src/main/java/com/mzl/flower/mapper/film/CommentLikesMapper.java | 29 +++++++++++++++++++++++------
1 files changed, 23 insertions(+), 6 deletions(-)
diff --git a/src/main/java/com/mzl/flower/mapper/film/CommentLikesMapper.java b/src/main/java/com/mzl/flower/mapper/film/CommentLikesMapper.java
index e17611d..e70d5b6 100644
--- a/src/main/java/com/mzl/flower/mapper/film/CommentLikesMapper.java
+++ b/src/main/java/com/mzl/flower/mapper/film/CommentLikesMapper.java
@@ -2,15 +2,32 @@
import com.mzl.flower.entity.film.CommentLikes;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import org.apache.ibatis.annotations.Select;
+import org.springframework.stereotype.Repository;
/**
- * <p>
- * 影视作品点赞表 Mapper 接口
- * </p>
- *
- * @author generator@Fang
- * @since 2025-05-29
+ * 评论点赞表 Mapper
*/
+@Repository
public interface CommentLikesMapper extends BaseMapper<CommentLikes> {
+ /**
+ * 根据评论id查询点赞数量
+ */
+ @Select("select count(1) from comment_likes where status = '1' and comment_id =#{ id} ")
+ Long getLikeCountCommentId(Integer id);
+
+ /**
+ * 判断用户是否点赞
+ */
+ @Select("select status from comment_likes where comment_id = #{commentId} and create_by = #{userId} ")
+ Boolean isLike(Integer commentId, String userId);
+
+ /**
+ * 查询人员有没有对应的评论点赞信息
+ */
+
+ @Select("select * from comment_likes where create_by = #{userId} and comment_id = #{commentId} ")
+ CommentLikes getCommentLikeByUserIdAndCommentId(String userId, Integer commentId);
+
}
--
Gitblit v1.9.3