57 lines
2.2 KiB
XML
57 lines
2.2 KiB
XML
<?xml version="1.0" encoding="UTF-8"?>
|
|
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
|
<mapper namespace="SouthExamCheck">
|
|
|
|
|
|
|
|
<sql id="baseSqlForAlias">
|
|
a.uid,a.examId,a.examPaperId,a.score,a.trueScore,a.areaId,a.howmuch,a.avgScore,a.maxScoreTime,a.lastTime,a.bigQuesScore
|
|
</sql>
|
|
<sql id="baseSql">
|
|
uid,examId,examPaperId,score,trueScore,areaId,howmuch,avgScore,maxScoreTime,lastTime,bigQuesScore
|
|
</sql>
|
|
|
|
|
|
|
|
<select id="getAdminSouthAreas" parameterType="java.util.Map" resultType="Area">
|
|
select c.* from admin as a inner join adminOwnArea as b on a.adminId = b.adminId inner join area as c on b.areaId = c.areaId
|
|
where a.adminId = #{adminId} and b.areaId >950000 and b.areaId <960000
|
|
<if test="type != null">and b.type = #{type}</if>
|
|
<if test="parentId != null">and c.parentId = #{parentId}</if>
|
|
</select>
|
|
|
|
|
|
|
|
|
|
<select id="getSouthExamAnswerAnalyse" parameterType="java.util.Map" resultType="FinishSouthStatDto">
|
|
|
|
with temp1 as (select a.trueName,a.studentId,a.recognizeCode from student as a inner join studentownclass as b
|
|
on a.studentId = b.studentId and b.status =1 and a.status = 1 where b.classesId = #{classesId} and a.areaId =
|
|
#{areaId}),
|
|
temp2 as (select
|
|
a.uid,a.examId,a.examPaperId,a.score,a.trueScore,a.areaId,a.howmuch,a.avgScore,a.maxScoreTime,a.lastTime,a.bigQuesScore,
|
|
case when a.score >= 85 then 'A'
|
|
when a.score >= 80 then 'B'
|
|
when a.score >= 70 then 'C'
|
|
when a.score >= 60 then 'D'
|
|
else 'E' end as level
|
|
from temp1 as b inner join finishSouthStat as a on a.uid =
|
|
b.studentId where a.areaId =#{areaId} and a.examId = #{examId}
|
|
order by a.score desc
|
|
<if test="pageSize != null and offset != null">
|
|
limit #{pageSize} offset #{offset}
|
|
</if>)
|
|
|
|
select b.trueName as studentName,b.recognizeCode ,b.studentId as uid,a.examId,coalesce (a.examPaperId,0) as examPaperId,COALESCE (a.score,0) as score,COALESCE (a.trueScore,0) as trueScore,a.areaId,a.howmuch,COALESCE (a.avgScore,0) as avgScore,a.maxScoreTime,a.lastTime,COALESCE (a.level,'E') as level,a.bigQuesScore from temp1 as b left join temp2 as a on b.studentId = a.uid order by score desc,a.lastTime asc
|
|
|
|
|
|
|
|
</select>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
</mapper> |