|
@@ -16,6 +16,7 @@
|
|
|
t.clazzName,
|
|
|
IF(t.examStudentCount = 0,null,t.paperNumber) as paperNumber,
|
|
|
t.printPlanId,
|
|
|
+ t.createId,
|
|
|
IF(t.examStudentCount = 0,null,t.printPlanName) as printPlanName,
|
|
|
t.examStudentCount,
|
|
|
IF(t.examStudentCount = 0,null,t.examStudentCount + (t.drawCount * t.backupCount)) as printSum,
|
|
@@ -35,6 +36,7 @@
|
|
|
tcs.clazz_name as clazzName,
|
|
|
tcs.batch_no as batchNo,
|
|
|
tcs.paper_number as paperNumber,
|
|
|
+ tcs.create_id as createId,
|
|
|
epp.id as printPlanId,
|
|
|
epp.name as printPlanName,
|
|
|
(
|
|
@@ -61,11 +63,14 @@
|
|
|
end status
|
|
|
from
|
|
|
t_c_statistics tcs
|
|
|
- join exam_print_plan epp on
|
|
|
+ left join exam_print_plan epp on
|
|
|
epp.id = tcs.print_plan_id
|
|
|
where
|
|
|
epp.school_id = #{schoolId}) t) temp
|
|
|
<where>
|
|
|
+ <if test="userId != null and userId != ''">
|
|
|
+ and temp.createId = #{userId}
|
|
|
+ </if>
|
|
|
<if test="collegeId != null and collegeId != ''">
|
|
|
and temp.collegeId = #{collegeId}
|
|
|
</if>
|
|
@@ -143,24 +148,35 @@
|
|
|
end status
|
|
|
from
|
|
|
t_c_statistics_temp tcst
|
|
|
- join exam_task et on
|
|
|
+ left join exam_task et on
|
|
|
et.course_code = tcst.course_code
|
|
|
and et.teaching_room_id = tcst.teaching_room_id
|
|
|
- join exam_task_detail etd on
|
|
|
+ left join exam_task_detail etd on
|
|
|
etd.exam_task_id = et.id
|
|
|
- join exam_detail_course edc on
|
|
|
+ left join exam_detail_course edc on
|
|
|
edc.course_code = tcst.course_code
|
|
|
and edc.paper_number = et.paper_number
|
|
|
and edc.school_id = et.school_id
|
|
|
- join exam_detail ed on
|
|
|
+ left join exam_detail ed on
|
|
|
ed.id = edc.exam_detail_id
|
|
|
- join exam_print_plan epp on
|
|
|
+ left join exam_print_plan epp on
|
|
|
epp.id = ed.print_plan_id
|
|
|
- where
|
|
|
- et.enable = true
|
|
|
+ <where>
|
|
|
+ and et.enable = true
|
|
|
and etd.enable = true
|
|
|
- and et.school_id = #{schoolId}
|
|
|
- and tcst.batch_no = #{batchNo}) t
|
|
|
+ <if test="schoolId != null and schoolId != ''">
|
|
|
+ and et.school_id = #{schoolId}
|
|
|
+ </if>
|
|
|
+ <if test="batchNo != null and batchNo != ''">
|
|
|
+ and tcst.batch_no = #{batchNo}
|
|
|
+ </if>
|
|
|
+ <if test="orgIds != null and orgIds.size() > 0">
|
|
|
+ AND epp.org_id IN
|
|
|
+ <foreach collection="orgIds" item="item" index="index" open="(" separator="," close=")">
|
|
|
+ #{item}
|
|
|
+ </foreach>
|
|
|
+ </if>
|
|
|
+ </where>) t
|
|
|
group by
|
|
|
t.collegeId,
|
|
|
t.collegeName,
|