Browse Source

Merge branch 'dev'
1

wangliang 4 năm trước cách đây
mục cha
commit
ca8dcb17bc

+ 51 - 5
themis-backend/src/main/java/com/qmth/themis/backend/api/TEExamStudentController.java

@@ -6,10 +6,12 @@ import com.baomidou.mybatisplus.core.metadata.IPage;
 import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
 import com.qmth.themis.business.annotation.ApiJsonObject;
 import com.qmth.themis.business.annotation.ApiJsonProperty;
+import com.qmth.themis.business.cache.bean.ExamCacheBean;
 import com.qmth.themis.business.cache.bean.ExamCourseCacheBean;
 import com.qmth.themis.business.config.SystemConfig;
 import com.qmth.themis.business.constant.SystemConstant;
 import com.qmth.themis.business.dto.MqDto;
+import com.qmth.themis.business.dto.response.MarkResultDto;
 import com.qmth.themis.business.dto.response.RoomCodeQueryDto;
 import com.qmth.themis.business.dto.response.TEExamStudentDto;
 import com.qmth.themis.business.entity.*;
@@ -199,8 +201,8 @@ public class TEExamStudentController {
                     teStudentService.save(teStudent);
                     s.setStudentId(teStudent.getId());
                     s.setCreateId(tbUser.getId());
-                }else {
-                	s.setStudentId(student.getId());
+                } else {
+                    s.setStudentId(student.getId());
                     s.setCreateId(tbUser.getId());
                 }
             } else {
@@ -230,12 +232,12 @@ public class TEExamStudentController {
                 }
                 s.setRoomName(roomCodeQueryDtoMap.get(s.getRoomCode()).getRoomName());
             }
-            if(s.getAlreadyExamCount()==null) {
-            	s.setAlreadyExamCount(0);
+            if (s.getAlreadyExamCount() == null) {
+                s.setAlreadyExamCount(0);
             }
             teExamStudentService.saveOrUpdate(s);
         });
-        for(TEExamStudent es:teExamStudentList){
+        for (TEExamStudent es : teExamStudentList) {
             teExamStudentService.updateExamStudentCacheBean(es.getId());
         }
         return ResultUtil.ok(Collections.singletonMap(SystemConstant.SUCCESS, true));
@@ -337,4 +339,48 @@ public class TEExamStudentController {
         }
         return ResultUtil.ok(Collections.singletonMap(SystemConstant.TASK_ID, tbTaskHistory.getId()));
     }
+
+    @ApiOperation(value = "成绩查询接口")
+    @RequestMapping(value = "/mark/result", method = RequestMethod.POST)
+    @ApiResponses({@ApiResponse(code = 200, message = "考试批次信息", response = MarkResultDto.class)})
+    public Result markResult(@ApiParam(value = "考试批次id", required = true) @RequestParam Long examId,
+                             @ApiParam(value = "考试场次id", required = false) @RequestParam(required = false) Long activityId,
+                             @ApiParam(value = "证件号", required = false) @RequestParam(required = false) String identity,
+                             @ApiParam(value = "姓名", required = false) @RequestParam(required = false) String name,
+                             @ApiParam(value = "科目代码", required = false) @RequestParam(required = false) String courseCode,
+                             @ApiParam(value = "分页页码", required = true) @RequestParam int pageNumber,
+                             @ApiParam(value = "分页数", required = true) @RequestParam int pageSize) {
+        if (Objects.isNull(examId) || Objects.equals(examId, "")) {
+            throw new BusinessException(ExceptionResultEnum.EXAM_ID_IS_NULL);
+        }
+        ExamCacheBean examCacheBean = teExamService.getExamCacheBean(examId);
+        if (Objects.isNull(examCacheBean)) {
+            throw new BusinessException(ExceptionResultEnum.EXAM_NO);
+        }
+        InvigilateMonitorStatusEnum invigilateMonitorStatusEnum = examCacheBean.getMonitorStatus();//监考状态
+        if (Objects.nonNull(invigilateMonitorStatusEnum) && !Objects.equals(invigilateMonitorStatusEnum, InvigilateMonitorStatusEnum.FINISHED)) {
+            throw new BusinessException("当前批次监考未结束,请在结束后查询");
+        }
+        ScoreStatusEnum scoreStatusEnum = examCacheBean.getScoreStatus();//算分状态
+        if (Objects.nonNull(scoreStatusEnum) && (Objects.equals(scoreStatusEnum, ScoreStatusEnum.NEVER) || Objects.equals(scoreStatusEnum, ScoreStatusEnum.FINISH))) {
+            throw new BusinessException("当前批次算分未结束,请在结束后查询");
+        }
+        QueryWrapper<TEExamCourse> teExamCourseQueryWrapper = new QueryWrapper<>();
+        teExamCourseQueryWrapper.lambda().eq(TEExamCourse::getExamId, examId);
+        List<TEExamCourse> teExamCourseList = teExamCourseService.list(teExamCourseQueryWrapper);
+        Set answerList = null;
+        if (Objects.nonNull(teExamCourseList) && teExamCourseList.size() > 0) {
+            answerList = teExamCourseList.stream().filter(s -> {
+                if (Objects.nonNull(s.getHasAnswer()) && s.getHasAnswer().intValue() == 0) {
+                    return true;
+                } else {
+                    return false;
+                }
+            }).collect(Collectors.toSet());
+        }
+        if (Objects.nonNull(answerList) && answerList.size() > 0) {
+            throw new BusinessException("当前批次标答未补齐,请补齐后查询");
+        }
+        return ResultUtil.ok(teExamStudentService.markResultQuery(new Page<>(pageNumber, pageSize), examId, activityId, identity, name, courseCode));
+    }
 }

