Browse Source

Merge remote-tracking branch 'origin/ywx' into wn_j

# Conflicts:
#	sexam/src/main/java/com/xhkjedu/sexam/service/report/EReportGenerateService.java
tags/正式版本
王宁 2 years ago
parent
commit
37fc2ad3fc

+ 6
- 6
sexam/src/main/java/com/xhkjedu/sexam/controller/paper/EPaperCorrectTeacherController.java View File

81
     @PostMapping("/get_cq")
81
     @PostMapping("/get_cq")
82
     public ResultVo getCorrectQuestion(@RequestBody EPTeacherVo vo) {
82
     public ResultVo getCorrectQuestion(@RequestBody EPTeacherVo vo) {
83
         Integer teacherid = vo.getTeacherid();
83
         Integer teacherid = vo.getTeacherid();
84
-        String eptqids = vo.getEptqids();
84
+        Integer eptqid = vo.getEptqid();
85
         Integer esid = vo.getEsid();
85
         Integer esid = vo.getEsid();
86
-        N_Utils.validation(new Object[]{teacherid, "教师id", 1, eptqids, "试卷试题ids", 2, esid, "考试科目id", 1});
87
-        return correctTeacherService.getCorrectQuestion(teacherid, eptqids, vo.getClassids(), esid);
86
+        N_Utils.validation(new Object[]{teacherid, "教师id", 1, eptqid, "试卷试题id", 1, esid, "考试科目id", 1});
87
+        return correctTeacherService.getCorrectQuestion(teacherid, eptqid, vo.getClassids(), esid);
88
     }
88
     }
89
 
89
 
90
     /**
90
     /**
97
      **/
97
      **/
98
     @PostMapping("/get_pre")
98
     @PostMapping("/get_pre")
99
     public ResultVo getPreQuestion(@RequestBody EPTeacherVo vo) {
99
     public ResultVo getPreQuestion(@RequestBody EPTeacherVo vo) {
100
-        Integer epid = vo.getEpid();
100
+        Integer eptqid = vo.getEptqid();
101
         Integer teacherid = vo.getTeacherid();
101
         Integer teacherid = vo.getTeacherid();
102
-        N_Utils.validation(new Object[]{epid, "试卷id", 1, teacherid, "教师id", 1});
103
-        return correctTeacherService.getPreQuestion(epid, teacherid);
102
+        N_Utils.validation(new Object[]{eptqid, "试卷试题id", 1, teacherid, "教师id", 1});
103
+        return correctTeacherService.getPreQuestion(eptqid, teacherid);
104
     }
104
     }
105
 
105
 
