|
@@ -26,7 +26,6 @@ import java.util.stream.Collectors;
|
|
|
import javax.persistence.EntityManager;
|
|
|
import javax.persistence.Query;
|
|
|
|
|
|
-import cn.com.qmth.examcloud.examwork.api.request.GetExamListReq;
|
|
|
import org.apache.commons.lang3.StringUtils;
|
|
|
import org.hibernate.query.NativeQuery;
|
|
|
import org.hibernate.transform.Transformers;
|
|
@@ -309,13 +308,14 @@ public class ExamStudentServiceImpl implements ExamStudentService {
|
|
|
ExamSettingsCacheBean examBean = ExamCacheTransferHelper.getDefaultCachedExam(query.getExamId());
|
|
|
|
|
|
List<ExamStudentEntity> examStudentList=new ArrayList<ExamStudentEntity>();
|
|
|
- Long startId=0L;
|
|
|
+ int pageNo=1;
|
|
|
+ int pageSize=500;
|
|
|
for(;;) {
|
|
|
- List<ExamStudentEntity> tem=getExamStudentInfoListByPage(query, examBean, startId);
|
|
|
+ List<ExamStudentEntity> tem=getExamStudentInfoListByPage(query, examBean, pageNo,pageSize);
|
|
|
if(tem==null||tem.size()==0) {
|
|
|
break;
|
|
|
}else {
|
|
|
- startId=tem.get(tem.size()-1).getId();
|
|
|
+ pageNo++;
|
|
|
examStudentList.addAll(tem);
|
|
|
}
|
|
|
}
|
|
@@ -395,7 +395,7 @@ public class ExamStudentServiceImpl implements ExamStudentService {
|
|
|
};
|
|
|
tool.setDataForBatch(dataList, 100);
|
|
|
}
|
|
|
- private List<ExamStudentEntity> getExamStudentInfoListByPage(ExamStudentQuery query,ExamSettingsCacheBean examBean,Long startId) {
|
|
|
+ private List<ExamStudentEntity> getExamStudentInfoListByPage(ExamStudentQuery query,ExamSettingsCacheBean examBean,int pageNo,int pageSize) {
|
|
|
//查询条件
|
|
|
StringBuffer sql = new StringBuffer();
|
|
|
sql.append("select id,exam_student_id,exam_id,course_id,course_code,course_level");
|
|
@@ -409,8 +409,8 @@ public class ExamStudentServiceImpl implements ExamStudentService {
|
|
|
+ ",info_collector,root_org_id,org_id,paper_type,used_num,extra_num"
|
|
|
+ ",specialty_code,specialty_name,grade from ec_oe_exam_student t1 where 1=1 ");
|
|
|
sql.append(selectExamStudentConfitionSql(query, examBean.getExamType()));
|
|
|
- sql.append(" and id >"+startId);
|
|
|
- sql.append(" order by id limit 500");
|
|
|
+ int currentNum = (pageNo - 1) * pageSize;
|
|
|
+ sql.append(" order by id limit "+currentNum+","+pageSize);
|
|
|
|
|
|
List<ExamStudentEntity> examStudentList = jdbcTemplate.query(sql.toString(), new RowMapper<ExamStudentEntity>() {
|
|
|
@Override
|