派生自 projectDept/qhighschool

EricsHu
2023-11-25 79ab2cbd31c022916a8e696903d5eb34b70aa403
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
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)));
    }
 
}