| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831 |
- <?xml version="1.0" encoding="UTF-8"?>
- <queryMap desc = "产量信息统计">
- <query id = "FrmrptTotalProduct.get_TotalProductionData_Insert" desc = "A、B、D、E、F、G产量信息查询">
- <![CDATA[
- BEGIN
- delete from TEMP_TAB_RPT_PRODUCTION;
- insert into TEMP_TAB_RPT_PRODUCTION (productiondate, processcode,area,dept,plinename,production,totalproduction,
- outputweight, totaloutputweight,productionrate,firstgoodrate,productionrate_m,firstgoodrate_m,input,
- output, firstgood,totalinput,totaloutput,totalfirstgood)
- select '#today#' as productiondate,'A' as processcode
- ,a.department_desc_p as area ,a.factoryname as dept,a.pline_name as plinename
- ,to_char(production_d,'FM9,999,990.000') as production
- ,to_char(production_m,'FM9,999,990.000') as totalproduction
- ,(select to_char(sum(nvl(t.TAPPINGWGT,0)),'FM9,999,999.000')
- from stl_eaf_optinfo t
- where to_char(t.OPTDATE+3/24,'yyyyMMdd')=replace('#today#','-','')
- and nvl((select t1.ef_pline_code from stl_control_log t1
- where t.stove_no=t1.stove_no and rownum=1),
- (select t2.ef_pline_code from pln_steelforfurnace t2
- where t.stove_no=t2.stove_no and rownum=1))=a.pline_code) as output
- ,(select to_char(sum(nvl(t.TAPPINGWGT,0)),'FM999,999.000')
- from stl_eaf_optinfo t
- where substr(to_char(t.OPTDATE+3/24,'yyyyMMdd'),1,6)=replace(substr('#today#',1,7),'-','')
- and to_char(t.OPTDATE+3/24,'yyyyMMdd')<=replace('#today#','-','')
- and nvl((select t1.ef_pline_code from stl_control_log t1
- where t.stove_no=t1.stove_no and rownum=1),
- (select t2.ef_pline_code from pln_steelforfurnace t2
- where t.stove_no=t2.stove_no and rownum=1))=a.pline_code) as totaloutput
- ,'' as productionrate,'' as firstgoodrate
- ,'' as productionrate_m,'' as firstgoodrate_m
- ,to_number(null) as input,to_number(null) as output,to_number(null) as firstgood
- ,to_number(null) as totalinput,to_number(null) as totaloutput,to_number(null) as totalfirstgood
- from v_production_a_pline a
- left join (select t.pline_code,sum(t.production) as production_m
- from v_production_a t
- where t.bal_year_month=replace(substr('#today#',1,7),'-','')
- and t.proc_date<=replace('#today#','-','')
- group by t.pline_code) x on x.pline_code=a.pline_code
- left join (select t.pline_code,sum(t.production) as production_d
- from v_production_a t
- where t.proc_date=replace('#today#','-','')
- group by t.pline_code) y on y.pline_code=a.pline_code
- where x.production_m is not null
- order by a.department_code_p,a.factory_code,a.pline_code;
- insert into TEMP_TAB_RPT_PRODUCTION (productiondate, processcode,area,dept,plinename,production,totalproduction,
- outputweight, totaloutputweight,productionrate,firstgoodrate,productionrate_m,firstgoodrate_m,input,
- output, firstgood,totalinput,totaloutput,totalfirstgood)
- select '#today#' as productiondate,'B' as processcode
- ,a.department_desc_p as area ,a.factoryname as dept,a.pline_name as plinename
- ,to_char(production_d,'FM9,999,990.000') as production
- ,to_char(production_m,'FM9,999,990.000') as totalproduction
- ,to_char((select sum(t.weight) --合格量
- from v_production_b_pweight t
- where t.proc_date=replace('#today#','-','')
- and t.pline_code=a.pline_code),'FM9,999,999.000') as outputweight
- ,to_char((select sum(t.weight) --合格量
- from v_production_b_pweight t
- where t.bal_year_month=replace(substr('#today#',1,7),'-','')
- and t.proc_date<=replace('#today#','-','')
- and t.pline_code=a.pline_code),'FM9,999,999.000') as totaloutputweight
- ,'' as productionrate ,'' as firstgoodrate
- ,'' as productionrate_m ,'' as firstgoodrate_m
- ,y.output_d as input,y.output_d as output,y.firstgood_d as firstgood
- ,x.output_m as totalinput,x.output_m as totaloutput,x.firstgood_m as totalfirstgood
- from v_production_b_pline a
- left join (select t.pline_code
- ,sum(t.output) as output_m,sum(t.firstgood) as firstgood_m,sum(t.production) as production_m
- from v_production_b_new t
- where t.bal_year_month=replace(substr('#today#',1,7),'-','')
- and t.proc_date<=replace('#today#','-','')
- group by t.pline_code) x on x.pline_code=a.pline_code
- left join
- (select t.pline_code
- ,sum(t.output) as output_d,sum(t.firstgood) as firstgood_d,sum(t.production) as production_d
- from v_production_b_new t
- where t.proc_date=replace('#today#','-','')
- group by t.pline_code) y on y.pline_code=a.pline_code
- where (select sum(t.weight) --合格量
- from v_production_b_pweight t
- where t.bal_year_month=replace(substr('#today#',1,7),'-','')
- and to_char(t.product_TIME+3/24,'yyyyMMdd')<=replace('#today#','-','')
- and t.pline_code=a.pline_code) is not null or production_m is not null
- order by a.department_code_p,a.factory_code,a.pline_code;
- insert into TEMP_TAB_RPT_PRODUCTION (productiondate, processcode,area,dept,plinename,production,totalproduction,
- outputweight, totaloutputweight,productionrate,firstgoodrate,productionrate_m,firstgoodrate_m,input,
- output, firstgood,totalinput,totaloutput,totalfirstgood)
- select '#today#' as productiondate,'D' as processcode
- ,a.department_desc_p as area ,a.factoryname as dept,a.pline_name as plinename
- ,to_char(production_d,'FM9,999,990.000') as production
- ,to_char(production_m,'FM9,999,990.000') as totalproduction
- ,(select to_char(sum(y.qualified_wt),'FM9,999,990.000')
- from v_production_d_pweight y
- where y.proc_date=replace('#today#','-','') and qualified_wt>0
- and y.pline_code=x.pline_code) as outputweight
- ,(select to_char(sum(y.qualified_wt),'FM9,999,990.000')
- from v_production_d_pweight y
- where y.bal_year_month=replace(substr('#today#',1,7),'-','')
- and y.proc_date<=replace('#today#','-','') and qualified_wt>0
- and y.pline_code=x.pline_code) as totaloutputweight
- ,'' as productionrate
- ,'' as firstgoodrate
- ,'' as productionrate_m
- ,'' as firstgoodrate_m
- ,y.input_d as input,y.output_d as output,y.firstgood_d as firstgood
- ,x.input_m as totalinput,x.output_m as totaloutput,x.firstgood_m as totalfirstgood
- from v_production_d_pline a
- left join (select t.pline_code,sum(t.input) as input_m,sum(t.outputweight) as outputweight_m
- ,sum(t.output) as output_m,sum(t.firstgood) as firstgood_m,sum(t.production) as production_m
- from v_production_d_new t
- where substr(t.production_date,1,7)=substr('#today#',1,7)
- and t.production_date<='#today#'
- group by t.pline_code) x on x.pline_code=a.pline_code
- left join
- (select t.pline_code,sum(t.input) as input_d
- ,sum(t.output) as output_d,sum(t.firstgood) as firstgood_d,sum(t.production) as production_d,sum(t.outputweight) as outputweight_d
- from v_production_d_new t
- where t.production_date='#today#'
- group by t.pline_code) y on y.pline_code=a.pline_code
- where (select sum(y.qualified_wt)
- from v_production_d_pweight y
- where y.bal_year_month=replace(substr('#today#',1,7),'-','')
- and y.proc_date<=replace('#today#','-','') and qualified_wt>0
- and y.pline_code=x.pline_code) is not null or production_m is not null
- order by a.department_code_p,a.factory_code,a.pline_code;
- insert into TEMP_TAB_RPT_PRODUCTION (productiondate, processcode,area,dept,plinename,production,totalproduction,
- outputweight, totaloutputweight,productionrate,firstgoodrate,productionrate_m,firstgoodrate_m,input,
- output, firstgood,totalinput,totaloutput,totalfirstgood)
- select '#today#' as productiondate,'E' as processcode
- ,a.department_desc_p,a.factoryname,a.pline_name as plinename
- ,to_char(production_d,'FM9,999,990.000') as production
- ,to_char(production_m,'FM9,999,990.000') as totalproduction
- ,(select to_char(sum(y.qualified_wt),'FM9,999,990.000')
- from v_production_e_pweight y
- where y.proc_date=replace('#today#','-','')
- and y.pline_code=x.pline_code) as outputweight
- ,(select to_char(sum(y.qualified_wt),'FM9,999,990.000')
- from v_production_e_pweight y
- where bal_year_month=replace(substr('#today#',1,7),'-','')
- and y.proc_date<=replace('#today#','-','')
- and y.pline_code=x.pline_code) as totaloutputweight
- ,'' as productionrate
- ,'' as firstgoodrate
- ,'' as productionrate_m
- ,'' as firstgoodrate_m
- ,y.input_d as input,y.output_d as output,y.firstgood_d as firstgood
- ,x.input_m as totalinput,x.output_m as totaloutput,x.firstgood_m as totalfirstgood
- from v_production_e_pline a
- left join
- (select t.pline_code,sum(t.input) as input_m,sum(t.output_weight) as outputweight_m
- ,sum(t.output) as output_m,sum(t.firstgood) as firstgood_m,sum(t.production) as production_m
- from v_production_e t
- where substr(t.production_date,1,7)=substr('#today#',1,7)
- and t.production_date<='#today#'
- group by t.pline_code) x on x.pline_code=a.pline_code
- left join
- (select t.pline_code,sum(t.input) as input_d
- ,sum(t.output) as output_d,sum(t.firstgood) as firstgood_d,sum(t.production) as production_d,sum(t.output_weight) as outputweight_d
- from v_production_e t
- where t.production_date='#today#'
- group by t.pline_code) y on y.pline_code=a.pline_code
- where (select sum(y.qualified_wt)
- from v_production_e_pweight y
- where y.bal_year_month=replace(substr('#today#',1,7),'-','')
- and y.proc_date<=replace('#today#','-','')
- and y.pline_code=x.pline_code) is not null or production_m is not null
- order by a.department_code_p,a.factory_code,a.pline_code;
- insert into TEMP_TAB_RPT_PRODUCTION (productiondate, processcode,area,dept,plinename,production,totalproduction,
- outputweight, totaloutputweight,productionrate,firstgoodrate,productionrate_m,firstgoodrate_m,input,
- output, firstgood,totalinput,totaloutput,totalfirstgood)
- select '#today#' as productiondate,'F' as processcode
- ,a.department_desc_p,a.factoryname,a.pline_name as plinename
- ,to_char(production_d,'FM9,999,990.000') as production
- ,to_char(production_m,'FM9,999,990.000') as totalproduction
- ,(select to_char(sum(y.qualified_wt),'FM9,999,990.000')
- from v_production_f_pweight y
- where proc_date=replace('#today#','-','')
- and y.pline_code=x.pline_code) as outputweight
- ,(select to_char(sum(y.qualified_wt),'FM9,999,990.000')
- from v_production_f_pweight y
- where y.bal_year_month=replace(substr('#today#',1,7),'-','')
- and y.proc_date<=replace('#today#','-','')
- and y.pline_code=x.pline_code) as totaloutputweight
- ,'' as productionrate
- ,'' as firstgoodrate
- ,'' as productionrate_m
- ,'' as firstgoodrate_m
- ,y.input_d as input,y.output_d as output,y.firstgood_d as firstgood
- ,x.input_m as totalinput,x.output_m as totaloutput,x.firstgood_m as totalfirstgood
- from v_production_f_pline a
- left join
- (select t.pline_code,sum(t.input) as input_m,sum(t.output_weight) as outputweight_m
- ,sum(t.output) as output_m,sum(t.firstgood) as firstgood_m,sum(t.production) as production_m
- from v_production_f t
- where substr(t.production_date,1,7)=substr('#today#',1,7)
- and t.production_date<='#today#'
- group by t.pline_code) x on x.pline_code=a.pline_code
- left join
- (select t.pline_code,sum(t.input) as input_d
- ,sum(t.output) as output_d,sum(t.firstgood) as firstgood_d,sum(t.production) as production_d,sum(t.output_weight) as outputweight_d
- from v_production_f t
- where t.production_date='#today#'
- group by t.pline_code) y on y.pline_code=a.pline_code
- where (select sum(y.qualified_wt)
- from v_production_f_pweight y
- where y.bal_year_month=replace(substr('#today#',1,7),'-','')
- and y.proc_date<=replace('#today#','-','')
- and y.pline_code=x.pline_code) is not null or production_m is not null
- order by a.department_code_p,a.factory_code,a.pline_code;
- insert into TEMP_TAB_RPT_PRODUCTION (productiondate, processcode,area,dept,plinename,production,totalproduction,
- outputweight, totaloutputweight,productionrate,firstgoodrate,productionrate_m,firstgoodrate_m,input,
- output, firstgood,totalinput,totaloutput,totalfirstgood)
- select '#today#' as productiondate,'G' as processcode
- ,a.department_desc_p,a.factoryname,a.pline_name as plinename
- ,to_char(production_d,'FM9,999,990.000') as production
- ,to_char(production_m,'FM9,999,990.000') as totalproduction
- ,(select to_char(sum(qualified_wt),'FM9,999,990.000')
- from v_production_g_pweight t --生产点
- where proc_date=replace('#today#','-','')
- and t.pline_code=a.pline_code) as outputweight
- ,(select to_char(sum(qualified_wt),'FM9,999,990.000')
- from v_production_g_pweight t --生产点
- where t.bal_year_month=replace(substr('#today#',1,7),'-','')
- and proc_date<=replace('#today#','-','')
- and t.pline_code=a.pline_code) as totaloutputweight
- ,'' as productionrate
- ,'' as firstgoodrate
- ,'' as productionrate_m
- ,'' as firstgoodrate_m
- ,y.input_d as input,y.output_d as output,y.firstgood_d as firstgood
- ,x.input_m as totalinput,x.output_m as totaloutput,x.firstgood_m as totalfirstgood
- from v_production_g_pline a
- left join
- (select t.pline_code,sum(t.input) as input_m
- ,sum(t.output) as output_m,sum(t.firstgood) as firstgood_m,sum(t.production) as production_m,sum(t.output_weight) as outputweight_m
- from v_production_g t
- where substr(t.production_date,1,7)=substr('#today#',1,7)
- and t.production_date<='#today#'
- group by t.pline_code) x on x.pline_code=a.pline_code
- left join
- (select t.pline_code,sum(t.input) as input_d
- ,sum(t.output) as output_d,sum(t.firstgood) as firstgood_d,sum(t.production) as production_d,sum(t.output_weight) as outputweight_d
- from v_production_g t
- where t.production_date='#today#'
- group by t.pline_code) y on y.pline_code=a.pline_code
- where (select sum(qualified_wt)
- from v_production_g_pweight t --生产点
- where t.bal_year_month=replace(substr('#today#',1,7),'-','')
- and proc_date<=replace('#today#','-','')
- and t.pline_code=a.pline_code) is not null or production_m is not null
- order by a.department_code_p,a.factory_code,a.pline_code;
- commit;
- end;
- ]]>
- </query>
- <query id = "FrmrptTotalProduct.get_TotalProductionData_Select" desc = "A、B、D、E、F、G产量信息查询">
- <![CDATA[
- select * from TEMP_TAB_RPT_PRODUCTION where productiondate='#today#'
- ]]>
- </query>
- <query id = "FrmrptTotalProduct.get_TotalProductionData0" desc = "A、B、D、E、F、G产量信息查询">
- <![CDATA[
- select * from (select '#today#' as productiondate,'A' as processcode
- ,a.department_desc_p as area ,a.factoryname as dept,a.pline_name as plinename
- ,to_char(production_d,'FM9,999,990.000') as production
- ,to_char(production_m,'FM9,999,990.000') as totalproduction
- ,to_char(production_d,'FM9,999,990.000') as outputweight
- ,to_char(production_m,'FM9,999,990.000') as totaloutputweight
- ,'' as productionrate,'' as firstgoodrate
- ,'' as productionrate_m,'' as firstgoodrate_m
- ,to_number(null) as input,to_number(null) as output,to_number(null) as firstgood
- ,to_number(null) as totalinput,to_number(null) as totaloutput,to_number(null) as totalfirstgood
- from v_production_a_pline a
- left join (select t.pline_code,sum(t.production) as production_m
- from v_production_a t
- where t.bal_year_month=replace(substr('#today#',1,7),'-','')
- and t.proc_date<=replace('#today#','-','')
- group by t.pline_code) x on x.pline_code=a.pline_code
- left join (select t.pline_code,sum(t.production) as production_d
- from v_production_a t
- where t.proc_date=replace('#today#','-','')
- group by t.pline_code) y on y.pline_code=a.pline_code
- where x.production_m is not null
- order by a.department_code_p,a.factory_code,a.pline_code)
- union all
- select * from (select '#today#' as productiondate,'B' as processcode
- ,a.department_desc_p as area ,a.factoryname as dept,a.pline_name as plinename
- ,to_char(production_d,'FM9,999,990.000') as production
- ,to_char(production_m,'FM9,999,990.000') as totalproduction
- ,to_char((select sum(t.weight) --合格量
- from v_production_b_pweight t
- where t.proc_date=replace('#today#','-','')
- and t.pline_code=a.pline_code),'FM999999.000') as outputweight
- ,to_char((select sum(t.weight) --合格量
- from v_production_b_pweight t
- where t.bal_year_month=replace(substr('#today#',1,7),'-','')
- and t.proc_date<=replace('#today#','-','')
- and t.pline_code=a.pline_code),'FM999999.000') as totaloutputweight
- ,'' as productionrate ,'' as firstgoodrate
- ,'' as productionrate_m ,'' as firstgoodrate_m
- ,y.output_d as input,y.output_d as output,y.firstgood_d as firstgood
- ,x.output_m as totalinput,x.output_m as totaloutput,x.firstgood_m as totalfirstgood
- from v_production_b_pline a
- left join (select t.pline_code
- ,sum(t.output) as output_m,sum(t.firstgood) as firstgood_m,sum(t.production) as production_m
- from v_production_b_new t
- where t.bal_year_month=replace(substr('#today#',1,7),'-','')
- and t.proc_date<=replace('#today#','-','')
- group by t.pline_code) x on x.pline_code=a.pline_code
- left join
- (select t.pline_code
- ,sum(t.output) as output_d,sum(t.firstgood) as firstgood_d,sum(t.production) as production_d
- from v_production_b_new t
- where t.proc_date=replace('#today#','-','')
- group by t.pline_code) y on y.pline_code=a.pline_code
- where/* (select sum(t.weight) --合格量+废品
- from v_production_b_pweight t
- where t.bal_year_month=replace(substr('#today#',1,7),'-','')
- and to_char(t.product_TIME+3/24,'yyyyMMdd')<=replace('#today#','-','')
- and t.pline_code=a.pline_code) is not null or */production_m is not null
- order by a.department_code_p,a.factory_code,a.pline_code)
- union all
- select * from (select '#today#' as productiondate,'D' as processcode
- ,a.department_desc_p as area ,a.factoryname as dept,a.pline_name as plinename
- ,to_char(production_d,'FM9,999,990.000') as production
- ,to_char(production_m,'FM9,999,990.000') as totalproduction
- ,(select to_char(sum(y.qualified_wt),'FM9,999,990.000')
- from v_production_d_pweight y
- where y.proc_date=replace('#today#','-','') and qualified_wt>0
- and y.pline_code=x.pline_code) as outputweight
- ,(select to_char(sum(y.qualified_wt),'FM9,999,990.000')
- from v_production_d_pweight y
- where y.bal_year_month=replace(substr('#today#',1,7),'-','')
- and y.proc_date<=replace('#today#','-','') and qualified_wt>0
- and y.pline_code=x.pline_code) as totaloutputweight
- ,'' as productionrate
- ,'' as firstgoodrate
- ,'' as productionrate_m
- ,'' as firstgoodrate_m
- ,y.input_d as input,y.output_d as output,y.firstgood_d as firstgood
- ,x.input_m as totalinput,x.output_m as totaloutput,x.firstgood_m as totalfirstgood
- from v_production_d_pline a
- left join (select t.pline_code,sum(t.input) as input_m,sum(t.outputweight) as outputweight_m
- ,sum(t.output) as output_m,sum(t.firstgood) as firstgood_m,sum(t.production) as production_m
- from v_production_d_new t
- where substr(t.production_date,1,7)=substr('#today#',1,7)
- and t.production_date<='#today#'
- group by t.pline_code) x on x.pline_code=a.pline_code
- left join
- (select t.pline_code,sum(t.input) as input_d
- ,sum(t.output) as output_d,sum(t.firstgood) as firstgood_d,sum(t.production) as production_d,sum(t.outputweight) as outputweight_d
- from v_production_d_new t
- where t.production_date='#today#'
- group by t.pline_code) y on y.pline_code=a.pline_code
- where (select sum(y.qualified_wt)
- from v_production_d_pweight y
- where y.bal_year_month=replace(substr('#today#',1,7),'-','')
- and y.proc_date<=replace('#today#','-','') and qualified_wt>0
- and y.pline_code=x.pline_code) is not null or production_m is not null
- order by a.department_code_p,a.factory_code,a.pline_code)
- union all
- select * from (select '#today#' as productiondate,'E' as processcode
- ,a.department_desc_p,a.factoryname,a.pline_name as plinename
- ,to_char(production_d,'FM9,999,990.000') as production
- ,to_char(production_m,'FM9,999,990.000') as totalproduction
- ,(select to_char(sum(y.qualified_wt),'FM9,999,990.000')
- from v_production_e_pweight y
- where y.proc_date=replace('#today#','-','')
- and y.pline_code=x.pline_code) as outputweight
- ,(select to_char(sum(y.qualified_wt),'FM9,999,990.000')
- from v_production_e_pweight y
- where bal_year_month=replace(substr('#today#',1,7),'-','')
- and y.proc_date<=replace('#today#','-','')
- and y.pline_code=x.pline_code) as totaloutputweight
- ,'' as productionrate
- ,'' as firstgoodrate
- ,'' as productionrate_m
- ,'' as firstgoodrate_m
- ,y.input_d as input,y.output_d as output,y.firstgood_d as firstgood
- ,x.input_m as totalinput,x.output_m as totaloutput,x.firstgood_m as totalfirstgood
- from v_production_e_pline a
- left join
- (select t.pline_code,sum(t.input) as input_m,sum(t.output_weight) as outputweight_m
- ,sum(t.output) as output_m,sum(t.firstgood) as firstgood_m,sum(t.production) as production_m
- from v_production_e t
- where substr(t.production_date,1,7)=substr('#today#',1,7)
- and t.production_date<='#today#'
- group by t.pline_code) x on x.pline_code=a.pline_code
- left join
- (select t.pline_code,sum(t.input) as input_d
- ,sum(t.output) as output_d,sum(t.firstgood) as firstgood_d,sum(t.production) as production_d,sum(t.output_weight) as outputweight_d
- from v_production_e t
- where t.production_date='#today#'
- group by t.pline_code) y on y.pline_code=a.pline_code
- where (select sum(y.qualified_wt)
- from v_production_e_pweight y
- where y.bal_year_month=replace(substr('#today#',1,7),'-','')
- and y.proc_date<=replace('#today#','-','')
- and y.pline_code=x.pline_code) is not null or production_m is not null
- order by a.department_code_p,a.factory_code,a.pline_code)
- union all
- select * from (select '#today#' as productiondate,'F' as processcode
- ,a.department_desc_p,a.factoryname,a.pline_name as plinename
- ,to_char(production_d,'FM9,999,990.000') as production
- ,to_char(production_m,'FM9,999,990.000') as totalproduction
- ,(select to_char(sum(y.qualified_wt),'FM9,999,990.000')
- from v_production_f_pweight y
- where proc_date=replace('#today#','-','')
- and y.pline_code=x.pline_code) as outputweight
- ,(select to_char(sum(y.qualified_wt),'FM9,999,990.000')
- from v_production_f_pweight y
- where y.bal_year_month=replace(substr('#today#',1,7),'-','')
- and y.proc_date<=replace('#today#','-','')
- and y.pline_code=x.pline_code) as totaloutputweight
- ,'' as productionrate
- ,'' as firstgoodrate
- ,'' as productionrate_m
- ,'' as firstgoodrate_m
- ,y.input_d as input,y.output_d as output,y.firstgood_d as firstgood
- ,x.input_m as totalinput,x.output_m as totaloutput,x.firstgood_m as totalfirstgood
- from v_production_f_pline a
- left join
- (select t.pline_code,sum(t.input) as input_m,sum(t.output_weight) as outputweight_m
- ,sum(t.output) as output_m,sum(t.firstgood) as firstgood_m,sum(t.production) as production_m
- from v_production_f t
- where substr(t.production_date,1,7)=substr('#today#',1,7)
- and t.production_date<='#today#'
- group by t.pline_code) x on x.pline_code=a.pline_code
- left join
- (select t.pline_code,sum(t.input) as input_d
- ,sum(t.output) as output_d,sum(t.firstgood) as firstgood_d,sum(t.production) as production_d,sum(t.output_weight) as outputweight_d
- from v_production_f t
- where t.production_date='#today#'
- group by t.pline_code) y on y.pline_code=a.pline_code
- where (select sum(y.qualified_wt)
- from v_production_f_pweight y
- where y.bal_year_month=replace(substr('#today#',1,7),'-','')
- and y.proc_date<=replace('#today#','-','')
- and y.pline_code=x.pline_code) is not null or production_m is not null
- order by a.department_code_p,a.factory_code,a.pline_code)
- union all
- select * from (select '#today#' as productiondate,'G' as processcode
- ,a.department_desc_p,a.factoryname,a.pline_name as plinename
- ,to_char(production_d,'FM9,999,990.000') as production
- ,to_char(production_m,'FM9,999,990.000') as totalproduction
- ,(select to_char(sum(qualified_wt),'FM9,999,990.000')
- from v_production_g_pweight t --生产点
- where proc_date=replace('#today#','-','')
- and t.pline_code=a.pline_code) as outputweight
- ,(select to_char(sum(qualified_wt),'FM9,999,990.000')
- from v_production_g_pweight t --生产点
- where t.bal_year_month=replace(substr('#today#',1,7),'-','')
- and proc_date<=replace('#today#','-','')
- and t.pline_code=a.pline_code) as totaloutputweight
- ,'' as productionrate
- ,'' as firstgoodrate
- ,'' as productionrate_m
- ,'' as firstgoodrate_m
- ,y.input_d as input,y.output_d as output,y.firstgood_d as firstgood
- ,x.input_m as totalinput,x.output_m as totaloutput,x.firstgood_m as totalfirstgood
- from v_production_g_pline a
- left join
- (select t.pline_code,sum(t.input) as input_m
- ,sum(t.output) as output_m,sum(t.firstgood) as firstgood_m,sum(t.production) as production_m,sum(t.output_weight) as outputweight_m
- from v_production_g t
- where substr(t.production_date,1,7)=substr('#today#',1,7)
- and t.production_date<='#today#'
- group by t.pline_code) x on x.pline_code=a.pline_code
- left join
- (select t.pline_code,sum(t.input) as input_d
- ,sum(t.output) as output_d,sum(t.firstgood) as firstgood_d,sum(t.production) as production_d,sum(t.output_weight) as outputweight_d
- from v_production_g t
- where t.production_date='#today#'
- group by t.pline_code) y on y.pline_code=a.pline_code
- where (select sum(qualified_wt)
- from v_production_g_pweight t --生产点
- where t.bal_year_month=replace(substr('#today#',1,7),'-','')
- and proc_date<=replace('#today#','-','')
- and t.pline_code=a.pline_code) is not null or production_m is not null
- order by a.department_code_p,a.factory_code,a.pline_code)
- ]]>
- </query>
- <query id = "FrmrptTotalProduct.get_TotalProductionData1" desc = "A、B、D、E、F、G产量信息查询">
- <![CDATA[
- select * from (select nvl(y.production_date,'#today#') as productiondate,'A' as processcode
- ,(select a.department_desc_p from com_base_pline a where a.pline_code=x.pline_code) as area
- ,(select a.pline_name from com_base_pline a where a.pline_code=x.pline_code) as plinename
- ,round(production_d,3) as production
- ,round(production_m,3) as totalproduction
- ,to_number(null) as productionrate,to_number(null) as firstgoodrate
- ,to_number(null) as productionrate_m,to_number(null) as firstgoodrate_m
- from (select substr(t.production_date,1,7) as ny,t.pline_code,sum(t.production) as production_m
- from v_production_a t
- where to_date(t.production_date,'yyyy-mm-dd')<=to_date('#today#','yyyy-mm-dd')
- and substr(t.production_date,1,7)=substr('#today#',1,7)
- group by substr(t.production_date,1,7),t.pline_code) x
- left join (select t.production_date,t.pline_code,sum(t.production) as production_d
- from v_production_a t
- where t.production_date='#today#'
- group by t.production_date,t.pline_code) y on x.pline_code=y.pline_code
- order by x.pline_code)
- union all
- select * from (select nvl(y.production_date,'#today#') as productiondate,'B' as processcode
- ,(select a.department_desc_p from com_base_pline a where a.pline_code=x.pline_code) as area
- ,(select a.pline_name from com_base_pline a where a.pline_code=x.pline_code) as plinename
- ,round(production_d,3) as production
- ,round(production_m,3) as totalproduction
- ,case when nvl(y.output_d,0.00)=0.00 then to_number(null) else round(y.production_d*100/y.output_d,2) end as productionrate
- ,case when nvl(y.output_d,0.00)=0.00 then to_number(null) else round(y.firstgood_d*100/y.output_d,2) end as firstgoodrate
- ,case when nvl(x.output_m,0.00)=0.00 then to_number(null) else round(x.production_m*100/x.output_m,2) end as productionrate_m
- ,case when nvl(x.output_m,0.00)=0.00 then to_number(null) else round(x.firstgood_m*100/x.output_m,2) end as firstgoodrate_m
- from (select substr(t.production_date,1,7) as ny,t.pline_code
- ,sum(t.output) as output_m,sum(t.firstgood) as firstgood_m,sum(t.production) as production_m
- from v_production_b_new t
- where to_date(t.production_date,'yyyy-mm-dd')<=to_date('#today#','yyyy-mm-dd')
- and substr(t.production_date,1,7)=substr('#today#',1,7)
- group by substr(t.production_date,1,7),t.pline_code) x
- left join
- (select t.production_date,t.pline_code
- ,sum(t.output) as output_d,sum(t.firstgood) as firstgood_d,sum(t.production) as production_d
- from v_production_b_new t
- where t.production_date='#today#'
- group by t.production_date,t.pline_code) y on x.pline_code=y.pline_code
- order by x.pline_code)
- union all
- select * from (select nvl(y.production_date,'#today#') as productiondate,'D' as processcode
- ,(select a.department_desc_p from com_base_pline a where a.pline_code=x.pline_code) as area
- ,(select a.pline_name from com_base_pline a where a.pline_code=x.pline_code) as plinename
- ,round(production_d,3) as production
- ,round(production_m,3) as totalproduction
- ,case when nvl(y.input_d,0.00)=0.00 then to_number(null) else round(y.production_d*100/y.input_d,2) end as productionrate
- ,case when nvl(y.output_d,0.00)=0.00 then to_number(null) else round(y.firstgood_d*100/y.output_d,2) end as firstgoodrate
- ,case when nvl(x.input_m,0.00)=0.00 then to_number(null) else round(x.production_m*100/x.input_m,2) end as productionrate_m
- ,case when nvl(x.output_m,0.00)=0.00 then to_number(null) else round(x.firstgood_m*100/x.output_m,2) end as firstgoodrate_m
- from (select substr(t.production_date,1,7) as ny,t.pline_code,sum(t.input) as input_m
- ,sum(t.output) as output_m,sum(t.firstgood) as firstgood_m,sum(t.production) as production_m
- from v_production_d t
- where to_date(t.production_date,'yyyy-mm-dd')<=to_date('#today#','yyyy-mm-dd')
- and substr(t.production_date,1,7)=substr('#today#',1,7)
- group by substr(t.production_date,1,7),t.pline_code) x
- left join
- (select t.production_date,t.pline_code,sum(t.input) as input_d
- ,sum(t.output) as output_d,sum(t.firstgood) as firstgood_d,sum(t.production) as production_d
- from v_production_d t
- where t.production_date='#today#'
- group by t.production_date,t.pline_code) y on x.pline_code=y.pline_code
- order by x.pline_code)
- union all
- select * from (select nvl(y.production_date,'#today#') as productiondate,'E' as processcode
- ,(select a.department_desc_p from com_base_pline a where a.pline_code=x.pline_code) as area
- ,(select a.pline_name from com_base_pline a where a.pline_code=x.pline_code) as plinename
- ,round(production_d,3) as production
- ,round(production_m,3) as totalproduction
- ,case when nvl(y.input_d,0.00)=0.00 then to_number(null) else round(y.production_d*100/y.input_d,2) end as productionrate
- ,case when nvl(y.output_d,0.00)=0.00 then to_number(null) else round(y.firstgood_d*100/y.output_d,2) end as firstgoodrate
- ,case when nvl(x.input_m,0.00)=0.00 then to_number(null) else round(x.production_m*100/x.input_m,2) end as productionrate_m
- ,case when nvl(x.output_m,0.00)=0.00 then to_number(null) else round(x.firstgood_m*100/x.output_m,2) end as firstgoodrate_m
- from (select substr(t.production_date,1,7) as ny,t.pline_code,sum(t.input) as input_m
- ,sum(t.output) as output_m,sum(t.firstgood) as firstgood_m,sum(t.production) as production_m
- from v_production_e t
- where to_date(t.production_date,'yyyy-mm-dd')<=to_date('#today#','yyyy-mm-dd')
- and substr(t.production_date,1,7)=substr('#today#',1,7)
- group by substr(t.production_date,1,7),t.pline_code) x
- left join
- (select t.production_date,t.pline_code,sum(t.input) as input_d
- ,sum(t.output) as output_d,sum(t.firstgood) as firstgood_d,sum(t.production) as production_d
- from v_production_e t
- where t.production_date='#today#'
- group by t.production_date,t.pline_code) y on x.pline_code=y.pline_code
- order by x.pline_code)
- union all
- select * from (select nvl(y.production_date,'#today#') as productiondate,'F' as processcode
- ,(select a.department_desc_p from com_base_pline a where a.pline_code=x.pline_code) as area
- ,(select a.pline_name from com_base_pline a where a.pline_code=x.pline_code) as plinename
- ,round(production_d,3) as production
- ,round(production_m,3) as totalproduction
- ,case when nvl(y.input_d,0.00)=0.00 then to_number(null) else round(y.production_d*100/y.input_d,2) end as productionrate
- ,case when nvl(y.output_d,0.00)=0.00 then to_number(null) else round(y.firstgood_d*100/y.output_d,2) end as firstgoodrate
- ,case when nvl(x.input_m,0.00)=0.00 then to_number(null) else round(x.production_m*100/x.input_m,2) end as productionrate_m
- ,case when nvl(x.output_m,0.00)=0.00 then to_number(null) else round(x.firstgood_m*100/x.output_m,2) end as firstgoodrate_m
- from (select substr(t.production_date,1,7) as ny,t.pline_code,sum(t.input) as input_m
- ,sum(t.output) as output_m,sum(t.firstgood) as firstgood_m,sum(t.production) as production_m
- from v_production_f t
- where to_date(t.production_date,'yyyy-mm-dd')<=to_date('#today#','yyyy-mm-dd')
- and substr(t.production_date,1,7)=substr('#today#',1,7)
- group by substr(t.production_date,1,7),t.pline_code) x
- left join
- (select t.production_date,t.pline_code,sum(t.input) as input_d
- ,sum(t.output) as output_d,sum(t.firstgood) as firstgood_d,sum(t.production) as production_d
- from v_production_f t
- where t.production_date='#today#'
- group by t.production_date,t.pline_code) y on x.pline_code=y.pline_code
- order by x.pline_code)
- union all
- select * from (select nvl(y.production_date,'#today#') as productiondate,'G' as processcode
- ,(select a.department_desc_p from com_base_pline a where a.pline_code=x.pline_code) as area
- ,(select a.pline_name from com_base_pline a where a.pline_code=x.pline_code) as plinename
- ,round(production_d,3) as production
- ,round(production_m,3) as totalproduction
- ,case when nvl(y.input_d,0.00)=0.00 then to_number(null) else round(y.production_d*100/y.input_d,2) end as productionrate
- ,case when nvl(y.output_d,0.00)=0.00 then to_number(null) else round(y.firstgood_d*100/y.output_d,2) end as firstgoodrate
- ,case when nvl(x.input_m,0.00)=0.00 then to_number(null) else round(x.production_m*100/x.input_m,2) end as productionrate_m
- ,case when nvl(x.output_m,0.00)=0.00 then to_number(null) else round(x.firstgood_m*100/x.output_m,2) end as firstgoodrate_m
- from (select substr(t.production_date,1,7) as ny,t.pline_code,sum(t.input) as input_m
- ,sum(t.output) as output_m,sum(t.firstgood) as firstgood_m,sum(t.production) as production_m
- from v_production_g t
- where to_date(t.production_date,'yyyy-mm-dd')<=to_date('#today#','yyyy-mm-dd')
- and substr(t.production_date,1,7)=substr('#today#',1,7)
- group by substr(t.production_date,1,7),t.pline_code) x
- left join
- (select t.production_date,t.pline_code,sum(t.input) as input_d
- ,sum(t.output) as output_d,sum(t.firstgood) as firstgood_d,sum(t.production) as production_d
- from v_production_g t
- where t.production_date='#today#'
- group by t.production_date,t.pline_code) y on x.pline_code=y.pline_code
- order by x.pline_code)
- ]]>
- </query>
- <query id = "FrmrptTotalProduct.get_TotalProductionData_old" desc = "A、B、D、E、F、G产量信息查询">
- <![CDATA[
- select * from (select nvl(y.production_date,'#today#') as productiondate,'A' as processcode
- ,(select a.department_desc_p from com_base_pline a where a.pline_code=x.pline_code) as area
- ,(select a.pline_name from com_base_pline a where a.pline_code=x.pline_code) as plinename
- ,case when y.production_date is null then '' else to_char(round(production_d,3),'FM9999,999') end as production
- ,case when y.production_date is null then '' else to_char(round(production_m,3),'FM9999,999') end as totalproduction
- ,'' as productionrate,'' as firstgoodrate
- from (select substr(t.production_date,1,7) as ny,t.pline_code,sum(t.production) as production_m
- from v_production_a t
- where to_date(t.production_date,'yyyy-mm-dd')<=to_date('#today#','yyyy-mm-dd')
- and substr(t.production_date,1,7)=substr('#today#',1,7)
- group by substr(t.production_date,1,7),t.pline_code) x
- left join (select t.production_date,t.pline_code,sum(t.production) as production_d
- from v_production_a t
- where t.production_date='#today#'
- group by t.production_date,t.pline_code) y on x.pline_code=y.pline_code
- order by x.pline_code)
- union all
- select * from (select nvl(y.production_date,'#today#') as productiondate,'B' as processcode
- ,(select a.department_desc_p from com_base_pline a where a.pline_code=x.pline_code) as area
- ,(select a.pline_name from com_base_pline a where a.pline_code=x.pline_code) as plinename
- ,to_char(round(production_d,3),'FM999,999.000') as production
- ,to_char(round(production_m,3),'FM999,999.000') as totalproduction
- ,case when y.production_date is null then '' else to_char(round(y.production_d*100/y.output_d,2),'FM999.00') || '%' end as productionrate
- ,case when y.production_date is null then '' else to_char(round(y.firstgood_d*100/y.output_d,2),'FM999.00') || '%' end as firstgoodrate
- from (select substr(t.production_date,1,7) as ny,t.pline_code
- ,sum(t.output) as output_m,sum(t.firstgood) as firstgood_m,sum(t.production) as production_m
- from v_production_b_new t
- where to_date(t.production_date,'yyyy-mm-dd')<=to_date('#today#','yyyy-mm-dd')
- and substr(t.production_date,1,7)=substr('#today#',1,7)
- group by substr(t.production_date,1,7),t.pline_code) x
- left join
- (select t.production_date,t.pline_code
- ,sum(t.output) as output_d,sum(t.firstgood) as firstgood_d,sum(t.production) as production_d
- from v_production_b_new t
- where t.production_date='#today#'
- group by t.production_date,t.pline_code) y on x.pline_code=y.pline_code
- order by x.pline_code)
- union all
- select * from (select nvl(y.production_date,'#today#') as productiondate,'D' as processcode
- ,(select a.department_desc_p from com_base_pline a where a.pline_code=x.pline_code) as area
- ,(select a.pline_name from com_base_pline a where a.pline_code=x.pline_code) as plinename
- ,to_char(round(production_d,3),'FM999,999.000') as production
- ,to_char(round(production_m,3),'FM999,999.000') as totalproduction
- ,case when y.production_date is null then '' else to_char(round(y.production_d*100/y.input_d,2),'FM999.00') || '%' end as productionrate
- ,case when y.production_date is null then '' else to_char(round(y.firstgood_d*100/y.output_d,2),'FM999.00') || '%' end as firstgoodrate
- from (select substr(t.production_date,1,7) as ny,t.pline_code,sum(t.input) as input_m
- ,sum(t.output) as output_m,sum(t.firstgood) as firstgood_m,sum(t.production) as production_m
- from v_production_d t
- where to_date(t.production_date,'yyyy-mm-dd')<=to_date('#today#','yyyy-mm-dd')
- and substr(t.production_date,1,7)=substr('#today#',1,7)
- group by substr(t.production_date,1,7),t.pline_code) x
- left join
- (select t.production_date,t.pline_code,sum(t.input) as input_d
- ,sum(t.output) as output_d,sum(t.firstgood) as firstgood_d,sum(t.production) as production_d
- from v_production_d t
- where t.production_date='#today#'
- group by t.production_date,t.pline_code) y on x.pline_code=y.pline_code
- order by x.pline_code)
- union all
- select * from (select nvl(y.production_date,'#today#') as productiondate,'E' as processcode
- ,(select a.department_desc_p from com_base_pline a where a.pline_code=x.pline_code) as area
- ,(select a.pline_name from com_base_pline a where a.pline_code=x.pline_code) as plinename
- ,to_char(round(production_d,3),'FM999,999.000') as production
- ,to_char(round(production_m,3),'FM999,999.000') as totalproduction
- ,case when y.production_date is null then '' else to_char(round(y.production_d*100/y.input_d,2),'FM999.00') || '%' end as productionrate
- ,case when y.production_date is null then '' else to_char(round(y.firstgood_d*100/y.output_d,2),'FM999.00') || '%' end as firstgoodrate
- from (select substr(t.production_date,1,7) as ny,t.pline_code,sum(t.input) as input_m
- ,sum(t.output) as output_m,sum(t.firstgood) as firstgood_m,sum(t.production) as production_m
- from v_production_e t
- where to_date(t.production_date,'yyyy-mm-dd')<=to_date('#today#','yyyy-mm-dd')
- and substr(t.production_date,1,7)=substr('#today#',1,7)
- group by substr(t.production_date,1,7),t.pline_code) x
- left join
- (select t.production_date,t.pline_code,sum(t.input) as input_d
- ,sum(t.output) as output_d,sum(t.firstgood) as firstgood_d,sum(t.production) as production_d
- from v_production_e t
- where t.production_date='#today#'
- group by t.production_date,t.pline_code) y on x.pline_code=y.pline_code
- order by x.pline_code)
- union all
- select * from (select nvl(y.production_date,'#today#') as productiondate,'E' as processcode
- ,(select a.department_desc_p from com_base_pline a where a.pline_code=x.pline_code) as area
- ,(select a.pline_name from com_base_pline a where a.pline_code=x.pline_code) as plinename
- ,to_char(round(production_d,3),'FM999,999.000') as production
- ,to_char(round(production_m,3),'FM999,999.000') as totalproduction
- ,case when y.production_date is null then '' else to_char(round(y.production_d*100/y.input_d,2),'FM999.00') || '%' end as productionrate
- ,case when y.production_date is null then '' else to_char(round(y.firstgood_d*100/y.output_d,2),'FM999.00') || '%' end as firstgoodrate
- from (select substr(t.production_date,1,7) as ny,t.pline_code,sum(t.input) as input_m
- ,sum(t.output) as output_m,sum(t.firstgood) as firstgood_m,sum(t.production) as production_m
- from v_production_f t
- where to_date(t.production_date,'yyyy-mm-dd')<=to_date('#today#','yyyy-mm-dd')
- and substr(t.production_date,1,7)=substr('#today#',1,7)
- group by substr(t.production_date,1,7),t.pline_code) x
- left join
- (select t.production_date,t.pline_code,sum(t.input) as input_d
- ,sum(t.output) as output_d,sum(t.firstgood) as firstgood_d,sum(t.production) as production_d
- from v_production_f t
- where t.production_date='#today#'
- group by t.production_date,t.pline_code) y on x.pline_code=y.pline_code
- order by x.pline_code)
- union all
- select * from (select nvl(y.production_date,'#today#') as productiondate,'G' as processcode
- ,(select a.department_desc_p from com_base_pline a where a.pline_code=x.pline_code) as area
- ,(select a.pline_name from com_base_pline a where a.pline_code=x.pline_code) as plinename
- ,to_char(round(production_d,3),'FM999,999.000') as production
- ,to_char(round(production_m,3),'FM999,999.000') as totalproduction
- ,case when y.production_date is null then '' else to_char(round(y.production_d*100/y.input_d,2),'FM999.00') || '%' end as productionrate
- ,case when y.production_date is null then '' else to_char(round(y.firstgood_d*100/y.output_d,2),'FM999.00') || '%' end as firstgoodrate
- from (select substr(t.production_date,1,7) as ny,t.pline_code,sum(t.input) as input_m
- ,sum(t.output) as output_m,sum(t.firstgood) as firstgood_m,sum(t.production) as production_m
- from v_production_g t
- where to_date(t.production_date,'yyyy-mm-dd')<=to_date('#today#','yyyy-mm-dd')
- and substr(t.production_date,1,7)=substr('#today#',1,7)
- group by substr(t.production_date,1,7),t.pline_code) x
- left join
- (select t.production_date,t.pline_code,sum(t.input) as input_d
- ,sum(t.output) as output_d,sum(t.firstgood) as firstgood_d,sum(t.production) as production_d
- from v_production_g t
- where t.production_date='#today#'
- group by t.production_date,t.pline_code) y on x.pline_code=y.pline_code
- order by x.pline_code)
- ]]>
- </query>
- <query id = "FrmrptTotalProduct.getA_ProductionData" desc = "炼钢产量信息查询">
- <![CDATA[
- select t.production_time as ptime,stove_no,'' as judge_stove_no,'' as batchno,to_number(null) as pcount
- ,to_char(round(production,3),'FM9,999,990.000') as pweight
- ,'' as pweightrate,'' as pfirtgoodrate,'A' as processcode_d,a.pline_name as plinename_d
- from v_production_a t,com_base_pline a
- where t.production_date={0}
- and a.pline_code=t.pline_code and a.pline_name={1}
- order by production_time,t.stove_no
- ]]>
- </query>
- <query id = "FrmrptTotalProduct.getB_ProductionData" desc = "铸造产量信息查询">
- <![CDATA[
- select t.production_time as ptime,stove_no,judge_stove_no,'' as batchno,t.production_count as pcount
- ,to_char(round(production,3),'FM9,999,990.000') as pweight
- ,to_char(round(t.production*100/t.output,2),'FM999.00') || '%' as pweightrate
- ,to_char(round(t.firstgood*100/t.output,2),'FM999.00') || '%' as pfirtgoodrate,'B' as processcode_d,a.pline_name as plinename_d
- from v_production_b_new t,com_base_pline a
- where t.production_date={0}
- and a.pline_code=t.pline_code and a.pline_name={1}
- order by production_time,t.stove_no,judge_stove_no
- ]]>
- </query>
- <query id = "FrmrptTotalProduct.getD_ProductionData" desc = "轧管产量信息查询">
- <![CDATA[
- select t.production_time as ptime,'' as stove_no,judge_stove_no,'' as batchno,t.production_count as pcount
- ,to_char(round(production,3),'FM9,999,990.000') as pweight
- ,to_char(round(production*100/input,2),'FM999.00') || '%' as pweightrate
- ,to_char(round(firstgood*100/output,2),'FM999.00') || '%' as pfirtgoodrate,'D' as processcode_d,a.pline_name as plinename_d
- from v_production_d t,com_base_pline a
- where t.production_date={0}
- and a.pline_code=t.pline_code and a.pline_name={1}
- order by production_time,judge_stove_no
- ]]>
- </query>E
- <query id = "FrmrptTotalProduct.getE_ProductionData" desc = "镦拔扩产量信息查询">
- <![CDATA[
- select t.production_time as ptime,'' as stove_no,judge_stove_no,batch_no as batchno,t.production_count as pcount
- ,to_char(round(production,3),'FM9,999,990.000') as pweight
- ,to_char(round(production*100/input,2),'FM999.00') || '%' as pweightrate
- ,to_char(round(firstgood*100/output,2),'FM999.00') || '%' as pfirtgoodrate,'E' as processcode_d,a.pline_name as plinename_d
- from v_production_E t,com_base_pline a
- where t.production_date={0}
- and a.pline_code=t.pline_code and a.pline_name={1}
- order by production_time,judge_stove_no,batch_no
- ]]>
- </query>
- <query id = "FrmrptTotalProduct.getF_ProductionData" desc = "热处理量信息查询">
- <![CDATA[
- select t.production_time as ptime,'' as stove_no,judge_stove_no,batch_no as batchno,t.production_count as pcount
- ,to_char(round(production,3),'FM9,999,990.000') as pweight
- ,to_char(round(production*100/input,2),'FM999.00') || '%' as pweightrate
- ,to_char(round(firstgood*100/output,2),'FM999.00') || '%' as pfirtgoodrate,'F' as processcode_d,a.pline_name as plinename_d
- from v_production_f t,com_base_pline a
- where t.production_date={0}
- and a.pline_code=t.pline_code and a.pline_name={1}
- order by production_time,judge_stove_no,batch_no
- ]]>
- </query>
- <query id = "FrmrptTotalProduct.getG_ProductionData" desc = "加工产产量信息查询">
- <![CDATA[
- select t.production_time as ptime,'' as stove_no,judge_stove_no,phy_batch_no as batchno,t.production_count as pcount
- ,to_char(round(production,3),'FM9,999,990.000') as pweight
- ,to_char(round(production*100/input,2),'FM999.00') || '%' as pweightrate
- ,to_char(round(firstgood*100/output,2),'FM999.00') || '%' as pfirtgoodrate,'G' as processcode_d,a.pline_name as plinename_d
- from v_production_G t,com_base_pline a
- where t.production_date={0}
- and a.pline_code=t.pline_code and a.pline_name={1}
- order by production_time,judge_stove_no,phy_batch_no
- ]]>
- </query>
- </queryMap>
|