|
@@ -58,15 +58,16 @@
|
|
and es.clazz_id = tcs.clazz_id
|
|
and es.clazz_id = tcs.clazz_id
|
|
and es.school_id = #{schoolId}),0) as examStudentCount,
|
|
and es.school_id = #{schoolId}),0) as examStudentCount,
|
|
case
|
|
case
|
|
- when epp.status is null then 'UN_JOIN'
|
|
|
|
- when epp.status = 'PRINT_FINISH'
|
|
|
|
- or epp.status = 'END' then 'FINISH'
|
|
|
|
|
|
+ when ed.status is null then 'UN_JOIN'
|
|
|
|
+ when ed.status = 'FINISH' then 'FINISH'
|
|
else 'UN_FINISH'
|
|
else 'UN_FINISH'
|
|
end status
|
|
end status
|
|
from
|
|
from
|
|
t_c_statistics tcs
|
|
t_c_statistics tcs
|
|
left join exam_print_plan epp on
|
|
left join exam_print_plan epp on
|
|
epp.id = tcs.print_plan_id
|
|
epp.id = tcs.print_plan_id
|
|
|
|
+ left join exam_detail ed on
|
|
|
|
+ ed.id = tcs.exam_detail_id and ed.print_plan_id = epp.id
|
|
where 1 = 1
|
|
where 1 = 1
|
|
and IF(epp.id is null, true,
|
|
and IF(epp.id is null, true,
|
|
<if test="schoolId != null and schoolId != ''">
|
|
<if test="schoolId != null and schoolId != ''">
|
|
@@ -115,6 +116,7 @@
|
|
when sum(t.examStudentCount) = 0 then 0
|
|
when sum(t.examStudentCount) = 0 then 0
|
|
else sum(t.examStudentCount) + (t.drawCount * t.backupCount)
|
|
else sum(t.examStudentCount) + (t.drawCount * t.backupCount)
|
|
end printSum,
|
|
end printSum,
|
|
|
|
+ t.examDetailId,
|
|
GROUP_CONCAT(distinct t.examDetailCourseId) as examDetailCourseIds,
|
|
GROUP_CONCAT(distinct t.examDetailCourseId) as examDetailCourseIds,
|
|
GROUP_CONCAT(distinct t.examTaskDetailId) as examTaskDetailIds
|
|
GROUP_CONCAT(distinct t.examTaskDetailId) as examTaskDetailIds
|
|
from
|
|
from
|
|
@@ -136,6 +138,7 @@
|
|
etd.id as examTaskDetailId,
|
|
etd.id as examTaskDetailId,
|
|
epp.id as printPlanId,
|
|
epp.id as printPlanId,
|
|
epp.name as printPlanName,
|
|
epp.name as printPlanName,
|
|
|
|
+ ed.id as examDetailId,
|
|
IFNULL(etd.draw_count, 0) as drawCount,
|
|
IFNULL(etd.draw_count, 0) as drawCount,
|
|
IFNULL((
|
|
IFNULL((
|
|
select
|
|
select
|
|
@@ -147,10 +150,9 @@
|
|
and es.clazz_id = tcst.clazz_id
|
|
and es.clazz_id = tcst.clazz_id
|
|
and es.school_id = #{schoolId}),0) as examStudentCount,
|
|
and es.school_id = #{schoolId}),0) as examStudentCount,
|
|
IFNULL(epp.backup_count, 0) as backupCount,
|
|
IFNULL(epp.backup_count, 0) as backupCount,
|
|
- case
|
|
|
|
- when epp.status is null then 'UN_JOIN'
|
|
|
|
- when epp.status = 'PRINT_FINISH'
|
|
|
|
- or epp.status = 'END' then 'FINISH'
|
|
|
|
|
|
+ case
|
|
|
|
+ when ed.status is null then 'UN_JOIN'
|
|
|
|
+ when ed.status = 'FINISH' then 'FINISH'
|
|
else 'UN_FINISH'
|
|
else 'UN_FINISH'
|
|
end status
|
|
end status
|
|
from
|
|
from
|
|
@@ -200,7 +202,8 @@
|
|
t.printPlanName,
|
|
t.printPlanName,
|
|
t.status,
|
|
t.status,
|
|
t.drawCount,
|
|
t.drawCount,
|
|
- t.batchNo
|
|
|
|
|
|
+ t.batchNo,
|
|
|
|
+ t.examDetailId
|
|
order by
|
|
order by
|
|
t.printPlanId,
|
|
t.printPlanId,
|
|
t.clazzId
|
|
t.clazzId
|
|
@@ -226,6 +229,7 @@
|
|
when sum(t.examStudentCount) = 0 then 0
|
|
when sum(t.examStudentCount) = 0 then 0
|
|
else sum(t.examStudentCount) + (t.drawCount * t.backupCount)
|
|
else sum(t.examStudentCount) + (t.drawCount * t.backupCount)
|
|
end printSum,
|
|
end printSum,
|
|
|
|
+ t.examDetailId,
|
|
GROUP_CONCAT(distinct t.examDetailCourseId) as examDetailCourseIds,
|
|
GROUP_CONCAT(distinct t.examDetailCourseId) as examDetailCourseIds,
|
|
GROUP_CONCAT(distinct t.examTaskDetailId) as examTaskDetailIds
|
|
GROUP_CONCAT(distinct t.examTaskDetailId) as examTaskDetailIds
|
|
from
|
|
from
|
|
@@ -247,6 +251,7 @@
|
|
etd.id as examTaskDetailId,
|
|
etd.id as examTaskDetailId,
|
|
epp.id as printPlanId,
|
|
epp.id as printPlanId,
|
|
epp.name as printPlanName,
|
|
epp.name as printPlanName,
|
|
|
|
+ ed.id as examDetailId,
|
|
IFNULL(etd.draw_count, 0) as drawCount,
|
|
IFNULL(etd.draw_count, 0) as drawCount,
|
|
IFNULL((
|
|
IFNULL((
|
|
select
|
|
select
|
|
@@ -259,9 +264,8 @@
|
|
and es.school_id = #{schoolId}),0) as examStudentCount,
|
|
and es.school_id = #{schoolId}),0) as examStudentCount,
|
|
IFNULL(epp.backup_count, 0) as backupCount,
|
|
IFNULL(epp.backup_count, 0) as backupCount,
|
|
case
|
|
case
|
|
- when epp.status is null then 'UN_JOIN'
|
|
|
|
- when epp.status = 'PRINT_FINISH'
|
|
|
|
- or epp.status = 'END' then 'FINISH'
|
|
|
|
|
|
+ when ed.status is null then 'UN_JOIN'
|
|
|
|
+ when ed.status = 'FINISH' then 'FINISH'
|
|
else 'UN_FINISH'
|
|
else 'UN_FINISH'
|
|
end status
|
|
end status
|
|
from
|
|
from
|
|
@@ -311,7 +315,8 @@
|
|
t.printPlanName,
|
|
t.printPlanName,
|
|
t.status,
|
|
t.status,
|
|
t.drawCount,
|
|
t.drawCount,
|
|
- t.batchNo
|
|
|
|
|
|
+ t.batchNo,
|
|
|
|
+ t.examDetailId
|
|
order by
|
|
order by
|
|
t.printPlanId,
|
|
t.printPlanId,
|
|
t.clazzId
|
|
t.clazzId
|