package cn.reghao.tnb.content.app.exam.db.mapper;

import cn.reghao.jutil.jdk.web.db.BaseMapper;
import cn.reghao.jutil.jdk.web.db.Page;
import cn.reghao.tnb.common.db.GroupCount;
import cn.reghao.tnb.content.app.exam.model.po.Question;
import cn.reghao.tnb.content.app.exam.model.query.QuestionQuery;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;

/**
 * @author reghao
 * @date 2024-08-24 23:28:40
 */
@Mapper
public interface QuestionMapper extends BaseMapper<Question> {
    void deleteByQuestionId(long questionId);

    List<Question> findBySubjectId(int subjectId);
    Question findByQuestionId(long questionId);
    List<Question> findByPid(long pid);
    List<Question> findByQuestionIds(List<Long> list);
    List<GroupCount> findGroupBySubjectId(int subjectId);

    int countByCriteria(QuestionQuery questionQuery);
    List<Question> findQuestionByPage(Page page, @Param("questionQuery") QuestionQuery questionQuery);
}