106
     /**
106
     /**

+ 2
- 2
sexam/src/main/java/com/xhkjedu/sexam/mapper/paper/EPaperCorrectTeacherMapper.java View File

16
 
16
 
17
     //随机获取一条待批阅试题
17
     //随机获取一条待批阅试题
18
     EPaperSQuestionVo getCorrectQuestion(@Param("teacherid") Integer teacherid,
18
     EPaperSQuestionVo getCorrectQuestion(@Param("teacherid") Integer teacherid,
19
-                                         @Param("eptqids") String eptqids, @Param("classids") String classids);
19
+                                         @Param("eptqid") Integer eptqid, @Param("classids") String classids);
20
 
20
 
21
     //试题批阅情况
21
     //试题批阅情况
22
     EPaperSQuestionVo getCheckQuestion(@Param("eptqid") Integer eptqid, @Param("teacherid") Integer teacherid);
22
     EPaperSQuestionVo getCheckQuestion(@Param("eptqid") Integer eptqid, @Param("teacherid") Integer teacherid);
25
     void updateCheckQuestionById(@Param("epsqid") Integer epsqid, @Param("teacherid") Integer teacherid);
25
     void updateCheckQuestionById(@Param("epsqid") Integer epsqid, @Param("teacherid") Integer teacherid);
26
 
26
 
27
     //获取上一份批阅试题
27
     //获取上一份批阅试题
28
-    Map getPreQuestion(@Param("epid") Integer epid, @Param("teacherid") Integer teacherid);
28
+    Map getPreQuestion(@Param("eptqid") Integer eptqid, @Param("teacherid") Integer teacherid);
29
 
29
 
30
     //阅卷记录
30
     //阅卷记录
31
     List<Map> listRecord(@Param("eptqid") Integer eptqid, @Param("teacherid") Integer teacherid);
31
     List<Map> listRecord(@Param("eptqid") Integer eptqid, @Param("teacherid") Integer teacherid);

+ 8
- 1
sexam/src/main/java/com/xhkjedu/sexam/mapper/report/EReportGenerateMapper.java View File

1
 package com.xhkjedu.sexam.mapper.report;
1
 package com.xhkjedu.sexam.mapper.report;
2
 
2
 
3
+import com.xhkjedu.sexam.model.reportstu.ERstudent;
3
 import com.xhkjedu.sexam.vo.report.ERPaperVo;
4
 import com.xhkjedu.sexam.vo.report.ERPaperVo;
4
 import org.apache.ibatis.annotations.Param;
5
 import org.apache.ibatis.annotations.Param;
5
 
6
 
17
     List<Map> listSubject(@Param("examid") Integer examid);
18
     List<Map> listSubject(@Param("examid") Integer examid);
18
 
19
 
19
     //考试试卷
20
     //考试试卷
20
-    public List<ERPaperVo> listPaper(@Param("examid") Integer examid);
21
+    List<ERPaperVo> listPaper(@Param("examid") Integer examid);
22
+
23
+    //删除考试报告
24
+    void deleteExamReport(@Param("examid") Integer examid);
25
+
26
+    //学生上次考试排名及目标
27
+    List<ERstudent> listStuRankAndGoal(@Param("examid") Integer examid);
21
 }
28
 }

+ 2
- 2
sexam/src/main/java/com/xhkjedu/sexam/service/paper/EPaperCorrectTeacherService.java View File

37
     }
37
     }
38
 
38
 
39
     //随机获取待批试题
39
     //随机获取待批试题
40
-    public ResultVo getCorrectQuestion(Integer teacherid, String eptqids, String classids, Integer esid) {
40
+    public ResultVo getCorrectQuestion(Integer teacherid, Integer eptqid, String classids, Integer esid) {
41
         lock.lock();
41
         lock.lock();
42
         Map map = correctTeacherMapper.getExamNameByEsId(esid);//根据考试科目id获取考试名称
42
         Map map = correctTeacherMapper.getExamNameByEsId(esid);//根据考试科目id获取考试名称
43
         try {
43
         try {
44
             //随机获取一条待批阅试题
44
             //随机获取一条待批阅试题
45
-            EPaperSQuestionVo sq = correctTeacherMapper.getCorrectQuestion(teacherid, eptqids, classids);
45
+            EPaperSQuestionVo sq = correctTeacherMapper.getCorrectQuestion(teacherid, eptqid, classids);
46
             if (sq == null) return new ResultVo(0, "已批阅完成");
46
             if (sq == null) return new ResultVo(0, "已批阅完成");
47
             //修改试卷学生试题为批阅中
47
             //修改试卷学生试题为批阅中
48
             correctTeacherMapper.updateCheckQuestionById(sq.getEpsqid(), teacherid);
48
             correctTeacherMapper.updateCheckQuestionById(sq.getEpsqid(), teacherid);

+ 39
- 58
sexam/src/main/java/com/xhkjedu/sexam/service/report/EReportGenerateService.java View File

2
 
2
 
3
 import com.alibaba.fastjson.JSON;
3
 import com.alibaba.fastjson.JSON;
4
 import com.xhkjedu.sexam.mapper.exam.EClassMapper;
4
 import com.xhkjedu.sexam.mapper.exam.EClassMapper;
5
-import com.xhkjedu.sexam.mapper.paper.EPaperAnalyzeMapper;
6
 import com.xhkjedu.sexam.mapper.paper.EPaperQtypeMapper;
5
 import com.xhkjedu.sexam.mapper.paper.EPaperQtypeMapper;
7
 import com.xhkjedu.sexam.mapper.paperstudent.EPaperStudentMapper;
6
 import com.xhkjedu.sexam.mapper.paperstudent.EPaperStudentMapper;
8
 import com.xhkjedu.sexam.mapper.paperstudent.EPaperStudentQuestionMapper;
7
 import com.xhkjedu.sexam.mapper.paperstudent.EPaperStudentQuestionMapper;
14
 import com.xhkjedu.sexam.mapper.reportclass.ERclassQuestionMapper;
13
 import com.xhkjedu.sexam.mapper.reportclass.ERclassQuestionMapper;
15
 import com.xhkjedu.sexam.mapper.reportclass.ERclassQuestionPointMapper;
14
 import com.xhkjedu.sexam.mapper.reportclass.ERclassQuestionPointMapper;
16
 import com.xhkjedu.sexam.mapper.reportstu.ERstudentMapper;
15
 import com.xhkjedu.sexam.mapper.reportstu.ERstudentMapper;
17
-import com.xhkjedu.sexam.model.paper.EPaperAnalyze;
18
 import com.xhkjedu.sexam.model.paperstudent.EPaperStudentQuestion;
16
 import com.xhkjedu.sexam.model.paperstudent.EPaperStudentQuestion;
19
 import com.xhkjedu.sexam.model.report.ERbase;
17
 import com.xhkjedu.sexam.model.report.ERbase;
20
 import com.xhkjedu.sexam.model.report.ERsubject;
18
 import com.xhkjedu.sexam.model.report.ERsubject;
21
 import com.xhkjedu.sexam.model.reportclass.ERclass;
19
 import com.xhkjedu.sexam.model.reportclass.ERclass;
22
 import com.xhkjedu.sexam.model.reportclass.ERclassQtype;
20
 import com.xhkjedu.sexam.model.reportclass.ERclassQtype;
23
 import com.xhkjedu.sexam.model.reportclass.ERclassQuestion;
21
 import com.xhkjedu.sexam.model.reportclass.ERclassQuestion;
24
-import com.xhkjedu.sexam.model.reportclass.ERclassQuestionPoint;
25
 import com.xhkjedu.sexam.model.reportstu.ERstudent;
22
 import com.xhkjedu.sexam.model.reportstu.ERstudent;
26
 import com.xhkjedu.sexam.utils.ExamUtil;
23
 import com.xhkjedu.sexam.utils.ExamUtil;
27
 import com.xhkjedu.sexam.vo.paper.EPaperQPointVo;
24
 import com.xhkjedu.sexam.vo.paper.EPaperQPointVo;
28
-import com.xhkjedu.sexam.vo.paper.EPaperQsVo;
29
 import com.xhkjedu.sexam.vo.paper.EPaperQtypeQuestionVo;
25
 import com.xhkjedu.sexam.vo.paper.EPaperQtypeQuestionVo;
30
 import com.xhkjedu.sexam.vo.paper.EPaperQtypeVo;
26
 import com.xhkjedu.sexam.vo.paper.EPaperQtypeVo;
31
 import com.xhkjedu.sexam.vo.report.ERClassScoreVo;
27
 import com.xhkjedu.sexam.vo.report.ERClassScoreVo;
32
 import com.xhkjedu.sexam.vo.report.ERPaperVo;
28
 import com.xhkjedu.sexam.vo.report.ERPaperVo;
33
 import com.xhkjedu.utils.N_Utils;
29
 import com.xhkjedu.utils.N_Utils;
34
-
35
 import org.springframework.beans.BeanUtils;
30
 import org.springframework.beans.BeanUtils;
36
 import org.springframework.stereotype.Service;
31
 import org.springframework.stereotype.Service;
32
+import org.springframework.transaction.annotation.Transactional;
33
+
37
 import javax.annotation.Resource;
34
 import javax.annotation.Resource;
38
-import java.util.*;
35
+import java.util.ArrayList;
36
+import java.util.Comparator;
37
+import java.util.DoubleSummaryStatistics;
38
+import java.util.HashMap;
39
+import java.util.List;
40
+import java.util.Map;
39
 import java.util.stream.Collectors;
41
 import java.util.stream.Collectors;
40
 
42
 
41
 /**
43
 /**
56
     private EPaperQtypeMapper ePaperQtypeMapper;
58
     private EPaperQtypeMapper ePaperQtypeMapper;
57
     @Resource
59
     @Resource
58
     private EPaperStudentQuestionMapper ePaperStudentQuestionMapper;
60
     private EPaperStudentQuestionMapper ePaperStudentQuestionMapper;
59
-    @Resource
60
-    private EPaperAnalyzeMapper ePaperAnalyzeMapper;
61
+
61
 
62
 
62
     @Resource
63
     @Resource
63
     private ERbaseMapper eRbaseMapper;
64
     private ERbaseMapper eRbaseMapper;
76
 
77
 
77
 
78
 
78
     //生成考试报告
79
     //生成考试报告
80
+    @Transactional(rollbackFor = Exception.class)
79
     public void generateExamReport(Integer examid) {
81
     public void generateExamReport(Integer examid) {
82
+        //生成前先删除以前的考试报告
83
+        eReportGenerateMapper.deleteExamReport(examid);
84
+        //学生上次考试排名及目标
85
+        List<ERstudent> stuRankGoals = eReportGenerateMapper.listStuRankAndGoal(examid);
86
+
80
         List<Map> classes = eClassMapper.listByExamId(examid);
87
         List<Map> classes = eClassMapper.listByExamId(examid);
81
         List<Map> subjects = eReportGenerateMapper.listSubject(examid);
88
         List<Map> subjects = eReportGenerateMapper.listSubject(examid);
82
         List<ERPaperVo> papers = eReportGenerateMapper.listPaper(examid);
89
         List<ERPaperVo> papers = eReportGenerateMapper.listPaper(examid);
158
         Map<String, List<ERstudent>> subCollect = students.stream().collect(Collectors.groupingBy(s -> s.getSubjectid()));
165
         Map<String, List<ERstudent>> subCollect = students.stream().collect(Collectors.groupingBy(s -> s.getSubjectid()));
159
         List<ERsubject> subjectList = new ArrayList<>();//考试报告科目情况
166
         List<ERsubject> subjectList = new ArrayList<>();//考试报告科目情况
160
         List<ERclass> classList = new ArrayList<>();//考试报告班级情况
167
         List<ERclass> classList = new ArrayList<>();//考试报告班级情况
161
-        List<ERclassQtype> qtypeList = new ArrayList<>();//考试报告班级题型情况
162
-        List<ERclassQuestion> questionList = new ArrayList<>();//考试报告班级试题情况
163
-        List<ERclassQuestionPoint> pointList = new ArrayList<>();//考试报告班级试题知识点情况
164
         for (Map.Entry<String, List<ERstudent>> ssEntry : subCollect.entrySet()) {
168
         for (Map.Entry<String, List<ERstudent>> ssEntry : subCollect.entrySet()) {
165
             subjectid = ssEntry.getKey();
169
             subjectid = ssEntry.getKey();
166
             subjectname = subjectMap.get(subjectid);
170
             subjectname = subjectMap.get(subjectid);
244
                 rc.setDfrate(N_Utils.getIntegerDivideAndMulitiply(dfnum, stunum));
248
                 rc.setDfrate(N_Utils.getIntegerDivideAndMulitiply(dfnum, stunum));
245
                 rc.setBzc(ExamUtil.standardDiviation(scores));
249
                 rc.setBzc(ExamUtil.standardDiviation(scores));
246
                 classList.add(rc);
250
                 classList.add(rc);
247
-                List<EPaperQsVo> typelist = JSON.parseArray(rp.getQnumjson(), EPaperQsVo.class);
248
-                for (EPaperQsVo t : typelist) {
249
-                    ERclassQtype rt = new ERclassQtype();
250
-                    rt.setExamid(examid);
251
-                    rt.setClassid(classid);
252
-                    rt.setSubjectid(subjectid);
253
-                    rt.setQtypename(t.getQtname());
254
-                    rt.setScore(t.getScore());
255
-                    rt.setNum(t.getNum());
256
-                    rt.setSrate(t.getSrate());
257
-                    qtypeList.add(rt);
258
-                }
259
-
260
-                List<Map> points = JSON.parseArray(rp.getQnumjson(), Map.class);
261
-                for (Map p : points) {
262
-                    ERclassQuestionPoint rqp = new ERclassQuestionPoint();
263
-                    rqp.setExamid(examid);
264
-                    rqp.setClassid(classid);
265
-                    rqp.setSubjectid(subjectid);
266
-                    rqp.setPointname(p.get("pointname").toString());
267
-                    rqp.setScore((Double) p.get("score"));
268
-                    rqp.setSrate((Double) p.get("srate"));
269
-                    pointList.add(rqp);
270
-                }
271
             }
251
             }
272
         }
252
         }
273
 
253
 
284
             cs.setClassrank(classStuRank.get(cs.getClassid() + "_" + studentid));
264
             cs.setClassrank(classStuRank.get(cs.getClassid() + "_" + studentid));
285
             cs.setClassmaxscore(classStatistics.getMax());
265
             cs.setClassmaxscore(classStatistics.getMax());
286
             cs.setClassavgscore(classStatistics.getAverage());
266
             cs.setClassavgscore(classStatistics.getAverage());
287
-            cs.setSchoolrank(schoolStuRank.get(studentid));
267
+            Integer schoolrank = schoolStuRank.get(studentid);
268
+            cs.setSchoolrank(schoolrank);
288
             cs.setSchoolmaxscore(schoolStatisticsMax);
269
             cs.setSchoolmaxscore(schoolStatisticsMax);
289
             cs.setSchoolavgscore(schoolStatisticsAverage);
270
             cs.setSchoolavgscore(schoolStatisticsAverage);
271
+            setStuGoal(stuRankGoals, cs, schoolrank);//设置学生目标
290
         }
272
         }
291
         eRstudentMapper.insertList(classStudents);
273
         eRstudentMapper.insertList(classStudents);
292
 
274
 
298
             cs.setClassrank(classSubStuRank.get(classid + "_" + subjectid + "_" + studentid));
280
             cs.setClassrank(classSubStuRank.get(classid + "_" + subjectid + "_" + studentid));
299
             cs.setClassmaxscore(cSStatistics.getMax());
281
             cs.setClassmaxscore(cSStatistics.getMax());
300
             cs.setClassavgscore(cSStatistics.getAverage());
282
             cs.setClassavgscore(cSStatistics.getAverage());
301
-            cs.setSchoolrank(schoolSubStuRank.get(subjectid + "_" + studentid));
283
+            Integer schoolrank = schoolSubStuRank.get(subjectid + "_" + studentid);
284
+            cs.setSchoolrank(schoolrank);
302
             cs.setSchoolmaxscore(sSStatistics.getMax());
285
             cs.setSchoolmaxscore(sSStatistics.getMax());
303
             cs.setSchoolavgscore(sSStatistics.getAverage());
286
             cs.setSchoolavgscore(sSStatistics.getAverage());
287
+            setStuGoal(stuRankGoals, cs, schoolrank);//设置学生目标
304
         }
288
         }
305
         eRstudentMapper.insertList(classSubjectStudents);
289
         eRstudentMapper.insertList(classSubjectStudents);
290
+
291
+        setClassQuestion(examid, subjects, classes);//题型试题
292
+    }
293
+
294
+    //设置学生目标
295
+    private void setStuGoal(List<ERstudent> stuRankGoals, ERstudent cs, Integer schoolrank) {
296
+        String goalparam = "0.2";
297
+        ERstudent rg = stuRankGoals.stream().filter(s -> s.getStudentid().equals(cs.getStudentid())
298
+                && s.getSubjectid().equals(cs.getSubjectid())).findFirst().orElse(null);
299
+        Integer goal = 0;
300
+        Integer nextgoal = 0;
301
+        if (rg != null) {
302
+            goal = rg.getNextgoal();
303
+            nextgoal = ExamUtil.getUserGroupGoalByParam(schoolrank, goalparam);
304
+        }
305
+        cs.setGoal(goal);
306
+        cs.setNextgoal(nextgoal);
306
     }
307
     }
307
 
308
 
308
     //分数排名
309
     //分数排名
334
         }
335
         }
335
     }
336
     }
336
 
337
 
337
-    //试卷题型试题、知识点
338
+    //题型试题
338
     private void setClassQuestion(Integer examid,List<Map> subjects,List<Map> classes){
339
     private void setClassQuestion(Integer examid,List<Map> subjects,List<Map> classes){
339
         //考试所有学生提交试卷情况
340
         //考试所有学生提交试卷情况
340
         List<EPaperStudentQuestion> stulist = ePaperStudentQuestionMapper.listExamStudentsAnswer(examid);
341
         List<EPaperStudentQuestion> stulist = ePaperStudentQuestionMapper.listExamStudentsAnswer(examid);
460
                     rtypelist.add(eRclassQtype);
461
                     rtypelist.add(eRclassQtype);
461
                 }
462
                 }
462
             }
463
             }
463
-
464
-            if(ptype == 1){
465
-                //获取试卷只是分析
466
-                Map epa = ePaperAnalyzeMapper.getPaperAnalzyeByEpid(epid);
467
-                String pointjson = epa.get("pointjson").toString();
468
-                List<Map> pointlist = JSON.parseArray(pointjson,Map.class);
469
-                //遍历知识点处理年级班级知识点情况
470
-                for(int j=0;j<pointlist.size();j++){
471
-                    Map pointmap = pointlist.get(j);
472
-                    String pointname = pointmap.get("pointname").toString();
473
-                    Double score = Double.parseDouble(pointmap.get("score").toString());
474
-                    Double scorerate = Double.parseDouble(pointmap.get("scorerate").toString());
475
-                    String order = pointmap.get("order").toString();
476
-
477
-                
478
-                }
479
-
480
-            }
481
-
482
-
483
         }
464
         }
484
         eRclassQtypeMapper.insertList(rtypelist);
465
         eRclassQtypeMapper.insertList(rtypelist);
485
         eRclassQuestionMapper.insertList(rqlist);
466
         eRclassQuestionMapper.insertList(rqlist);

+ 20
- 0
sexam/src/main/java/com/xhkjedu/sexam/utils/ExamUtil.java View File

1
 package com.xhkjedu.sexam.utils;
1
 package com.xhkjedu.sexam.utils;
2
 
2
 
3
+import com.xhkjedu.utils.N_Utils;
3
 import lombok.extern.slf4j.Slf4j;
4
 import lombok.extern.slf4j.Slf4j;
4
 
5
 
5
 import java.math.BigDecimal;
6
 import java.math.BigDecimal;
153
     public static double standardDiviation(List<Double> x) {
154
     public static double standardDiviation(List<Double> x) {
154
         return Math.sqrt(variance(x));
155
         return Math.sqrt(variance(x));
155
     }
156
     }
157
+
158
+    /**
159
+     * 根据本次排名和参数计算下次的目标
160
+     *
161
+     * @param countschool:本次排名
162
+     * @param goalparam:进步目标参数
163
+     * @return
164
+     */
165
+    public static Integer getUserGroupGoalByParam(Integer countschool, String goalparam) {
166
+        if (countschool != null && (1 == countschool || 2 == countschool)) {//若本次是第一名或者第二名,则下次目标一定是第一名
167
+            return 1;
168
+        } else {
169
+            BigDecimal count = countschool == null || N_Utils.isEmpty(goalparam) ? new BigDecimal(0) :
170
+                    new BigDecimal(goalparam).multiply(new BigDecimal(countschool.toString()));//进步的名次
171
+            Integer thiscount = countschool == null ? 0 : new BigDecimal(countschool.toString()).subtract(count).intValue();
172
+            //舍弃小数点
173
+            return thiscount;
174
+        }
175
+    }
156
 }
