package com.fs.course.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.fs.course.domain.FsCourseWatchComment;
import com.fs.course.param.FsCourseWatchCommentListParam;
import com.fs.course.param.FsCourseWatchCommentPageParam;
import com.fs.course.vo.FsCourseWatchCommentListVO;
import com.fs.course.vo.FsCourseWatchCommentVO;
import org.apache.ibatis.annotations.Update;

import java.util.List;

/**
 * 看课评论Mapper接口
 *
 * @author fs
 * @date 2025-05-26
 */
public interface FsCourseWatchCommentMapper extends BaseMapper<FsCourseWatchComment>{
    /**
     * 查询看课评论
     *
     * @param commentId 看课评论主键
     * @return 看课评论
     */
    FsCourseWatchComment selectFsCourseWatchCommentByCommentId(Long commentId);

    /**
     * 查询看课评论列表
     *
     * @param fsCourseWatchCommentPageParam 看课评论
     * @return 看课评论集合
     */
    List<FsCourseWatchCommentListVO> selectFsCourseWatchCommentList(FsCourseWatchCommentPageParam fsCourseWatchCommentPageParam);

    /**
     * 新增看课评论
     *
     * @param fsCourseWatchComment 看课评论
     * @return 结果
     */
    int insertFsCourseWatchComment(FsCourseWatchComment fsCourseWatchComment);

    /**
     * 修改看课评论
     *
     * @param fsCourseWatchComment 看课评论
     * @return 结果
     */
    int updateFsCourseWatchComment(FsCourseWatchComment fsCourseWatchComment);

    /**
     * 删除看课评论
     *
     * @param commentId 看课评论主键
     * @return 结果
     */
    int deleteFsCourseWatchCommentByCommentId(Long commentId);

    /**
     * 批量删除看课评论
     *
     * @param commentIds 需要删除的数据主键集合
     * @return 结果
     */
    int deleteFsCourseWatchCommentByCommentIds(Long[] commentIds);

    /**
     * 撤销评论
     * @param commentId 评论id
     * @return int，1-是，0-否
     */
    @Update("update fs_course_watch_comment set is_revoke = 1 where comment_id = #{commentId}")
    int revokeH5CourseWatchComment(Long commentId);

    /**
     * h5查询评论列表
     * @param param 入参
     * @return list
     */
    List<FsCourseWatchCommentVO> selectH5CourseWatchComments(FsCourseWatchCommentListParam param);

    /**
     * 随机获取200条弹幕
     * @param param 入参
     * @return list
     */
    List<FsCourseWatchCommentVO> selectH5CourseWatchCommentsRound(FsCourseWatchCommentListParam param);
}
