cloudroam
2025-06-04 ed0dc655e6732f15d30f399c0d460ad7b9fe42da
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
package com.mzl.flower.mapper.film;
 
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;
 
/**
 * 评论点赞表 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);
 
}