diff --git a/servers/boe-server-all/src/main/java/com/xboe/school/study/dao/StudyExamDao.java b/servers/boe-server-all/src/main/java/com/xboe/school/study/dao/StudyExamDao.java index 1b7eb5f8..f1bb62e8 100644 --- a/servers/boe-server-all/src/main/java/com/xboe/school/study/dao/StudyExamDao.java +++ b/servers/boe-server-all/src/main/java/com/xboe/school/study/dao/StudyExamDao.java @@ -11,7 +11,7 @@ import java.util.List; public class StudyExamDao extends BaseDao { public List getAllStudyExamByStudyId() { - String hql1 = "SELECT course_id,study_id,student_id FROM boe_study_exam GROUP BY study_id"; + String hql1 = "SELECT courseId,studyId,studentId FROM boe_study_exam GROUP BY study_id"; List listByHql = super.findListByHql(hql1); return listByHql; } diff --git a/servers/boe-server-all/src/main/java/com/xboe/school/study/service/impl/StudyExamServiceImpl.java b/servers/boe-server-all/src/main/java/com/xboe/school/study/service/impl/StudyExamServiceImpl.java index 2713f795..a247a654 100644 --- a/servers/boe-server-all/src/main/java/com/xboe/school/study/service/impl/StudyExamServiceImpl.java +++ b/servers/boe-server-all/src/main/java/com/xboe/school/study/service/impl/StudyExamServiceImpl.java @@ -6,6 +6,8 @@ import java.util.List; import javax.annotation.Resource; import javax.transaction.Transactional; +import com.xboe.core.orm.QueryBuilder; +import com.xboe.system.user.entity.Message; import lombok.extern.slf4j.Slf4j; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; @@ -110,7 +112,19 @@ public class StudyExamServiceImpl implements IStudyExamService{ @Override public void correctStstus() { - List list = dao.getAllStudyExamByStudyId(); + List list = null; + try { + list = dao.getAllStudyExamByStudyId(); + } catch (Exception exception) { + exception.printStackTrace(); + } + + QueryBuilder builder = QueryBuilder.from(StudyExam.class); + builder.addGroupBy("studyId"); + builder.addOrder(OrderCondition.desc("msgTime")); + List list1 = dao.findList(builder.builder()); + + log.info("QueryBuilder list1.size = " + list1.size() + ",0 = " + list1.get(0)); log.info("list.size = " + list.size() + ",0 = " + list.get(0)); for(StudyExam item : list){ log.info("CourseId = " + item.getCourseId() + " , StudyId = " + item.getStudyId() + " , StudentId = " + item.getStudentId());