package com.tzy.mapper;

import com.tzy.pojo.question.Question;
import com.tzy.pojo.question.QuestionAnswer;
import com.tzy.pojo.question.Questionnaire;
import com.tzy.pojo.question.UserLimitRecord;
import org.apache.ibatis.annotations.Param;

import java.util.List;

public interface QuestionnaireMapper {

    Long hasUserQuestionnaireByType(@Param("userId") Integer userId, @Param("type") String type);

    Questionnaire getLastQuestionnaire(@Param("type") String type, @Param("id") Long id, @Param("memberLevel") Integer memberLevel);

    List<Question> getQuestionsByQuestionnaireId(@Param("questionnaireId") Long questionnaireId);

    int insertUserLimitRecord(UserLimitRecord record);

    int batchInsertQuestionAnswers(List<QuestionAnswer> questionAnswers);

    Long hasUserQuestionnaire(@Param("userId") Integer userId,  @Param("memberLevel") Integer memberLevel);

    int getLastNewMonthlyLimit(Long userId);
}