+ 4 - 4
themis-backend/src/main/java/com/qmth/themis/backend/api/TIeInvigilateController.java

@@ -133,14 +133,14 @@ public class TIeInvigilateController {
                     if (Objects.nonNull(finalMonitorVideoSourceList) && finalMonitorVideoSourceList.size() > 0) {
                         finalMonitorVideoSourceList.forEach(l -> {
                             MonitorVideoSourceEnum source = MonitorVideoSourceEnum.valueOf(l);
-                            switch (source.ordinal()) {
-                                case 0:
+                            switch (source.name()) {
+                                case "CLIENT_SCREEN":
                                     s.setScreenMonitorStatusSource(ExamRecordCacheUtil.getMonitorStatus(s.getExamRecordId(), source.name()));
                                     break;
-                                case 1:
+                                case "CLIENT_CAMERA":
                                     s.setCameraMonitorStatusSource(ExamRecordCacheUtil.getMonitorStatus(s.getExamRecordId(), source.name()));
                                     break;
-                                case 2:
+                                case "MOBILE_FIRST":
                                     s.setMobileFirstMonitorStatusSource(ExamRecordCacheUtil.getMonitorStatus(s.getExamRecordId(), source.name()));
                                     break;
                                 default:

+ 19 - 18
themis-business/src/main/java/com/qmth/themis/business/dao/TEExamStudentMapper.java

@@ -1,19 +1,19 @@
 package com.qmth.themis.business.dao;
 
-import java.util.List;
-import java.util.Map;
-
-import org.apache.ibatis.annotations.Mapper;
-import org.apache.ibatis.annotations.Param;
-
 import com.baomidou.mybatisplus.core.mapper.BaseMapper;
 import com.baomidou.mybatisplus.core.metadata.IPage;
 import com.qmth.themis.business.bean.backend.ExamDeficiencyListBean;
 import com.qmth.themis.business.bean.backend.ExamStudentLogListBean;
 import com.qmth.themis.business.bean.backend.ExamViewCountListBean;
+import com.qmth.themis.business.dto.response.MarkResultDto;
 import com.qmth.themis.business.dto.response.RoomCodeQueryDto;
 import com.qmth.themis.business.dto.response.TEExamStudentDto;
 import com.qmth.themis.business.entity.TEExamStudent;
+import org.apache.ibatis.annotations.Mapper;
+import org.apache.ibatis.annotations.Param;
+
+import java.util.List;
+import java.util.Map;
 
 /**
  * @Description: 考生库 Mapper 接口
@@ -43,7 +43,7 @@ public interface TEExamStudentMapper extends BaseMapper<TEExamStudent> {
     public IPage<TEExamStudentDto> examStudentQuery(IPage<Map> iPage, @Param("examId") Long examId,
                                                     @Param("activityId") Long activityId, @Param("identity") String identity, @Param("name") String name,
                                                     @Param("roomCode") String roomCode, @Param("courseCode") String courseCode, @Param("grade") String grade,
-                                                    @Param("enable") Integer enable, @Param("classNo") String classNo, @Param("hasPhoto")Integer hasPhoto);
+                                                    @Param("enable") Integer enable, @Param("classNo") String classNo, @Param("hasPhoto") Integer hasPhoto);
 
     public List<Map<String, Object>> getTotalCount(@Param("examId") Long examId, @Param("activityId") Long activityId,
                                                    @Param("roomCode") String roomCode, @Param("courseCode") String courseCode);
@@ -62,23 +62,24 @@ public interface TEExamStudentMapper extends BaseMapper<TEExamStudent> {
      * @return
      */
     public List<RoomCodeQueryDto> examRoomQuery(@Param("roomName") String roomName);
-    
+
     public IPage<ExamDeficiencyListBean> getExamDeficiencyPage(IPage<ExamDeficiencyListBean> iPage, @Param("examId") Long examId,
-			@Param("activityId") Long activityId, @Param("roomCode") String roomCode,
-			@Param("courseCode") String courseCode, @Param("name") String name, @Param("identity") String identity,@Param("activityIds") List<Long> activityIds);
+                                                               @Param("activityId") Long activityId, @Param("roomCode") String roomCode,
+                                                               @Param("courseCode") String courseCode, @Param("name") String name, @Param("identity") String identity, @Param("activityIds") List<Long> activityIds);
 
     public IPage<ExamStudentLogListBean> getPageForStudentLog(IPage<ExamStudentLogListBean> iPage, @Param("examId") Long examId,
-			@Param("activityId") Long activityId, @Param("roomCode") String roomCode,
-			@Param("courseCode") String courseCode, @Param("name") String name, @Param("identity") String identity);
+                                                              @Param("activityId") Long activityId, @Param("roomCode") String roomCode,
+                                                              @Param("courseCode") String courseCode, @Param("name") String name, @Param("identity") String identity);
+
 
-	
     public List<TEExamStudentDto> examStudentList(@Param("examId") Long examId,
-            @Param("activityId") Long activityId, @Param("identity") String identity, @Param("name") String name,
-            @Param("roomCode") String roomCode, @Param("courseCode") String courseCode, @Param("grade") String grade,
-            @Param("enable") Integer enable, @Param("classNo") String classNo, @Param("hasPhoto")Integer hasPhoto);
+                                                  @Param("activityId") Long activityId, @Param("identity") String identity, @Param("name") String name,
+                                                  @Param("roomCode") String roomCode, @Param("courseCode") String courseCode, @Param("grade") String grade,
+                                                  @Param("enable") Integer enable, @Param("classNo") String classNo, @Param("hasPhoto") Integer hasPhoto);
 
-	public void updateAlreadyExamCount(@Param("examStudentId")Long examStudentId,@Param("alreadyExamCount") Integer alreadyExamCount);
+    public void updateAlreadyExamCount(@Param("examStudentId") Long examStudentId, @Param("alreadyExamCount") Integer alreadyExamCount);
 
-	public void updateCurrentRecordId(@Param("examStudentId")Long examStudentId,@Param("currentRecordId") Long currentRecordId);
+    public void updateCurrentRecordId(@Param("examStudentId") Long examStudentId, @Param("currentRecordId") Long currentRecordId);
 
+    public IPage<MarkResultDto> markResultQuery(IPage<Map> iPage, @Param("examId") Long examId, @Param("activityId") Long activityId, @Param("identity") String identity, @Param("name") String name, @Param("courseCode") String courseCode);
 }

+ 217 - 0
themis-business/src/main/java/com/qmth/themis/business/dto/response/MarkResultDto.java

@@ -0,0 +1,217 @@
+package com.qmth.themis.business.dto.response;
+
+import com.fasterxml.jackson.databind.annotation.JsonSerialize;
+import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
+import io.swagger.annotations.ApiModelProperty;
+
+import java.io.Serializable;
+
+/**
+ * @Description: 成绩查询
+ * @Param:
+ * @return:
+ * @Author: wangliang
+ * @Date: 2020/10/19
+ */
+public class MarkResultDto implements Serializable {
+
+    @ApiModelProperty(name = "考试场次code")
+    private String examActivityCode;
+
+    @ApiModelProperty(name = "学生姓名")
+    private String name;
+
+    @ApiModelProperty(name = "证件号")
+    private String identity;
+
+    @ApiModelProperty(name = "科目代码")
+    private String courseCode;
+
+    @ApiModelProperty(name = "科目名称")
+    private String courseName;
+
+    @ApiModelProperty(name = "考场代码")
+    private String roomCode;
+
+    @ApiModelProperty(name = "考场名称")
+    private String roomName;
+
+    @ApiModelProperty(value = "年级")
+    private String grade;
+
+    @ApiModelProperty(value = "教学班级")
+    private String classNo;
+
+    @ApiModelProperty(value = "缺考")
+    private Boolean examAbsent;
+
+    @ApiModelProperty(value = "违纪次数")
+    private Integer breachCount;
+
+    @ApiModelProperty(value = "考试次数")
+    private Integer examCount;
+
+    @ApiModelProperty(value = "客观分")
+    private Double objectiveScore;
+
+    @ApiModelProperty(value = "主观分")
+    private Double subjectiveScore;
+
+    @ApiModelProperty(value = "总分")
+    private Double sumScore;
+
+    @JsonSerialize(using = ToStringSerializer.class)
+    @ApiModelProperty(value = "批次id")
+    private Long examId;
+
+    @JsonSerialize(using = ToStringSerializer.class)
+    @ApiModelProperty(value = "场次id")
+    private Long examActivityId;
+
+    @ApiModelProperty(value = "批次名称")
+    private String examName;
+
+    public Long getExamId() {
+        return examId;
+    }
+
+    public void setExamId(Long examId) {
+        this.examId = examId;
+    }
+
+    public Long getExamActivityId() {
+        return examActivityId;
+    }
+
+    public void setExamActivityId(Long examActivityId) {
+        this.examActivityId = examActivityId;
+    }
+
+    public String getExamName() {
+        return examName;
+    }
+
+    public void setExamName(String examName) {
+        this.examName = examName;
+    }
+
+    public String getExamActivityCode() {
+        return examActivityCode;
+    }
+
+    public void setExamActivityCode(String examActivityCode) {
+        this.examActivityCode = examActivityCode;
+    }
+
+    public String getName() {
+        return name;
+    }
+
+    public void setName(String name) {
+        this.name = name;
+    }
+
+    public String getIdentity() {
+        return identity;
+    }
+
+    public void setIdentity(String identity) {
+        this.identity = identity;
+    }
+
+    public String getCourseCode() {
+        return courseCode;
+    }
+
+    public void setCourseCode(String courseCode) {
+        this.courseCode = courseCode;
+    }
+
+    public String getCourseName() {
+        return courseName;
+    }
+
+    public void setCourseName(String courseName) {
+        this.courseName = courseName;
+    }
+
+    public String getRoomCode() {
+        return roomCode;
+    }
+
+    public void setRoomCode(String roomCode) {
+        this.roomCode = roomCode;
+    }
+
+    public String getRoomName() {
+        return roomName;
+    }
+
+    public void setRoomName(String roomName) {
+        this.roomName = roomName;
+    }
+
+    public String getGrade() {
+        return grade;
+    }
+
+    public void setGrade(String grade) {
+        this.grade = grade;
+    }
+
+    public String getClassNo() {
+        return classNo;
+    }
+
+    public void setClassNo(String classNo) {
+        this.classNo = classNo;
+    }
+
+    public Boolean getExamAbsent() {
+        return examAbsent;
+    }
+
+    public void setExamAbsent(Boolean examAbsent) {
+        this.examAbsent = examAbsent;
+    }
+
+    public Integer getBreachCount() {
+        return breachCount;
+    }
+
+    public void setBreachCount(Integer breachCount) {
+        this.breachCount = breachCount;
+    }
+
+    public Integer getExamCount() {
+        return examCount;
+    }
+
+    public void setExamCount(Integer examCount) {
+        this.examCount = examCount;
+    }
+
+    public Double getObjectiveScore() {
+        return objectiveScore;
+    }
+
+    public void setObjectiveScore(Double objectiveScore) {
+        this.objectiveScore = objectiveScore;
+    }
+
+    public Double getSubjectiveScore() {
+        return subjectiveScore;
+    }
+
+    public void setSubjectiveScore(Double subjectiveScore) {
+        this.subjectiveScore = subjectiveScore;
+    }
+
+    public Double getSumScore() {
+        return sumScore;
+    }
+
+    public void setSumScore(Double sumScore) {
+        this.sumScore = sumScore;
+    }
+}

+ 18 - 4
themis-business/src/main/java/com/qmth/themis/business/service/TEExamStudentService.java

@@ -3,6 +3,7 @@ package com.qmth.themis.business.service;
 import com.baomidou.mybatisplus.core.metadata.IPage;
 import com.baomidou.mybatisplus.extension.service.IService;
 import com.qmth.themis.business.cache.bean.ExamStudentCacheBean;
+import com.qmth.themis.business.dto.response.MarkResultDto;
 import com.qmth.themis.business.dto.response.RoomCodeQueryDto;
 import com.qmth.themis.business.dto.response.TEExamStudentDto;
 import com.qmth.themis.business.entity.TEExamStudent;
@@ -34,10 +35,10 @@ public interface TEExamStudentService extends IService<TEExamStudent> {
      * @param classNo
      * @return
      */
-    public IPage<TEExamStudentDto> examStudentQuery(IPage<Map> iPage, Long examId, Long activityId, String identity, String name, String roomCode, String courseCode, String grade, Integer enable, String classNo,Integer hasPhoto);
+    public IPage<TEExamStudentDto> examStudentQuery(IPage<Map> iPage, Long examId, Long activityId, String identity, String name, String roomCode, String courseCode, String grade, Integer enable, String classNo, Integer hasPhoto);
+
+    public List<TEExamStudentDto> examStudentList(Long examId, Long activityId, String identity, String name, String roomCode, String courseCode, String grade, Integer enable, String classNo, Integer hasPhoto);
 
-    public List<TEExamStudentDto> examStudentList(Long examId, Long activityId, String identity, String name, String roomCode, String courseCode, String grade, Integer enable, String classNo,Integer hasPhoto);
-    
     ExamStudentCacheBean getExamStudentCacheBean(Long examStudentId);
 
     /**
@@ -63,5 +64,18 @@ public interface TEExamStudentService extends IService<TEExamStudent> {
      */
     public List<RoomCodeQueryDto> examRoomQuery(String roomName);
 
-	void updateByMqMsg(Map<String, Object> param);
+    void updateByMqMsg(Map<String, Object> param);
+
+    /**
+     * 查询学生成绩信息
+     *
+     * @param iPage
+     * @param examId
+     * @param activityId
+     * @param identity
+     * @param name
+     * @param courseCode
+     * @return
+     */
+    public IPage<MarkResultDto> markResultQuery(IPage<Map> iPage, Long examId, Long activityId, String identity, String name, String courseCode);
 }

+ 17 - 0
themis-business/src/main/java/com/qmth/themis/business/service/impl/TEExamStudentServiceImpl.java

@@ -4,6 +4,7 @@ import com.baomidou.mybatisplus.core.metadata.IPage;
 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
 import com.qmth.themis.business.cache.bean.ExamStudentCacheBean;
 import com.qmth.themis.business.dao.TEExamStudentMapper;
+import com.qmth.themis.business.dto.response.MarkResultDto;
 import com.qmth.themis.business.dto.response.RoomCodeQueryDto;
 import com.qmth.themis.business.dto.response.TEExamStudentDto;
 import com.qmth.themis.business.entity.TEExamStudent;
@@ -142,4 +143,20 @@ public class TEExamStudentServiceImpl extends ServiceImpl<TEExamStudentMapper, T
             teExamStudentMapper.updateCurrentRecordId(examStudentId, currentRecordId);
         }
     }
