|
@@ -212,21 +212,22 @@ public class ExamRecordForMarkingServiceImpl implements ExamRecordForMarkingServ
|
|
return null;
|
|
return null;
|
|
}
|
|
}
|
|
StringBuffer sql = new StringBuffer();
|
|
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) {
|
|
if (id != null) {
|
|
- sql.append(" and id = " + id);
|
|
|
|
|
|
+ sql.append(" and t.id = " + id);
|
|
}
|
|
}
|
|
if (examId != null) {
|
|
if (examId != null) {
|
|
- sql.append(" and exam_id = " + examId);
|
|
|
|
|
|
+ sql.append(" and t.exam_id = " + examId);
|
|
}
|
|
}
|
|
if (courseId != null) {
|
|
if (courseId != null) {
|
|
- sql.append(" and course_id = '" + courseId + "'");
|
|
|
|
|
|
+ sql.append(" and t.course_id = '" + courseId + "'");
|
|
}
|
|
}
|
|
if (StringUtils.isNotEmpty(batchNum)) {
|
|
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>() {
|
|
return jdbcTemplate.query(sql.toString(), new RowMapper<ExamRecordForMarkingEntity>() {
|
|
@Override
|
|
@Override
|
|
public ExamRecordForMarkingEntity mapRow(ResultSet rs, int arg1) throws SQLException {
|
|
public ExamRecordForMarkingEntity mapRow(ResultSet rs, int arg1) throws SQLException {
|