package com.ruoyi.test.seriver.Impl;

import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.ruoyi.test.domain.ClassExamPaper;
import com.ruoyi.test.mapper.ClassExamPaperMapper;
import com.ruoyi.test.seriver.IClassExamPaperService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class ClassExamPaperServiceImpl extends ServiceImpl<ClassExamPaperMapper, ClassExamPaper> implements IClassExamPaperService {

    @Autowired
    private ClassExamPaperMapper classExamPaperMapper;

    @Override
    public List<ClassExamPaper> selectByGradeAndClass(String grade, String Class) {
        LambdaQueryWrapper<ClassExamPaper> queryWrapper = new LambdaQueryWrapper<>();
        queryWrapper.eq(ClassExamPaper::getGrade,grade)
                .eq(ClassExamPaper::getClass1,Class);
        return classExamPaperMapper.selectList(queryWrapper);
    }

    @Override
    public int addClassExamPaper(String grade, String Class1, Long id) {
        return classExamPaperMapper.addClassExamPaper(grade,Class1,id);
    }

}
