groupid@p>
<@p p="AND (%s)">sfwp@p>
<@p p="AND (jhly='sj' or groupid=%s)" f="?">filter1@p>
<@p p="AND groupid=%s" f="?">filter2@p>
<@p p="AND 1=%s" f="?">filter3@p>
<@p p="and id in (%s)" f="?">idarr@p>
order by nd desc
]]>
filter1@p>
<@p p="AND groupid=%s" f="?">filter2@p>
<@p p="AND 1=%s" f="?">filter3@p>
<@p p="or jhly=%s" f="?">jhly@p>
order by convert(kcmc using gbk)
]]>
filter1@p>
<@p p="AND groupid=%s" f="?">filter2@p>
<@p p="AND 1=%s" f="?">filter3@p>
order by convert(kcmc using gbk)
]]>
sfwp@p>
<@p p=" AND (%s)">groupid@p>
<@p p=" AND (%s)">nd@p>
<@p p=" and jhly IN(%s)" f="?">jhlyarr@p>
order by nd desc
]]>
sfwp@p>
<@p p=" AND (%s)">groupid@p>
<@p p=" AND (%s)">nd@p>
<@p p=" AND (%s)">jhly@p>
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@p> and <@p>groupid@p> and jhly = 'bmn' and sfwp = '否') year_inplan_unout_num,
( SELECT
count( * )
FROM
et_train_kc_all
WHERE
<@p>nd@p>
and <@p>groupid@p>
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@p> 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 p="AND d.groupid = ?">groupid@p>
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@p>
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 p="AND d.groupid = ?">groupid@p>
AND d.jhly = 'bmn'
AND d.sfwp = '否'
) inplan_unout_hour,
(SELECT count(*) FROM et_train_ot WHERE <@p p=" addgroupid = %s " f=" ? ">groupid@p> 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@p> and <@p>groupid@p> 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@p> 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@p> and <@p>groupid@p> and jhly = 'bmn' and sfwp = '是'))) inplan_out_person,
( SELECT
count( * )
FROM
et_train_kc_all
WHERE
<@p>nd@p>
and <@p>groupid@p>
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@p> 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 p="AND d.groupid = ?">groupid@p>
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@p>
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 p="AND d.groupid = ?">groupid@p>
AND d.jhly = 'bmw'
AND d.sfwp = '否'
) outplan_unout_hour,
(SELECT count(*) FROM et_train_ot WHERE <@p p=" addgroupid = %s " f=" ? ">groupid@p> 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@p> and <@p>groupid@p> 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@p> 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@p> and <@p>groupid@p> and jhly = 'bmw' and sfwp = '是'))) outplan_out_person
]]>
nd@p> and <@p>groupid@p> 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@p> and status = '2' and kcmcid in (select id from et_train_kc_all where <@p>nd@p> and <@p>groupid@p> 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@p> and status = '2' and kcmcid in (select id from et_train_kc_all where <@p>nd@p> and <@p>groupid@p> and jhly = 'bmn' and sfwp = '否'))) inplan_unout_person,
(select sum(pxxsh) from et_train_pd_cc where <@p p=" addgroupid = %s " f=" ? ">groupid@p> and status = '2' and kcmcid in (select id from et_train_kc_all where <@p>nd@p> and <@p>groupid@p> and jhly = 'bmn' and sfwp = '否')) inplan_unout_hour,
(select count(*) from (select * from et_train_ot where <@p p=" addgroupid = %s " f=" ? ">groupid@p> and wpid in (select id from et_train_kc_all where <@p>nd@p> and <@p>groupid@p> 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@p> and wpid in (select id from et_train_kc_all where <@p>nd@p> and <@p>groupid@p> and jhly = 'bmn' and sfwp = '是'))) inplan_out_person,
(select count(*) from et_train_pd_cc where <@p p=" addgroupid = %s " f=" ? ">groupid@p> and status = '2' and kcmcid in (select id from et_train_kc_all where <@p>nd@p> and <@p>groupid@p> 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@p> and status = '2' and kcmcid in (select id from et_train_kc_all where <@p>nd@p> and <@p>groupid@p> and jhly = 'bmw' and sfwp = '否'))) outplan_unout_person,
(select sum(pxxsh) from et_train_pd_cc where <@p p=" addgroupid = %s " f=" ? ">groupid@p> and status = '2' and kcmcid in (select id from et_train_kc_all where <@p>nd@p> and <@p>groupid@p> and jhly = 'bmw' and sfwp = '否')) outplan_unout_hour,
(select count(*) from (select * from et_train_ot where <@p p=" addgroupid = %s " f=" ? ">groupid@p> and wpid in (select id from et_train_kc_all where <@p>nd@p> and <@p>groupid@p> 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@p> and wpid in (select id from et_train_kc_all where <@p>nd@p> and <@p>groupid@p> and jhly = 'bmw' and sfwp = '是')) outplan_out_person
]]>
groupid@p>
<@p p=" AND (%s)">nd@p> and jhly='bmn' and sfwp='否')a,
(select count(*) wwc from et_train_kc where 1=1
<@p p=" AND (%s)">groupid@p>
<@p p=" AND (%s)">nd@p>and 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 p=" AND (%s)">nd@p> 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 p=" AND (%s)">nd@p> and sfwp='是' ) d
]]>
0 and datediff(enddate,curdate()) > 0 and state <> '已撤销'
]]>
= 0 and state <> '已撤销'
]]>
'已撤销'
]]>