|
@@ -121,8 +121,19 @@
|
|
|
<select id="getStudentCountByExamAndStatusAndUserIdNew" resultType="int">
|
|
|
select
|
|
|
count(1)
|
|
|
- from mark_student s left join sys_user su on s.create_id = su.id
|
|
|
- left join basic_exam_student bes on bes.id = s.basic_student_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 basic_exam_student bes on bes.id = s.basic_student_id
|
|
|
+ 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>
|
|
|
<if test="examId != null">
|
|
|
and s.exam_id = #{examId}
|
|
@@ -136,23 +147,14 @@
|
|
|
<if test="teachClassName != null and teachClassName != ''">
|
|
|
and bes.teach_class_name = #{teachClassName}
|
|
|
</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
|
|
|
from scan_omr_task t
|
|
|
where t.exam_id = #{examId}
|
|
|
and t.status=#{status}
|
|
|
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>
|
|
|
</select>
|