xiatian 1 год назад
Родитель
Сommit
ee02dbdfc9

+ 8 - 7
examcloud-core-oe-admin-service/src/main/java/cn/com/qmth/examcloud/core/oe/admin/service/impl/ExamRecordForMarkingServiceImpl.java

@@ -212,21 +212,22 @@ public class ExamRecordForMarkingServiceImpl implements ExamRecordForMarkingServ
             return null;
         }
         StringBuffer sql = new StringBuffer();
-        sql.append("select id,exam_id,exam_record_data_id,base_paper_id,paper_type,course_id,batch_num " +
-                " from ec_oe_exam_record_4_marking where 1=1 ");
+        sql.append("select t.id,t.exam_id,t.exam_record_data_id,t.base_paper_id,t.paper_type,t.course_id,t.batch_num " +
+                " from ec_oe_exam_record_4_marking t left join ec_oe_exam_record_data f  "
+        		+" on t.exam_record_data_id=f.id  where f.random_paper=0 ");
         if (id != null) {
-            sql.append(" and id = " + id);
+            sql.append(" and t.id = " + id);
         }
         if (examId != null) {
-            sql.append(" and exam_id = " + examId);
+            sql.append(" and t.exam_id = " + examId);
         }
         if (courseId != null) {
-            sql.append(" and course_id = '" + courseId + "'");
+            sql.append(" and t.course_id = '" + courseId + "'");
         }
         if (StringUtils.isNotEmpty(batchNum)) {
-            sql.append(" and (batch_num is null or batch_num != '" + batchNum + "')");
+            sql.append(" and (t.batch_num is null or t.batch_num != '" + batchNum + "')");
         }
-        sql.append(" group by base_paper_id");
+        sql.append(" group by t.base_paper_id");
         return jdbcTemplate.query(sql.toString(), new RowMapper<ExamRecordForMarkingEntity>() {
             @Override
             public ExamRecordForMarkingEntity mapRow(ResultSet rs, int arg1) throws SQLException {