|
@@ -38,8 +38,18 @@
|
|
bes.student_name,
|
|
bes.student_name,
|
|
s.student_code
|
|
s.student_code
|
|
from mark_student s
|
|
from mark_student s
|
|
- left join (select * from basic_exam_student where exam_id = #{examId}) bes on s.basic_student_id = bes.id
|
|
|
|
- left join sys_user su on s.create_id = su.id
|
|
|
|
|
|
+ inner join basic_exam_student bes on s.basic_student_id = bes.id
|
|
|
|
+ INNER join sys_user su on s.create_id = su.id
|
|
|
|
+ <if test="dpr != null and dpr.orgIdSet != null and dpr.orgIdSet != '' and dpr.orgIdSet.size > 0">
|
|
|
|
+ AND su.org_id IN
|
|
|
|
+ <foreach collection="dpr.orgIdSet" item="item" index="index" open="(" separator="," close=")">
|
|
|
|
+ #{item}
|
|
|
|
+ </foreach>
|
|
|
|
+ </if>
|
|
|
|
+ INNER JOIN mark_paper mp ON s.exam_id = mp.exam_id
|
|
|
|
+ and s.paper_number = mp.paper_number
|
|
|
|
+ and s.paper_type = mp.paper_type
|
|
|
|
+ and mp.status = #{markPaperStatus}
|
|
<where>
|
|
<where>
|
|
<if test="examId != null">
|
|
<if test="examId != null">
|
|
and s.exam_id = #{examId}
|
|
and s.exam_id = #{examId}
|
|
@@ -56,31 +66,33 @@
|
|
<if test="studentCodeOrName != null and studentCodeOrName != ''">
|
|
<if test="studentCodeOrName != null and studentCodeOrName != ''">
|
|
and (s.student_code = #{studentCodeOrName} or bes.student_name = #{studentCodeOrName})
|
|
and (s.student_code = #{studentCodeOrName} or bes.student_name = #{studentCodeOrName})
|
|
</if>
|
|
</if>
|
|
- and exists (select 1 from mark_paper mp where s.exam_id = mp.exam_id and s.course_paper_id = mp.course_paper_id and s.paper_type = mp.paper_type and mp.status = #{markPaperStatus})
|
|
|
|
|
|
+ <if test="dpr != null and dpr.requestUserId != null">
|
|
|
|
+ AND s.create_id = #{dpr.requestUserId}
|
|
|
|
+ </if>
|
|
and exists(select 1
|
|
and exists(select 1
|
|
from scan_omr_task t
|
|
from scan_omr_task t
|
|
where t.exam_id = #{examId}
|
|
where t.exam_id = #{examId}
|
|
and t.status=#{status}
|
|
and t.status=#{status}
|
|
and s.id = t.student_id
|
|
and s.id = t.student_id
|
|
- <if test="dpr != null">
|
|
|
|
- <if test="dpr.requestUserId != null">
|
|
|
|
- AND s.create_id = #{dpr.requestUserId}
|
|
|
|
- </if>
|
|
|
|
- <if test="dpr.orgIdSet != null and dpr.orgIdSet != '' and dpr.orgIdSet.size > 0">
|
|
|
|
- AND su.org_id IN
|
|
|
|
- <foreach collection="dpr.orgIdSet" item="item" index="index" open="(" separator="," close=")">
|
|
|
|
- #{item}
|
|
|
|
- </foreach>
|
|
|
|
- </if>
|
|
|
|
- </if>
|
|
|
|
- )
|
|
|
|
|
|
+ )
|
|
</where>
|
|
</where>
|
|
</select>
|
|
</select>
|
|
|
|
|
|
<select id="getStudentCountByExamAndStatusAndUserId" resultType="int">
|
|
<select id="getStudentCountByExamAndStatusAndUserId" resultType="int">
|
|
select
|
|
select
|
|
count(1)
|
|
count(1)
|
|
- from mark_student s left join sys_user su on s.create_id = su.id
|
|
|
|
|
|
+ from mark_student s
|
|
|
|
+ INNER JOIN sys_user su on s.create_id = su.id
|
|
|
|
+ <if test="dpr != null and dpr.orgIdSet != null and dpr.orgIdSet != '' and dpr.orgIdSet.size > 0">
|
|
|
|
+ AND su.org_id IN
|
|
|
|
+ <foreach collection="dpr.orgIdSet" item="item" index="index" open="(" separator="," close=")">
|
|
|
|
+ #{item}
|
|
|
|
+ </foreach>
|
|
|
|
+ </if>
|
|
|
|
+ INNER JOIN mark_paper mp ON s.exam_id = mp.exam_id
|
|
|
|
+ and s.paper_number = mp.paper_number
|
|
|
|
+ and s.paper_type = mp.paper_type
|
|
|
|
+ and mp.status = #{markPaperStatus}
|
|
<where>
|
|
<where>
|
|
<if test="examId != null">
|
|
<if test="examId != null">
|
|
and s.exam_id = #{examId}
|
|
and s.exam_id = #{examId}
|
|
@@ -94,23 +106,14 @@
|
|
<if test="coursePaperId != null and coursePaperId != ''">
|
|
<if test="coursePaperId != null and coursePaperId != ''">
|
|
and s.course_paper_id = #{coursePaperId}
|
|
and s.course_paper_id = #{coursePaperId}
|
|
</if>
|
|
</if>
|
|
- and exists (select 1 from mark_paper mp where s.exam_id = mp.exam_id and s.course_paper_id = mp.course_paper_id and s.paper_type = mp.paper_type and mp.status = #{markPaperStatus})
|
|
|
|
|
|
+ <if test="dpr != null and dpr.requestUserId != null">
|
|
|
|
+ AND s.create_id = #{dpr.requestUserId}
|
|
|
|
+ </if>
|
|
and exists(select 1
|
|
and exists(select 1
|
|
from scan_omr_task t
|
|
from scan_omr_task t
|
|
where t.exam_id = #{examId}
|
|
where t.exam_id = #{examId}
|
|
and t.status=#{status}
|
|
and t.status=#{status}
|
|
and s.id = t.student_id
|
|
and s.id = t.student_id
|
|
- <if test="dpr != null">
|
|
|
|
- <if test="dpr.requestUserId != null">
|
|
|
|
- AND s.create_id = #{dpr.requestUserId}
|
|
|
|
- </if>
|
|
|
|
- <if test="dpr.orgIdSet != null and dpr.orgIdSet != '' and dpr.orgIdSet.size > 0">
|
|
|
|
- AND su.org_id IN
|
|
|
|
- <foreach collection="dpr.orgIdSet" item="item" index="index" open="(" separator="," close=")">
|
|
|
|
- #{item}
|
|
|
|
- </foreach>
|
|
|
|
- </if>
|
|
|
|
- </if>
|
|
|
|
)
|
|
)
|
|
</where>
|
|
</where>
|
|
</select>
|
|
</select>
|
|
@@ -169,28 +172,29 @@
|
|
1
|
|
1
|
|
FROM
|
|
FROM
|
|
mark_student ms
|
|
mark_student ms
|
|
- left join sys_user su on ms.create_id = su.id
|
|
|
|
- WHERE
|
|
|
|
- sot.student_id = ms.id
|
|
|
|
|
|
+ INNER join sys_user su on ms.create_id = su.id
|
|
|
|
+ <if test="dpr != null and dpr.orgIdSet != null and dpr.orgIdSet != '' and dpr.orgIdSet.size > 0">
|
|
|
|
+ AND su.org_id IN
|
|
|
|
+ <foreach collection="dpr.orgIdSet" item="item" index="index" open="(" separator="," close=")">
|
|
|
|
+ #{item}
|
|
|
|
+ </foreach>
|
|
|
|
+ </if>
|
|
<if test="scanOmrTask.markPaperStatus != null">
|
|
<if test="scanOmrTask.markPaperStatus != null">
|
|
- AND exists(select 1 from mark_paper mp where ms.exam_id = mp.exam_id and ms.paper_number = mp.paper_number and ms.paper_type = mp.paper_type and mp.status = #{scanOmrTask.markPaperStatus})
|
|
|
|
|
|
+ INNER JOIN mark_paper mp ON ms.exam_id = mp.exam_id
|
|
|
|
+ and ms.paper_number = mp.paper_number
|
|
|
|
+ and ms.paper_type = mp.paper_type
|
|
|
|
+ and mp.status = #{scanOmrTask.markPaperStatus}
|
|
</if>
|
|
</if>
|
|
|
|
+ WHERE
|
|
|
|
+ sot.student_id = ms.id
|
|
<if test="scanOmrTask.courseCode != null">
|
|
<if test="scanOmrTask.courseCode != null">
|
|
AND ms.course_code = #{scanOmrTask.courseCode}
|
|
AND ms.course_code = #{scanOmrTask.courseCode}
|
|
</if>
|
|
</if>
|
|
<if test="scanOmrTask.coursePaperId != null">
|
|
<if test="scanOmrTask.coursePaperId != null">
|
|
AND ms.course_paper_id = #{scanOmrTask.coursePaperId}
|
|
AND ms.course_paper_id = #{scanOmrTask.coursePaperId}
|
|
</if>
|
|
</if>
|
|
- <if test="dpr != null">
|
|
|
|
- <if test="dpr.requestUserId != null">
|
|
|
|
- AND ms.create_id = #{dpr.requestUserId}
|
|
|
|
- </if>
|
|
|
|
- <if test="dpr.orgIdSet != null and dpr.orgIdSet != '' and dpr.orgIdSet.size > 0">
|
|
|
|
- AND su.org_id IN
|
|
|
|
- <foreach collection="dpr.orgIdSet" item="item" index="index" open="(" separator="," close=")">
|
|
|
|
- #{item}
|
|
|
|
- </foreach>
|
|
|
|
- </if>
|
|
|
|
|
|
+ <if test="dpr != null and dpr.requestUserId != null">
|
|
|
|
+ AND ms.create_id = #{dpr.requestUserId}
|
|
</if>
|
|
</if>
|
|
)
|
|
)
|
|
</if>
|
|
</if>
|