package com.mcwl.communityCenter.mapper;

import com.baomidou.mybatisplus.annotation.InterceptorIgnore;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.mcwl.communityCenter.domain.Publish;
import com.mcwl.communityCenter.domain.Question;
import com.mcwl.communityCenter.domain.QuestionComment;
import com.mcwl.communityCenter.domain.dto.QuestionDetailRes;
import com.mcwl.communityCenter.domain.vo.QuestionCommentVo;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import javax.validation.constraints.NotNull;
import java.util.List;

@Mapper
public interface QuestionCommentMapper extends BaseMapper<QuestionComment> {

    @InterceptorIgnore(tenantLine = "true")
    Page<QuestionComment> selectByTenantIdAndCommunityIdAndQuestionIdPage(Page<QuestionComment> page,
                                                                          @Param("tenantId")
                                                                          Long tenantId,
                                                                          @Param("communityId")
                                                                          Long communityId,
                                                                          @Param("questionId")
                                                                          Long questionId);


    @InterceptorIgnore(tenantLine = "true")
    QuestionComment selectByIdAndTenantIdAndCommunityIdAndQuestionIdAndCommentId(@Param("tenantId")
                                                                                 Long tenantId,
                                                                                 @Param("communityId")
                                                                                 Long communityId,
                                                                                 @Param("questionId")
                                                                                 Long questionId,
                                                                                 @Param("commentId")
                                                                                 Long commentId);

    @InterceptorIgnore(tenantLine = "true")
    List<QuestionCommentVo> getComment(@Param("questionDetailRes") QuestionDetailRes questionDetailRes);
}
