package com.qxueyou.scc.admin.score.dao;
|
|
import org.springframework.stereotype.Repository;
|
|
import com.qxueyou.scc.base.dao.BaseDAO;
|
import com.qxueyou.scc.base.util.CollectionUtils;
|
import com.qxueyou.scc.exercise.model.ExerciseCompleteInfo;
|
|
@Repository
|
public class HomeworkScoreVDAO extends BaseDAO {
|
|
public int getHomeworkCount(String classId) {
|
|
String hql = "select count(distinct id.homeworkId) from HomeworkScoreV where classId=?";
|
|
return this.findCount(hql, CollectionUtils.newList(classId));
|
}
|
|
public int getHomeworkToAuditCount(String classId) {
|
|
String hql = "from HomeworkScoreV where classId=? and completeStatus=?";
|
|
return this.findCount(hql, CollectionUtils.newList(classId,
|
String.valueOf(ExerciseCompleteInfo.STATUS_COMMIT)));
|
}
|
|
public int getHomeworkHasAuditCount(String classId) {
|
|
String hql = "from HomeworkScoreV where classId=? and completeStatus=?";
|
|
return this.findCount(hql, CollectionUtils.newList(classId,
|
String.valueOf(ExerciseCompleteInfo.STATUS_CHECKED)));
|
}
|
|
public int getHomeworkNoSubmitCount(String classId) {
|
|
String hql = "from HomeworkScoreV where classId=? and coalesce(completeStatus,0) in(?,?)";
|
|
return this.findCount(hql, CollectionUtils.newList(classId,
|
String.valueOf(ExerciseCompleteInfo.STATUS_DRAFT),
|
String.valueOf(ExerciseCompleteInfo.STATUS_REDO)));
|
}
|
|
}
|