| | |
| | | package com.ycl.jxkg.service.impl; |
| | | |
| | | import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import com.github.pagehelper.PageHelper; |
| | | import com.github.pagehelper.PageInfo; |
| | | import com.ycl.jxkg.base.Result; |
| | | import com.ycl.jxkg.domain.ExamPaperAnswerInfo; |
| | | import com.ycl.jxkg.domain.entity.*; |
| | | import com.ycl.jxkg.domain.other.KeyValue; |
| | |
| | | import org.springframework.stereotype.Service; |
| | | import org.springframework.transaction.annotation.Transactional; |
| | | |
| | | import java.util.ArrayList; |
| | | import java.util.Date; |
| | | import java.util.List; |
| | | import java.util.stream.Collectors; |
| | |
| | | return PageHelper.startPage(model.getPageIndex(), model.getPageSize()).doSelectPageInfo(() -> |
| | | examPaperScoreMapper.pageUser(model)); |
| | | } |
| | | |
| | | @Override |
| | | public Result queryMaxAndMinScore(Integer id) { |
| | | List<ExamPaperScore> list = new ArrayList<>(); |
| | | ExamPaperScore max = examPaperScoreMapper.selectOne(new LambdaQueryWrapper<>(ExamPaperScore.class) |
| | | .eq(ExamPaperScore::getExamId, id) |
| | | .orderByDesc(ExamPaperScore::getTotalScore) |
| | | .last("limit 1")); |
| | | list.add(max); |
| | | if (null != max) { |
| | | ExamPaperScore min = examPaperScoreMapper.selectOne(new LambdaQueryWrapper<>(ExamPaperScore.class) |
| | | .eq(ExamPaperScore::getExamId, id) |
| | | .orderByAsc(ExamPaperScore::getTotalScore) |
| | | .last("limit 1")); |
| | | list.add(min); |
| | | } |
| | | return Result.ok(list); |
| | | } |
| | | } |