package com.ynfy.buss.exam.exam.service.impl;


import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.ynfy.buss.exam.exam.entity.ExamPapers;
import com.ynfy.buss.exam.exam.mapper.ExamPapersMapper;
import com.ynfy.buss.exam.exam.service.IExamPapersService;
import com.ynfy.buss.exam.paper.entity.Paper;
import com.ynfy.buss.exam.paperrulegroup.service.IPaperRuleGroupService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;


/**
 * @Description: exam
 * @Author: jeecg-boot
 * @Date: 2023-02-23
 * @Version: V1.0
 */
@Service
public class ExamPapersServiceImpl extends ServiceImpl<ExamPapersMapper, ExamPapers> implements IExamPapersService {
    @Autowired
    private ExamPapersMapper examPapersMapper ;
    @Override
    public List<ExamPapers> ExamIdAllExamPapers(String examId) {
        LambdaQueryWrapper<ExamPapers> wrapper = new LambdaQueryWrapper<>();
        wrapper.eq(ExamPapers::getExamId, examId).orderBy(true,true,ExamPapers::getPaperOrder);
        return this.list(wrapper);
    }

    @Override
    public List<ExamPapers> PaperIdAllExamPapers(String examId,String PaperId) {
        LambdaQueryWrapper<ExamPapers> wrapper = new LambdaQueryWrapper<>();
        wrapper.eq(ExamPapers::getExamId, examId)
               .eq(ExamPapers::getPaperId, PaperId);
        return this.list(wrapper);
    }

    @Override
    public List<ExamPapers> getExamIdPaper(String examId) {
        return examPapersMapper.getExamIdExamPaper(examId);
    }

    @Override
    public List<ExamPapers> ExamIdExamPapers(String examId) {
        return examPapersMapper.ExamIdExamPapers(examId);
    }
}
