|
@@ -53,72 +53,57 @@
|
53
|
53
|
</update>
|
54
|
54
|
<!--试题知识点列表-->
|
55
|
55
|
<resultMap id="questionResult" type="com.xhkjedu.sstudy.vo.question.QuestionVo">
|
56
|
|
- <result property="questionid" column="questionid"></result>
|
57
|
|
- <result property="score" column="score"></result>
|
58
|
|
- <result property="complexity" column="complexity"></result>
|
59
|
|
- <result property="ctype" column="ctype"></result>
|
60
|
|
- <result property="qstem" column="qstem"></result>
|
61
|
|
- <result property="qstemtxt" column="qstemtxt"></result>
|
62
|
|
- <result property="qoption" column="qoption"></result>
|
63
|
|
- <result property="qanswer" column="qanswer"></result>
|
64
|
|
- <result property="qanalyze" column="qanalyze"></result>
|
65
|
|
- <result property="qtypeid" column="qtypeid"></result>
|
66
|
|
- <result property="qtypename" column="qtypename"></result>
|
67
|
|
- <result property="createtime" column="createtime"></result>
|
68
|
|
- <result property="createname" column="createname"></result>
|
69
|
|
- <result property="count" column="count"></result>
|
70
|
|
- <result property="directorid" column="directorid"></result>
|
71
|
|
- <result property="directorname" column="directorname"></result>
|
72
|
|
- <result property="hashear" column="hashear"></result>
|
73
|
|
- <result property="hearfile" column="hearfile"></result>
|
74
|
|
- <result property="belong" column="belong"></result>
|
75
|
|
- <result property="createid" column="createid"></result>
|
76
|
|
- <result property="source" column="source"></result>
|
77
|
|
- <result property="year" column="year"></result>
|
78
|
|
- <result property="region" column="region"></result>
|
79
|
|
- <result property="schoolname" column="schoolname"></result>
|
80
|
|
- <result property="schoolid" column="schoolid"></result>
|
81
|
|
- <result property="subjectid" column="subjectid"></result>
|
82
|
|
- <result property="areaall" column="areaall"></result>
|
83
|
|
- <result property="qlevel" column="qlevel"></result>
|
|
56
|
+ <result property="questionid" column="questionid"/>
|
|
57
|
+ <result property="score" column="score"/>
|
|
58
|
+ <result property="complexity" column="complexity"/>
|
|
59
|
+ <result property="ctype" column="ctype"/>
|
|
60
|
+ <result property="qstem" column="qstem"/>
|
|
61
|
+ <result property="qstemtxt" column="qstemtxt"/>
|
|
62
|
+ <result property="qoption" column="qoption"/>
|
|
63
|
+ <result property="qanswer" column="qanswer"/>
|
|
64
|
+ <result property="qanalyze" column="qanalyze"/>
|
|
65
|
+ <result property="qtypeid" column="qtypeid"/>
|
|
66
|
+ <result property="qtypename" column="qtypename"/>
|
|
67
|
+ <result property="createtime" column="createtime"/>
|
|
68
|
+ <result property="createname" column="createname"/>
|
|
69
|
+ <result property="count" column="count"/>
|
|
70
|
+ <result property="directorid" column="directorid"/>
|
|
71
|
+ <result property="directorname" column="directorname"/>
|
|
72
|
+ <result property="hashear" column="hashear"/>
|
|
73
|
+ <result property="hearfile" column="hearfile"/>
|
|
74
|
+ <result property="belong" column="belong"/>
|
|
75
|
+ <result property="createid" column="createid"/>
|
|
76
|
+ <result property="source" column="source"/>
|
|
77
|
+ <result property="year" column="year"/>
|
|
78
|
+ <result property="region" column="region"/>
|
|
79
|
+ <result property="schoolname" column="schoolname"/>
|
|
80
|
+ <result property="schoolid" column="schoolid"/>
|
|
81
|
+ <result property="subjectid" column="subjectid"/>
|
|
82
|
+ <result property="areaall" column="areaall"/>
|
|
83
|
+ <result property="qlevel" column="qlevel"/>
|
84
|
84
|
<collection property="points" ofType="com.xhkjedu.sstudy.vo.subjectbook.PointVo" javaType="java.util.List"
|
85
|
85
|
select="listPoint" column="{questionid=questionid}">
|
86
|
86
|
</collection>
|
87
|
87
|
<collection property="directors" ofType="com.xhkjedu.sstudy.vo.subjectbook.DirectorVo" javaType="java.util.List">
|
88
|
|
- <result property="lsbid" column="lsbid"></result>
|
89
|
|
- <result property="directorid" column="directorid"></result>
|
90
|
|
- <result property="directorname" column="directorname"></result>
|
91
|
|
- <result property="level" column="level"></result>
|
92
|
|
- <result property="subjectid" column="subjectid"></result>
|
93
|
|
- <result property="subjectname" column="subjectname"></result>
|
94
|
|
- <result property="versionname" column="versionname"></result>
|
95
|
|
- <result property="lsbname" column="lsbname"></result>
|
|
88
|
+ <result property="lsbid" column="lsbid"/>
|
|
89
|
+ <result property="directorid" column="directorid"/>
|
|
90
|
+ <result property="directorname" column="directorname"/>
|
|
91
|
+ <result property="level" column="level"/>
|
|
92
|
+ <result property="subjectid" column="subjectid"/>
|
|
93
|
+ <result property="subjectname" column="subjectname"/>
|
|
94
|
+ <result property="versionname" column="versionname"/>
|
|
95
|
+ <result property="lsbname" column="lsbname"/>
|
96
|
96
|
</collection>
|
97
|
97
|
</resultMap>
|
98
|
|
- <resultMap id="pointResult" type="com.xhkjedu.sstudy.vo.subjectbook.PointVo">
|
99
|
|
- <result property="pointid" column="pointid"></result>
|
100
|
|
- <result property="pointname" column="pointname"></result>
|
101
|
|
- </resultMap>
|
102
|
|
- <select id="listPoint" resultMap="pointResult">
|
|
98
|
+ <select id="listPoint" resultType="com.xhkjedu.sstudy.vo.subjectbook.PointVo">
|
103
|
99
|
select qp.pointid,p.pointname from t_question_point qp left join t_point p on qp.pointid = p.pointid
|
104
|
100
|
where qp.questionid=#{questionid}
|
105
|
101
|
</select>
|
106
|
|
- <select id="listQuestions" resultMap="questionResult">
|
107
|
|
- select q.questionid,q.score,q.complexity,q.ctype,q.qstem,q.qoption,q.qanswer,q.qanalyze,q.belong,q.hashear,q.hearfile
|
108
|
|
- ,q.qtypeid,q.qtypename,q.createtime,u.username createname,q.count,qd.directorid,d.directorname,0 pointid
|
109
|
|
- from t_question q left join t_user u on u.userid = q.createid
|
110
|
|
- left join t_question_director qd on q.questionid=qd.questionid
|
111
|
|
- left join t_director d on qd.directorid = d.directorid
|
112
|
|
- where q.questionid in
|
113
|
|
- <foreach item="question" collection="questions" open="(" separator="," close=")">
|
114
|
|
- #{question.questionid}
|
115
|
|
- </foreach>
|
116
|
|
- </select>
|
117
|
102
|
<!--详情-->
|
118
|
103
|
<select id="findById" resultMap="questionResult">
|
119
|
104
|
select q.questionid,q.score,q.complexity,q.ctype,q.qstem,q.qstemtxt,q.qoption,q.qanswer,q.qanalyze,q.belong
|
120
|
105
|
,q.qtypeid,q.qtypename,q.createtime,q.source,q.year,q.region,q.schoolname,q.subjectid,q.schoolid
|
121
|
|
- ,qd.directorid,d.directorall directorname,d.lsbid,q.hashear,q.hearfile,q.qlevel,
|
|
106
|
+ ,qd.directorid,d.directorall as directorname,d.lsbid,q.hashear,q.hearfile,q.qlevel,
|
122
|
107
|
sb.level,sb.subjectid,s.subjectname,v.versionname,sb.lsbname
|
123
|
108
|
,(select a.areaall from t_areazone a where a.areacode=q.region)areaall
|
124
|
109
|
from t_question q left join t_question_director qd on q.questionid=qd.questionid
|
|
@@ -146,28 +131,33 @@
|
146
|
131
|
left join t_question_collect qc on q.questionid = qc.questionid
|
147
|
132
|
</if>
|
148
|
133
|
<where>
|
149
|
|
- <if test="question.belong==0">
|
150
|
|
- and (q.belong in(1,2)
|
151
|
|
- <if test="question.schoolid!=null">
|
152
|
|
- or (q.belong in(3,10) and q.schoolid=#{question.schoolid})
|
153
|
|
- </if>
|
154
|
|
- <if test="question.createid!=null">
|
155
|
|
- or (q.belong=4 and q.createid=#{question.createid})
|
156
|
|
- </if>
|
157
|
|
- )
|
158
|
|
- </if>
|
159
|
|
- <if test="question.belong>=3 and question.belong<=4">
|
160
|
|
- and q.belong=#{question.belong}
|
161
|
|
- </if>
|
162
|
|
- <if test="question.belong==2">
|
163
|
|
- and q.belong in(1,2)
|
164
|
|
- </if>
|
165
|
|
- <if test="question.belong==3">
|
166
|
|
- and q.schoolid=#{question.schoolid}
|
167
|
|
- </if>
|
168
|
|
- <if test="question.belong==10">
|
169
|
|
- and q.schoolid=#{question.schoolid} and q.belong=#{question.belong}
|
170
|
|
- </if>
|
|
134
|
+ <choose>
|
|
135
|
+ <when test="question.belong==0">
|
|
136
|
+ and (q.belong in(1,2)
|
|
137
|
+ <if test="question.schoolid!=null">
|
|
138
|
+ or (q.belong in(3,10) and q.schoolid=#{question.schoolid})
|
|
139
|
+ </if>
|
|
140
|
+ <if test="question.createid!=null">
|
|
141
|
+ or (q.belong=4 and q.createid=#{question.createid})
|
|
142
|
+ </if>
|
|
143
|
+ )
|
|
144
|
+ </when>
|
|
145
|
+ <when test="question.belong==2">
|
|
146
|
+ and q.belong in(1,2)
|
|
147
|
+ </when>
|
|
148
|
+ <when test="question.belong==3 or question.belong==10">
|
|
149
|
+ and q.schoolid=#{question.schoolid} and q.belong=#{question.belong}
|
|
150
|
+ </when>
|
|
151
|
+ <when test="question.belong==4">
|
|
152
|
+ and q.belong=#{question.belong} and q.createid=#{question.createid}
|
|
153
|
+ </when>
|
|
154
|
+ <when test="question.belong==5">
|
|
155
|
+ and qc.userid=#{question.createid}
|
|
156
|
+ </when>
|
|
157
|
+ <when test="question.belong==6">
|
|
158
|
+ and q.schoolid=#{question.schoolid} and q.createid=#{question.createid}
|
|
159
|
+ </when>
|
|
160
|
+ </choose>
|
171
|
161
|
<if test="question.subjectid!=null and question.subjectid!='0'.toString() and question.subjectid!=''">
|
172
|
162
|
and q.subjectid=#{question.subjectid}
|
173
|
163
|
</if>
|
|
@@ -189,14 +179,6 @@
|
189
|
179
|
<if test="question.hashear!=1 and question.qtypeid!=null and question.qtypeid!='0'.toString() and question.qtypeid!=''">
|
190
|
180
|
and q.hashear=0 and q.qtypeid=#{question.qtypeid}
|
191
|
181
|
</if>
|
192
|
|
- <if test="question.belong!=null and question.belong!=0">
|
193
|
|
- <if test="question.belong==4 or question.belong==6">
|
194
|
|
- and q.createid=#{question.createid}
|
195
|
|
- </if>
|
196
|
|
- <if test="question.belong==5">
|
197
|
|
- and qc.userid=#{question.createid}
|
198
|
|
- </if>
|
199
|
|
- </if>
|
200
|
182
|
<if test="question.complexity!=null and question.complexity!=0">
|
201
|
183
|
and q.complexity=#{question.complexity}
|
202
|
184
|
</if>
|
|
@@ -208,36 +190,6 @@
|
208
|
190
|
group by q.questionid order by q.qstate,q.createtime desc
|
209
|
191
|
</select>
|
210
|
192
|
|
211
|
|
- <!--章节、知识点选题-->
|
212
|
|
- <!--<resultMap id="directPointQuestions" type="java.util.Map">
|
213
|
|
- <result property="questionid" column="questionid"></result>
|
214
|
|
- <result property="score" column="score"></result>
|
215
|
|
- <result property="complexity" column="complexity"></result>
|
216
|
|
- <result property="qstem" column="qstem"></result>
|
217
|
|
- <result property="qoption" column="qoption"></result>
|
218
|
|
- <result property="qanswer" column="qanswer"></result>
|
219
|
|
- <result property="qanalyze" column="qanalyze"></result>
|
220
|
|
- <result property="qtypeid" column="qtypeid"></result>
|
221
|
|
- <result property="qtypename" column="qtypename"></result>
|
222
|
|
- <result property="count" column="count"></result>
|
223
|
|
- <result property="points" column="points"></result>
|
224
|
|
- <result property="ctype" column="ctype"></result>
|
225
|
|
- <result property="source" column="source"></result>
|
226
|
|
- <result property="year" column="year"></result>
|
227
|
|
- <result property="region" column="region"></result>
|
228
|
|
- <result property="schoolname" column="schoolname"></result>
|
229
|
|
- <result property="qlevel" column="qlevel"></result>
|
230
|
|
- <result property="snum" column="snum"></result>
|
231
|
|
- <result property="hashear" column="hashear"></result>
|
232
|
|
- <result property="hearfile" column="hearfile"></result>
|
233
|
|
- <collection property="sonqlist" ofType="java.util.Map"
|
234
|
|
- column="questionid" select="listSonQuestionForSelect">
|
235
|
|
- </collection>
|
236
|
|
- <collection property="points" ofType="java.util.Map" javaType="java.util.List"
|
237
|
|
- column="questionid" select="selectQuesitonPoints">
|
238
|
|
- </collection>
|
239
|
|
- </resultMap>-->
|
240
|
|
-
|
241
|
193
|
<!--章节、知识点选题-->
|
242
|
194
|
<select id="listForSelect" resultType="java.util.Map">
|
243
|
195
|
select q.questionid,q.score,q.complexity,q.qstem,q.qstemtxt,q.qoption,q.qanswer,q.qanalyze
|
|
@@ -276,36 +228,33 @@
|
276
|
228
|
<if test="question.complexity!=null and question.complexity!=0">
|
277
|
229
|
and q.complexity=#{question.complexity}
|
278
|
230
|
</if>
|
279
|
|
- <if test="question.belong==0">
|
280
|
|
- and (q.belong in(1,2)
|
281
|
|
- <if test="question.schoolid!=null">
|
282
|
|
- or (q.belong in(3,10) and q.schoolid=#{question.schoolid})
|
283
|
|
- </if>
|
284
|
|
- <if test="question.createid!=null">
|
285
|
|
- or (q.belong=4 and q.createid=#{question.createid})
|
286
|
|
- </if>
|
287
|
|
- )
|
288
|
|
- </if>
|
289
|
|
- <if test="question.belong>=3 and question.belong<=4">
|
290
|
|
- and q.belong=#{question.belong}
|
291
|
|
- </if>
|
292
|
|
- <if test="question.belong==2">
|
293
|
|
- and q.belong in(1,2)
|
294
|
|
- </if>
|
295
|
|
- <if test="question.belong==3">
|
296
|
|
- and q.schoolid=#{question.schoolid}
|
297
|
|
- </if>
|
298
|
|
- <if test="question.belong==10">
|
299
|
|
- and q.schoolid=#{question.schoolid} and q.belong=#{question.belong}
|
300
|
|
- </if>
|
301
|
|
- <if test="question.belong!=null and question.belong!=0">
|
302
|
|
- <if test="question.belong==4 or question.belong==6">
|
303
|
|
- and q.createid=#{question.createid}
|
304
|
|
- </if>
|
305
|
|
- <if test="question.belong==5">
|
|
231
|
+ <choose>
|
|
232
|
+ <when test="question.belong==0">
|
|
233
|
+ and (q.belong in(1,2)
|
|
234
|
+ <if test="question.schoolid!=null">
|
|
235
|
+ or (q.belong in(3,10) and q.schoolid=#{question.schoolid})
|
|
236
|
+ </if>
|
|
237
|
+ <if test="question.createid!=null">
|
|
238
|
+ or (q.belong=4 and q.createid=#{question.createid})
|
|
239
|
+ </if>
|
|
240
|
+ )
|
|
241
|
+ </when>
|
|
242
|
+ <when test="question.belong==2">
|
|
243
|
+ and q.belong in(1,2)
|
|
244
|
+ </when>
|
|
245
|
+ <when test="question.belong==3 or question.belong==10">
|
|
246
|
+ and q.schoolid=#{question.schoolid} and q.belong=#{question.belong}
|
|
247
|
+ </when>
|
|
248
|
+ <when test="question.belong==4">
|
|
249
|
+ and q.belong=#{question.belong} and q.createid=#{question.createid}
|
|
250
|
+ </when>
|
|
251
|
+ <when test="question.belong==5">
|
306
|
252
|
and qc.userid=#{question.createid}
|
307
|
|
- </if>
|
308
|
|
- </if>
|
|
253
|
+ </when>
|
|
254
|
+ <when test="question.belong==6">
|
|
255
|
+ and q.schoolid=#{question.schoolid} and q.createid=#{question.createid}
|
|
256
|
+ </when>
|
|
257
|
+ </choose>
|
309
|
258
|
<if test="question.year!=null and question.year!=0">
|
310
|
259
|
and FROM_UNIXTIME(q.createtime,'%Y')=#{question.year}
|
311
|
260
|
</if>
|
|
@@ -354,9 +303,9 @@
|
354
|
303
|
</select>
|
355
|
304
|
<!--获取试题详情及关联章节、知识点、伙伴校-->
|
356
|
305
|
<resultMap id="questionMap" type="com.xhkjedu.sstudy.model.question.TQuestion">
|
357
|
|
- <collection property="questionPoints" select="listPoint2" column="questionid"></collection>
|
358
|
|
- <collection property="directors" select="listDirector" column="questionid"></collection>
|
359
|
|
- <collection property="schools" select="listSchool" column="questionid"></collection>
|
|
306
|
+ <collection property="questionPoints" select="listPoint2" column="questionid"/>
|
|
307
|
+ <collection property="directors" select="listDirector" column="questionid"/>
|
|
308
|
+ <collection property="schools" select="listSchool" column="questionid"/>
|
360
|
309
|
</resultMap>
|
361
|
310
|
<select id="listPoint2" resultType="com.xhkjedu.sstudy.model.question.TQuestionPoint">
|
362
|
311
|
select * from t_question_point where questionid=#{questionid}
|