| | |
| | | /** 班级 */ |
| | | private Integer classesId; |
| | | |
| | | /** 状态 */ |
| | | private String status; |
| | | |
| | | } |
| | | |
| | |
| | | if (Objects.isNull(exam.getExamPaperId())) { |
| | | throw new RuntimeException("考试未绑定试卷"); |
| | | } |
| | | if (ExamStatusEnum.NOT_START.equals(exam.getStatus())) { |
| | | throw new RuntimeException("考试还未开始"); |
| | | } |
| | | if (ExamStatusEnum.FINISHED.equals(exam.getStatus())) { |
| | | throw new RuntimeException("考试已经结束"); |
| | | } |
| | | // 查出考试试卷 |
| | | ExamPaper examPaper = examPaperMapper.selectById(exam.getExamPaperId()); |
| | | if (Objects.isNull(examPaper)) { |
| | |
| | | TE.exam_paper_type, |
| | | TE.exam_place, |
| | | TE.status, |
| | | IF(TE.status != 'not_start', IF(TE.status == 'ing', 1, 2), 0) as orderc, |
| | | IF(TE.status != 'not_start', IF(TE.status = 'ing', 2, 1), 0) as orderc, |
| | | TE.start_time, |
| | | TE.end_time, |
| | | TE.create_time, |
| | |
| | | TEP.name |
| | | FROM |
| | | t_exam TE |
| | | INNER JOIN t_classes TC ON TC.id = TE.classes_id AND TC.deleted = 0 |
| | | INNER JOIN t_classes TC ON TC.id = TE.classes_id AND TC.deleted = 0 AND TC.status = 'normal' |
| | | INNER JOIN t_classes_user TCU ON TC.id = TCU.classes_id AND TC.deleted = 0 AND TCU.user_id = #{userId} |
| | | INNER JOIN t_exam_paper TEP ON TEP.id = TE.exam_paper_id AND TEP.deleted = 0 |
| | | WHERE |
| | |
| | | <if test="query.examName != null and query.examName != ''"> |
| | | AND TE.exam_name like concat('%', #{query.examName}, '%') |
| | | </if> |
| | | ORDER BY orderc DESC |
| | | <if test="query.status != null and query.status != ''"> |
| | | AND TE.status = #{query.status} |
| | | </if> |
| | | ORDER BY orderc, TE.create_time DESC |
| | | </select> |
| | | |
| | | </mapper> |