|
@@ -3,13 +3,13 @@
|
3
|
3
|
<mapper namespace="com.xhkjedu.sstudy.mapper.resource.GuideMapper">
|
4
|
4
|
|
5
|
5
|
<resultMap id="guidesForMap" type="com.xhkjedu.sstudy.vo.resource.GuideVo">
|
6
|
|
- <result column="guideid" property="guideid"></result>
|
7
|
|
- <result column="guidename" property="guidename"></result>
|
8
|
|
- <result column="createname" property="createname"></result>
|
9
|
|
- <result column="createtime" property="createtime"></result>
|
10
|
|
- <result column="costtime" property="costtime"></result>
|
11
|
|
- <result column="subjectname" property="subjectname"></result>
|
12
|
|
- <result column="createid" property="createid"></result>
|
|
6
|
+ <result column="guideid" property="guideid"/>
|
|
7
|
+ <result column="guidename" property="guidename"/>
|
|
8
|
+ <result column="createname" property="createname"/>
|
|
9
|
+ <result column="createtime" property="createtime"/>
|
|
10
|
+ <result column="costtime" property="costtime"/>
|
|
11
|
+ <result column="subjectname" property="subjectname"/>
|
|
12
|
+ <result column="createid" property="createid"/>
|
13
|
13
|
<collection property="resources" ofType="java.util.Map"
|
14
|
14
|
javaType="java.util.List" select="listResourcesByGuideid" column="{guideid=guideid}">
|
15
|
15
|
</collection>
|
|
@@ -23,7 +23,7 @@
|
23
|
23
|
left join t_guide_group gg on g.guideid = gg.guideid
|
24
|
24
|
where g.subjectid=#{guide.subjectid}
|
25
|
25
|
and ((g.hashb=1 and g.schoolid=#{guide.schoolid} and gg.classid in (${guide.classids})) or
|
26
|
|
- (gg.classid in (${guide.bxclassids})))
|
|
26
|
+ (gg.classid in (${guide.bxclassids})) or g.createid=#{guide.createid})
|
27
|
27
|
<if test="guide.lsbid!=null and guide.lsbid!='' and guide.lsbid!='0'.toString()">
|
28
|
28
|
and g.lsbid = #{guide.lsbid}
|
29
|
29
|
</if>
|
|
@@ -33,7 +33,7 @@
|
33
|
33
|
<if test="guide.guidename!=null and guide.guidename!=''">
|
34
|
34
|
and g.guidename like '%${guide.guidename}%'
|
35
|
35
|
</if>
|
36
|
|
- group by g.guideid order by g.createtime desc,g.guidename asc
|
|
36
|
+ group by g.guideid order by g.createtime desc,g.guidename
|
37
|
37
|
</select>
|
38
|
38
|
<select id="listResourcesByGuideid" resultType="java.util.Map">
|
39
|
39
|
select r.resourceid, r.resourcename,r.resourceurl,r.resourcecover,r.converted,r.pdfurl,
|
|
@@ -46,13 +46,13 @@
|
46
|
46
|
select g.guideid,g.guidename,g.createtime,
|
47
|
47
|
g.schoolid,(select u.username from t_user u where g.createid=u.userid)createname,
|
48
|
48
|
count(DISTINCT gr.resourceid)as filenum,r.suffix,r.resourcecover,r.resourceclass,r.converted,
|
49
|
|
- sum(r.resourcesize) resourcesize
|
|
49
|
+ sum(r.resourcesize) as resourcesize
|
50
|
50
|
from t_guide g left join t_guide_resource gr on g.guideid=gr.guideid
|
51
|
51
|
left join t_resource r on gr.resourceid=r.resourceid
|
52
|
52
|
left join t_guide_group gg on g.guideid = gg.guideid
|
53
|
53
|
where g.subjectid=#{guide.subjectid}
|
54
|
54
|
and ((g.hashb=1 and g.schoolid=#{guide.schoolid} and gg.classid in (${guide.classids})) or
|
55
|
|
- (gg.classid in (${guide.bxclassids})))
|
|
55
|
+ (gg.classid in (${guide.bxclassids})) or g.createid=#{guide.createid})
|
56
|
56
|
<if test="guide.lsbid!=null and guide.lsbid!='' and guide.lsbid!='0'.toString()">
|
57
|
57
|
and g.lsbid = #{guide.lsbid}
|
58
|
58
|
</if>
|
|
@@ -62,7 +62,7 @@
|
62
|
62
|
<if test="guide.guidename!=null and guide.guidename!=''">
|
63
|
63
|
and g.guidename like '%${guide.guidename}%'
|
64
|
64
|
</if>
|
65
|
|
- group by g.guideid order by g.createtime desc,g.guidename asc limit #{guide.page},#{guide.pageSize}
|
|
65
|
+ group by g.guideid order by g.createtime desc,g.guidename limit #{guide.page},#{guide.pageSize}
|
66
|
66
|
</select>
|
67
|
67
|
|
68
|
68
|
<!--学生预习列表学生网页端-->
|
|
@@ -140,7 +140,7 @@
|
140
|
140
|
|
141
|
141
|
<!--预习统计:年级下教师列表-->
|
142
|
142
|
<select id="listUser" resultType="com.xhkjedu.sstudy.vo.resource.GuideAnalyzeVo">
|
143
|
|
- select u.userid teacherid,u.username teachername,s.subjectname,c.gradeid
|
|
143
|
+ select u.userid as teacherid,u.username teachername,s.subjectname,c.gradeid
|
144
|
144
|
from t_class_teacher ct inner join t_class c on ct.classid=c.classid
|
145
|
145
|
inner join t_teacher_powersb tp on tp.teacherid=ct.teacherid
|
146
|
146
|
inner join t_subject_book sb on sb.lsbid=tp.lsbid
|
|
@@ -162,7 +162,7 @@
|
162
|
162
|
<!--预习统计:教师预习统计-->
|
163
|
163
|
<select id="getPreviewAnalyze" resultType="com.xhkjedu.sstudy.vo.resource.GuideAnalyzeVo">
|
164
|
164
|
select g.createid as teacherid,count(distinct ggs.guideid)fbnum,count(distinct ggs.rgsid)yyxnum,
|
165
|
|
- count(distinct case when ggs.costtime!=0 then ggs.rgsid else null end)yxnum
|
|
165
|
+ count(distinct if(ggs.costtime!=0, ggs.rgsid, null))yxnum
|
166
|
166
|
from t_guide g left join t_guide_group_student ggs on ggs.guideid=g.guideid
|
167
|
167
|
left join t_class c on ggs.classid=c.classid
|
168
|
168
|
where g.schoolid=#{paper.schoolid} and ggs.schoolid=#{paper.schoolid}
|
|
@@ -193,7 +193,7 @@
|
193
|
193
|
left join t_class c on gg.classid=c.classid
|
194
|
194
|
left join t_guide_resource gr on g.guideid=gr.guideid
|
195
|
195
|
where c.gradeid=#{paper.gradeid} and c.year=#{paper.year}
|
196
|
|
- and g.createid=#{paper.teacherid} and gg.schoolid=#{paper.schoolid}
|
|
196
|
+ and g.createid=#{paper.createid} and gg.schoolid=#{paper.schoolid}
|
197
|
197
|
<if test="paper.starttime!=null and paper.starttime!=0">
|
198
|
198
|
and g.createtime>=#{paper.starttime}
|
199
|
199
|
</if>
|
|
@@ -209,14 +209,14 @@
|
209
|
209
|
<if test="paper.subjectid!='0'.toString() and paper.subjectid!=''">
|
210
|
210
|
and g.subjectid=#{paper.subjectid}
|
211
|
211
|
</if>
|
212
|
|
- group by g.guideid order by g.createtime desc,g.guidename asc,g.guideid asc
|
|
212
|
+ group by g.guideid order by g.createtime desc,g.guidename,g.guideid
|
213
|
213
|
</select>
|
214
|
214
|
<!--预习统计-按学生列表-->
|
215
|
215
|
<select id="listPreviewStuGrade1" resultType="java.util.Map">
|
216
|
216
|
select a.*,ifnull(truncate(a.commitnum*100/a.sdnum,2),0)commitrate
|
217
|
217
|
from(select cs.studentid,u.username studentname
|
218
|
|
- ,count(distinct case when g.guideid is not null then ggs.rgsid else null end)sdnum
|
219
|
|
- ,count(distinct case when ggs.costtime!=0 and g.guideid is not null then ggs.rgsid else null end)commitnum
|
|
218
|
+ ,count(distinct if(g.guideid is not null, ggs.rgsid, null))sdnum
|
|
219
|
+ ,count(distinct if(ggs.costtime!=0 and g.guideid is not null, ggs.rgsid, null))commitnum
|
220
|
220
|
from t_class_student cs left join t_class c on cs.classid=c.classid
|
221
|
221
|
left join t_guide_group_student ggs on c.classid=ggs.classid and ggs.studentid=cs.studentid
|
222
|
222
|
left join t_guide g on ggs.guideid=g.guideid
|
|
@@ -243,8 +243,8 @@
|
243
|
243
|
<select id="listPreviewStuGrade" resultType="java.util.Map">
|
244
|
244
|
select a.*,ifnull(truncate(a.commitnum*100/a.sdnum,2),0)commitrate
|
245
|
245
|
from(select cs.*
|
246
|
|
- ,count(distinct case when g.guideid is not null then ggs.rgsid else null end)sdnum
|
247
|
|
- ,count(distinct case when ggs.costtime!=0 and g.guideid is not null then ggs.rgsid else null end)commitnum
|
|
246
|
+ ,count(distinct if(g.guideid is not null, ggs.rgsid, null))sdnum
|
|
247
|
+ ,count(distinct if(ggs.costtime!=0 and g.guideid is not null, ggs.rgsid, null))commitnum
|
248
|
248
|
from (select cs2.studentid,u.username studentname
|
249
|
249
|
from t_class_student cs2,t_class c,t_user u
|
250
|
250
|
where c.schoolid=#{paper.schoolid} and c.gradeid=#{paper.gradeid} and c.year=#{paper.year}
|
|
@@ -281,7 +281,7 @@
|
281
|
281
|
<select id="listPreviewStuDetail" resultType="com.xhkjedu.sstudy.vo.paper.AStudentPaperVo">
|
282
|
282
|
select a.*,ifnull(truncate(a.commitnum*100/a.sdnum,2),0)commitrate
|
283
|
283
|
from(select s.subjectname
|
284
|
|
- ,count(distinct ggs.rgsid)sdnum,count(distinct case when ggs.costtime!=0 then ggs.rgsid else null end)commitnum
|
|
284
|
+ ,count(distinct ggs.rgsid)sdnum,count(distinct if(ggs.costtime!=0, ggs.rgsid, null))commitnum
|
285
|
285
|
from t_guide_group_student ggs left join t_class c on ggs.classid=c.classid
|
286
|
286
|
left join t_guide g on ggs.guideid=g.guideid
|
287
|
287
|
left join t_subject s on g.subjectid=s.subjectid
|
|
@@ -329,7 +329,7 @@
|
329
|
329
|
<!--预习关联班级-->
|
330
|
330
|
<select id="listGuideClassByGuide" resultType="java.util.Map">
|
331
|
331
|
select rs.classid,c.classname,c.gradeid,s.schoolid,s.schoolname,count(distinct rs.rgsid)stunum
|
332
|
|
- ,count(distinct case when rs.readtime>0 then rs.rgsid else null end)commitnum
|
|
332
|
+ ,count(distinct if(rs.readtime>0, rs.rgsid, null))commitnum
|
333
|
333
|
from t_guide_group_student rs left join t_class c on rs.classid = c.classid
|
334
|
334
|
left join t_guide g on rs.guideid=g.guideid
|
335
|
335
|
left join t_school s on rs.schoolid=s.schoolid
|
|
@@ -341,4 +341,8 @@
|
341
|
341
|
</if>
|
342
|
342
|
group by rs.classid order by s.createtime desc, c.classtype,c.classorder
|
343
|
343
|
</select>
|
|
344
|
+ <!--获取预习年份-->
|
|
345
|
+ <select id="getYearById" resultType="java.lang.Integer">
|
|
346
|
+ select year from t_guide where guideid=#{guideid}
|
|
347
|
+ </select>
|
344
|
348
|
</mapper>
|