package com.ruoyi.frequency.workscomment.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.DialoguePageReq;
import com.ruoyi.controller.req.WorksCommentPageReq;
import com.ruoyi.controller.resp.CommentNum;
import com.ruoyi.controller.resp.WorksCommentPageResp;
import com.ruoyi.controller.resp.WorksCommentResp;
import com.ruoyi.frequency.workscomment.entity.WorksComment;
import com.ruoyi.post.controller.req.PostCommentPageReq;
import com.ruoyi.post.controller.resp.PostCommentPageResp;
import com.ruoyi.vo.UserVo;
import org.apache.ibatis.annotations.Param;

/**
 * 作品评论Mapper接口
 * 
 * @author liwenlong
 * @date 2024-04-11
 */
public interface WorksCommentMapper  extends BaseMapper<WorksComment>
{
    /**
     * 查询作品评论
     * 
     * @param id 作品评论主键
     * @return 作品评论
     */
    public WorksComment selectWorksCommentById(Long id);

    /**
     * 查询作品评论列表
     * 
     * @param worksComment 作品评论
     * @return 作品评论集合
     */
    public List<WorksComment> selectWorksCommentList(WorksComment worksComment);

    /**
     * 新增作品评论
     * 
     * @param worksComment 作品评论
     * @return 结果
     */
    public int insertWorksComment(WorksComment worksComment);

    /**
     * 修改作品评论
     * 
     * @param worksComment 作品评论
     * @return 结果
     */
    public int updateWorksComment(WorksComment worksComment);

    WorksCommentResp getWorksCommentResp(@Param("id") Long id);

    Page<WorksCommentPageResp> worksCommentPage(@Param("page") Page<Object> objectPage, @Param("req") WorksCommentPageReq req,@Param("userVo") UserVo userVo);

    List<WorksCommentPageResp> worksCommentList(@Param("req") WorksCommentPageReq req, @Param("userVo") UserVo userVo, @Param("list") List<Long> parentIds);

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

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

    void updateWorksCommentBatch(@Param("list")List<WorksComment> worksComments);
}
