inner join (select exam_id,school_id,school_name from single_yuejuan_source.bus_exam_student group exam_id,school_id,school_name) b on a.exam_id=b.exam_id</sql>
<sql>select case when (select count(*) from task_list where task_status=1 and id=${task_id} and del_flag=0 and source_type=1)>0 then 1 else 0 end is_run</sql>
<sql>select case when (select count(*) from task_list where task_status=1 and id=${task_id} and del_flag=0)>0 then 1 else 0 end is_run</sql>
<sql>select case when (select count(*) from task_list where task_status=1 and id=${task_id} and del_flag=0 and source_type=3)>0 then 1 else 0 end is_run</sql>
<sql>select case when (select count(*) from task_list where task_status=1 and id=${task_id} and del_flag=0)>0 then 1 else 0 end is_run</sql>
@@ -522,32 +522,36 @@ where b.is_execute=0 and a.exam_id=b.exam_id and a.subject_id=b.subject_id and a
delete from union_yuejuan_source_process.bus_subjective_question_config a
using union_yuejuan_source_process.bus_exam_question_del_log b
where b.is_execute=0 and a.exam_id=b.exam_id and a.subject_id=b.subject_id and a.parent_id=b.question_config_id and b.oper_type=1;
-------------------------
-------------------------
delete from union_yuejuan_source_process.bus_marking_judgment_task a
using (select zz.id,zz.question_config_id from union_yuejuan_source_process.bus_marking_task_config zz
inner join union_yuejuan_source_process.bus_exam_question_del_log ss on zz.exam_id=ss.exam_id and zz.subject_id=ss.subject_id and zz.question_config_id=ss.question_block_id
where ss.oper_type=2 and ss.is_execute=0) b
where a.marking_config_id=b.id and a.question_config_id=b.question_config_id
delete from union_yuejuan_source_process.bus_student_subj_ques_score a
using union_yuejuan_source_process.bus_exam_question_del_log b
where b.is_execute=0 and a.exam_id=b.exam_id and a.subject_id=b.subject_id and a.subj_ques_config_id=b.question_config_id and b.oper_type=1;
delete from union_yuejuan_source_process.bus_student_subj_ques_score a
using union_yuejuan_source_process.bus_exam_question_del_log b
where b.is_execute=0 and a.exam_id=b.exam_id and a.subject_id=b.subject_id and b.question_block_id=a.subj_ques_config_id and b.oper_type=2;
where b.is_execute=0 and a.exam_id=b.exam_id and a.subject_id=b.subject_id and a.parent_id=b.question_config_id and b.oper_type=1;
delete from union_yuejuan_source_process.bus_student_subj_ques_arbitrate_record a
using union_yuejuan_source_process.bus_exam_question_del_log b
where b.is_execute=0 and a.exam_id=b.exam_id and a.subject_id=b.subject_id and a.subj_ques_config_id=b.question_config_id and b.oper_type=1;
delete from union_yuejuan_source_process.bus_student_subj_ques_score_record a
using union_yuejuan_source_process.bus_exam_question_del_log b
where b.is_execute=0 and a.exam_id=b.exam_id and a.subject_id=b.subject_id and a.subj_ques_config_id=b.question_config_id and b.oper_type=1;
-------------------------
-------------------------
delete from union_yuejuan_source_process.bus_student_subj_ques_score a
using (select zz.exam_id,zz.id,zz.subject_id from union_yuejuan_source_process.bus_subjective_question_config zz
inner join union_yuejuan_source_process.bus_exam_question_del_log ss on zz.exam_id=ss.exam_id and zz.subject_id=ss.subject_id and zz.belong_block_id=ss.question_block_id
where ss.oper_type=2 and ss.is_execute=0) b
where a.exam_id=b.exam_id and a.subject_id=b.subject_id and a.subj_ques_config_id=b.id;
using union_yuejuan_source_process.bus_exam_question_del_log b
where b.is_execute=0 and a.exam_id=b.exam_id and a.subject_id=b.subject_id and b.question_config_id=a.subj_ques_config_id and b.oper_type=2;
delete from union_yuejuan_source_process.bus_student_subj_ques_score_record a
using union_yuejuan_source_process.bus_exam_question_del_log b
where b.is_execute=0 and a.exam_id=b.exam_id and a.subject_id=b.subject_id and b.question_block_id=a.subj_ques_config_id and b.oper_type=2;
where b.is_execute=0 and a.exam_id=b.exam_id and a.subject_id=b.subject_id and b.question_config_id=a.subj_ques_config_id and b.oper_type=2;
delete from union_yuejuan_source_process.bus_student_subj_ques_arbitrate_record a
using union_yuejuan_source_process.bus_exam_question_del_log b
where b.is_execute=0 and a.exam_id=b.exam_id and a.subject_id=b.subject_id and b.question_block_id=a.subj_ques_config_id and b.oper_type=2;
where b.is_execute=0 and a.exam_id=b.exam_id and a.subject_id=b.subject_id and b.question_config_id=a.subj_ques_config_id and b.oper_type=2;
-------------------------
...
...
@@ -599,62 +603,6 @@ delete from union_yuejuan_source_process.bus_subjective_question_config a
using union_yuejuan_source_process.bus_exam_question_del_log b
where b.is_execute=0 and a.exam_id=b.exam_id and a.subject_id=b.subject_id and b.oper_type=4;
delete from union_yuejuan_source_process.bus_subjective_question_block a
using union_yuejuan_source_process.bus_exam_question_del_log b
where b.is_execute=0 and a.exam_id=b.exam_id and a.subject_id=b.subject_id and b.oper_type=4;
-------------------------
-------------------------
delete from union_yuejuan_source_process.bus_subjective_question_block a
using union_yuejuan_source_process.bus_exam_question_del_log b
where b.is_execute=0 and a.exam_id=b.exam_id and a.subject_id=b.subject_id and a.id=b.question_block_id and b.oper_type=5;
delete from union_yuejuan_source_process.bus_marking_task_config a
using union_yuejuan_source_process.bus_exam_question_del_log b
where b.is_execute=0 and a.exam_id=b.exam_id and a.subject_id=b.subject_id and a.question_config_id=b.question_block_id and b.oper_type=5;
delete from union_yuejuan_source_process.bus_marking_teacher_task a
using (select zz.id,zz.question_config_id from union_yuejuan_source_process.bus_marking_task_config zz
inner join union_yuejuan_source_process.bus_exam_question_del_log ss on zz.exam_id=ss.exam_id and zz.subject_id=ss.subject_id and zz.question_config_id=ss.question_block_id
where ss.oper_type=5 and ss.is_execute=0) b
where a.marking_config_id=b.id and a.question_config_id=b.question_config_id;
delete from union_yuejuan_source_process.bus_marking_judgment_task a
using (select zz.id,zz.question_config_id from union_yuejuan_source_process.bus_marking_task_config zz
inner join union_yuejuan_source_process.bus_exam_question_del_log ss on zz.exam_id=ss.exam_id and zz.subject_id=ss.subject_id and zz.question_config_id=ss.question_block_id
where ss.oper_type=5 and ss.is_execute=0) b
where a.marking_config_id=b.id and a.question_config_id=b.question_config_id
delete from union_yuejuan_source_process.bus_student_subj_ques_score a
using union_yuejuan_source_process.bus_exam_question_del_log b
where b.is_execute=0 and a.exam_id=b.exam_id and a.subject_id=b.subject_id and b.question_block_id=a.subj_ques_config_id and b.oper_type=5;
delete from union_yuejuan_source_process.bus_student_subj_ques_score a
using (select zz.exam_id,zz.id,zz.subject_id from union_yuejuan_source_process.bus_subjective_question_config zz
inner join union_yuejuan_source_process.bus_exam_question_del_log ss on zz.exam_id=ss.exam_id and zz.subject_id=ss.subject_id and zz.belong_block_id=ss.question_block_id
where ss.oper_type=5 and ss.is_execute=0) b
where a.exam_id=b.exam_id and a.subject_id=b.subject_id and a.subj_ques_config_id=b.id;
delete from union_yuejuan_source_process.bus_student_subj_ques_score_record a
using union_yuejuan_source_process.bus_exam_question_del_log b
where b.is_execute=0 and a.exam_id=b.exam_id and a.subject_id=b.subject_id and a.subj_ques_config_id=b.question_block_id and b.oper_type=5;
delete from union_yuejuan_source_process.bus_student_subj_ques_arbitrate_record a
using union_yuejuan_source_process.bus_exam_question_del_log b
where b.is_execute=0 and a.exam_id=b.exam_id and a.subject_id=b.subject_id and a.subj_ques_config_id=b.question_block_id and b.oper_type=5;
-------------------------
-------------------------
delete from union_yuejuan_source_process.bus_student_subj_ques_score_record a
using union_yuejuan_source_process.bus_exam_question_del_log b
where b.is_execute=0 and a.exam_id=b.exam_id and a.subject_id=b.subject_id and a.subj_ques_config_id=b.question_block_id and b.oper_type=6;
delete from union_yuejuan_source_process.bus_student_subj_ques_arbitrate_record a
using union_yuejuan_source_process.bus_exam_question_del_log b
where b.is_execute=0 and a.exam_id=b.exam_id and a.subject_id=b.subject_id and a.subj_ques_config_id=b.question_block_id and b.oper_type=6;
----------------
----------------
delete from union_yuejuan_source_process.gp_waiting_statistics_exam;