Commit 39ea4860 authored by wujipeng's avatar wujipeng
Browse files

仿真考试数据接收

parent e5c0e307
package com.platform.business.model.vo;
import com.baomidou.mybatisplus.annotation.TableField;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.annotation.JsonInclude;
import com.platform.business.model.entity.ExamStudentEntity;
......@@ -8,6 +9,7 @@ import lombok.Data;
import lombok.EqualsAndHashCode;
import java.util.Date;
import java.util.List;
@Data
@EqualsAndHashCode(callSuper = true)
......@@ -68,4 +70,15 @@ public class ExamStudentVO extends ExamStudentEntity {
@ApiModelProperty(value = "得分率")
private String scoreRate;
@ApiModelProperty(value = "禁止交卷时长")
private Integer forbid;
@ApiModelProperty(value = "首席考评员id")
private String chiefId;
@ApiModelProperty(value = "监考教师id")
private String invigilationId;
private List<ExamStudentVO> data;
}
package com.platform.business.controller;
import com.platform.business.model.dto.ExamStudentDTO;
import com.platform.business.model.vo.ExamStudentVO;
import com.platform.business.service.ExamStudentService;
import com.platform.controller.BaseController;
import com.platform.model.resp.Result;
......@@ -31,4 +32,11 @@ public class ExamStudentController extends BaseController {
public Result<Map<String, String>> summary(@PathVariable String studentId) {
return Result.data(examStudentService.summary(studentId));
}
@ApiOperation(value = "根据学生id查询最近的一场考试")
@GetMapping("/recent/{studentId}")
public Result<ExamStudentVO> recent(@PathVariable String studentId) {
return Result.data(examStudentService.recent(studentId));
}
}
......@@ -27,4 +27,7 @@ public interface ExamStudentMapper extends BaseMapper<ExamStudentEntity> {
Map<String, String> summary(@Param("studentId") String studentId);
ExamStudentVO recent(@Param("studentId") String studentId);
List<ExamStudentVO> theSameEvent(@Param("examId") Integer examId);
}
......@@ -30,4 +30,6 @@ public interface ExamStudentService extends IService<ExamStudentEntity> {
Map<String, String> summary(String studentId);
ExamStudentVO recent(String studentId);
}
......@@ -63,4 +63,13 @@ public class ExamStaudentServiceImpl extends ServiceImpl<ExamStudentMapper, Exam
}
return result;
}
@Override
public ExamStudentVO recent(String studentId) {
ExamStudentVO examStudentVO = baseMapper.recent(studentId);
//获取同一场考试的学生
List<ExamStudentVO> data = baseMapper.theSameEvent(examStudentVO.getExamId());
examStudentVO.setData(data);
return examStudentVO;
}
}
......@@ -127,4 +127,29 @@
GROUP BY
es.class_id;
</select>
<select id="recent" resultType="com.platform.business.model.vo.ExamStudentVO">
select u.level as lev,
e.type,
e.name as examName,
es.start_time as startTime,
es.duration,
e.forbid,
e.chief_id as chiefId,
e.invigilation_id as invigilationId,
es.exam_id as examId,
c.name as className
from exam_student es
left join exam e on es.exam_id = e.id
left join user u on es.student_id = u.id
left join class c on e.class_id = c.id
where u.id = #{studentId}
order by es.start_time desc
limit 1
</select>
<select id="theSameEvent" resultType="com.platform.business.model.vo.ExamStudentVO">
select es.student_id as studentId, u.nick_name as studentName
from exam_student es
left join user u on es.student_id = u.id
where es.exam_id = #{examId}
</select>
</mapper>
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment