|
@@ -288,10 +288,9 @@
|
288
|
288
|
<select id="getStudentPaperAnalyzeWeb" resultType="com.xhkjedu.sstudy.vo.paperstudent.StudentPaperVo">
|
289
|
289
|
select p.paperid,p.papername,p.papernum,p.paperscore,pg.starttime,pg.stoptime,ps.showanswer,pg.showtype
|
290
|
290
|
,ps.userscore,ps.costtime,truncate(ps.userscore*100/p.paperscore,2)scorerate,u.username as createname
|
291
|
|
- ,ps.psstate,ps.pschecked,(select count(*)+1 from t_paper_student ps1
|
292
|
|
- where ps1.paperid=ps.paperid and ps1.classid=ps.classid and ps1.userscore>ps.userscore)rank,
|
293
|
|
- (select count(*) from t_paper_student ps2 where ps2.paperid=ps.paperid and ps2.classid=ps.classid) stunum
|
|
291
|
+ ,ps.psstate,ps.pschecked,count(distinct case when ps2.userscore>ps.userscore then ps2.psid else null end)+1 rank,count(distinct ps2.psid)stunum
|
294
|
292
|
from t_paper_student ps left join t_paper p on ps.paperid = p.paperid
|
|
293
|
+ left join t_paper_student ps2 on ps2.paperid=ps.paperid and ps2.classid=ps.classid
|
295
|
294
|
left join t_paper_group pg on pg.paperid=ps.paperid and pg.classid=ps.classid
|
296
|
295
|
left join t_user u on p.createid=u.userid
|
297
|
296
|
where ps.psid=#{psid} limit 1
|