groupid <@p p="AND (%s)">sfwp <@p p="AND (jhly='sj' or groupid=%s)" f="?">filter1 <@p p="AND groupid=%s" f="?">filter2 <@p p="AND 1=%s" f="?">filter3 <@p p="and id in (%s)" f="?">idarr order by nd desc ]]> filter1 <@p p="AND groupid=%s" f="?">filter2 <@p p="AND 1=%s" f="?">filter3 <@p p="or jhly=%s" f="?">jhly order by convert(kcmc using gbk) ]]> filter1 <@p p="AND groupid=%s" f="?">filter2 <@p p="AND 1=%s" f="?">filter3 order by convert(kcmc using gbk) ]]> sfwp <@p p=" AND (%s)">groupid <@p p=" AND (%s)">nd <@p p=" and jhly IN(%s)" f="?">jhlyarr order by nd desc ]]> sfwp <@p p=" AND (%s)">groupid <@p p=" AND (%s)">nd <@p p=" AND (%s)">jhly and id not in(SELECT a.kcmcid FROM et_train_pd_cc a LEFT JOIN et_train_pd_cc_pg b ON a.id = b.ccid LEFT JOIN et_train_pd_cc_pgwjyxx c ON c.pgID = b.id WHERE IF( et_train_kc_all.nd >= 2023, c.`status` = 2, IF ( c.`status` IS NOT NULL, c.`status` = 2, b.`status` = 1 ) )) ]]> nd and <@p>groupid and jhly = 'bmn' and sfwp = '否') year_inplan_unout_num, ( SELECT count( * ) FROM et_train_kc_all WHERE <@p>nd and <@p>groupid AND jhly = 'bmn' AND sfwp = '否' AND id IN ( SELECT a.kcmcid FROM et_train_pd_cc a LEFT JOIN et_train_pd_cc_pg b ON a.id = b.ccid LEFT JOIN et_train_pd_cc_pgwjyxx c ON c.pgID = b.id WHERE 1 = 1 AND IF ( et_train_kc_all.nd >= 2023, c.`status` = 2, IF ( c.`status` IS NOT NULL, c.`status` = 2, b.`status` = 1 ) ) ) ) inplan_unout_num, (select count(*) from et_train_pd_cc_user where istrain = '1' and ccid in (select a.id from et_train_pd_cc a LEFT JOIN et_train_pd_cc_pg b ON a.id = b.ccid LEFT JOIN et_train_pd_cc_pgwjyxx c ON c.pgID = b.id LEFT JOIN et_train_kc_all d ON a.kcmcid=d.id where <@p p=" a.addgroupid = %s " f=" ? ">groupid and IF ( d.nd >= 2023, c.`status` = 2, IF ( c.`status` IS NOT NULL, c.`status` = 2, b.`status` = 1 ) ) <@p p="AND d.nd = ?">nd <@p p="AND d.groupid = ?">groupid AND d.jhly = 'bmn' AND d.sfwp = '否' )) inplan_unout_person, ( SELECT sum( a.pxxsh ) FROM et_train_pd_cc a LEFT JOIN et_train_pd_cc_pg b ON a.id = b.ccid LEFT JOIN et_train_pd_cc_pgwjyxx c ON c.pgID = b.id LEFT JOIN et_train_kc_all d ON a.kcmcid = d.id WHERE <@p p=" a.addgroupid = %s " f=" ? ">groupid AND IF ( d.nd >= 2023, c.`status` = 2, IF ( c.`status` IS NOT NULL, c.`status` = 2, b.`status` = 1 ) ) <@p p="AND d.nd = ?">nd <@p p="AND d.groupid = ?">groupid AND d.jhly = 'bmn' AND d.sfwp = '否' ) inplan_unout_hour, (SELECT count(*) FROM et_train_ot WHERE <@p p=" addgroupid = %s " f=" ? ">groupid and `status`='5' and delstatus="0" and not exists (select 1 from et_train_ot_pxdj b where et_train_ot.id = b.otid and b.`status`!="4") AND EXISTS ( SELECT 1 FROM et_train_ot_pxdj b WHERE et_train_ot.id = b.otid AND b.`status` = "4" )AND wpid IN ( SELECT id FROM et_train_kc_all WHERE <@p>nd and <@p>groupid AND jhly = 'bmn' AND sfwp = '是' ) )inplan_out_num, (select count(*) from et_train_ot_xy where otid in (select id from et_train_ot where <@p p=" addgroupid = %s " f=" ? ">groupid and `status`='5' and delstatus="0" and not exists (select 1 from et_train_ot_pxdj b where et_train_ot.id = b.otid and b.`status`!="4") AND EXISTS ( SELECT 1 FROM et_train_ot_pxdj b WHERE et_train_ot.id = b.otid AND b.`status` = "4" )and wpid in (select id from et_train_kc_all where <@p>nd and <@p>groupid and jhly = 'bmn' and sfwp = '是'))) inplan_out_person, ( SELECT count( * ) FROM et_train_kc_all WHERE <@p>nd and <@p>groupid AND jhly = 'bmw' AND sfwp = '否' AND id IN ( SELECT a.kcmcid FROM et_train_pd_cc a LEFT JOIN et_train_pd_cc_pg b ON a.id = b.ccid LEFT JOIN et_train_pd_cc_pgwjyxx c ON c.pgID = b.id WHERE 1 = 1 AND IF ( et_train_kc_all.nd >= 2023, c.`status` = 2, IF ( c.`status` IS NOT NULL, c.`status` = 2, b.`status` = 1 ) ) ) )outplan_unout_num, (select count(*) from et_train_pd_cc_user where istrain = '1' and ccid in (select a.id from et_train_pd_cc a LEFT JOIN et_train_pd_cc_pg b ON a.id = b.ccid LEFT JOIN et_train_pd_cc_pgwjyxx c ON c.pgID = b.id LEFT JOIN et_train_kc_all d ON a.kcmcid=d.id where <@p p=" a.addgroupid = %s " f=" ? ">groupid and IF ( d.nd >= 2023, c.`status` = 2, IF ( c.`status` IS NOT NULL, c.`status` = 2, b.`status` = 1 ) ) <@p p="AND d.nd = ?">nd <@p p="AND d.groupid = ?">groupid AND d.jhly = 'bmw' AND d.sfwp = '否' )) outplan_unout_person, ( SELECT sum( a.pxxsh ) FROM et_train_pd_cc a LEFT JOIN et_train_pd_cc_pg b ON a.id = b.ccid LEFT JOIN et_train_pd_cc_pgwjyxx c ON c.pgID = b.id LEFT JOIN et_train_kc_all d ON a.kcmcid = d.id WHERE <@p p=" a.addgroupid = %s " f=" ? ">groupid AND IF ( d.nd >= 2023, c.`status` = 2, IF ( c.`status` IS NOT NULL, c.`status` = 2, b.`status` = 1 ) ) <@p p="AND d.nd = ?">nd <@p p="AND d.groupid = ?">groupid AND d.jhly = 'bmw' AND d.sfwp = '否' ) outplan_unout_hour, (SELECT count(*) FROM et_train_ot WHERE <@p p=" addgroupid = %s " f=" ? ">groupid and `status`='5' and delstatus="0" and not exists (select 1 from et_train_ot_pxdj b where et_train_ot.id = b.otid and b.`status`!="4") AND EXISTS ( SELECT 1 FROM et_train_ot_pxdj b WHERE et_train_ot.id = b.otid AND b.`status` = "4" )AND wpid IN ( SELECT id FROM et_train_kc_all WHERE <@p>nd and <@p>groupid AND jhly = 'bmw' AND sfwp = '是' ) )outplan_out_num, (select count(*) from et_train_ot_xy where otid in (select id from et_train_ot where <@p p=" addgroupid = %s " f=" ? ">groupid and `status`='5' and delstatus="0" and not exists (select 1 from et_train_ot_pxdj b where et_train_ot.id = b.otid and b.`status`!="4") AND EXISTS ( SELECT 1 FROM et_train_ot_pxdj b WHERE et_train_ot.id = b.otid AND b.`status` = "4" ) and wpid in (select id from et_train_kc_all where <@p>nd and <@p>groupid and jhly = 'bmw' and sfwp = '是'))) outplan_out_person ]]> nd and <@p>groupid and jhly = 'bmn' and sfwp = '否') year_inplan_unout_num, (select count(*) from (select * from et_train_pd_cc where <@p p=" addgroupid = %s " f=" ? ">groupid and status = '2' and kcmcid in (select id from et_train_kc_all where <@p>nd and <@p>groupid and jhly = 'bmn' and sfwp = '否') group by kcmcid ) e) inplan_unout_num, (select count(*) from et_train_pd_cc_user where istrain = '1' and ccid in (select id from et_train_pd_cc where <@p p=" addgroupid = %s " f=" ? ">groupid and status = '2' and kcmcid in (select id from et_train_kc_all where <@p>nd and <@p>groupid and jhly = 'bmn' and sfwp = '否'))) inplan_unout_person, (select sum(pxxsh) from et_train_pd_cc where <@p p=" addgroupid = %s " f=" ? ">groupid and status = '2' and kcmcid in (select id from et_train_kc_all where <@p>nd and <@p>groupid and jhly = 'bmn' and sfwp = '否')) inplan_unout_hour, (select count(*) from (select * from et_train_ot where <@p p=" addgroupid = %s " f=" ? ">groupid and wpid in (select id from et_train_kc_all where <@p>nd and <@p>groupid and jhly = 'bmn' and sfwp = '是') group by wpid) d) inplan_out_num, (select count(*) from et_train_ot_xy where otid in (select id from et_train_ot where <@p p=" addgroupid = %s " f=" ? ">groupid and wpid in (select id from et_train_kc_all where <@p>nd and <@p>groupid and jhly = 'bmn' and sfwp = '是'))) inplan_out_person, (select count(*) from et_train_pd_cc where <@p p=" addgroupid = %s " f=" ? ">groupid and status = '2' and kcmcid in (select id from et_train_kc_all where <@p>nd and <@p>groupid and jhly = 'bmw' and sfwp = '否')) outplan_unout_num, (select count(*) from et_train_pd_cc_user where istrain = '1' and ccid in (select id from et_train_pd_cc where <@p p=" addgroupid = %s " f=" ? ">groupid and status = '2' and kcmcid in (select id from et_train_kc_all where <@p>nd and <@p>groupid and jhly = 'bmw' and sfwp = '否'))) outplan_unout_person, (select sum(pxxsh) from et_train_pd_cc where <@p p=" addgroupid = %s " f=" ? ">groupid and status = '2' and kcmcid in (select id from et_train_kc_all where <@p>nd and <@p>groupid and jhly = 'bmw' and sfwp = '否')) outplan_unout_hour, (select count(*) from (select * from et_train_ot where <@p p=" addgroupid = %s " f=" ? ">groupid and wpid in (select id from et_train_kc_all where <@p>nd and <@p>groupid and jhly = 'bmw' and sfwp = '是') group by wpid) c) outplan_out_num, (select count(*) from et_train_ot where <@p p=" addgroupid = %s " f=" ? ">groupid and wpid in (select id from et_train_kc_all where <@p>nd and <@p>groupid and jhly = 'bmw' and sfwp = '是')) outplan_out_person ]]> groupid <@p p=" AND (%s)">nd and jhly='bmn' and sfwp='否')a, (select count(*) wwc from et_train_kc where 1=1 <@p p=" AND (%s)">groupid <@p p=" AND (%s)">ndand jhly='bmn' and sfwp='否' and id not in(select kcmcid from et_train_pd_cc where kcmcid is not null group by kcmcid )) b, (select count(*) bmw from et_train_kc where 1=1 <@p p=" AND (%s)">groupid <@p p=" AND (%s)">nd and jhly='bmw' and sfwp='否' and id in(select kcmcid from et_train_pd_cc where kcmcid is not null group by kcmcid )) c, (select count(*) wp from et_train_kc where 1=1 <@p p=" AND (%s)">groupid <@p p=" AND (%s)">nd and sfwp='是' ) d ]]> 0 and datediff(enddate,curdate()) > 0 and state <> '已撤销' ]]> = 0 and state <> '已撤销' ]]> '已撤销' ]]>