|
@@ -6,43 +6,24 @@
|
6
|
6
|
UPDATE t_recite SET recitetitle=#{recite.recitetitle},recitecont=#{recite.recitecont}
|
7
|
7
|
WHERE reciteid=#{recite.reciteid}
|
8
|
8
|
</update>
|
9
|
|
-
|
10
|
|
- <resultMap id="reciteClass" type="com.xhkjedu.sstudy.vo.recite.ReciteVo">
|
11
|
|
- <result property="reciteid" column="reciteid"></result>
|
12
|
|
- <result property="recitetitle" column="recitetitle"></result>
|
13
|
|
- <result property="recitecont" column="recitecont"></result>
|
14
|
|
- <result property="subjectid" column="subjectid"></result>
|
15
|
|
- <result property="subjectname" column="subjectname"></result>
|
16
|
|
- <result property="createid" column="createid"></result>
|
17
|
|
- <result property="createname" column="createname"></result>
|
18
|
|
- <result property="createtime" column="createtime"></result>
|
19
|
|
- <collection property="classlist" ofType="com.xhkjedu.sstudy.vo.recite.ReciteClassVo"
|
20
|
|
- javaType="java.util.List" select="listClass" column="{reciteid=reciteid}">
|
21
|
|
- </collection>
|
22
|
|
- </resultMap>
|
23
|
|
- <resultMap id="classResult" type="com.xhkjedu.sstudy.vo.recite.ReciteClassVo">
|
24
|
|
- <result property="classid" column="classid"></result>
|
25
|
|
- <result property="classname" column="classname"></result>
|
26
|
|
- <result property="starttime" column="starttime"></result>
|
27
|
|
- <result property="stoptime" column="stoptime"></result>
|
28
|
|
- <result property="stunum" column="stunum"></result>
|
29
|
|
- <result property="commitnum" column="commitnum"></result>
|
30
|
|
- </resultMap>
|
31
|
|
- <select id="listClass" resultMap="classResult">
|
32
|
|
- select rg.classid,c.classname,c.gradeid,rg.starttime,rg.stoptime,
|
33
|
|
- (SELECT COUNT(*) FROM t_recite_student rs WHERE rs.reciteid=rg.reciteid AND rs.classid=rg.classid) stunum,
|
34
|
|
- (SELECT COUNT(*) FROM t_recite_student rs WHERE rs.reciteid=rg.reciteid AND rs.classid=rg.classid AND rs.rsstate>0) commitnum
|
35
|
|
- from t_recite_group rg LEFT JOIN t_class c ON rg.classid = c.classid
|
36
|
|
- where rg.reciteid=#{reciteid} order by c.gradeid,c.classtype,c.classorder
|
|
9
|
+ <!--获取背诵班级-->
|
|
10
|
+ <select id="listClass" resultType="java.util.Map">
|
|
11
|
+ select rs.classid,c.classname,c.gradeid,count(distinct rs.rsid)stunum
|
|
12
|
+ ,count(distinct case when rs.rsstate>0 then rs.rsid else null end)commitnum
|
|
13
|
+ from t_recite_student rs left join t_class c on rs.classid = c.classid
|
|
14
|
+ where rs.reciteid=#{reciteid} group by rs.classid order by c.classtype,c.classorder
|
37
|
15
|
</select>
|
38
|
16
|
|
39
|
17
|
<!-- 背诵分页列表 网页 -->
|
40
|
|
- <select id="listRecites" resultMap="reciteClass">
|
41
|
|
- SELECT r.reciteid,r.recitetitle,r.recitecont,r.subjectid,s.subjectname,
|
42
|
|
- r.createid,u.username AS createname,r.createtime,rg.starttime,rg.stoptime
|
43
|
|
- FROM t_recite r LEFT JOIN t_subject s ON r.subjectid = s.subjectid
|
44
|
|
- LEFT JOIN t_user u ON r.createid=u.userid
|
|
18
|
+ <select id="listRecites" resultType="java.util.Map">
|
|
19
|
+ SELECT r.reciteid,r.recitetitle,r.recitecont
|
|
20
|
+ ,(select s.subjectname from t_subject s where s.subjectid=r.subjectid)subjectname
|
|
21
|
+ ,COUNT(DISTINCT CASE WHEN rs.reciteid=r.reciteid THEN rs.rsid ELSE NULL END)stunum
|
|
22
|
+ ,COUNT(DISTINCT CASE WHEN rs.reciteid=r.reciteid AND rs.rsstate>0 THEN rs.rsid ELSE NULL END)commitnum
|
|
23
|
+ ,r.createid,u.username AS createname,r.createtime,rg.starttime,rg.stoptime
|
|
24
|
+ FROM t_recite r LEFT JOIN t_user u ON r.createid=u.userid
|
45
|
25
|
LEFT JOIN t_recite_group rg ON rg.reciteid = r.reciteid
|
|
26
|
+ LEFT JOIN t_recite_student rs ON r.reciteid=rg.reciteid
|
46
|
27
|
where r.createid=#{recite.createid}
|
47
|
28
|
<if test="recite.recitestate==1">
|
48
|
29
|
AND rg.stoptime<![CDATA[ >= ]]>UNIX_TIMESTAMP()
|
|
@@ -50,6 +31,9 @@
|
50
|
31
|
<if test="recite.recitestate==2">
|
51
|
32
|
AND rg.stoptime<![CDATA[ < ]]>UNIX_TIMESTAMP()
|
52
|
33
|
</if>
|
|
34
|
+ <if test="recite.recitetitle!=null and recite.recitetitle!=''">
|
|
35
|
+ AND r.recitetitle like '%${recite.recitetitle}%'
|
|
36
|
+ </if>
|
53
|
37
|
GROUP BY r.reciteid ORDER BY r.createtime desc
|
54
|
38
|
</select>
|
55
|
39
|
</mapper>
|