176
 }

+ 1
- 1
sexam/src/main/java/com/xhkjedu/sexam/vo/paper/EPTeacherVo.java View File

20
     private Integer teacherid;
20
     private Integer teacherid;
21
 
21
 
22
     //试卷试题ids
22
     //试卷试题ids
23
-    private String eptqids;
23
+    private Integer eptqid;
24
 
24
 
25
     //班级ids
25
     //班级ids
26
     private String classids;
26
     private String classids;

+ 2
- 2
sexam/src/main/resources/mapper/paper/EPaperCorrectTeacherMapper.xml View File

50
     <!--随机获取一条待批阅试题-->
50
     <!--随机获取一条待批阅试题-->
51
     <select id="getCorrectQuestion" resultType="com.xhkjedu.sexam.vo.paper.EPaperSQuestionVo">
51
     <select id="getCorrectQuestion" resultType="com.xhkjedu.sexam.vo.paper.EPaperSQuestionVo">
52
         select psq.epsqid,psq.stuanswer,psq.qn,psq.eptqid,psq.qscore,psq.epsid
52
         select psq.epsqid,psq.stuanswer,psq.qn,psq.eptqid,psq.qscore,psq.epsid
53
-        from e_paper_student_question psq where psq.eptqid in(${eptqids})
53
+        from e_paper_student_question psq where psq.eptqid=#{eptqid}
54
         and psq.answered=1 and (psq.checked=0 or (psq.checked=1 and psq.checkid=#{teacherid}))
54
         and psq.answered=1 and (psq.checked=0 or (psq.checked=1 and psq.checkid=#{teacherid}))
55
         <if test="classids!=null and classids!=''">
55
         <if test="classids!=null and classids!=''">
56
             and psq.classid in(${classids})
56
             and psq.classid in(${classids})
70
     <!--获取上一份批阅试题-->
70
     <!--获取上一份批阅试题-->
71
     <select id="getPreQuestion" resultType="java.util.Map">
71
     <select id="getPreQuestion" resultType="java.util.Map">
72
         select psq.epsqid,psq.stuanswer,psq.qn,psq.qorder,psq.qscore,psq.stuscore,psq.good,psq.bad,psq.epsid
72
         select psq.epsqid,psq.stuanswer,psq.qn,psq.qorder,psq.qscore,psq.stuscore,psq.good,psq.bad,psq.epsid
73
-        from e_paper_student_question psq where psq.epid=#{epid} and psq.checked=2 and psq.checkid=#{teacherid}
73
+        from e_paper_student_question psq where psq.eptqid=#{eptqid} and psq.checked=2 and psq.checkid=#{teacherid}
74
         order by psq.checktime desc limit 1
74
         order by psq.checktime desc limit 1
75
     </select>
75
     </select>
76
     <!--阅卷记录-->
76
     <!--阅卷记录-->

+ 21
- 3
sexam/src/main/resources/mapper/report/EReportGenerateMapper.xml View File

8
     </select>
8
     </select>
9
     <!--考试试卷-->
9
     <!--考试试卷-->
10
     <select id="listPaper" resultType="com.xhkjedu.sexam.vo.report.ERPaperVo">
10
     <select id="listPaper" resultType="com.xhkjedu.sexam.vo.report.ERPaperVo">
11
-        select ep.subjectid,ep.pscore,epa.qnumjson,epa.complexityjson,epa.pointjson
12
-        from e_paper ep left join e_paper_analyze epa on ep.epid = epa.epid
13
-        where ep.examid=#{examid}
11
+        select ep.subjectid,ep.pscore from e_paper ep where ep.examid=#{examid}
12
+    </select>
13
+    <!--删除考试报告-->
14
+    <delete id="deleteExamReport">
15
+        delete from e_rbase where examid=#{examid};
16
+        delete from e_rclass where examid=#{examid};
17
+        delete from e_rclass_qtype where examid=#{examid};
18
+        delete from e_rclass_question where examid=#{examid};
19
+        delete from e_rclass_question_point where examid=#{examid};
20
+        delete from e_rclass_rank where examid=#{examid};
21
+        delete from e_rgrade_rank where examid=#{examid};
22
+        delete from e_rrank where examid=#{examid};
23
+        delete from e_rstudent where examid=#{examid};
24
+        delete from e_rstudent_point where examid=#{examid};
25
+        delete from e_rsubject where examid=#{examid};
26
+    </delete>
27
+    <!--学生上次考试排名及目标-->
28
+    <select id="listStuRankAndGoal" resultType="com.xhkjedu.sexam.model.reportstu.ERstudent">
29
+        select er.studentid,er.subjectid,er.schoolrank,er.nextgoal
30
+        from(select max(er.rsid)rsid from e_class_student ecs left join e_rstudent er on ecs.studentid = er.studentid
31
+        where ecs.examid=#{examid} group by er.studentid,er.subjectid)a left join e_rstudent er on a.rsid=er.rsid
14
     </select>
32
     </select>
15
 </mapper>
33
 </mapper>

Loading…
Cancel
Save