hql查找最大最小

@Query(“select COALESCE(min(h.beginDate),0) from ExamAnswersheetResult h where h.deleted = false and h.beginDate != 0 and h.exam.id = :examId and h.student.id = :studentId “)
Long findMinBeginTime(@Param(“examId”) String examId, @Param(“studentId”) String studentId);

@Query(“select COALESCE(min(ear.beginDate),0) from ExamAnswersheetResult ear where ear.deleted= false and ear.beginDate != 0 and ear.exam.id=:examId and ear.student.id=:studentId “)
Long getMinBeginTime(@Param(“examId”) String examId, @Param(“studentId”) String studentId);