|
@@ -337,27 +337,22 @@ public class ExamRecordServiceImpl implements ExamRecordService {
|
|
|
* @return
|
|
|
*/
|
|
|
private Page<ExamRecordInfo> _getExamRecordDetailListForPage(ExamRecordQuery query) {
|
|
|
- //分页条件
|
|
|
-// int currentNum = (query.getPageNo() - 1) * query.getPageSize();
|
|
|
Check.isNull(query, "查询参数不能为空!");
|
|
|
Check.isNull(query.getExamId(), "请先选择考试批次!");
|
|
|
//查询条件
|
|
|
StringBuilder sqlBuilder = new StringBuilder();
|
|
|
sqlBuilder.append(EXAM_RECORD_SQL);
|
|
|
- StringBuilder condition = buildExamRecordCommonSelectCondition(query);
|
|
|
- sqlBuilder.append(condition);
|
|
|
- String otherCondition = " and ((record_data.is_warn = 0) OR (record_data.is_warn = 1 and record_data.is_audit = 1))";
|
|
|
- sqlBuilder.append(otherCondition);
|
|
|
-// String idBuilder = "select id from ec_oe_exam_record_data record_data where 1 = 1" + condition + otherCondition+
|
|
|
-// " order by record_data.id desc limit " + currentNum + ",1 ";
|
|
|
-// sqlBuilder.append(" and record_data.id <=(").append(idBuilder).append(")");
|
|
|
+ sqlBuilder.append(buildExamRecordCommonSelectCondition(query));
|
|
|
+ sqlBuilder.append(" and ((record_data.is_warn = 0) OR (record_data.is_warn = 1 and record_data.is_audit = 1))");
|
|
|
sqlBuilder.append(" group by record_data.id ");
|
|
|
//根据ip查询
|
|
|
/*if (StringUtils.isNoneBlank(query.getIp())) {
|
|
|
sqlBuilder.append(" having ip like '%"+query.getIp()+"%' ");
|
|
|
}*/
|
|
|
sqlBuilder.append(" order by record_data.id desc");
|
|
|
- sqlBuilder.append(" limit " + query.getPageSize());
|
|
|
+ //分页条件
|
|
|
+ int currentNum = (query.getPageNo() - 1) * query.getPageSize();
|
|
|
+ sqlBuilder.append(" limit " + currentNum + "," + query.getPageSize());
|
|
|
List<ExamRecordDataEntity> examRecordDataList = jdbcTemplate.query(sqlBuilder.toString(), new RowMapper<ExamRecordDataEntity>() {
|
|
|
@Override
|
|
|
public ExamRecordDataEntity mapRow(ResultSet rs, int rowNum) throws SQLException {
|