Selaa lähdekoodia

举一反三随机取3条数据

tags/正式3.2.0
王宁 2 vuotta sitten
vanhempi
commit
abe6e0f7da

+ 6
- 4
sstudy/src/main/resources/mapper/question/QuestionClassMapper.xml Näytä tiedosto

@@ -39,7 +39,8 @@
39 39
     <select id="directorList" resultType="com.xhkjedu.sstudy.vo.question.QuestionClassVo">
40 40
         select qc.questionid,qc.qscore,qc.avgscore,qc.errorrate,qc.qctype,qc.qtypeid
41 41
         ,concat(p.papername,'-第',qc.qorder,'题')qstem
42
-        from (select max(qcid)qcid,questionid from t_question_class where classid=#{question.classid} group by questionid)a
42
+        from (select max(qcid)qcid,questionid from t_question_class where classid=#{question.classid} group by
43
+        questionid)a
43 44
         left join t_question_class qc on a.qcid=qc.qcid
44 45
         left join t_paper p on qc.paperid=p.paperid
45 46
         where qc.classid=#{question.classid} and qc.qctype in(1,2)
@@ -75,7 +76,8 @@
75 76
     <select id="pointList" resultType="com.xhkjedu.sstudy.vo.question.QuestionClassVo">
76 77
         select qc.questionid,qc.qscore,qc.avgscore,qc.errorrate,qc.qctype
77 78
         ,q.ctype,q.qstem,q.qoption,q.qtypeid,q.qtypename,q.count
78
-        from (select max(qcid)qcid,questionid from t_question_class where classid=#{question.classid} group by questionid)a
79
+        from (select max(qcid)qcid,questionid from t_question_class where classid=#{question.classid} group by
80
+        questionid)a
79 81
         left join t_question_class qc on a.qcid=qc.qcid
80 82
         left join t_paper p on qc.paperid=p.paperid
81 83
         left join t_question q on qc.questionid=q.questionid
@@ -243,7 +245,7 @@
243 245
     <select id="getPointIds" resultType="java.lang.String">
244 246
         select concat("'",group_concat(pointid separator "','"),"'") from t_question_point where questionid=#{questionid}
245 247
     </select>
246
-    <!--举一反三试题列表-->
248
+    <!--举一反三试题列表(随机返回3条)-->
247 249
     <select id="listJYFSQuestion" resultType="java.util.Map">
248 250
         select q.questionid,q.qtypeid,q.qtypename,q.complexity,q.count,q.qstem,q.qoption,q.qanswer,q.qanalyze,q.ctype
249 251
         ,(select count(*) from t_question_collect qc where qc.questionid=q.questionid)collected
@@ -253,7 +255,7 @@
253 255
         left join t_point p on tqp.pointid=p.pointid
254 256
         where qp.pointid in(${pointIds}) and qp.questionid!=#{questionid} and q.qstate=1
255 257
         and (q.belong in(1,2) or (q.schoolid=#{schoolid} and q.belong=3) or (q.createid=#{userid} and q.belong=4))
256
-        group by qp.questionid order by rand() limit 30
258
+        group by qp.questionid order by rand() limit 3
257 259
     </select>
258 260
 
259 261
     <!-- 根据作业id获取作业附件 -->

Loading…
Peruuta
Tallenna