package com.ruoyi.frequency.comment.mapper;

import java.util.List;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.ruoyi.controller.req.CommentPageReq;
import com.ruoyi.controller.req.DialoguePageReq;
import com.ruoyi.controller.resp.CommentNum;
import com.ruoyi.controller.resp.CommentPageResp;
import com.ruoyi.controller.resp.CommentResp;
import com.ruoyi.controller.resp.WorksCommentPageResp;
import com.ruoyi.frequency.comment.entity.Comment;
import com.ruoyi.vo.UserVo;
import org.apache.ibatis.annotations.Param;

/**
 * 评论(新闻)Mapper接口
 * 
 * @author liwenlong
 * @date 2024-04-15
 */
public interface CommentMapper  extends BaseMapper<Comment>
{
    /**
     * 查询评论(新闻)
     * 
     * @param id 评论(新闻)主键
     * @return 评论(新闻)
     */
    public Comment selectCommentById(Long id);

    /**
     * 查询评论(新闻)列表
     * 
     * @param comment 评论(新闻)
     * @return 评论(新闻)集合
     */
    public List<Comment> selectCommentList(Comment comment);

    /**
     * 新增评论(新闻)
     * 
     * @param comment 评论(新闻)
     * @return 结果
     */
    public int insertComment(Comment comment);

    /**
     * 修改评论(新闻)
     * 
     * @param comment 评论(新闻)
     * @return 结果
     */
    public int updateComment(Comment comment);

    CommentResp getCommentResp(@Param("id") Long id,@Param("userVo") UserVo userVo);

    Page<CommentPageResp> commentPage(@Param("page")Page<Object> objectPage, @Param("req")CommentPageReq req, @Param("userVo")UserVo userVo);

    List<CommentPageResp> commentList(@Param("req")CommentPageReq req, @Param("userVo") UserVo userVo,@Param("list") List<Long> parentIds);

    List<CommentNum> selectCommentNumList(@Param("commentIds")List<Long> commentIds,@Param("userVoList") List<UserVo> userVoList);

    Page<CommentPageResp> commentDialoguePage(@Param("page")Page<Object> objectPage,@Param("req") DialoguePageReq req,@Param("userVo") UserVo userVo);

    void updateCommentBatch(@Param("list")List<Comment> comments);
}
