deason пре 10 месеци
родитељ
комит
08b0068ae6

+ 5 - 6
examcloud-core-oe-admin-service/src/main/java/cn/com/qmth/examcloud/core/oe/admin/service/impl/ExamRecordAlreadyAuditServiceImpl.java

@@ -197,9 +197,12 @@ public class ExamRecordAlreadyAuditServiceImpl implements ExamRecordAlreadyAudit
         sql.append(" where rd.exam_id = ").append(query.getExamId());
         sql.append(" and rd.exam_record_status != 'EXAM_INVALID'");
 
+        if (query.getExamRecordDataId() != null) {
+            sql.append(" and rd.id = ").append(query.getExamRecordDataId());
+        }
+
         sql.append(" and exists (");
-        sql.append(" select aa.exam_record_data_id from ec_oe_exam_audit aa");
-        sql.append(" where aa.exam_record_data_id = rd.id");
+        sql.append(" select 1 from ec_oe_exam_audit aa where aa.exam_record_data_id = rd.id");
         if (StringUtils.isNotBlank(query.getStatus())) {
             sql.append(" and aa.status = '").append(query.getStatus()).append("'");
         }
@@ -233,10 +236,6 @@ public class ExamRecordAlreadyAuditServiceImpl implements ExamRecordAlreadyAudit
         }
         sql.append(" )");
 
-        if (query.getExamRecordDataId() != null) {
-            sql.append(" and rd.id = ").append(query.getExamRecordDataId());
-        }
-
         if (courseRule.assertNeedQueryRefIds()) {
             // 限定课程数据权限范围
             if (query.getCourseId() != null) {

+ 3 - 2
examcloud-core-oe-admin-service/src/main/java/cn/com/qmth/examcloud/core/oe/admin/service/impl/ExamRecordIllegallyServiceImpl.java

@@ -169,9 +169,10 @@ public class ExamRecordIllegallyServiceImpl implements ExamRecordIllegallyServic
 
         sql.append(" where rd.exam_id = ").append(query.getExamId());
         sql.append(" and rd.exam_record_status != 'EXAM_INVALID'");
+
         sql.append(" and exists (");
-        sql.append(" select aa.exam_record_data_id from ec_oe_exam_audit aa");
-        sql.append(" where aa.exam_record_data_id = rd.id and aa.status = 'UN_PASS'");
+        sql.append(" select 1 from ec_oe_exam_audit aa where aa.exam_record_data_id = rd.id");
+        sql.append(" and aa.status = 'UN_PASS'");
         if (StringUtils.isNotBlank(query.getDisciplineType())) {
             sql.append(" and aa.discipline_type = '").append(query.getDisciplineType()).append("'");
         }

+ 12 - 14
examcloud-core-oe-admin-service/src/main/java/cn/com/qmth/examcloud/core/oe/admin/service/impl/ExamRecordWaitingAuditServiceImpl.java

@@ -130,15 +130,17 @@ public class ExamRecordWaitingAuditServiceImpl implements ExamRecordWaitingAudit
 
         sql.append(" where rd.exam_id = ").append(query.getExamId());
         sql.append(" and rd.exam_record_status in ('EXAM_END','EXAM_OVERDUE')");
-        sql.append(" and rd.is_audit = 0");
-        sql.append(" and rd.is_illegality = 0");
-        if (query.getIsWarn() != null) {
-            sql.append(" and rd.is_warn = ").append(query.getIsWarn() ? "1" : "0");
-        }
+
         if (query.getExamRecordId() != null) {
             sql.append(" and rd.id = ").append(query.getExamRecordId());
         }
 
+        if (query.getIsWarn() != null) {
+            sql.append(" and rd.is_warn = ").append(query.getIsWarn() ? "1" : "0");
+        }
+        sql.append(" and rd.is_audit = 0");
+        sql.append(" and rd.is_illegality = 0");
+
         if (courseRule.assertNeedQueryRefIds()) {
             // 限定课程数据权限范围
             if (query.getCourseId() != null) {
@@ -222,15 +224,11 @@ public class ExamRecordWaitingAuditServiceImpl implements ExamRecordWaitingAudit
         }
 
         if (query.getHasVirtual() != null) {
-            if (query.getHasVirtual()) {
-                sql.append(" and exists(");
-                sql.append(" select 1 from ec_oe_exam_capture_camera_info v where v.exam_record_data_id = rd.id and v.virtual_camera = 1");
-                sql.append(" )");
-            } else {
-                sql.append(" and not exists(");
-                sql.append(" select 1 from ec_oe_exam_capture_camera_info v where v.exam_record_data_id = rd.id and v.virtual_camera = 1");
-                sql.append(" )");
-            }
+            sql.append(" and").append(query.getHasVirtual() ? " exists" : " not exists");
+            sql.append(" (");
+            sql.append(" select 1 from ec_oe_exam_capture_camera_info v where v.exam_record_data_id = rd.id");
+            sql.append(" and v.virtual_camera = 1");
+            sql.append(" )");
         }
 
         if (StringUtils.isNotBlank(query.getWarnType())) {