瀏覽代碼

显示排名得分

tags/正式版本
雍文秀 2 年之前
父節點
當前提交
98e4d79650

+ 1
- 1
sexam/src/main/java/com/xhkjedu/sexam/mapper/exam/EBaseMapper.java 查看文件

@@ -62,5 +62,5 @@ public interface EBaseMapper extends TkMapper<EBase> {
62 62
     EBaseVo getExamStateAndMode(@Param("examid") Integer examid);
63 63
 
64 64
     //根据考试id获取显示排名
65
-    Integer getShowRankById(@Param("examid") Integer examid);
65
+    EBase getShowRankById(@Param("examid") Integer examid);
66 66
 }

+ 5
- 2
sexam/src/main/java/com/xhkjedu/sexam/model/exam/EBase.java 查看文件

@@ -36,8 +36,11 @@ public class EBase extends BaseBean {
36 36
     //考试状态0未开始1已开始2已结束3已生成报告
37 37
     private Integer examstate;
38 38
 
39
-    //显示排名得分0保密1分数2分数+班排名3分数+校排名
40
-    private Integer showrank;
39
+    //教师显示排名得分0保密1分数2分数+班排名3分数+校排名
40
+    private Integer teashowrank;
41
+
42
+    //学生显示排名得分0保密1分数2分数+班排名3分数+校排名
43
+    private Integer stushowrank;
41 44
 
42 45
     //考试公告
43 46
     private String examcomm;

+ 4
- 2
sexam/src/main/java/com/xhkjedu/sexam/service/exam/EBaseService.java 查看文件

@@ -67,7 +67,8 @@ public class EBaseService {
67 67
         try {
68 68
             //考试
69 69
             model.setExamstate(0);
70
-            model.setShowrank(0);
70
+            model.setTeashowrank(0);
71
+            model.setStushowrank(0);
71 72
             model.setDeleted(1);
72 73
             model.setReportstate(0);
73 74
             model.setCreatetime(N_Utils.getSecondTimestamp());
@@ -511,7 +512,8 @@ public class EBaseService {
511 512
 
512 513
     //设置学生报告排名显示
513 514
     public void setShowRank(EBase eBase) {
514
-        if (eBase.getShowrank() == null) eBase.setShowrank(0);
515
+        if (eBase.getTeashowrank() == null) eBase.setTeashowrank(0);
516
+        if (eBase.getStushowrank() == null) eBase.setStushowrank(0);
515 517
         eBaseMapper.updateByPrimaryKeySelective(eBase);
516 518
     }
517 519
 }

+ 35
- 23
sexam/src/main/java/com/xhkjedu/sexam/service/report/EReportStudentService.java 查看文件

@@ -8,6 +8,7 @@ import com.xhkjedu.sexam.mapper.paper.EPaperAnalyzeMapper;
8 8
 import com.xhkjedu.sexam.mapper.paper.EPaperFileMapper;
9 9
 import com.xhkjedu.sexam.mapper.paper.EPaperMapper;
10 10
 import com.xhkjedu.sexam.mapper.reportstu.ERstudentMapper;
11
+import com.xhkjedu.sexam.model.exam.EBase;
11 12
 import com.xhkjedu.sexam.utils.ExamUtil;
12 13
 import com.xhkjedu.utils.N_Utils;
13 14
 import org.springframework.stereotype.Service;
@@ -73,10 +74,11 @@ public class EReportStudentService {
73 74
      **/
74 75
     public Map listStudentSubjectScoreByExamid(Integer examid, Integer studentid, Integer teacherid) {
75 76
         Integer showrank;
77
+        EBase base = eBaseMapper.getShowRankById(examid);
76 78
         if (!N_Utils.isEmptyInteger(teacherid)) {
77
-            showrank = 1;
79
+            showrank = base.getTeashowrank();
78 80
         } else {
79
-            showrank = eBaseMapper.getShowRankById(examid);
81
+            showrank = base.getStushowrank();
80 82
         }
81 83
         List<Map> list = eRstudentMapper.getStudentScoreByExamid(examid, studentid, showrank);
82 84
         Map rtnmap = new LinkedHashMap();
@@ -84,7 +86,7 @@ public class EReportStudentService {
84 86
         if (list != null && list.size() > 0) {
85 87
             String classnum = "0";
86 88
             String gradenum = "0";
87
-            if (showrank == 1) {
89
+            if (showrank != 0) {
88 90
                 Map map1 = list.get(0);
89 91
                 Integer classid = Integer.parseInt(map1.get("classid").toString());
90 92
                 Map gcnum = eRstudentMapper.getStudentNumByExamid(examid, classid);
@@ -107,12 +109,13 @@ public class EReportStudentService {
107 109
      **/
108 110
     public List<Map> listStudentRankHistory(Integer studentid, Integer examid, Integer teacherid) {
109 111
         Integer showrank;
112
+        EBase base = eBaseMapper.getShowRankById(examid);
110 113
         if (!N_Utils.isEmptyInteger(teacherid)) {
111
-            showrank = 1;
114
+            showrank = base.getTeashowrank();
112 115
         } else if (N_Utils.isEmptyInteger(examid)) {
113 116
             showrank = 0;
114 117
         } else {
115
-            showrank = eBaseMapper.getShowRankById(examid);
118
+            showrank = base.getStushowrank();
116 119
         }
117 120
         if (showrank == 0) return new ArrayList<>();
118 121
         return eRstudentMapper.listStudentExamHistory(studentid, "zf");
@@ -127,10 +130,11 @@ public class EReportStudentService {
127 130
      **/
128 131
     public Map getSubjectScoreByStudentid(Integer examid, Integer studentid, String subjectid, Integer teacherid) {
129 132
         Integer showrank;
133
+        EBase base = eBaseMapper.getShowRankById(examid);
130 134
         if (!N_Utils.isEmptyInteger(teacherid)) {
131
-            showrank = 1;
135
+            showrank = base.getTeashowrank();
132 136
         } else {
133
-            showrank = eBaseMapper.getShowRankById(examid);
137
+            showrank = base.getStushowrank();
134 138
         }
135 139
         Map rtnmap = eRstudentMapper.getSubjectScoreByStudentid(examid, studentid, subjectid, showrank);
136 140
         if (rtnmap != null && rtnmap.size() > 0) {
@@ -164,10 +168,11 @@ public class EReportStudentService {
164 168
      **/
165 169
     public List<Map> listSubjectPoints(Integer examid, Integer studentid, String subjectid, Integer teacherid) {
166 170
         Integer showrank;
171
+        EBase base = eBaseMapper.getShowRankById(examid);
167 172
         if (!N_Utils.isEmptyInteger(teacherid)) {
168
-            showrank = 1;
173
+            showrank = base.getTeashowrank();
169 174
         } else {
170
-            showrank = eBaseMapper.getShowRankById(examid);
175
+            showrank = base.getStushowrank();
171 176
         }
172 177
         return eRstudentMapper.listSubjectPoints(examid, studentid, subjectid, showrank);
173 178
     }
@@ -181,10 +186,11 @@ public class EReportStudentService {
181 186
      **/
182 187
     public List<Map> listSubjectComplexitys(Integer examid, Integer studentid, String subjectid, Integer teacherid) {
183 188
         Integer showrank;
189
+        EBase base = eBaseMapper.getShowRankById(examid);
184 190
         if (!N_Utils.isEmptyInteger(teacherid)) {
185
-            showrank = 1;
191
+            showrank = base.getTeashowrank();
186 192
         } else {
187
-            showrank = eBaseMapper.getShowRankById(examid);
193
+            showrank = base.getStushowrank();
188 194
         }
189 195
         return eRstudentMapper.listSubjectComplexitys(examid, studentid, subjectid, showrank);
190 196
     }
@@ -198,10 +204,11 @@ public class EReportStudentService {
198 204
      **/
199 205
     public List<Map> listSubjectQtypes(Integer examid, Integer studentid, String subjectid, Integer teacherid) {
200 206
         Integer showrank;
207
+        EBase base = eBaseMapper.getShowRankById(examid);
201 208
         if (!N_Utils.isEmptyInteger(teacherid)) {
202
-            showrank = 1;
209
+            showrank = base.getTeashowrank();
203 210
         } else {
204
-            showrank = eBaseMapper.getShowRankById(examid);
211
+            showrank = base.getStushowrank();
205 212
         }
206 213
         return eRstudentMapper.listSubjectQtypes(examid, studentid, subjectid, showrank);
207 214
     }
@@ -215,10 +222,11 @@ public class EReportStudentService {
215 222
      **/
216 223
     public List<Map> listSubjectQuestions(Integer examid, Integer studentid, String subjectid, Integer teacherid) {
217 224
         Integer showrank;
225
+        EBase base = eBaseMapper.getShowRankById(examid);
218 226
         if (!N_Utils.isEmptyInteger(teacherid)) {
219
-            showrank = 1;
227
+            showrank = base.getTeashowrank();
220 228
         } else {
221
-            showrank = eBaseMapper.getShowRankById(examid);
229
+            showrank = base.getStushowrank();
222 230
         }
223 231
         Map map = ePaperMapper.getPaperByExamidAndSubjectid(examid, subjectid);
224 232
         Integer ptype = Integer.parseInt(map.get("ptype").toString());
@@ -276,10 +284,11 @@ public class EReportStudentService {
276 284
     public Map getStudentPaperQuestions(Integer examid, Integer studentid, String subjectid, Integer teacherid) {
277 285
         Integer showrank;
278 286
         Integer pstate = eSubjectMapper.getPstateByExamIdSid(examid, subjectid);
287
+        EBase base = eBaseMapper.getShowRankById(examid);
279 288
         if (!N_Utils.isEmptyInteger(teacherid)) {
280
-            showrank = 1;
289
+            showrank = base.getTeashowrank();
281 290
         } else {
282
-            showrank = eBaseMapper.getShowRankById(examid);
291
+            showrank = base.getStushowrank();
283 292
         }
284 293
         Map map = ePaperMapper.getPaperByExamidAndSubjectid(examid, subjectid);
285 294
         Integer ptype = Integer.parseInt(map.get("ptype").toString());
@@ -423,10 +432,11 @@ public class EReportStudentService {
423 432
      **/
424 433
     public List<Map> listStudentSubjectErrorQues(Integer examid, Integer studentid, Integer teacherid) {
425 434
         Integer showrank;
435
+        EBase base = eBaseMapper.getShowRankById(examid);
426 436
         if (!N_Utils.isEmptyInteger(teacherid)) {
427
-            showrank = 1;
437
+            showrank = base.getTeashowrank();
428 438
         } else {
429
-            showrank = eBaseMapper.getShowRankById(examid);
439
+            showrank = base.getStushowrank();
430 440
         }
431 441
         List<Map> list = eRstudentMapper.listStudentSubjectErrorQues(examid, studentid, showrank);
432 442
         if (showrank == 0) return list;
@@ -465,10 +475,11 @@ public class EReportStudentService {
465 475
     public Map listStudentErrorQuestionsTk(Integer examid, Integer studentid, String subjectid, Integer teacherid) {
466 476
         Integer pstate = eSubjectMapper.getPstateByExamIdSid(examid, subjectid);
467 477
         Integer showrank;
478
+        EBase base = eBaseMapper.getShowRankById(examid);
468 479
         if (!N_Utils.isEmptyInteger(teacherid)) {
469
-            showrank = 1;
480
+            showrank = base.getTeashowrank();
470 481
         } else {
471
-            showrank = eBaseMapper.getShowRankById(examid);
482
+            showrank = base.getStushowrank();
472 483
         }
473 484
         if (showrank == 0) {
474 485
             Map map = new HashMap();
@@ -519,10 +530,11 @@ public class EReportStudentService {
519 530
      **/
520 531
     public List<Map> listStudentErrorQuestionsFj(Integer examid, Integer studentid, String subjectid, Integer teacherid) {
521 532
         Integer showrank;
533
+        EBase base = eBaseMapper.getShowRankById(examid);
522 534
         if (!N_Utils.isEmptyInteger(teacherid)) {
523
-            showrank = 1;
535
+            showrank = base.getTeashowrank();
524 536
         } else {
525
-            showrank = eBaseMapper.getShowRankById(examid);
537
+            showrank = base.getStushowrank();
526 538
         }
527 539
         if (showrank == 0) return new ArrayList<>();
528 540
         List<Map> list = eRstudentMapper.listStudentErrorQuestionsForFj(examid, studentid, subjectid);

+ 6
- 5
sexam/src/main/resources/mapper/exam/EBaseMapper.xml 查看文件

@@ -12,7 +12,7 @@
12 12
     </delete>
13 13
     <!--考试列表-->
14 14
     <select id="listAll" resultType="java.util.Map">
15
-        select b.examid,b.examname,b.examdate,b.gradeid,b.examtype,b.exammode,b.monitored,b.showrank
15
+        select b.examid,b.examname,b.examdate,b.gradeid,b.examtype,b.exammode,b.monitored,b.teashowrank,b.stushowrank
16 16
         ,b.examstate,u.username createname,group_concat(distinct es.subjectname order by es.esid separator '|')subjectname
17 17
         ,count(distinct case when es.begintime is null or es.begintime='' then es.esid else null end)esnum
18 18
         ,min(es.esstate)esstate,min(es.pstate)pstate,min(ifnull(ep.correcttype,0))correcttype
@@ -62,12 +62,13 @@
62 62
     </update>
63 63
     <!--考试基本信息-->
64 64
     <select id="findById" resultType="java.util.Map">
65
-        select examid,examname,gradeid,examdate,examtype,exammode,monitored,examstate,showrank
65
+        select examid,examname,gradeid,examdate,examtype,exammode,monitored,examstate,teashowrank,stushowrank
66 66
         from e_base where examid=#{examid}
67 67
     </select>
68 68
     <!--考试基本信息(带考试人数)-->
69 69
     <select id="findById2" resultType="java.util.Map">
70
-        select b.examid,b.examname,b.examdate,b.examtype,b.gradeid,b.exammode,b.monitored,b.examstate,b.examcomm,showrank
70
+        select b.examid,b.examname,b.examdate,b.examtype,b.gradeid,b.exammode,b.monitored,b.examstate,b.examcomm
71
+        ,teashowrank,stushowrank
71 72
         ,(select sum(c.classnum) from e_class c where c.examid=b.examid)examnum
72 73
         from e_base b where b.examid=#{examid}
73 74
     </select>
@@ -124,8 +125,8 @@
124 125
         from e_base eb where eb.examid=#{examid}
125 126
     </select>
126 127
     <!--根据考试id获取显示排名-->
127
-    <select id="getShowRankById" resultType="java.lang.Integer">
128
-        select eb.showrank
128
+    <select id="getShowRankById" resultType="com.xhkjedu.sexam.model.exam.EBase">
129
+        select eb.teashowrank,eb.stushowrank
129 130
         from e_base eb where eb.examid=#{examid}
130 131
     </select>
131 132
 </mapper>

+ 26
- 16
sexam/src/main/resources/mapper/report/ERstudentMapper.xml 查看文件

@@ -45,7 +45,15 @@
45 45
              ,0 schoolmaxscore,0 schoolavgscore,0 goal,0 nextgoal
46 46
         </if>
47 47
         <if test="showrank==1">
48
-            ,rs.score,rs.bzscore,rs.classrank,rs.classrankpre,rs.classmaxscore,rs.classavgscore,rs.schoolrank
48
+            ,rs.score,rs.bzscore,0 classrank,0 classrankpre,rs.classmaxscore,rs.classavgscore,0 schoolrank
49
+            ,rs.schoolmaxscore,rs.schoolavgscore,0 goal,0 nextgoal
50
+        </if>
51
+        <if test="showrank==2">
52
+            ,rs.score,rs.bzscore,rs.classrank,rs.classrankpre,rs.classmaxscore,rs.classavgscore,0 schoolrank
53
+            ,rs.schoolmaxscore,rs.schoolavgscore,0 goal,0 nextgoal
54
+        </if>
55
+        <if test="showrank==3">
56
+            ,rs.score,rs.bzscore,0 classrank,0 classrankpre,rs.classmaxscore,rs.classavgscore,rs.schoolrank
49 57
             ,rs.schoolmaxscore,rs.schoolavgscore,rs.goal,rs.nextgoal
50 58
         </if>
51 59
         ,eps.device,eps.submittype,eps.endtime
@@ -81,7 +89,15 @@
81 89
             ,0 schoolmaxscore,0 schoolavgscore,0 goal,0 nextgoal
82 90
         </if>
83 91
         <if test="showrank==1">
84
-            ,rs.score,rs.bzscore,rs.classrank,rs.classrankpre,rs.classmaxscore,rs.classavgscore,rs.schoolrank
92
+            ,rs.score,rs.bzscore,0 classrank,0 classrankpre,rs.classmaxscore,rs.classavgscore,0 schoolrank
93
+            ,rs.schoolmaxscore,rs.schoolavgscore,0 goal,0 nextgoal
94
+        </if>
95
+        <if test="showrank==2">
96
+            ,rs.score,rs.bzscore,rs.classrank,rs.classrankpre,rs.classmaxscore,rs.classavgscore,0 schoolrank
97
+            ,rs.schoolmaxscore,rs.schoolavgscore,0 goal,0 nextgoal
98
+        </if>
99
+        <if test="showrank==3">
100
+            ,rs.score,rs.bzscore,0 classrank,0 classrankpre,rs.classmaxscore,rs.classavgscore,rs.schoolrank
85 101
             ,rs.schoolmaxscore,rs.schoolavgscore,rs.goal,rs.nextgoal
86 102
         </if>
87 103
         from e_rstudent rs where rs.examid=#{examid} and rs.studentid=#{studentid} and rs.subjectid=#{subjectid}
@@ -93,7 +109,7 @@
93 109
             ,0 stuscore,0 stusrate,0 gradescore,0 gradesrate,0 gradeavgscore
94 110
             ,0 classscore,0 classsrate,0 classavgscore
95 111
         </if>
96
-        <if test="showrank==1">
112
+        <if test="showrank!=0">
97 113
             ,sp.stuscore,sp.stusrate,cp.gradescore,cp.gradesrate,cp.gradeavgscore
98 114
             ,cp.classscore,cp.classsrate,cp.classavgscore
99 115
         </if>
@@ -108,7 +124,7 @@
108 124
             ,0 stuscore,0 stusrate,0 gradescore,0 gradeavgscore,0 gradesrate
109 125
             ,0 classscore,0 classavgscore,0 classsrate
110 126
         </if>
111
-        <if test="showrank==1">
127
+        <if test="showrank!=0">
112 128
             ,sc.stuscore,sc.stusrate,cc.gradescore,cc.gradeavgscore,cc.gradesrate
113 129
             ,cc.classscore,cc.classavgscore,cc.classsrate
114 130
         </if>
@@ -123,7 +139,7 @@
123 139
             ,0 stuscore,0 stusrate,0 gradescore,0 gradesrate,0 gradeavgscore
124 140
             ,0 classscore,0 classsrate,0 classavgscore
125 141
         </if>
126
-        <if test="showrank==1">
142
+        <if test="showrank!=0">
127 143
             ,st.stuscore,st.stusrate,ct.gradescore,ct.gradesrate,ct.gradeavgscore
128 144
             ,ct.classscore,ct.classsrate,ct.classavgscore
129 145
         </if>
@@ -138,7 +154,7 @@
138 154
             ,0 stuscore,0 classscore,0 classsrate,0 gradescore,0 gradesrate
139 155
             ,0 gradeavgscore,0 classavgscore
140 156
         </if>
141
-        <if test="showrank==1">
157
+        <if test="showrank!=0">
142 158
             ,sq.stuscore,cq.classscore,cq.classsrate,cq.gradescore,cq.gradesrate
143 159
             ,cq.gradeavgscore,cq.classavgscore
144 160
         </if>
@@ -172,7 +188,7 @@
172 188
         <if test="showrank==0">
173 189
             ,0 classscore,0 classsrate,0 gradescore,0 gradesrate,0 classavgscore,0 gradeavgscore
174 190
         </if>
175
-        <if test="showrank==1">
191
+        <if test="showrank!=0">
176 192
             ,cq.classscore,cq.classsrate,cq.gradescore,cq.gradesrate,cq.classavgscore,cq.gradeavgscore
177 193
         </if>
178 194
         from e_rclass_question cq
@@ -181,12 +197,6 @@
181 197
     </select>
182 198
     <select id="listSubjectQuestionsStuScore" resultType="java.util.Map">
183 199
         select sq.stuscore,sq.qscore,sq.questionid squestionid
184
-        <!--<if test="showrank==0">-->
185
-        <!--    ,0 stuscore-->
186
-        <!--</if>-->
187
-        <!--<if test="showrank==1">-->
188
-        <!--    ,sq.stuscore-->
189
-        <!--</if>-->
190 200
         from e_paper_student_question sq
191 201
         left join t_question q on sq.questionid=q.questionid
192 202
         where sq.studentid=#{studentid} and sq.epid=#{epid} and (q.questionid=#{questionid} or q.questionpid=#{questionid})
@@ -245,7 +255,7 @@
245 255
         <if test="showrank==0">
246 256
             ,0 stuscore,0 classavgscore,0 gradeavgscore
247 257
         </if>
248
-        <if test="showrank==1">
258
+        <if test="showrank!=0">
249 259
             ,sq.stuscore,cq.classavgscore,cq.gradeavgscore
250 260
         </if>
251 261
         from e_paper_student_question sq left join t_question q on sq.questionid=q.questionid
@@ -273,7 +283,7 @@
273 283
         <if test="showrank==0">
274 284
             ,0 stuscore,0 classavgscore,0 gradeavgscore
275 285
         </if>
276
-        <if test="showrank==1">
286
+        <if test="showrank!=0">
277 287
             ,sq.stuscore,cq.classavgscore,cq.gradeavgscore
278 288
         </if>
279 289
         from e_paper_student_question sq left join e_rclass_question cq on sq.eptqid=cq.eptqid and sq.classid=cq.classid
@@ -296,7 +306,7 @@
296 306
         </collection>
297 307
     </resultMap>
298 308
     <select id="listStudentSubjectErrorQues" resultMap="listStudentSubjectErrorQues">
299
-        <if test="showrank==1">
309
+        <if test="showrank!=0">
300 310
         select sq.subjectid,st.subjectname,p.ptype,sq.epsqid,sq.eptqid,q.questionid,q.qlevel,q.questionpid
301 311
         from e_paper_student_question sq
302 312
         left join t_question q on q.questionid=sq.questionid

Loading…
取消
儲存