+
+    /**
+     * 查询学生成绩信息
+     *
+     * @param iPage
+     * @param examId
+     * @param activityId
+     * @param identity
+     * @param name
+     * @param courseCode
+     * @return
+     */
+    @Override
+    public IPage<MarkResultDto> markResultQuery(IPage<Map> iPage, Long examId, Long activityId, String identity, String name, String courseCode) {
+        return teExamStudentMapper.markResultQuery(iPage, examId, activityId, identity, name, courseCode);
+    }
 }

+ 3 - 1
themis-business/src/main/resources/db/init.sql

@@ -512,8 +512,9 @@ INSERT INTO `t_b_privilege` VALUES (155, '进度查询列表导出', '/api/admin
 INSERT INTO `t_b_privilege` VALUES (156, '报表-考情监控-预警时间趋势', '/api/admin/report/examination_monitor/warn_msg', 'LINK', 60, 41, NULL, 1600932652000);
 INSERT INTO `t_b_privilege` VALUES (157, '候考/答题状态退出', '/api/oe/exam/exit', 'LINK', 60, 42, NULL, 1600932652000);
 INSERT INTO `t_b_privilege` VALUES (158, '监考端通话中', '/api/admin/monitor/call/calling', 'LINK', 10, 6, NULL, 1600932652000);
-INSERT INTO `t_b_privilege` VALUES (159, '成绩查询', 'markResult', 'MENU', 4, 8, NULL, 1600932652000);
+INSERT INTO `t_b_privilege` VALUES (159, '成绩查询', 'MarkResultManagement', 'MENU', 4, 8, NULL, 1600932652000);
 INSERT INTO `t_b_privilege` VALUES (160, '预警提醒清除未阅列表', '/api/admin/invigilate/warn/approveStatus/list/update', 'LINK', 60, 43, NULL, 1600932652000);
+INSERT INTO `t_b_privilege` VALUES (161, '成绩查询接口', '/api/admin/examStudent/mark/result', 'LINK', 159, 1, NULL, 1600932652000);
 COMMIT;
 
 -- ----------------------------
@@ -748,6 +749,7 @@ INSERT INTO `t_b_role_privilege` VALUES (196, 'INVIGILATE', 158);
 INSERT INTO `t_b_role_privilege` VALUES (197, 'ADMIN', 159);
 INSERT INTO `t_b_role_privilege` VALUES (198, 'ADMIN', 160);
 INSERT INTO `t_b_role_privilege` VALUES (199, 'INVIGILATE', 160);
+INSERT INTO `t_b_role_privilege` VALUES (200, 'ADMIN', 161);
 COMMIT;
 
 -- ----------------------------

+ 62 - 1
themis-business/src/main/resources/mapper/TEExamStudentMapper.xml

@@ -67,6 +67,7 @@
 			</if>
 		</where>
 	</select>
+
 	<select id="examStudentList"
 		resultType="com.qmth.themis.business.dto.response.TEExamStudentDto">
 		select
@@ -278,5 +279,65 @@
 	<update id="updateCurrentRecordId">
 	update t_e_exam_student set current_record_id=#{currentRecordId} where id=#{examStudentId} and (current_record_id is null or current_record_id &lt; #{currentRecordId})
 	</update>
-	
+
+	<select id="markResultQuery" resultType="com.qmth.themis.business.dto.response.MarkResultDto">
+		select
+			t.examActivityCode,
+			t.name,
+			t.identity,
+			t.courseCode,
+			t.courseName,
+			t.roomCode,
+			t.roomName,
+			t.grade,
+			t.classNo,
+			if(t.examCount <![CDATA[ <= ]]> 0,true,false) as examAbsent,
+			t.examCount,
+			t.examName,
+			if(t.breachCount is null,0,t.breachCount) as breachCount,
+			ifnull(t.objectiveScore,0) as objectiveScore,
+			ifnull(t.objectiveScore,0) as sumScore,
+			t.examId,
+			t.examActivityId,
+			0 as subjectiveScore
+			from
+			(
+			select
+			tee.id as examId,tee.name as examName,teea.id as examActivityId, teea.code as examActivityCode, tes.name, tes.`identity`, tees.course_code as courseCode, tees.course_name as courseName, tees.room_code as roomCode, tees.room_name as roomName, tees.grade, tees.class_no as classNo, (
+			select
+			count(1)
+			from
+			t_oe_exam_record toer
+			where
+			toer.exam_student_id = tees.id) as examCount,
+			(select sum(toer.breach_status) from t_oe_exam_record toer
+			where toer.exam_student_id = tees.id and toer.breach_status = 0) as breachCount,
+			(select max(toer.objective_score) from t_oe_exam_record toer
+			where toer.exam_student_id = tees.id and (toer.breach_status = 1 or breach_status is null) and (toer.status = 'FINISHED' or toer.status = 'PERSISTED')) as objectiveScore
+			from
+			t_e_student tes
+			left join t_e_exam_student tees on
+			tees.student_id = tes.id
+			left join t_e_exam tee on
+			tee.id = tees.exam_id
+			left join t_e_exam_activity teea on
+			teea.id = tees.exam_activity_id
+			<where>
+				<if test="examId != null and examId != ''">
+					and tee.id = #{examId}
+				</if>
+				<if test="activityId != null and activityId != ''">
+					and teea.id = #{activityId}
+				</if>
+				<if test="identity != null and identity != ''">
+					and tes.identity like concat('%', #{identity}, '%')
+				</if>
+				<if test="name != null and name != ''">
+					and tes.name like concat('%', #{name}, '%')
+				</if>
+				<if test="courseCode != null and courseCode != ''">
+					and tees.course_code = #{courseCode}
+				</if>
+			</where> ) t
+	</select>
 </mapper>