|
@@ -14,7 +14,10 @@
|
|
|
t.printPlanId,
|
|
|
t.printPlanName,
|
|
|
t.examStudentCount,
|
|
|
- IFNULL(t.examStudentCount, 0) + (t.drawCount * t.backupCount) as printSum,
|
|
|
+ case
|
|
|
+ when t.examStudentCount = 0 then 0
|
|
|
+ else t.examStudentCount + (t.drawCount * t.backupCount)
|
|
|
+ end printSum,
|
|
|
t.status
|
|
|
from
|
|
|
(
|
|
@@ -41,7 +44,7 @@
|
|
|
where
|
|
|
FIND_IN_SET(etd.id, tcs.exam_task_detail_ids)) as drawCount,
|
|
|
IFNULL(epp.backup_count, 0) as backupCount,
|
|
|
- (
|
|
|
+ IFNULL((
|
|
|
select
|
|
|
count(1)
|
|
|
from
|
|
@@ -49,7 +52,7 @@
|
|
|
where
|
|
|
FIND_IN_SET(es.exam_detail_course_id, tcs.exam_detail_course_ids)
|
|
|
and es.clazz_id = tcs.clazz_id
|
|
|
- and es.school_id = 137) as examStudentCount,
|
|
|
+ and es.school_id = #{schoolId}),0) as examStudentCount,
|
|
|
case
|
|
|
when epp.status = 'PRINT_FINISH'
|
|
|
or epp.status = 'END' then 'FINISH'
|
|
@@ -96,7 +99,10 @@
|
|
|
t.printPlanName,
|
|
|
t.batchNo,
|
|
|
t.status,
|
|
|
- IFNULL(sum(t.examStudentCount),0) + (t.drawCount * t.backupCount) as printSum,
|
|
|
+ case
|
|
|
+ when sum(t.examStudentCount) = 0 then 0
|
|
|
+ else sum(t.examStudentCount) + (t.drawCount * t.backupCount)
|
|
|
+ end printSum,
|
|
|
GROUP_CONCAT(distinct t.examDetailCourseId) as examDetailCourseIds,
|
|
|
GROUP_CONCAT(distinct t.examTaskDetailId) as examTaskDetailIds
|
|
|
from
|
|
@@ -119,7 +125,7 @@
|
|
|
epp.id as printPlanId,
|
|
|
epp.name as printPlanName,
|
|
|
IFNULL(etd.draw_count, 0) as drawCount,
|
|
|
- (
|
|
|
+ IFNULL((
|
|
|
select
|
|
|
count(1)
|
|
|
from
|
|
@@ -127,7 +133,7 @@
|
|
|
where
|
|
|
es.exam_detail_course_id = edc.id
|
|
|
and es.clazz_id = tcst.clazz_id
|
|
|
- and es.school_id = #{schoolId}) as examStudentCount,
|
|
|
+ and es.school_id = #{schoolId}),0) as examStudentCount,
|
|
|
IFNULL(epp.backup_count, 0) as backupCount,
|
|
|
case
|
|
|
when epp.status = 'PRINT_FINISH'
|