|
@@ -934,4 +934,116 @@
|
|
|
</if>
|
|
|
</if>
|
|
|
</select>
|
|
|
+ <select id="listCourseForPrintCount" resultType="com.qmth.teachcloud.common.entity.BasicCourse">
|
|
|
+ select
|
|
|
+ distinct bc.id, bc.code,bc.name
|
|
|
+ from exam_task et
|
|
|
+ join basic_course bc on bc.id = et.course_id
|
|
|
+ join t_f_flow_approve tffa on tffa.flow_id = et.flow_id
|
|
|
+ <where>
|
|
|
+ and (et.status = 'SUBMIT' and (et.flow_id is null or (et.flow_id is not null and tffa.status = 'FINISH')))
|
|
|
+ AND et.exam_id = #{examId}
|
|
|
+ <if test="openCollegeId != null">
|
|
|
+ AND bc.teaching_room_id = #{openCollegeId}
|
|
|
+ </if>
|
|
|
+ <if test="dpr != null">
|
|
|
+ <if test="dpr.requestUserId != null">
|
|
|
+ AND et.user_id = #{dpr.requestUserId}
|
|
|
+ </if>
|
|
|
+ <if test="dpr.courseUserId != null">
|
|
|
+ AND EXISTS( SELECT 1 FROM (select course_id from teach_course where exam_id = #{examId} and user_id = #{dpr.courseUserId}) tc WHERE tc.course_id = et.course_id)
|
|
|
+ </if>
|
|
|
+ <if test="dpr.orgIdSet != null and dpr.orgIdSet != '' and dpr.orgIdSet.size > 0">
|
|
|
+ AND bc.teaching_room_id IN
|
|
|
+ <foreach collection="dpr.orgIdSet" item="item" index="index" open="(" separator="," close=")">
|
|
|
+ #{item}
|
|
|
+ </foreach>
|
|
|
+ </if>
|
|
|
+ </if>
|
|
|
+ </where>
|
|
|
+ </select>
|
|
|
+ <select id="listCourseForScanCount" resultType="com.qmth.teachcloud.common.entity.BasicCourse">
|
|
|
+ select
|
|
|
+ distinct bc.id, bc.code,bc.name
|
|
|
+ from mark_paper mp
|
|
|
+ join basic_course bc on bc.id = mp.course_id
|
|
|
+ <where>
|
|
|
+ AND mp.exam_id = #{examId}
|
|
|
+ <if test="openCollegeId != null">
|
|
|
+ AND bc.teaching_room_id = #{openCollegeId}
|
|
|
+ </if>
|
|
|
+ <if test="dpr != null">
|
|
|
+ <if test="dpr.requestUserId != null">
|
|
|
+ AND EXISTS( SELECT 1 FROM (select exam_id, paper_number,basic_student_id from mark_student where exam_id = #{examId}) ms
|
|
|
+ join
|
|
|
+ (select id from basic_exam_student where exam_id = #{examId} and teacher_id = #{dpr.requestUserId}) bes on ms.basic_student_id = bes.id WHERE mp.exam_id = ms.exam_id and mp.paper_number = ms.paper_number)
|
|
|
+ </if>
|
|
|
+ <if test="dpr.courseUserId != null">
|
|
|
+ AND EXISTS( SELECT 1 FROM (select course_id from teach_course where exam_id = #{examId} and user_id = #{dpr.courseUserId}) tc WHERE tc.course_id = mp.course_id)
|
|
|
+ </if>
|
|
|
+ <if test="dpr.orgIdSet != null and dpr.orgIdSet != '' and dpr.orgIdSet.size > 0">
|
|
|
+ AND bc.teaching_room_id IN
|
|
|
+ <foreach collection="dpr.orgIdSet" item="item" index="index" open="(" separator="," close=")">
|
|
|
+ #{item}
|
|
|
+ </foreach>
|
|
|
+ </if>
|
|
|
+ </if>
|
|
|
+ </where>
|
|
|
+ </select>
|
|
|
+ <select id="listPaperNumberForPrintCount" resultType="java.lang.String">
|
|
|
+ select
|
|
|
+ distinct et.paper_number
|
|
|
+ from exam_task et
|
|
|
+ join basic_course bc on bc.id = et.course_id
|
|
|
+ join t_f_flow_approve tffa on tffa.flow_id = et.flow_id
|
|
|
+ <where>
|
|
|
+ and (et.status = 'SUBMIT' and (et.flow_id is null or (et.flow_id is not null and tffa.status = 'FINISH')))
|
|
|
+ AND et.exam_id = #{examId}
|
|
|
+ <if test="courseId != null">
|
|
|
+ AND bc.id = #{courseId}
|
|
|
+ </if>
|
|
|
+ <if test="dpr != null">
|
|
|
+ <if test="dpr.requestUserId != null">
|
|
|
+ AND et.user_id = #{dpr.requestUserId}
|
|
|
+ </if>
|
|
|
+ <if test="dpr.courseUserId != null">
|
|
|
+ AND EXISTS( SELECT 1 FROM (select course_id from teach_course where exam_id = #{examId} and user_id = #{dpr.courseUserId}) tc WHERE tc.course_id = et.course_id)
|
|
|
+ </if>
|
|
|
+ <if test="dpr.orgIdSet != null and dpr.orgIdSet != '' and dpr.orgIdSet.size > 0">
|
|
|
+ AND bc.teaching_room_id IN
|
|
|
+ <foreach collection="dpr.orgIdSet" item="item" index="index" open="(" separator="," close=")">
|
|
|
+ #{item}
|
|
|
+ </foreach>
|
|
|
+ </if>
|
|
|
+ </if>
|
|
|
+ </where>
|
|
|
+ </select>
|
|
|
+ <select id="listPaperNumberForScanCount" resultType="java.lang.String">
|
|
|
+ select
|
|
|
+ distinct mp.paper_number
|
|
|
+ from mark_paper mp
|
|
|
+ join basic_course bc on bc.id = mp.course_id
|
|
|
+ <where>
|
|
|
+ AND mp.exam_id = #{examId}
|
|
|
+ <if test="courseId != null">
|
|
|
+ AND mp.course_id = #{courseId}
|
|
|
+ </if>
|
|
|
+ <if test="dpr != null">
|
|
|
+ <if test="dpr.requestUserId != null">
|
|
|
+ AND EXISTS( SELECT 1 FROM (select exam_id, paper_number,basic_student_id from mark_student where exam_id = #{examId}) ms
|
|
|
+ join
|
|
|
+ (select id from basic_exam_student where exam_id = #{examId} and teacher_id = #{dpr.requestUserId}) bes on ms.basic_student_id = bes.id WHERE mp.exam_id = ms.exam_id and mp.paper_number = ms.paper_number)
|
|
|
+ </if>
|
|
|
+ <if test="dpr.courseUserId != null">
|
|
|
+ AND EXISTS( SELECT 1 FROM (select course_id from teach_course where exam_id = #{examId} and user_id = #{dpr.courseUserId}) tc WHERE tc.course_id = mp.course_id)
|
|
|
+ </if>
|
|
|
+ <if test="dpr.orgIdSet != null and dpr.orgIdSet != '' and dpr.orgIdSet.size > 0">
|
|
|
+ AND bc.teaching_room_id IN
|
|
|
+ <foreach collection="dpr.orgIdSet" item="item" index="index" open="(" separator="," close=")">
|
|
|
+ #{item}
|
|
|
+ </foreach>
|
|
|
+ </if>
|
|
|
+ </if>
|
|
|
+ </where>
|
|
|
+ </select>
|
|
|
</mapper>
|