ReportLgJobMgt.xml 222 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860186118621863186418651866186718681869187018711872187318741875187618771878187918801881188218831884188518861887188818891890189118921893189418951896189718981899190019011902190319041905190619071908190919101911191219131914191519161917191819191920192119221923192419251926192719281929193019311932193319341935193619371938193919401941194219431944194519461947194819491950195119521953195419551956195719581959196019611962196319641965196619671968196919701971197219731974197519761977197819791980198119821983198419851986198719881989199019911992199319941995199619971998199920002001200220032004200520062007200820092010201120122013201420152016201720182019202020212022202320242025202620272028202920302031203220332034203520362037203820392040204120422043204420452046204720482049205020512052205320542055205620572058205920602061206220632064206520662067206820692070207120722073207420752076207720782079208020812082208320842085208620872088208920902091209220932094209520962097209820992100210121022103210421052106210721082109211021112112211321142115211621172118211921202121212221232124212521262127212821292130213121322133213421352136213721382139214021412142214321442145214621472148214921502151215221532154215521562157215821592160216121622163216421652166216721682169217021712172217321742175217621772178217921802181218221832184218521862187218821892190219121922193219421952196219721982199220022012202220322042205220622072208220922102211221222132214221522162217221822192220222122222223222422252226222722282229223022312232223322342235223622372238223922402241224222432244224522462247224822492250225122522253225422552256225722582259226022612262226322642265226622672268226922702271227222732274227522762277227822792280228122822283228422852286228722882289229022912292229322942295229622972298229923002301230223032304230523062307230823092310231123122313231423152316231723182319232023212322232323242325232623272328232923302331233223332334233523362337233823392340234123422343234423452346234723482349235023512352235323542355235623572358235923602361236223632364236523662367236823692370237123722373237423752376237723782379238023812382238323842385238623872388238923902391239223932394239523962397239823992400240124022403240424052406240724082409241024112412241324142415241624172418241924202421242224232424242524262427242824292430243124322433243424352436243724382439244024412442244324442445244624472448244924502451245224532454245524562457245824592460246124622463246424652466246724682469247024712472247324742475247624772478247924802481248224832484248524862487248824892490249124922493249424952496249724982499250025012502250325042505250625072508250925102511251225132514251525162517251825192520252125222523252425252526252725282529253025312532253325342535253625372538253925402541254225432544254525462547254825492550255125522553255425552556255725582559256025612562256325642565256625672568256925702571257225732574257525762577257825792580258125822583258425852586258725882589259025912592259325942595259625972598259926002601260226032604260526062607260826092610261126122613261426152616261726182619262026212622262326242625262626272628262926302631263226332634263526362637263826392640264126422643264426452646264726482649265026512652265326542655265626572658265926602661266226632664266526662667266826692670267126722673267426752676267726782679268026812682268326842685268626872688268926902691269226932694269526962697269826992700270127022703270427052706270727082709271027112712271327142715271627172718271927202721272227232724272527262727272827292730273127322733273427352736273727382739274027412742274327442745274627472748274927502751275227532754275527562757275827592760276127622763276427652766276727682769277027712772277327742775277627772778277927802781278227832784278527862787278827892790279127922793279427952796279727982799280028012802280328042805280628072808280928102811281228132814281528162817281828192820282128222823282428252826282728282829283028312832283328342835283628372838283928402841284228432844284528462847284828492850285128522853285428552856285728582859286028612862286328642865286628672868286928702871287228732874287528762877287828792880288128822883288428852886288728882889289028912892289328942895289628972898289929002901290229032904290529062907290829092910291129122913291429152916291729182919292029212922292329242925292629272928292929302931293229332934293529362937293829392940294129422943294429452946294729482949295029512952295329542955295629572958295929602961296229632964296529662967296829692970297129722973297429752976297729782979298029812982298329842985298629872988298929902991299229932994299529962997299829993000300130023003300430053006300730083009301030113012301330143015301630173018301930203021302230233024302530263027302830293030303130323033303430353036303730383039304030413042304330443045304630473048304930503051305230533054305530563057305830593060306130623063306430653066306730683069307030713072307330743075307630773078307930803081308230833084308530863087308830893090309130923093309430953096309730983099310031013102310331043105310631073108310931103111311231133114311531163117311831193120312131223123312431253126312731283129313031313132313331343135313631373138313931403141314231433144314531463147314831493150315131523153315431553156315731583159316031613162316331643165316631673168316931703171317231733174317531763177317831793180318131823183318431853186318731883189319031913192319331943195319631973198319932003201320232033204320532063207320832093210321132123213321432153216321732183219322032213222322332243225322632273228322932303231323232333234323532363237323832393240324132423243324432453246324732483249325032513252325332543255325632573258325932603261326232633264326532663267326832693270327132723273327432753276327732783279328032813282328332843285328632873288328932903291329232933294329532963297329832993300330133023303330433053306330733083309331033113312331333143315331633173318331933203321332233233324332533263327332833293330333133323333333433353336333733383339334033413342334333443345334633473348334933503351335233533354335533563357335833593360336133623363336433653366336733683369337033713372337333743375337633773378337933803381338233833384338533863387338833893390339133923393339433953396339733983399340034013402340334043405340634073408340934103411341234133414341534163417341834193420342134223423342434253426342734283429343034313432343334343435343634373438343934403441344234433444344534463447344834493450345134523453345434553456345734583459346034613462346334643465346634673468346934703471347234733474347534763477347834793480348134823483348434853486348734883489349034913492349334943495349634973498349935003501350235033504350535063507350835093510351135123513351435153516351735183519352035213522352335243525352635273528352935303531353235333534353535363537353835393540354135423543354435453546354735483549355035513552355335543555355635573558355935603561356235633564356535663567356835693570357135723573357435753576357735783579358035813582358335843585358635873588358935903591359235933594359535963597359835993600360136023603360436053606360736083609361036113612361336143615361636173618361936203621362236233624362536263627362836293630363136323633363436353636363736383639364036413642364336443645364636473648364936503651365236533654365536563657365836593660366136623663366436653666366736683669367036713672367336743675367636773678367936803681368236833684368536863687368836893690369136923693369436953696369736983699370037013702370337043705370637073708370937103711371237133714371537163717371837193720372137223723372437253726372737283729373037313732373337343735373637373738373937403741374237433744374537463747374837493750375137523753375437553756375737583759376037613762376337643765376637673768376937703771377237733774377537763777377837793780378137823783378437853786378737883789379037913792379337943795379637973798379938003801380238033804380538063807380838093810381138123813381438153816381738183819382038213822382338243825382638273828382938303831383238333834383538363837383838393840384138423843384438453846384738483849385038513852385338543855385638573858385938603861386238633864386538663867386838693870387138723873387438753876387738783879388038813882388338843885388638873888388938903891389238933894389538963897389838993900390139023903390439053906390739083909391039113912391339143915391639173918391939203921392239233924392539263927392839293930393139323933393439353936393739383939394039413942394339443945394639473948394939503951395239533954395539563957395839593960396139623963396439653966396739683969397039713972397339743975397639773978397939803981398239833984398539863987398839893990399139923993399439953996399739983999400040014002400340044005400640074008400940104011401240134014401540164017401840194020402140224023402440254026402740284029403040314032403340344035403640374038403940404041404240434044404540464047404840494050405140524053405440554056405740584059406040614062406340644065406640674068406940704071407240734074407540764077407840794080408140824083408440854086408740884089409040914092409340944095409640974098409941004101410241034104410541064107410841094110411141124113411441154116411741184119412041214122412341244125412641274128412941304131413241334134413541364137413841394140414141424143414441454146414741484149415041514152415341544155415641574158415941604161416241634164416541664167416841694170417141724173417441754176417741784179418041814182418341844185418641874188418941904191419241934194419541964197419841994200420142024203420442054206420742084209421042114212421342144215421642174218421942204221422242234224422542264227422842294230423142324233423442354236423742384239424042414242424342444245424642474248424942504251425242534254425542564257425842594260426142624263426442654266426742684269427042714272427342744275427642774278427942804281428242834284428542864287428842894290429142924293429442954296429742984299430043014302430343044305430643074308430943104311431243134314431543164317431843194320432143224323432443254326432743284329433043314332433343344335433643374338433943404341434243434344434543464347434843494350435143524353435443554356435743584359436043614362436343644365436643674368436943704371437243734374437543764377437843794380438143824383438443854386438743884389439043914392439343944395439643974398439944004401440244034404440544064407440844094410441144124413441444154416441744184419442044214422442344244425442644274428442944304431443244334434443544364437443844394440444144424443444444454446444744484449445044514452445344544455445644574458445944604461446244634464446544664467446844694470447144724473447444754476447744784479448044814482448344844485448644874488448944904491449244934494449544964497449844994500450145024503450445054506450745084509451045114512451345144515451645174518451945204521452245234524452545264527452845294530453145324533453445354536453745384539454045414542454345444545454645474548454945504551455245534554455545564557455845594560456145624563456445654566456745684569457045714572457345744575457645774578457945804581458245834584458545864587458845894590459145924593459445954596459745984599460046014602460346044605460646074608460946104611461246134614461546164617461846194620462146224623462446254626462746284629463046314632463346344635463646374638463946404641464246434644464546464647464846494650465146524653465446554656465746584659466046614662466346644665466646674668466946704671467246734674467546764677467846794680468146824683468446854686468746884689469046914692469346944695469646974698469947004701470247034704470547064707470847094710471147124713471447154716471747184719472047214722472347244725472647274728472947304731473247334734473547364737473847394740474147424743474447454746474747484749475047514752475347544755475647574758475947604761476247634764476547664767476847694770477147724773477447754776477747784779478047814782478347844785478647874788478947904791479247934794479547964797479847994800480148024803480448054806480748084809481048114812481348144815481648174818481948204821482248234824482548264827482848294830483148324833483448354836483748384839484048414842484348444845484648474848484948504851485248534854485548564857485848594860486148624863486448654866486748684869487048714872487348744875487648774878487948804881488248834884488548864887488848894890489148924893489448954896489748984899490049014902490349044905490649074908490949104911
  1. <?xml version="1.0" encoding="UTF-8"?>
  2. <queryMap desc="炼钢报表">
  3. <query id="reportGBData.Query" desc="钢包使用记录原始台账" fetchSize="10">
  4. <![CDATA[
  5. select to_char(OPTDATE, 'yyyy-MM-dd hh24:mi:ss') OPTDATE,
  6. HEATNO,
  7. CVTPOS,
  8. LADLEID,
  9. AGE,
  10. LVL,
  11. INSTANCE,
  12. VDSMELTTIME VDSTIME,
  13. '' ARFLUX,
  14. (select t.basename
  15. from com_base_info t
  16. where t.basecode = a.skatefactory) SKATEFACTORY,
  17. (select b.PLANSTEEL
  18. from stl_bof_optinfo b
  19. where b.heatno = a.heatno
  20. union
  21. select c.PLANSTEEL
  22. from j#stl_bof_optinfo c
  23. where c.heatno = a.heatno) PLANSTEEL,
  24. (select d.SELETIME
  25. from stl_lfs_optinfo d
  26. where d.heatno = a.heatno
  27. and rownum = 1
  28. union
  29. select f.SELETIME
  30. from j#stl_lfs_optinfo f
  31. where f.heatno = a.heatno
  32. and rownum = 1) LFSSMELTTIME,
  33. (select USETIMES from dev_gb_base_info b where b.ladleid = a.ladleid) USETIMES
  34. from dev_gb_use_detail a $
  35. order by OPTDATE desc
  36. ]]>
  37. </query>
  38. <query id="LoadGBPno.Query" desc="初始化钢包号" fetchSize="10">
  39. <![CDATA[
  40. select t.ladleid from dev_gb_base_info t
  41. ]]>
  42. </query>
  43. <query id="LoadGetSteel.Query" desc="RH炉操作记录报表--加载钢种" fetchSize="10">
  44. <![CDATA[
  45. Select steel from com_steel where VALIDFLAG='1' ORDER BY steel
  46. ]]>
  47. </query>
  48. <query id="LgRHReport.Query" desc="RH炉操作记录报表" fetchSize="10">
  49. <![CDATA[
  50. select distinct to_char(a.OPTDATE, 'yyyy-MM-dd hh24:mi') OPTDATE,
  51. a.HEATNO HEATNO,
  52. a.LMLTEMPT,
  53. decode(substr(a.shiftcode, 1, 1),
  54. '1',
  55. '白',
  56. '2',
  57. '中',
  58. '3',
  59. '晚') BC,
  60. decode(substr(a.shiftcode, 2, 1),
  61. '1',
  62. '甲',
  63. '2',
  64. '乙',
  65. '3',
  66. '丙',
  67. '4',
  68. '丁') BB,
  69. to_char(b.BALEPFTIME,'hh24:mi') DCCMTIME,
  70. e.MaxSPvalue,
  71. e.MinSPVALUE,
  72. e.AvgSPVALUE,
  73. a.PLANSTEEL PLANSTEEL,
  74. a.RHSNO RHSNO,
  75. I.POTNO POTNO,
  76. a.VACGROOVEID VACGROOVEID,
  77. a.ARRIVEO2,
  78. a.LEAVEO2,
  79. to_char(a.ARRIVETIME,'hh24:mi') ARRIVETIME,
  80. a.RESIDUETHICKNESS RESIDUETHICKNESS,
  81. to_char(a.REPOSEBEGINTIME, 'hh24:mi') STARTTIME,
  82. a.ARFTEMPT ARFTEMPT_A,
  83. case
  84. when a.REPOSECLOSETIME is not null then
  85. to_char(a.REPOSECLOSETIME, 'hh24:mi')
  86. when a.LD_DOWN_DTIME is not null then
  87. to_char(a.LD_DOWN_DTIME, 'hh24:mi')
  88. else
  89. to_char(a.LEAVETIME, 'hh24:mi')
  90. end ENDTIME,
  91. a.ARBTEMPT ARBTEMPT_B,
  92. a.O2USEDTOTALC O2USEDTOTALC,
  93. '' LANCE_A,
  94. a.O2USEDTOTALAL O2USEDTOTALAL,
  95. '' LANCE_B,
  96. '' OBFLOW,
  97. a.VAC_MIN VAC_MIN,
  98. a.VAC_TIME VAC_TIME,
  99. a.PURE_TIME PURE_TIME,
  100. a.N2_CONS_S N2_CONS_S,
  101. a.STEAMTEMPT STEAMTEMPT,
  102. a.STEAMPRESS STEAMPRESS,
  103. a.STEAMFLUX STEAMFLUX,
  104. round(u.JMWGT, 2) JMWGT,
  105. to_char(a.LEAVETIME,'hh24:mi') LEAVETIME,
  106. v.PLAN_LINES PLAN_LINES,
  107. a.ARBTEMPT ARBTEMPT,
  108. b.PFBALETEMPT,
  109. a.STATIONCODE STATIONCODE,
  110. a.DISPOSALTIME DISPOSALTIME,
  111. max(case when a.HEATNO = w.HEATNO and w.xh = w.cnt then w.C end) over(partition by a.HEATNO) Y_C,
  112. max(case when a.HEATNO = w.HEATNO and w.xh = w.cnt then w.SI end) over(partition by a.HEATNO) Y_SI,
  113. max(case when a.HEATNO = w.HEATNO and w.xh = w.cnt then w.MN end) over(partition by a.HEATNO) Y_MN,
  114. max(case when a.HEATNO = w.HEATNO and w.xh = w.cnt then w.P end) over(partition by a.HEATNO) Y_P,
  115. max(case when a.HEATNO = w.HEATNO and w.xh = w.cnt then w.S end) over(partition by a.HEATNO) Y_S,
  116. max(case when a.HEATNO = w.HEATNO and w.xh = w.cnt then w.ALS end) over(partition by a.HEATNO) Y_ALS,
  117. max(case when a.HEATNO = w.HEATNO and w.xh = w.cnt then w.Nb end) over(partition by a.HEATNO) Y_NB,
  118. max(case when a.HEATNO = w.HEATNO and w.xh = w.cnt then w.V end) over(partition by a.HEATNO) Y_V,
  119. max(case when a.HEATNO = t4.HEATNO and t4.xh = t4.cnt then t4.C end) over(partition by a.HEATNO) C_C,
  120. max(case when a.HEATNO = t4.HEATNO and t4.xh = t4.cnt then t4.SI end) over(partition by a.HEATNO) C_SI,
  121. max(case when a.HEATNO = t4.HEATNO and t4.xh = t4.cnt then t4.MN end) over(partition by a.HEATNO) C_MN,
  122. max(case when a.HEATNO = t4.HEATNO and t4.xh = t4.cnt then t4.P end) over(partition by a.HEATNO) C_P,
  123. max(case when a.HEATNO = t4.HEATNO and t4.xh = t4.cnt then t4.S end) over(partition by a.HEATNO) C_S,
  124. max(case when a.HEATNO = t4.HEATNO and t4.xh = t4.cnt then t4.ALS end) over(partition by a.HEATNO) C_ALS,
  125. max(case when a.HEATNO = t4.HEATNO and t4.xh = t4.cnt then T4.NB end) over(partition by a.HEATNO) C_NB,
  126. max(case when a.HEATNO = t4.HEATNO and t4.xh = t4.cnt then T4.V end) over(partition by a.HEATNO) C_V,
  127. max(case when a.HEATNO = t4.HEATNO and t4.xh = t4.cnt then t4.NI end) over(partition by a.HEATNO) C_NI,
  128. max(case when a.HEATNO = t4.HEATNO and t4.xh = t4.cnt then t4.MO end) over(partition by a.HEATNO) C_MO,
  129. max(case when a.HEATNO = t4.HEATNO and t4.xh = t4.cnt then T4.CR end) over(partition by a.HEATNO) C_CR,
  130. max(case when a.HEATNO = t4.HEATNO and t4.xh = t4.cnt then T4.CU end) over(partition by a.HEATNO) C_CU,
  131. GetStandardVaule(a.HEATNO,t4.MN,t4.NI,t4.MO,t4.NB,t4.V,t4.ALS,t4.CR,t4.CU) CFFC,
  132. "1#RISER",
  133. "1#Dow",
  134. "2#RISER",
  135. "2#Dow",
  136. "3#RISER",
  137. "3#Dow",
  138. "1#TOPTIMES",
  139. "1#MIDDLETIMES",
  140. "1#BOTTOMTIMES",
  141. "2#TOPTIMES",
  142. "2#MIDDLETIMES",
  143. "2#BOTTOMTIMES",
  144. "3#TOPTIMES",
  145. "3#MIDDLETIMES",
  146. "3#BOTTOMTIMES",
  147. "1#OBS",
  148. "1#OBZ",
  149. "1#OBX",
  150. "2#OBS",
  151. "2#OBZ",
  152. "2#OBX",
  153. "3#OBS",
  154. "3#OBZ",
  155. "3#OBX",
  156. "1#AGE",
  157. "2#AGE",
  158. "3#AGE",
  159. "1#JIAOB",
  160. "1#JIEB",
  161. "2#JIAOB",
  162. "2#JIEB"
  163. from (select *
  164. from STL_RHS_OPTINFO
  165. where $
  166. union
  167. select * from J#stl_RHS_OPTINFO where $) a,
  168. (select *
  169. from STL_CCM_OPTINFO
  170. where $
  171. union
  172. select * from J#stl_CCM_OPTINFO where $ ) b,
  173. (select *
  174. from stl_BOF_OPTINFO
  175. union
  176. select * from J#stl_BOF_OPTINFO ) I,
  177. (select HEATNO, sum(JMWGT) over(partition by HEATNO) JMWGT
  178. from stl_ADDITIVES
  179. where upper(substr(STATIONCODE, 1, 1)) = 'F'
  180. and MATERIELTYPE = 'WS'
  181. and $ ) u,
  182. (select y.*
  183. from (select x.*,
  184. count(1) over(partition by x.HEATNO) cnt,
  185. row_number() over(partition by x.HEATNO order by x.ASSAYTYPECODE) xh
  186. from (select t.*
  187. from stl_CHEMELEMENT t
  188. where upper(SUBSTR(CHECKNO, 12, 1)) = 'F'
  189. and upper(SUBSTR(T.CHECKNO, -1)) = 'S'
  190. and $
  191. union
  192. select t.*
  193. from j#stl_CHEMELEMENT t
  194. where upper(SUBSTR(CHECKNO, 12, 1)) = 'F'
  195. and upper(SUBSTR(T.CHECKNO, -1)) = 'S'
  196. and $
  197. ) x) y
  198. where y.xh in (1, round(y.cnt / 2), y.cnt)) w,
  199. (select y.*
  200. from (select x.*,
  201. count(1) over(partition by x.HEATNO) cnt,
  202. row_number() over(partition by x.HEATNO order by x.ASSAYTYPECODE desc) xh
  203. from (select *
  204. from stl_CHEMELEMENT
  205. where upper(SUBSTR(CHECKNO, -1)) = 'S'
  206. and upper(SUBSTR(CHECKNO, 12, 2)) = 'GP'
  207. and $
  208. union
  209. select t.*
  210. from j#stl_CHEMELEMENT t
  211. where upper(SUBSTR(T.CHECKNO, -1)) = 'S'
  212. and upper(SUBSTR(CHECKNO, 12, 2)) = 'GP'
  213. and $ ) x) y
  214. where y.xh = y.cnt) t4,
  215. (select HEATNO, maxSPvalue, MinSPVALUE, avgSPVALUE
  216. from (select max(SAMPLINGVALUE) maxSPvalue,
  217. min(SAMPLINGVALUE) MinSPVALUE,
  218. round(avg(SAMPLINGVALUE), 2) avgSPVALUE,
  219. HEATNO
  220. from stl_tempsampling where substr(samplingdepict,1,4)='中包温度'
  221. group by HEATNO
  222. union
  223. select max(SAMPLINGVALUE) maxSPvalue,
  224. min(SAMPLINGVALUE) MinSPVALUE,
  225. round(avg(SAMPLINGVALUE), 2) avgSPVALUE,
  226. HEATNO
  227. from J#stl_tempsampling where substr(samplingdepict,1,4)='中包温度'
  228. group by HEATNO)) e,
  229. (select *
  230. from ppc_steel_heat
  231. union
  232. select * from J#ppc_steel_heat) v,
  233. (select '' "1#RISER",
  234. '' "1#Dow",
  235. '' "2#RISER",
  236. '' "2#Dow",
  237. '' "3#RISER",
  238. '' "3#Dow",
  239. s.heatno HEATNO,
  240. u.TOPTIMES "1#TOPTIMES",
  241. u.MIDDLETIMES "1#MIDDLETIMES",
  242. u.BOTTOMTIMES "1#BOTTOMTIMES",
  243. '' "2#TOPTIMES",
  244. '' "2#MIDDLETIMES",
  245. '' "2#BOTTOMTIMES",
  246. '' "3#TOPTIMES",
  247. '' "3#MIDDLETIMES",
  248. '' "3#BOTTOMTIMES",
  249. '' "1#OBS",
  250. '' "1#OBZ",
  251. '' "1#OBX",
  252. '' "2#OBS",
  253. '' "2#OBZ",
  254. '' "2#OBX",
  255. '' "3#OBS",
  256. '' "3#OBZ",
  257. '' "3#OBX",
  258. u.AGE "1#AGE",
  259. '' "2#AGE",
  260. '' "3#AGE",
  261. '' "1#JIAOB",
  262. '' "1#JIEB",
  263. '' "2#JIAOB",
  264. '' "2#JIEB"
  265. from dev_zkc_base_info t, STL_RHS_OPTINFO s, DEV_ZKC_USE_DETAIL u
  266. where t.tankcarid = s.vacgrooveid
  267. and u.tankcarid = t.id) C
  268. where a.HEATNO = u.HEATNO(+)
  269. and a.HEATNO = w.HEATNO(+)
  270. and a.HEATNO = t4.HEATNO(+)
  271. and a.HEATNO = v.heatno(+)
  272. and a.HEATNO = b.HEATNO(+)
  273. and a.HEATNO = C.HEATNO(+)
  274. and a.HEATNO = e.HEATNO(+)
  275. and a.heatno = I.HEATNO(+)
  276. order by OPTDATE,
  277. to_char(a.REPOSEBEGINTIME, 'hh24:mi')
  278. ]]>
  279. </query>
  280. <query id="LoadGetSteel_bindFLHJ.Query" desc="RH炉操作记录报表--合金加入量" fetchSize="10">
  281. <![CDATA[
  282. select a.HEATNO HEATNO,
  283. substr(a.STATIONCODE, 2, 2) STATIONCODE,
  284. a.DISPOSALTIME DISPOSALTIME,
  285. a.MATERIELTYPE TYPE,
  286. a.MATERIELCODE CODE,
  287. t.MATERIELNAME NAME,
  288. round(sum(nvl(a.JMWGT, 0)) over(partition by a.HEATNO,
  289. a.STATIONCODE,
  290. a.DISPOSALTIME,
  291. a.MATERIELTYPE,
  292. a.MATERIELCODE),
  293. 2) WEIGHT
  294. from stl_ADDITIVES a, com_MATERIEL t
  295. where substr(a.STATIONCODE, 1, 1) = 'F' and $
  296. and a.MATERIELCODE = t.MATERIELCODE(+)
  297. and a.MATERIELTYPE = t.MATERIELTYPE(+)
  298. ]]>
  299. </query>
  300. <query id="reportLFData.Query" desc="LF炉操作记录报表" fetchSize="10">
  301. <![CDATA[
  302. select distinct to_char(a.OPTDATE, 'yyyy-MM-dd hh24:mi') OPTDATE,
  303. a.HEATNO,
  304. decode(a.DESLAGGFLAG,'0','否','1','是') SFDZ,
  305. a.LMLTEMPT,
  306. substr(a.STATIONCODE,2,1) ||'LF'||'-'||a.WSID STATIONCODE,
  307. b.MaxSPvalue,
  308. b.MinSPVALUE,
  309. b.AvgSPVALUE,
  310. a.LFSNO,
  311. v.aim_grade_code PLANSTEEL,
  312. I.POTNO,
  313. I.POTWRAPSTATE,
  314. I.POTAGE,
  315. decode(substr(a.shiftcode, 1, 1),
  316. '1',
  317. '白',
  318. '2',
  319. '中',
  320. '3',
  321. '晚') BC,
  322. decode(substr(a.shiftcode, 2, 1),
  323. '1',
  324. '甲',
  325. '2',
  326. '乙',
  327. '3',
  328. '丙',
  329. '4',
  330. '丁') BB,
  331. nvl(u.PFBALEWGT,0)-nvl(u.BALELEAVEWGT,0) MOLSTLWGT,
  332. a.RESIDUETHICKNESS,
  333. to_char(a.ARRIVETIME, 'hh24:mi') ARRIVETIME,
  334. to_char(a.LEAVETIME, 'hh24:mi') LEAVETIME,
  335. a.ARRIVEWGT,
  336. a.LEAVEWGT,
  337. a.ARRIVEO2,
  338. a.LEAVEO2,
  339. '' WAL,
  340. '' WCA,
  341. '' SDDW,
  342. '' GLMB,
  343. to_char(a.SELESTARTTIME, 'hh24:mi') SELESTARTTIME,
  344. to_char(a.SELEENDTIME, 'hh24:mi') SELEENDTIME,
  345. a.SELETIME,
  346. a.ARRIVETEMPT LEAVETEMPT,
  347. '' "PPM",
  348. h.BLOWARPRESS,
  349. h.ARFLUX,
  350. '' WATERP,
  351. '' WATERFLOW,
  352. to_char(a.REPOSEBEGINTIME, 'hh24:mi') REPOSEBEGINTIME,
  353. a.REPOSETIME,
  354. a.FLEXIBLEBLOWTIME,
  355. v.PLAN_LINES,
  356. v.CAST_ID || '-' || v.cast_seq CAST_ID,
  357. a.LEAVETEMPT, PFBALETEMPT,
  358. decode(a.DESLAGGFLAG,'0','否','1','是') IFSLAG,
  359. I.POTDISTINCTION POTDISTINCTION,
  360. round((a.SELEENDTIME - a.SELESTARTTIME) * 24 * 60) YLZQ,
  361. to_char(a.REPOSECLOSETIME,'hh24:mi') QDTIME,
  362. a.DISPOSALTIME,
  363. max(case when a.HEATNO = w.HEATNO and w.xh = 1 then w.C end) over(partition by a.HEATNO) C_1,
  364. max(case when a.HEATNO = w.HEATNO and w.xh = 1 then w.SI end) over(partition by a.HEATNO) SI_1,
  365. max(case when a.HEATNO = w.HEATNO and w.xh = 1 then w.MN end) over(partition by a.HEATNO) MN_1,
  366. max(case when a.HEATNO = w.HEATNO and w.xh = 1 then w.P end) over(partition by a.HEATNO) P_1,
  367. max(case when a.HEATNO = w.HEATNO and w.xh = 1 then w.S end) over(partition by a.HEATNO) S_1,
  368. max(case when a.HEATNO = w.HEATNO and w.xh = 1 then w.ALS end) over(partition by a.HEATNO) ALS_1,
  369. max(case when a.HEATNO = w.HEATNO and w.xh = 1 then w.Alt end) over(partition by a.HEATNO) ALT_1,
  370. max(case when a.HEATNO = w.HEATNO and w.xh = 1 then w.Ca end) over(partition by a.HEATNO) CA_1,
  371. max(case when a.HEATNO = w.HEATNO and w.xh = round(w.cnt / 2) then w.C end) over(partition by a.HEATNO) C_2,
  372. max(case when a.HEATNO = w.HEATNO and w.xh = round(w.cnt / 2) then w.SI end) over(partition by a.HEATNO) SI_2,
  373. max(case when a.HEATNO = w.HEATNO and w.xh = round(w.cnt / 2) then w.MN end) over(partition by a.HEATNO) MN_2,
  374. max(case when a.HEATNO = w.HEATNO and w.xh = round(w.cnt / 2) then w.P end) over(partition by a.HEATNO) P_2,
  375. max(case when a.HEATNO = w.HEATNO and w.xh = round(w.cnt / 2) then w.S end) over(partition by a.HEATNO) S_2,
  376. max(case when a.HEATNO = w.HEATNO and w.xh = round(w.cnt / 2) then w.ALS end) over(partition by a.HEATNO) ALS_2,
  377. max(case When a.HEATNO = w.HEATNO and w.xh = round(w.cnt / 2) then w.Alt end) over(partition by a.HEATNO) ALT_2,
  378. max(case when a.HEATNO = w.HEATNO and w.xh = round(w.cnt / 2) then w.Ca end) over(partition by a.HEATNO) CA_2,
  379. max(case when a.HEATNO = w.HEATNO and w.xh = w.cnt then w.C end) over(partition by a.HEATNO) C_3,
  380. max(case when a.HEATNO = w.HEATNO and w.xh = w.cnt then w.SI end) over(partition by a.HEATNO) SI_3,
  381. max(case when a.HEATNO = w.HEATNO and w.xh = w.cnt then w.MN end) over(partition by a.HEATNO) MN_3,
  382. max(case when a.HEATNO = w.HEATNO and w.xh = w.cnt then w.P end) over(partition by a.HEATNO) P_3,
  383. max(case when a.HEATNO = w.HEATNO and w.xh = w.cnt then w.S end) over(partition by a.HEATNO) S_3,
  384. max(case when a.HEATNO = w.HEATNO and w.xh = w.cnt then w.ALS end) over(partition by a.HEATNO) ALS_3,
  385. max(case when a.HEATNO = w.HEATNO and w.xh = w.cnt then w.ALT end) over(partition by a.HEATNO) ALT_3,
  386. max(case when a.HEATNO = w.HEATNO and w.xh = w.cnt then w.Ca end) over(partition by a.HEATNO) CA_3,
  387. max(case when a.heatno = t4.heatno and t4.xh = 1 then t4.c end) over(partition by a.heatno) C_4,
  388. max(case when a.heatno = t4.heatno and t4.xh = 1 then t4.SI end) over(partition by a.heatno) SI_4,
  389. max(case when a.heatno = t4.heatno and t4.xh = 1 then t4.MN end) over(partition by a.heatno) MN_4,
  390. max(case when a.heatno = t4.heatno and t4.xh = 1 then t4.P end) over(partition by a.heatno) P_4,
  391. max(case when a.heatno = t4.heatno and t4.xh = 1 then t4.S end) over(partition by a.heatno) S_4,
  392. max(case when a.heatno = t4.heatno and t4.xh = 1 then t4.ALS end) over(partition by a.heatno) ALS_4,
  393. max(case when a.heatno = t4.heatno and t4.xh = 1 then t4.NI end) over(partition by a.heatno) Ni_4,
  394. max(case when a.heatno = t4.heatno and t4.xh = 1 then t4.MO end) over(partition by a.heatno) Mo_4,
  395. max(case when a.heatno = t4.heatno and t4.xh = 1 then t4.NB end) over(partition by a.heatno) Nb_4,
  396. max(case when a.heatno = t4.heatno and t4.xh = 1 then t4.V end) over(partition by a.heatno) V_4,
  397. max(case when a.heatno = t4.heatno and t4.xh = 1 then t4.CR end) over(partition by a.heatno) Cr_4,
  398. max(case when a.heatno = t4.heatno and t4.xh = 1 then t4.CU end) over(partition by a.heatno) Cu_4,
  399. max(case when a.heatno = t4.heatno and t4.xh = 1 then t4.ALT end) over(partition by a.heatno) ALT_4,
  400. max(case when a.heatno = t4.heatno and t4.xh = 1 then t4.CA end) over(partition by a.heatno) CA_4,
  401. GetStandardVaule(a.HEATNO,t4.MN,t4.NI,t4.MO,t4.NB,t4.V,t4.ALS,t4.CR,t4.CU) CFFC
  402. from (select *
  403. from stl_LFS_OPTINFO
  404. where $
  405. union
  406. select * from J#stl_LFS_OPTINFO where $) a,
  407. (select y.*
  408. from (select x.*,
  409. count(1) over(partition by x.HEATNO) cnt,
  410. row_number() over(partition by x.HEATNO order by x.ASSAYTYPECODE) xh
  411. from (select *
  412. from stl_CHEMELEMENT
  413. where upper(SUBSTR(CHECKNO, 12, 1)) = 'E'
  414. and upper(SUBSTR(CHECKNO, -1)) = 'S'
  415. and $
  416. union
  417. select *
  418. from J#stl_CHEMELEMENT
  419. where upper(SUBSTR(CHECKNO, 12, 1)) = 'E'
  420. and upper(SUBSTR(CHECKNO, -1)) = 'S'
  421. and $) x) y
  422. where y.xh in (1, round(y.cnt / 2), y.cnt)) w,
  423. (select y.*
  424. from (select x.*,
  425. row_number() over(partition by x.HEATNO, substr(assaytypecode, 1, 1) order by x.ASSAYTYPECODE desc) xh,
  426. substr(assaytypecode, 1, 1) typecode
  427. from (select *
  428. from stl_CHEMELEMENT
  429. where upper(SUBSTR(CHECKNO, -1)) = 'S'
  430. and upper(SUBSTR(CHECKNO, 12, 2)) = 'GP'
  431. and $
  432. union
  433. select *
  434. from J#stl_CHEMELEMENT
  435. where upper(SUBSTR(CHECKNO, -1)) = 'S'
  436. and upper(SUBSTR(CHECKNO, 12, 2)) = 'GP'
  437. and $) x) y
  438. where y.xh = 1) t4,
  439. (select *
  440. from stl_CCM_OPTINFO
  441. where $
  442. union
  443. select * from J#stl_CCM_OPTINFO where $) u,
  444. (select HEATNO, maxSPvalue, MinSPVALUE, avgSPVALUE
  445. from (select max(SAMPLINGVALUE) maxSPvalue,
  446. min(SAMPLINGVALUE) MinSPVALUE,
  447. round(avg(SAMPLINGVALUE), 2) avgSPVALUE,
  448. HEATNO
  449. from stl_tempsampling where substr(samplingdepict,1,4)='中包温度'
  450. group by HEATNO
  451. union
  452. select max(SAMPLINGVALUE) maxSPvalue,
  453. min(SAMPLINGVALUE) MinSPVALUE,
  454. round(avg(SAMPLINGVALUE), 2) avgSPVALUE,
  455. HEATNO
  456. from J#stl_tempsampling where substr(samplingdepict,1,4)='中包温度'
  457. group by HEATNO)) b,
  458. (select *
  459. from stl_CAS_OPTINFO
  460. where $
  461. union
  462. select * from J#stl_CAS_OPTINFO where $) h,
  463. (select *
  464. from stl_BOF_OPTINFO
  465. where $
  466. union
  467. select * from J#stl_BOF_OPTINFO where $) I,
  468. (select *
  469. from ppc_steel_heat
  470. union
  471. select * from J#ppc_steel_heat) v
  472. where a.HEATNO = u.HEATNO(+)
  473. and a.HEATNO = w.HEATNO(+)
  474. and a.HEATNO = v.HEATNo(+)
  475. and a.HEATNO = t4.HEATNO(+)
  476. and a.heatno = h.heatno(+)
  477. and a.heatno = b.HEATNO(+)
  478. and a.heatno = I.HEATNO(+)
  479. order by OPTDATE
  480. ]]>
  481. </query>
  482. <query id="queryLFData_FLHJ.Query" desc="LF炉操作记录报表--合金加入量" fetchSize="10">
  483. <![CDATA[
  484. Select t.heatno,
  485. t.STATIONCODE,
  486. t.DISPOSALTIME,
  487. t1.materielcode,
  488. decode(t1.materieltype, 'WS', t1.materieltype, 'WL') MATERIELTYPE,
  489. t2.materielname,
  490. round(sum(nvl(t1.JMWGT, 0)) over(partition by t1.HEATNO,
  491. t1.STATIONCODE,
  492. t1.DISPOSALTIME,
  493. t1.MATERIELTYPE,
  494. t1.MATERIELCODE)) materielWgt
  495. from (select *
  496. from stl_LFS_optinfo
  497. where 1 = 1 $
  498. union
  499. select * from J#stl_LFS_Optinfo where 1 = 1 $) t
  500. left join stl_additives t1 on t.heatno = t1.heatno
  501. and 'E' || t.stationcode = t1.stationcode
  502. and t.disposaltime = t1.disposaltime
  503. left join com_materiel t2 on t1.materielcode = t2.materielcode
  504. order by t.STATIONCODE, t.HEATNO
  505. ]]>
  506. </query>
  507. <query id="reportLFS_DPR.Query" desc="LF炉日生产统计报表--加载钢种" fetchSize="10">
  508. <![CDATA[
  509. Select steel from com_steel where VALIDFLAG='1' ORDER BY steel
  510. ]]>
  511. </query>
  512. <query id="reportLFS.Query" desc="LF炉日生产统计报表" fetchSize="10">
  513. <![CDATA[
  514. select t.OPTDATE,
  515. t.SUMLUCOUNT DT1,
  516. sum(t.SUMLUCOUNT) over(order by t.OPTDATE) CM1,
  517. t.SUMPLANSTEEL DT2,
  518. sum(t.SUMPLANSTEEL) over(order by t.OPTDATE) CM2,
  519. round(t.DC, 2) DC,
  520. t.JIABANLS DT3,
  521. sum(t.JIABANLS) over(order by t.OPTDATE) CM3,
  522. round(t.JIABANYIELD, 2) DT4,
  523. round(sum(t.JIABANYIELD) over(order by t.OPTDATE), 2) CM4,
  524. t.YIBANLS DT5,
  525. sum(t.YIBANLS) over(order by t.OPTDATE) CM5,
  526. round(t.YIBANYIELD, 2) DT6,
  527. round(sum(t.YIBANYIELD) over(order by t.OPTDATE), 2) CM6,
  528. t.BINGBANLS DT7,
  529. sum(t.BINGBANLS) over(order by t.OPTDATE) CM7,
  530. round(t.BINGBANYIELD, 2) DT8,
  531. round(sum(t.BINGBANYIELD) over(order by t.OPTDATE), 2) CM8,
  532. t.DINGBANLS DT9,
  533. sum(t.DINGBANLS) over(order by t.OPTDATE) CM9,
  534. round(t.DINGBANYIELD, 2) DT10,
  535. round(sum(t.DINGBANYIELD) over(order by t.OPTDATE), 2) CM10
  536. from (select distinct x.OPTDATE,
  537. count(distinct x.heatno) over(partition by x.optdate) SUMLUCOUNT,
  538. sum(y.WEIGHT) over(partition by x.optdate) SUMPLANSTEEL,
  539. sum(y.WEIGHT) over(partition by x.optdate) / count(distinct x.heatno) over(partition by x.optdate) DC,
  540. sum(case x.shiftcode
  541. when '1' then
  542. 1
  543. end) over(partition by x.optdate) JIABANLS,
  544. sum(case x.shiftcode
  545. when '1' then
  546. y.WEIGHT
  547. end) over(partition by x.optdate) JIABANYIELD,
  548. sum(case x.shiftcode
  549. when '2' then
  550. 1
  551. end) over(partition by x.optdate) YIBANLS,
  552. sum(case x.shiftcode
  553. when '2' then
  554. y.WEIGHT
  555. end) over(partition by x.optdate) YIBANYIELD,
  556. sum(case x.shiftcode
  557. when '3' then
  558. 1
  559. end) over(partition by x.optdate) BINGBANLS,
  560. sum(case x.shiftcode
  561. when '3' then
  562. y.WEIGHT
  563. end) over(partition by x.optdate) BINGBANYIELD,
  564. sum(case x.shiftcode
  565. when '4' then
  566. 1
  567. end) over(partition by x.optdate) DINGBANLS,
  568. sum(case x.shiftcode
  569. when '4' then
  570. y.WEIGHT
  571. end) over(partition by x.optdate) DINGBANYIELD
  572. from (select a.heatno,
  573. a.plansteel,
  574. substr(a.shiftcode, 2, 1) shiftcode,
  575. to_char(a.optdate, 'yyyy-MM-dd') optdate
  576. from (select *
  577. from STL_LFS_OPTINFO
  578. where $
  579. union
  580. select * from J#STL_LFS_OPTINFO where $) a
  581. group by a.heatno,
  582. a.plansteel,
  583. to_char(a.optdate, 'yyyy-MM-dd'),
  584. a.shiftcode) x,
  585. (select heatno,
  586. nvl(PFBALEWGT, 0) - nvl(BALELEAVEWGT, 0) WEIGHT
  587. from (select row_number() over(partition by b.heatno order by b.disposaltime) xh,
  588. count(1) over(partition by b.heatno) cnt,
  589. b.*
  590. from (select *
  591. from STL_CCM_OPTINFO
  592. where $
  593. union
  594. select * from J#STL_CCM_OPTINFO where $) b)
  595. where xh = cnt) y
  596. where x.heatno = y.heatno(+)
  597. order by x.optdate) t
  598. ]]>
  599. </query>
  600. <query id="proc_GetHeatNo_All.Query" desc="生产日报表--所有炉号查询" fetchSize="10">
  601. <![CDATA[
  602. select A.HEATNO,
  603. A.STATIONCODE,
  604. nvl(round(B.CPL, 3), 0) CPL,
  605. case
  606. when (nvl(A.PFBALEWGT, 0) - nvl(A.BALELEAVEWGT, 0)) > 0 then
  607. round((nvl(A.PFBALEWGT, 0) - nvl(A.BALELEAVEWGT, 0)), 3)
  608. else
  609. 0
  610. end GSL,
  611. (select substr(mes_lg_common.getlgshift1(A.RecFlag), 2, 1) from dual) SHIFTCODE,
  612. case
  613. when to_char(A.RecFlag, 'yyyy-MM-dd HH24:mi') between ? and ? then
  614. '1'
  615. else
  616. '0'
  617. end BECURR
  618. from (select *
  619. from (select t.*,
  620. row_number() over(partition by HEATNO order by RecFlag) XH
  621. from (select t.recflag, t2.*
  622. from (select t.heatno,
  623. case
  624. when B1STARTTIME is not null then
  625. B1STARTTIME
  626. else
  627. OPTDATE
  628. end RecFlag
  629. from STL_bof_optinfo t
  630. where to_char(case when
  631. B1STARTTIME is not null then
  632. B1STARTTIME else OPTDATE end,
  633. 'yyyy-MM-dd') between ? and ?
  634. union all
  635. select t.heatno,
  636. case
  637. when B1STARTTIME is not null then
  638. B1STARTTIME
  639. else
  640. OPTDATE
  641. end RecFlag
  642. from J#STL_bof_optinfo t
  643. where to_char(case when
  644. B1STARTTIME is not null then
  645. B1STARTTIME else OPTDATE end,
  646. 'yyyy-MM-dd') between ? and ?) t,
  647. (select *
  648. from STL_ccm_optinfo
  649. union
  650. select * from J#STL_Ccm_Optinfo) t2
  651. where t.heatno = t2.heatno) t)
  652. where XH = 1) A,
  653. (select distinct substr(HEATNO, 1, 10) HEATNO,
  654. sum(nvl(WEIGHT, 0)) over(partition by HEATNO) CPL
  655. from (select HEATNO, (sum(WEIGHT)/1000) WEIGHT
  656. from stl_incision_view
  657. where to_char(CUTTIME,'yyyymmddhh24miss') between ? and
  658. ? Group by HEATNO) t) B
  659. where A.HEATNO = B.HEATNO(+)
  660. ]]>
  661. </query>
  662. <query id="proc_GetBOFInfo_CEF.Query" desc="生产日报表--BOF炉信息查询" fetchSize="10">
  663. <![CDATA[
  664. select HEATNO,
  665. STATIONCODE,
  666. substr(SHIFTCODE, 2, 1) SHIFTCODE,
  667. nvl(IRONPOTWGT, 0) TSL,
  668. nvl(PIGIRONWGT, 0) STL,
  669. nvl(WSTEELWGT, 0) FGL,
  670. case
  671. when to_char(RecFlag, 'yyyy-MM-dd HH24:mi') between ? and ? then
  672. '1'
  673. else
  674. '0'
  675. end BECURR
  676. from (select *
  677. from (select t.*,
  678. row_number() over(partition by t.HEATNO order by t.RecFlag) XH
  679. from (select t.*,
  680. case
  681. when B1STARTTIME is not null then
  682. B1STARTTIME
  683. else
  684. OPTDATE
  685. end RecFlag
  686. from STL_BOF_OPTINFO t
  687. where to_char(case when B1STARTTIME is not null then
  688. B1STARTTIME else OPTDATE end,
  689. 'yyyy-MM-dd') between ? and ?
  690. union all
  691. select t.*,
  692. case
  693. when B1STARTTIME is not null then
  694. B1STARTTIME
  695. else
  696. OPTDATE
  697. end RecFlag
  698. from J#STL_BOF_OPTINFO t
  699. where to_char(case when B1STARTTIME is not null then
  700. B1STARTTIME else OPTDATE end,
  701. 'yyyy-MM-dd') between ? and ? ) t)
  702. where XH = 1)
  703. ]]>
  704. </query>
  705. <query id="proc_GetLFSInfo_CEF.Query" desc="生产日报表--LF炉信息查询" fetchSize="10">
  706. <![CDATA[
  707. select HEATNO,
  708. STATIONCODE,
  709. substr(SHIFTCODE, 2, 1) SHIFTCODE,
  710. case
  711. when to_char(RecFlag, 'yyyy-MM-dd HH24:mi') between ? and ? then
  712. '1'
  713. else
  714. '0'
  715. end BECURR
  716. from (select *
  717. from (select t.*,
  718. row_number() over(partition by HEATNO order by RecFlag) XH
  719. from (select t.recflag, t2.*
  720. from (select t.heatno,
  721. case
  722. when B1STARTTIME is not null then
  723. B1STARTTIME
  724. else
  725. OPTDATE
  726. end RecFlag
  727. from stl_bof_optinfo t
  728. where to_char(case when
  729. B1STARTTIME is not null then
  730. B1STARTTIME else OPTDATE end,
  731. 'yyyy-MM-dd') between ? and ?
  732. union all
  733. select t.heatno,
  734. case
  735. when B1STARTTIME is not null then
  736. B1STARTTIME
  737. else
  738. OPTDATE
  739. end RecFlag
  740. from J#stl_bof_optinfo t
  741. where to_char(case when
  742. B1STARTTIME is not null then
  743. B1STARTTIME else OPTDATE end,
  744. 'yyyy-MM-dd') between ? and ? ) t,
  745. (select *
  746. from stl_LFS_optinfo
  747. union
  748. select * from J#stl_LFS_Optinfo) t2
  749. where t.heatno = t2.heatno) t)
  750. where XH = 1)
  751. ]]>
  752. </query>
  753. <query id="proc_GetRHSInfo_CEF.Query" desc="生产日报表--RH炉信息查询" fetchSize="10">
  754. <![CDATA[
  755. select HEATNO,
  756. STATIONCODE,
  757. substr(SHIFTCODE, 2, 1) SHIFTCODE,
  758. ?
  759. case
  760. when to_char(OPTDATE, 'yyyy-MM-dd HH24:mi') between ? and ? then
  761. '1'
  762. else
  763. '0'
  764. end BECURR
  765. from (select *
  766. from (select t.*,
  767. row_number() over(partition by t.HEATNO order by t.OPTDATE) XH
  768. from (select *
  769. from ?
  770. where to_char(OPTDATE, 'yyyy-MM-dd') between ? and ?
  771. union all
  772. select *
  773. from J# ?
  774. where to_char(OPTDATE, 'yyyy-MM-dd') between ? and ? ) t)
  775. where XH = 1)
  776. ]]>
  777. </query>
  778. <query id="reportBOFToCCMData.Query" desc="炼钢生产报表--加载钢种" fetchSize="10">
  779. <![CDATA[
  780. Select steel from com_steel where VALIDFLAG='1' ORDER BY steel
  781. ]]>
  782. </query>
  783. <!--select *
  784. from com_base_info d
  785. where d.sortcode = '1006'
  786. order by d.basecode) h
  787. where d.ITEMCODE = h.basename
  788. and steel = t4.AIM_GRADE_CODE
  789. and stdstyle = '1'
  790. and d.ITEMCODE = 'Mn'
  791. group by
  792. steel, stdstyle,
  793. itemcode, std, stdmin, stdmax, basename,basecode -->
  794. <query id="BOFToCCMData.Query" desc="炼钢生产报表--炼钢生产报表数据查询" fetchSize="10">
  795. <![CDATA[
  796. select distinct t.HEATNO,
  797. t.STATIONCODE STATIONCODE,
  798. to_char(t.OPTDATE, 'yyyy-MM-dd') OPTDATE,
  799. t.SHIFTCODE,
  800. substr(t.shiftcode, 1, 1) BC,
  801. substr(t.shiftcode, 2, 1) BB,
  802. t4.aim_grade_code PLANSTEEL,
  803. case when substr(t4.fact_route,9,2) !='E0' then
  804. '是'
  805. else
  806. '否'
  807. end FACT_ROUTE,
  808. '' MnFC,
  809. NVL((select distinct d.stdmin
  810. from com_standard_chem_view d,
  811. (select *
  812. from com_base_info d
  813. where d.sortcode = '1006'
  814. order by d.basecode) h,
  815. (select * from COM_SORTCODE_CHEM) s
  816. where d.ITEMCODE = h.basename
  817. and d.cic=s.cic
  818. and s.steel =t4.aim_grade_code
  819. and s.stdstyle = '1'
  820. and d.ITEMCODE = 'Mn'
  821. group by steel,
  822. stdstyle,
  823. itemcode,
  824. std,
  825. stdmin,
  826. stdmax,
  827. basename,
  828. basecode
  829. ),0) NKMn ,
  830. case
  831. when substr(t4.fact_route, 9, 2) != 'E0' then
  832. nvl(max(case when t.HEATNO = t10.HEATNO and t10.xh = t10.cnt then t10.Mn end) over(partition by t.HEATNO),0) --精炼
  833. else
  834. nvl(max(case when t.HEATNO = t11.HEATNO and t11.xh = t11.cnt then t11.Mn end) over(partition by t.HEATNO),0) --连铸
  835. end LForCCM,
  836. t.SAGE,
  837. t.GAGE,
  838. t.OGGNUMID,
  839. t.EMOLSTLTIME,
  840. nvl(t.IRONPOTWGT, '0') IRONPOTWGT,
  841. t.WSTEELWGT,
  842. t.PIGIRONWGT,
  843. t.JOINMARLWGT,
  844. t.RSTEELWGT,
  845. t.RSWGT,
  846. t.IRONPOTID,
  847. t.N2CONSUME,
  848. t.ARCONSUME,
  849. t.POTDISTINCTION,
  850. t.POTWRAPSTATE,
  851. nvl(t.N2CONSUME, 0) + nvl(t.TOPN2CONSUME, 0) N2SUM,
  852. decode(substr(t.MOLIRNTYPE, 1, 1),
  853. '1',
  854. '半钢',
  855. decode(substr(t.MOLIRNTYPE, 1, 1),
  856. '2',
  857. '脱硫',
  858. decode(substr(t.MOLIRNTYPE, 1, 1),
  859. '3',
  860. '混铁炉',
  861. decode(substr(t.MOLIRNTYPE, 1, 1),
  862. '4',
  863. '直兑',
  864. '')))) MOLIRNTYPE,
  865. t.IRONTEMPERATURE,
  866. (select CAST_ID || '-' || CAST_SEQ
  867. from ppc_steel_heat
  868. where HEATNO = t.HEATNO) MOULDUMID,
  869. to_char(t.CHANGESTARTTIME, 'HH24:mi') CHANGESTARTTIME,
  870. to_char(t.OPENOXYGENTIME, 'HH24:mi') OPENOXYGENTIME,
  871. FLOOR(nvl(t.supplyoxygentime / 60, 0)) SUPPLYOXYGENTIME,
  872. --to_char(round((nvl(t.supplyoxygentime, 0) / 60 -
  873. -- FLOOR(nvl(t.supplyoxygentime, 0) / 60)) * 60))
  874. t.supplyoxygentime SUPPLYOXYGENTIME_S,
  875. FLOOR(nvl(t.B1TIME / 60, 0)) B1TIME_M,
  876. --to_char(round((nvl(t.B1TIME, 0) / 60 -
  877. -- FLOOR(nvl(t.B1TIME, 0) / 60)) * 60))
  878. t.B1TIME B1TIME_S,
  879. t.O2CONSUME,
  880. t.TERMINUSTEPT TAPPINGTEMPERATURE,
  881. t.POTNO,
  882. t.TAPPINGTIME,
  883. to_char(t.TAPPINGENDTIME, 'HH24:mi') TAPPINGENDTIME,
  884. to_char(t.TAPPINGSTARTTIME, 'HH24:mi') TAPPINGSTARTTIME,
  885. t.MOLSTLTEMPERATURE,
  886. t.CCMPLANTEMPT,
  887. to_char(t.CCMPLANTEMPTTIME, 'HH24:mi') CCMPLANTEMPTTIME,
  888. round((t.psendtime - t.changestarttime) * 24 * 60) CYCLE,
  889. decode(substr(t4.plan_route,
  890. instr(t4.plan_route, 'E') + 1,
  891. 1),
  892. '0',
  893. '',
  894. substr(t4.plan_route,
  895. instr(t4.plan_route, 'E') + 1,
  896. 1)) LFSNO,
  897. (t4.width || '*' || t4.thick) ROLLING,
  898. t4.cast_id CCMNO,
  899. t5.Si I_SI,
  900. t5.Mn I_MN,
  901. t5.P I_P,
  902. t5.S I_S,
  903. t5.c I_AS,
  904. t.BLOWO2TIMES DownHeatTime,
  905. t6.pfbalewgt GROSSWGT,
  906. t6.baleleavewgt KongWGT,
  907. t6.pfbalewgt - t6.baleleavewgt TAPPINGWGT,
  908. t7.ARFTEMPT CASBEFORETEMPERATURE,
  909. t7.ARBTEMPT CASAFTERTEMPERATURE,
  910. t.optdate optDisp,
  911. t.GASRECOVERYTIME,
  912. decode(t8.isrs,
  913. '1',
  914. '精炼回炉',
  915. decode(t6.isrs, '1', '连铸回炉', '')) ISRS,
  916. decode(t8.isrs,
  917. '1',
  918. decode(t6.isrs,
  919. '1',
  920. (select sum(WEIGHTOFCVT)
  921. from (select WEIGHTOFCVT, SMELTINGIDOFCVT
  922. from stl_es_taphole
  923. union
  924. select WEIGHTOFCVT, SMELTINGIDOFCVT
  925. from stl_mis_taphole)
  926. where SMELTINGIDOFCVT = t.heatno),
  927. ''),
  928. '') ISRSWGT,
  929. nvl(t.IRONPOTWGT, '0') + nvl(t.WSTEELWGT, '0') +
  930. nvl(t.PIGIRONWGT, '0') + nvl(t.JOINMARLWGT, '0') +
  931. nvl(t.RSTEELWGT, '0') + nvl(t.RSWGT, '0') JOINSTOVEWGT,
  932. decode((nvl(t.IRONPOTWGT, '0') + nvl(t.WSTEELWGT, '0') +
  933. nvl(t.PIGIRONWGT, '0') + nvl(t.JOINMARLWGT, '0') +
  934. nvl(t.RSTEELWGT, '0') + nvl(t.RSWGT, '0')),
  935. 0,
  936. 0,
  937. round((t6.pfbalewgt - t6.baleleavewgt) /
  938. (nvl(t.IRONPOTWGT, '0') + nvl(t.WSTEELWGT, '0') +
  939. nvl(t.PIGIRONWGT, '0') +
  940. nvl(t.JOINMARLWGT, '0') +
  941. nvl(t.RSTEELWGT, '0') + nvl(t.RSWGT, '0')) * 100,
  942. 2)) STEELOUT,
  943. t8.LADLECOVERAGE,
  944. t6.MWRAPNO,
  945. t8.ELETRICITYCONSUME,
  946. t7.ARFTEMPT,
  947. round(((t8.REPOSEBEGINTIME - t8.ARRIVETIME) * 24 * 60), 0) AWAITTIME,
  948. t8.REFINETIME,
  949. t8.FLEXIBLEBLOWTIME,
  950. t8.ARRIVETEMPT,
  951. t8.LEAVETEMPT,
  952. t7.BLOWARTIME,
  953. t6.BILLETFIXSIZE,
  954. t9.BILLETNUM,
  955. t9.BILLETWGT
  956. from (select *
  957. from stl_bof_optinfo
  958. where 1 = 1 $
  959. union
  960. select * from J#stl_Bof_Optinfo where 1 = 1 $ ) t
  961. left join (select *
  962. from ppc_steel_heat
  963. union
  964. select * from J#ppc_steel_heat) t4 on t.heatno = t4.heatno
  965. left join (select *
  966. from stl_chemelement
  967. union
  968. select * from J#stl_chemelement) t5 on t5.heatno =
  969. t.MOLIRNSOURCE
  970. left join (select heatno,
  971. PFBALEWGT,
  972. BALELEAVEWGT,
  973. isrs,
  974. MWRAPNO,
  975. BILLETFIXSIZE
  976. from stl_ccm_optinfo
  977. union
  978. select heatno,
  979. PFBALEWGT,
  980. BALELEAVEWGT,
  981. isrs,
  982. MWRAPNO,
  983. BILLETFIXSIZE
  984. from J#stl_ccm_optinfo) t6 on t.heatno = t6.heatno
  985. left join (select heatno, ARFTEMPT, ARBTEMPT, BLOWARTIME
  986. from stl_cas_optinfo
  987. union
  988. select heatno, ARFTEMPT, ARBTEMPT, BLOWARTIME
  989. from J#stl_cas_optinfo) t7 on t.heatno = t7.heatno
  990. left join (select heatno,
  991. isrs,
  992. ELETRICITYCONSUME,
  993. LADLECOVERAGE,
  994. REPOSEBEGINTIME,
  995. ARRIVETIME,
  996. REFINETIME,
  997. FLEXIBLEBLOWTIME,
  998. ARRIVETEMPT,
  999. LEAVETEMPT
  1000. from stl_lfs_optinfo
  1001. union
  1002. select heatno,
  1003. isrs,
  1004. ELETRICITYCONSUME,
  1005. LADLECOVERAGE,
  1006. REPOSEBEGINTIME,
  1007. ARRIVETIME,
  1008. REFINETIME,
  1009. FLEXIBLEBLOWTIME,
  1010. ARRIVETEMPT,
  1011. LEAVETEMPT
  1012. from J#stl_lfs_optinfo) t8 on t.heatno = t8.heatno
  1013. left join (select s.HEATNO, s.BILLETNUM, s.BILLETWGT
  1014. from (select t.HEATNO,
  1015. count(1) BILLETNUM,
  1016. sum(nvl(t.WEIGHT, 0)) BILLETWGT
  1017. from stl_incision t
  1018. group by HEATNO, WEIGHT
  1019. union
  1020. select t.HEATNO,
  1021. count(1) BILLETNUM,
  1022. sum(nvl(t.WEIGHT, 0)) BILLETWGT
  1023. from y#stl_incision t
  1024. group by HEATNO, WEIGHT) S) t9 on t.heatno =
  1025. t9.heatno
  1026. left join (select y.*--LFS
  1027. from (select x.*,
  1028. count(1) over(partition by x.HEATNO) cnt,
  1029. row_number() over(partition by x.HEATNO order by x.ASSAYTYPECODE desc, x.assaydate desc) xh,
  1030. substr(x.assaytypecode, 1, 1) gw
  1031. from (select *
  1032. from STL_CHEMELEMENT
  1033. where upper(SUBSTR(CHECKNO, 12, 1)) = 'E'
  1034. and upper(SUBSTR(CHECKNO, -1)) = 'S'
  1035. union
  1036. select *
  1037. from J#STL_CHEMELEMENT
  1038. where upper(SUBSTR(CHECKNO, 12, 1)) = 'E'
  1039. and upper(SUBSTR(CHECKNO, -1)) = 'S') x) y) t10 on t.heatno =
  1040. t10.heatno
  1041. left join (select y.*--ccm
  1042. from (select x.*,
  1043. count(1) over(partition by x.HEATNO) cnt,
  1044. row_number() over(partition by x.HEATNO order by x.ASSAYTYPECODE desc, x.assaydate desc) xh,
  1045. substr(x.assaytypecode, 1, 1) gw
  1046. from (select *
  1047. from STL_CHEMELEMENT
  1048. where upper(SUBSTR(CHECKNO, -1)) = 'S'
  1049. and upper(SUBSTR(CHECKNO, 12, 2)) = 'GP'
  1050. union
  1051. select *
  1052. from J#STL_CHEMELEMENT
  1053. where upper(SUBSTR(CHECKNO, -1)) = 'S'
  1054. and upper(SUBSTR(CHECKNO, 12, 2)) = 'GP') x) y) t11 on t.heatno =
  1055. t11.heatno
  1056. order by t.optdate
  1057. ]]>
  1058. </query>
  1059. <query id="queryBofData_FLHJ.Query" desc="炼钢生产报表--取转炉辅料合金数据" fetchSize="10">
  1060. <![CDATA[
  1061. Select t.heatno,
  1062. t.STATIONCODE,
  1063. t.DISPOSALTIME,
  1064. t1.materielcode,
  1065. t1.materieltype,
  1066. t2.materielname,
  1067. round(sum(nvl(t1.JMWGT, 0)) over(partition by t1.HEATNO,
  1068. t1.STATIONCODE,
  1069. t1.DISPOSALTIME,
  1070. t1.MATERIELTYPE,
  1071. t1.MATERIELCODE)) materielWgt
  1072. from (select *
  1073. from stl_bof_optinfo
  1074. where 1 = 1 $
  1075. union
  1076. select * from J#stl_Bof_Optinfo where 1 = 1 $ ) t
  1077. left join stl_additives t1 on t.heatno = t1.heatno
  1078. and 'C' || t.stationcode = t1.stationcode
  1079. and t.disposaltime = t1.disposaltime
  1080. left join com_materiel t2 on t1.materielcode = t2.materielcode
  1081. order by t.STATIONCODE, t.HEATNO
  1082. ]]>
  1083. </query>
  1084. <query id="queryBofLfsData_FLHJ.Query" desc="炼钢生产报表--取精炼辅料合金数据" fetchSize="10">
  1085. <![CDATA[
  1086. Select t.heatno,
  1087. t.STATIONCODE,
  1088. t.DISPOSALTIME,
  1089. t1.materielcode,
  1090. decode(t1.materieltype, 'WS', t1.materieltype, 'WL') MATERIELTYPE,
  1091. t2.materielname,
  1092. round(sum(nvl(t1.JMWGT, 0)) over(partition by t1.HEATNO,
  1093. t1.STATIONCODE,
  1094. t1.DISPOSALTIME,
  1095. t1.MATERIELTYPE,
  1096. t1.MATERIELCODE)) materielWgt
  1097. from (select *
  1098. from stl_bof_optinfo
  1099. where 1 = 1 $
  1100. union
  1101. select * from J#stl_Bof_Optinfo where 1 = 1 $ ) t
  1102. left join stl_additives t1 on t.heatno = t1.heatno
  1103. and 'C' || t.stationcode = t1.stationcode
  1104. and t.disposaltime = t1.disposaltime
  1105. left join com_materiel t2 on t1.materielcode = t2.materielcode
  1106. order by t.STATIONCODE, t.HEATNO
  1107. ]]>
  1108. </query>
  1109. <query id="VDSTEEL.Query" desc="VD炉操作记录报表--加载钢种" fetchSize="10">
  1110. <![CDATA[
  1111. Select steel from com_steel where VALIDFLAG='1' ORDER BY steel
  1112. ]]>
  1113. </query>
  1114. <query id="VDData.Query" desc="VD炉操作记录报表" fetchSize="10">
  1115. <![CDATA[
  1116. select distinct to_char(a.OPTDATE, 'yyyy-MM-dd hh24:mi') OPTDATE,
  1117. a.HEATNO,
  1118. decode(substr(a.shiftcode, 1, 1),
  1119. '1',
  1120. '白',
  1121. '2',
  1122. '中',
  1123. '3',
  1124. '晚') BC,
  1125. decode(substr(a.shiftcode, 2, 1),
  1126. '1',
  1127. '甲',
  1128. '2',
  1129. '乙',
  1130. '3',
  1131. '丙',
  1132. '4',
  1133. '丁') BB,
  1134. a.LMLTEMPT,
  1135. b.MaxSPvalue,
  1136. b.MinSPVALUE,
  1137. b.AvgSPVALUE,
  1138. a.PLANSTEEL,
  1139. a.HEATPROCESSNO,
  1140. to_char(a.ARRIVETIME,'hh24:mi:ss')ARRIVETIME,
  1141. I.POTNO,
  1142. I.POTDISTINCTION,
  1143. a.WSID,
  1144. a.RESIDUETHICKNESS,
  1145. a.CLEARENCELHEIGHT,
  1146. a.ARFTEMPT,
  1147. to_char(a.VACBEGINTIME,'hh24:mi')VACBEGINTIME,
  1148. a.ARRIVEH,
  1149. a.VACUUMPRESS VAC_MIN,
  1150. to_char(a.HYDGENSTARTTIME,'hh24:mi')HYDGENSTARTTIME,
  1151. a.ARBTEMPT ARBTEMPT_A,
  1152. to_char(a.VACLOSETIME,'hh24:mi')VACLOSETIME,
  1153. a.LEAVEH,
  1154. to_char(a.HYDGENENDTIME,'hh24:mi')HYDGENENDTIME,
  1155. '' PROPHASE,
  1156. '' INTERIM,
  1157. '' LATE,
  1158. a.FLEXIBLEBLOWTIME,
  1159. --a.VACUUMPRESS,
  1160. FLOOR(nvl(a.VAC_KEEP_TIME / 60, 0)) VAC_KEEP_TIME,
  1161. a.VAC_TIME VACUUMTIME,
  1162. a.STEAM_TEM,
  1163. a.STEAM_PRES,
  1164. a.STEAM_FLUX,
  1165. to_char(a.LEAVETIME,'hh24:mi') LEAVETIME,
  1166. p.PLAN_LINES,
  1167. u.PFBALETEMPT,
  1168. a.ARBTEMPT,
  1169. p.HEAT_NUM,
  1170. a.MEMO,
  1171. max(case when a.HEATNO = w.HEATNO and w.xh = w.cnt then w.c end) over(partition by a.HEATNO) Y_C,
  1172. max(case when a.HEATNO = w.HEATNO and w.xh = w.cnt then w.si end) over(partition by a.HEATNO) Y_SI,
  1173. max(case when a.HEATNO = w.HEATNO and w.xh = w.cnt then w.MN end) over(partition by a.HEATNO) Y_MN,
  1174. max(case when a.HEATNO = w.HEATNO and w.xh = w.cnt then w.P end) over(partition by a.HEATNO) Y_P,
  1175. max(case when a.HEATNO = w.HEATNO and w.xh = w.cnt then w.S end) over(partition by a.HEATNO) Y_S,
  1176. max(case when a.HEATNO = w.HEATNO and w.xh = w.cnt then w.ALS end) over(partition by a.HEATNO) Y_ALS,
  1177. max(case when a.HEATNO = w.HEATNO and w.xh = w.cnt then w.NB end) over(partition by a.HEATNO) Y_NB,
  1178. max(case when a.HEATNO = w.HEATNO and w.xh = w.cnt then w.V end) over(partition by a.HEATNO) Y_V,
  1179. max(case when a.HEATNO = w.HEATNO and w.xh = w.cnt then w.TI end) over(partition by a.HEATNO) Y_TI,
  1180. max(case when a.HEATNO = w.HEATNO and w.xh = w.cnt then w.CU end) over(partition by a.HEATNO) Y_CU,
  1181. max(case when a.HEATNO = w.HEATNO and w.xh = w.cnt then w.N end) over(partition by a.HEATNO) Y_N,
  1182. max(case when a.HEATNO = w.HEATNO and w.xh = w.cnt then w.B end) over(partition by a.HEATNO) Y_B,
  1183. max(case when a.HEATNO = t4.HEATNO and t4.xh = t4.cnt then t4.c end) over(partition by a.HEATNO) C_C,
  1184. max(case when a.HEATNO = t4.HEATNO and t4.xh = t4.cnt then t4.SI end) over(partition by a.HEATNO) C_SI,
  1185. max(case when a.HEATNO = t4.HEATNO and t4.xh = t4.cnt then t4.MN end) over(partition by a.HEATNO) C_MN,
  1186. max(case when a.HEATNO = t4.HEATNO and t4.xh = t4.cnt then t4.P end) over(partition by a.HEATNO) C_P,
  1187. max(case when a.HEATNO = t4.HEATNO and t4.xh = t4.cnt then t4.S end) over(partition by a.HEATNO) C_S,
  1188. max(case when a.HEATNO = t4.HEATNO and t4.xh = t4.cnt then t4.ALS end) over(partition by a.HEATNO) C_ALS,
  1189. max(case when a.HEATNO = t4.HEATNO and t4.xh = t4.cnt then t4.NB end) over(partition by a.HEATNO) C_NB,
  1190. max(case when a.HEATNO = t4.HEATNO and t4.xh = t4.cnt then t4.V end) over(partition by a.HEATNO) C_V,
  1191. max(case when a.HEATNO = t4.HEATNO and t4.xh = t4.cnt then t4.TI end) over(partition by a.HEATNO) C_TI,
  1192. max(case when a.HEATNO = t4.HEATNO and t4.xh = t4.cnt then t4.CU end) over(partition by a.HEATNO) C_CU,
  1193. max(case when a.HEATNO = t4.HEATNO and t4.xh = t4.cnt then t4.N end) over(partition by a.HEATNO) C_N,
  1194. max(case when a.HEATNO = t4.HEATNO and t4.xh = t4.cnt then t4.B end) over(partition by a.HEATNO) C_B,
  1195. max(case when a.HEATNO = t4.HEATNO and t4.xh = t4.cnt then t4.N end) over(partition by a.HEATNO) C_NI,
  1196. max(case when a.HEATNO = t4.HEATNO and t4.xh = t4.cnt then t4.B end) over(partition by a.HEATNO) C_MO,
  1197. max(case when a.HEATNO = t4.HEATNO and t4.xh = t4.cnt then t4.N end) over(partition by a.HEATNO) C_CR,
  1198. GetStandardVaule(a.HEATNO,t4.MN,t4.NI,t4.MO,t4.NB,t4.V,t4.ALS,t4.CR,t4.CU) CFFC,
  1199. '' ETGYEXRECORD
  1200. from (select *
  1201. from stl_vds_optinfo $
  1202. union
  1203. select * from j#stl_vds_optinfo $ ) a,
  1204. (select *
  1205. from stl_BOF_OPTINFO
  1206. union
  1207. select * from J#stl_BOF_OPTINFO ) I,
  1208. (select *
  1209. from STL_CCM_OPTINFO
  1210. $
  1211. union
  1212. select * from J#stl_CCM_OPTINFO $ ) u,
  1213. (select HEATNO, maxSPvalue, MinSPVALUE, avgSPVALUE
  1214. from (select max(SAMPLINGVALUE) maxSPvalue,
  1215. min(SAMPLINGVALUE) MinSPVALUE,
  1216. round(avg(SAMPLINGVALUE), 2) avgSPVALUE,
  1217. HEATNO
  1218. from stl_tempsampling where substr(samplingdepict,1,4)='中包温度'
  1219. group by HEATNO
  1220. union
  1221. select max(SAMPLINGVALUE) maxSPvalue,
  1222. min(SAMPLINGVALUE) MinSPVALUE,
  1223. round(avg(SAMPLINGVALUE), 2) avgSPVALUE,
  1224. HEATNO
  1225. from J#stl_tempsampling where substr(samplingdepict,1,4)='中包温度'
  1226. group by HEATNO)) b,
  1227. (select *
  1228. from ppc_steel_heat
  1229. union
  1230. select * from J#ppc_steel_heat) p,
  1231. (select y.*
  1232. from (select x.*,count(1) over(partition by x.HEATNO) cnt,
  1233. row_number() over(partition by x.HEATNO order by x.ASSAYTYPECODE) xh
  1234. from (select t.*
  1235. from stl_CHEMELEMENT t where upper(SUBSTR(CHECKNO, 12, 1)) = 'I'
  1236. and upper(SUBSTR(CHECKNO, -1)) = 'S'
  1237. and $
  1238. union
  1239. select t.*
  1240. from j#stl_CHEMELEMENT t where upper(SUBSTR(CHECKNO, 12, 1)) = 'I'
  1241. and upper(SUBSTR(CHECKNO, -1)) = 'S'
  1242. and $
  1243. ) x) y
  1244. where y.xh in (1, round(y.cnt / 2), y.cnt)) w,
  1245. (select y.*
  1246. from (select x.*,count(1) over(partition by x.HEATNO) cnt,
  1247. row_number() over (partition by x.HEATNO order by x.ASSAYTYPECODE) xh
  1248. from (select t.*
  1249. from stl_CHEMELEMENT t
  1250. where upper(SUBSTR(CHECKNO, -1)) = 'S'
  1251. and upper(SUBSTR(CHECKNO, 12, 2)) = 'GP'
  1252. and $
  1253. union
  1254. select t.*
  1255. from J#stl_CHEMELEMENT t
  1256. where upper(SUBSTR(CHECKNO, -1)) = 'S'
  1257. and upper(SUBSTR(CHECKNO, 12, 2)) = 'GP'
  1258. and $
  1259. ) x) y
  1260. ) t4
  1261. where a.HEATNO = p.HEATNO(+)
  1262. and a.HEATNO = w.HEATNO(+)
  1263. and a.HEATNO = t4.HEATNO(+)
  1264. and a.HEATNO = u.HEATNO(+)
  1265. and a.heatno = b.HEATNO(+)
  1266. and a.heatno = I.HEATNO(+)
  1267. order by OPTDATE
  1268. ]]>
  1269. </query>
  1270. <query id="LgHMPReport.Query" desc="脱硫操作记录报表" fetchSize="10">
  1271. <![CDATA[
  1272. select distinct t.misid,
  1273. t.stoveid,
  1274. t.stovetime,
  1275. t.tapholeno,
  1276. to_char(b.CHANGESTARTTIME,'HH24:mi') CHANGESTARTTIME,
  1277. to_char(t.HSTAPHOLETIME,'HH24:mi') HSTAPHOLETIME,
  1278. to_char(a.DR_BEF_ENDTIME,'HH24:mi') DR_BEF_ENDTIME,
  1279. to_char(a.DR_AFT_ENDTIME,'HH24:mi') DR_AFT_ENDTIME,
  1280. case substr(t.SHIFTCODE, 1, 1)
  1281. when '1' then
  1282. '白'
  1283. when '2' then
  1284. '中'
  1285. when '3' then
  1286. '晚'
  1287. end BC,
  1288. case substr(t.SHIFTCODE, 2, 1)
  1289. when '1' then
  1290. '甲'
  1291. when '2' then
  1292. '乙'
  1293. when '3' then
  1294. '丙'
  1295. when '4' then
  1296. '丁'
  1297. end BB,
  1298. decode(substr(t.molirnsource,1,1),'J','转炉','脱硫') molirnsource,
  1299. a.HUDWID,
  1300. round(t.TFPOTWGT,2) ARRIVEWGT,
  1301. CASE
  1302. when nvl(a.LEAVEWGT, 0) > 0 and nvl(a.ARRIVEWGT, 0) > 0 and
  1303. nvl(a.LEAVEWGT, 0) < nvl(a.ARRIVEWGT, 0) THEN
  1304. round(t.TFPOTWGT -
  1305. (nvl(a.ARRIVEWGT, 0) - nvl(a.LEAVEWGT, 0)),
  1306. 2)
  1307. ELSE
  1308. t.TFPOTWGT
  1309. END LEAVEWGT,
  1310. round(t.TFPOTWGT-(t.TFPOTWGT -
  1311. (nvl(a.ARRIVEWGT, 0) - nvl(a.LEAVEWGT, 0))),
  1312. 2) DRQUANTITY,
  1313. CASE
  1314. WHEN nvl(a.LEAVEWGT, 0) > 0 THEN
  1315. (nvl(a.LEAVEWGT, 0) - nvl(t4.TAREWEIGHT,0))
  1316. ELSE
  1317. 0
  1318. END LEAVEWGT_OUT,
  1319. CASE
  1320. WHEN nvl(a.ARRIVEWGT, 0) > 0 THEN
  1321. (nvl(a.ARRIVEWGT, 0) - nvl(t4.TAREWEIGHT,0))
  1322. ELSE
  1323. 0
  1324. END ARRIVEWGT_OUT,
  1325. t4.TAREWEIGHT IRONPOTBOFWGT,
  1326. t.TFPOTID || '-' || t4.age IRONPWRAPNO,
  1327. CASE
  1328. WHEN a.HUDWID IS NOT NULL THEN
  1329. a.PLANSTEEL
  1330. ELSE
  1331. t.PLANSTEEL
  1332. END PLANSTEEL,
  1333. to_char(a.ARRIVETIME, 'HH24:mi') ARRIVETIME,
  1334. to_char(a.LEAVETIME, 'HH24:mi') LEAVETIME,
  1335. a.DR_BEF_TIME,
  1336. a.DR_AFT_TIME,
  1337. a.SWBTEMPERATURE,
  1338. a.SWFTEMPERATURE,
  1339. a.DREGSSOLVENT,
  1340. a.CHURNUPDATE,
  1341. a.MOSTROTATESPEED,
  1342. a.SGGAGE,
  1343. a.DFRWGT,
  1344. CASE
  1345. WHEN a.HEATNO IS NOT NULL THEN
  1346. a.HEATNO
  1347. WHEN substr(t.MOLIRNSOURCE, 1, 1) = 'J' then
  1348. t.MOLIRNSOURCE
  1349. END HEATNO,
  1350. t.SI SI_BF,
  1351. t.MN MN_BF,
  1352. t.P P_BF,
  1353. t.S S_BF,
  1354. t2.SI,
  1355. t2.MN,
  1356. t2.P,
  1357. t2.S,
  1358. t3.SI SI2,
  1359. t3.MN MN2,
  1360. t3.P P2,
  1361. t3.S S2,
  1362. a.MEMO
  1363. from (select *
  1364. from stl_mis_importiron
  1365. where to_char(operationdate, 'yyyy-MM-dd hh24:mi:ss') between ? AND
  1366. ?) t,
  1367. (select *
  1368. from STL_HMP_OPTINFO
  1369. where to_char(OPTDATE, 'yyyy-MM-dd') between ? AND
  1370. ?
  1371. union
  1372. select *
  1373. from J#STL_HMP_OPTINFO
  1374. where to_char(OPTDATE, 'yyyy-MM-dd') between ? AND
  1375. ?
  1376. ) a,
  1377. (select *
  1378. from STL_bof_OPTINFO
  1379. where to_char(OPTDATE, 'yyyy-MM-dd') between ? AND
  1380. ?
  1381. union
  1382. select *
  1383. from J#STL_bof_OPTINFO
  1384. where to_char(OPTDATE, 'yyyy-MM-dd') between ? AND
  1385. ?
  1386. ) b,
  1387. (select HEATNO, SI, MN, P, S, ASSAYTYPECODE
  1388. from stl_CHEMELEMENT
  1389. WHERE upper(SUBSTR(ASSAYTYPECODE, 1, 1)) = 'B'
  1390. and to_char(assaydate, 'yyyy-MM-dd') between ? AND
  1391. ?
  1392. union
  1393. select HEATNO, SI, MN, P, S, ASSAYTYPECODE
  1394. from J#stl_CHEMELEMENT
  1395. WHERE upper(SUBSTR(ASSAYTYPECODE, 1, 1)) = 'B'
  1396. and to_char(assaydate, 'yyyy-MM-dd') between ? AND
  1397. ?) t2,
  1398. (select y.*
  1399. from (select x.*,
  1400. row_number() over(partition by x.HEATNO, substr(assaytypecode, 1, 1) order by x.ASSAYTYPECODE desc) xh,
  1401. substr(assaytypecode, 1, 1) typecode
  1402. from (select *
  1403. from stl_CHEMELEMENT
  1404. where upper(SUBSTR(ASSAYTYPECODE, 1, 1)) = 'B'
  1405. and to_char(assaydate, 'yyyy-MM-dd') between
  1406. ? AND ?
  1407. union
  1408. select *
  1409. from J#stl_CHEMELEMENT
  1410. where upper(SUBSTR(ASSAYTYPECODE, 1, 1)) = 'B'
  1411. and to_char(assaydate, 'yyyy-MM-dd') between
  1412. ? AND ?) x) y
  1413. where y.xh = 1) t3,
  1414. dev_ib_base_info t4
  1415. where t.MOLIRNSOURCE = a.hudwid(+) and t.MOLIRNSOURCE = b.heatno(+)
  1416. and t.misid = t2.heatno(+)
  1417. and a.HUDWID = t3.heatno(+) and t.TFPOTID =t4.ladleid (+)
  1418. AND substr(T.MOLIRNSOURCE,3, 1) =
  1419. decode(?, null, substr(T.MOLIRNSOURCE, 3, 1), ?)
  1420. and substr(T.MOLIRNSOURCE,1, 1) =
  1421. decode(?, null, substr(T.MOLIRNSOURCE, 1, 1), ?)
  1422. and substr(T.SHIFTCODE, 1, 1) =
  1423. decode(?, null, substr(T.SHIFTCODE, 1, 1), ?)
  1424. and substr(T.SHIFTCODE, 2, 1) =
  1425. decode(?, null, substr(T.SHIFTCODE, 2, 1), ?)
  1426. order by t.misid
  1427. ]]>
  1428. </query>
  1429. <query id="reportRHS_DPR.Query" desc="RH炉日生产统计报表--加载钢种" fetchSize="10">
  1430. <![CDATA[
  1431. Select steel from com_steel where VALIDFLAG='1' ORDER BY steel
  1432. ]]>
  1433. </query>
  1434. <query id="reportRHS.Query" desc="RH炉日生产统计报表" fetchSize="10">
  1435. <![CDATA[
  1436. select t.OPTDATE,
  1437. t.SUMLUCOUNT DT1,
  1438. sum(t.SUMLUCOUNT) over(order by t.OPTDATE) CM1,
  1439. t.SUMPLANSTEEL DT2,
  1440. sum(t.SUMPLANSTEEL) over(order by t.OPTDATE) CM2,
  1441. round(t.DC, 2) DC,
  1442. t.JIABANLS DT3,
  1443. sum(t.JIABANLS) over(order by t.OPTDATE) CM3,
  1444. round(t.JIABANYIELD, 2) DT4,
  1445. round(sum(t.JIABANYIELD) over(order by t.OPTDATE), 2) CM4,
  1446. t.YIBANLS DT5,
  1447. sum(t.YIBANLS) over(order by t.OPTDATE) CM5,
  1448. round(t.YIBANYIELD, 2) DT6,
  1449. round(sum(t.YIBANYIELD) over(order by t.OPTDATE), 2) CM6,
  1450. t.BINGBANLS DT7,
  1451. sum(t.BINGBANLS) over(order by t.OPTDATE) CM7,
  1452. round(t.BINGBANYIELD, 2) DT8,
  1453. round(sum(t.BINGBANYIELD) over(order by t.OPTDATE), 2) CM8,
  1454. t.DINGBANLS DT9,
  1455. sum(t.DINGBANLS) over(order by t.OPTDATE) CM9,
  1456. round(t.DINGBANYIELD, 2) DT10,
  1457. round(sum(t.DINGBANYIELD) over(order by t.OPTDATE), 2) CM10
  1458. from (select distinct x.OPTDATE,
  1459. count(distinct x.heatno) over(partition by x.optdate) SUMLUCOUNT,
  1460. sum(y.WEIGHT) over(partition by x.optdate) SUMPLANSTEEL,
  1461. sum(y.WEIGHT) over(partition by x.optdate) / count(distinct x.heatno) over(partition by x.optdate) DC,
  1462. sum(case x.shiftcode
  1463. when '1' then
  1464. 1
  1465. end) over(partition by x.optdate) JIABANLS,
  1466. sum(case x.shiftcode
  1467. when '1' then
  1468. y.WEIGHT
  1469. end) over(partition by x.optdate) JIABANYIELD,
  1470. sum(case x.shiftcode
  1471. when '2' then
  1472. 1
  1473. end) over(partition by x.optdate) YIBANLS,
  1474. sum(case x.shiftcode
  1475. when '2' then
  1476. y.WEIGHT
  1477. end) over(partition by x.optdate) YIBANYIELD,
  1478. sum(case x.shiftcode
  1479. when '3' then
  1480. 1
  1481. end) over(partition by x.optdate) BINGBANLS,
  1482. sum(case x.shiftcode
  1483. when '3' then
  1484. y.WEIGHT
  1485. end) over(partition by x.optdate) BINGBANYIELD,
  1486. sum(case x.shiftcode
  1487. when '4' then
  1488. 1
  1489. end) over(partition by x.optdate) DINGBANLS,
  1490. sum(case x.shiftcode
  1491. when '4' then
  1492. y.WEIGHT
  1493. end) over(partition by x.optdate) DINGBANYIELD
  1494. from (select a.heatno,
  1495. a.plansteel,
  1496. substr(a.shiftcode, 2, 1) shiftcode,
  1497. to_char(a.optdate, 'yyyy-MM-dd') optdate
  1498. from (select *
  1499. from STL_RHS_OPTINFO
  1500. where $
  1501. union
  1502. select * from J#STL_RHS_OPTINFO where $ ) a
  1503. group by a.heatno,
  1504. a.plansteel,
  1505. to_char(a.optdate, 'yyyy-MM-dd'),
  1506. a.shiftcode) x,
  1507. (select heatno,
  1508. nvl(PFBALEWGT, 0) - nvl(BALELEAVEWGT, 0) WEIGHT
  1509. from (select row_number() over(partition by b.heatno order by b.disposaltime) xh,
  1510. count(1) over(partition by b.heatno) cnt,
  1511. b.*
  1512. from (select *
  1513. from STL_CCM_OPTINFO
  1514. where $
  1515. union
  1516. select * from J#STL_CCM_OPTINFO where $ ) b)
  1517. where xh = cnt) y
  1518. where x.heatno = y.heatno(+)
  1519. order by x.optdate) t
  1520. ]]>
  1521. </query>
  1522. <query id="LgCASReport.Query" desc="吹氩操作记录报表" fetchSize="10">
  1523. <![CDATA[
  1524. select distinct a.HEATNO,
  1525. v.aim_grade_code PLANSTEEL,
  1526. a.SHIFTCODE,
  1527. v.CAST_ID || '-' || v.cast_seq CAST_ID,
  1528. a.POTWRAPSTATE,
  1529. a.POTNO,
  1530. decode(substr(a.shiftcode, 1, 1),
  1531. '1',
  1532. '白',
  1533. '2',
  1534. '中',
  1535. '3',
  1536. '晚') BC,
  1537. decode(substr(a.shiftcode, 2, 1),
  1538. '1',
  1539. '甲',
  1540. '2',
  1541. '乙',
  1542. '3',
  1543. '丙',
  1544. '4',
  1545. '丁') BB,
  1546. to_char(a.LEAVETIME, 'hh24:mi') ZZTIME,
  1547. to_char(a.ARRIVETIME, 'HH24:mi') ARRIVETIME,
  1548. to_char(a.OPTDATE, 'yyyy-MM-dd hh24:mi') OPTDATE,
  1549. to_char(a.BLOWARSTARTTIME, 'HH24:mi') BLOWARSTARTTIME,
  1550. to_char(a.BLOWARENDTIME, 'HH24:mi') BLOWARENDTIME,
  1551. to_char(a.CASSTARTTIME, 'HH24:mi') CASSTARTTIME,
  1552. to_char(a.CASENDTIME, 'HH24:mi') CASENDTIME,
  1553. a.ARITEMPT,
  1554. a.ARFTEMPT,
  1555. a.ARBTEMPT,
  1556. a.ARRIVEO2,
  1557. a.LEAVEO2,
  1558. a.TWSTEELWGT,
  1559. a.MANTLENUM,
  1560. a.RESIDUETHICKNESS,
  1561. a.BLOWARPRESS,
  1562. a.ARFLUX,
  1563. a.STATIONCODE,
  1564. a.DISPOSALTIME,
  1565. v.PLAN_LINES,
  1566. nvl(t.PFBALEWGT,0)-nvl(t.BALELEAVEWGT,0) MOLSTLWGT,
  1567. max(case when a.HEATNO = t4.HEATNO and t4.xh = t4.cnt then t4.C end) over(partition by a.HEATNO) C,
  1568. max(case when a.HEATNO = t4.HEATNO and t4.xh = t4.cnt then t4.MN end) over(partition by a.HEATNO) Mn,
  1569. max(case when a.HEATNO = t4.HEATNO and t4.xh = t4.cnt then t4.S end) over(partition by a.HEATNO) S,
  1570. max(case when a.HEATNO = t4.HEATNO and t4.xh = t4.cnt then t4.P end) over(partition by a.HEATNO) P,
  1571. max(case when a.HEATNO = t4.HEATNO and t4.xh = t4.cnt then t4.SI end) over(partition by a.HEATNO) Si,
  1572. max(case when a.HEATNO = t4.HEATNO and t4.xh = t4.cnt then t4.ALS end) over(partition by a.HEATNO) AIS,
  1573. max(case when a.HEATNO = t4.HEATNO and t4.xh = t4.cnt then t4.ALt end) over(partition by a.HEATNO) AIt,
  1574. max(case when a.HEATNO = t4.HEATNO and t4.xh = t4.cnt then T4.CA end) over(partition by a.HEATNO) Ca
  1575. from (select *
  1576. from STL_CAS_OPTINFO
  1577. where to_char(OPTDATE, 'yyyy-MM-dd hh24:mi:ss') between ? and ?
  1578. and substr(STATIONCODE, 2, 1) =
  1579. decode(?, null, substr(STATIONCODE, 2, 1), ?)
  1580. and UPPER(nvl(PLANSTEEL, 'null')) in
  1581. (decode(?, null, UPPER(nvl(PLANSTEEL, 'null')), ?))
  1582. and substr(SHIFTCODE, 1, 1) =
  1583. decode(?, null, substr(SHIFTCODE, 1, 1), ?)
  1584. and substr(SHIFTCODE, 2, 1) =
  1585. decode(?, null, substr(SHIFTCODE, 2, 1), ?)
  1586. union
  1587. select *
  1588. from J#STL_CAS_OPTINFO
  1589. where to_char(OPTDATE, 'yyyy-MM-dd hh24:mi:ss') between ? and ?
  1590. and substr(STATIONCODE, 2, 1) =
  1591. decode(?, null, substr(STATIONCODE, 2, 1), ?)
  1592. and UPPER(nvl(PLANSTEEL, 'null')) in
  1593. (decode(?, null, UPPER(nvl(PLANSTEEL, 'null')), ?))
  1594. and substr(SHIFTCODE, 1, 1) =
  1595. decode(?, null, substr(SHIFTCODE, 1, 1), ?)
  1596. and substr(SHIFTCODE, 2, 1) =
  1597. decode(?, null, substr(SHIFTCODE, 2, 1), ?)) a,
  1598. (select *
  1599. from ppc_steel_heat
  1600. union
  1601. select * from J#ppc_steel_heat) v,
  1602. (select *
  1603. from STL_CCM_OPTINFO
  1604. where to_char(OPTDATE, 'yyyy-MM-dd') between ? and ?
  1605. union
  1606. select *
  1607. from J#STL_CCM_OPTINFO
  1608. where to_char(OPTDATE, 'yyyy-MM-dd') between ? and ?) t,
  1609. (select *
  1610. from STL_LFS_OPTINFO
  1611. where to_char(OPTDATE, 'yyyy-MM-dd') between ? and ?
  1612. union
  1613. select *
  1614. from J#STL_LFS_OPTINFO
  1615. where to_char(OPTDATE, 'yyyy-MM-dd') between ? and ?) w,
  1616. (select y.*
  1617. from (select x.*,
  1618. count(1) over(partition by x.HEATNO) cnt,
  1619. row_number() over(partition by x.HEATNO order by x.ASSAYTYPECODE desc) xh
  1620. from (select *
  1621. from stl_CHEMELEMENT
  1622. where upper(SUBSTR(CHECKNO, 12, 2)) = 'DQ'
  1623. and upper(SUBSTR(CHECKNO, -1)) = 'S'
  1624. union
  1625. select t.*
  1626. from j#stl_CHEMELEMENT t
  1627. where upper(SUBSTR(CHECKNO, 12, 2)) = 'DQ'
  1628. and upper(SUBSTR(CHECKNO, -1)) = 'S'
  1629. ) x) y
  1630. where y.xh = y.cnt) t4
  1631. where a.HEATNO = v.heatNo(+)
  1632. and a.HEATNO = t.HEATNO(+)
  1633. and a.heatno = w.heatno(+)
  1634. and a.heatno = t4.heatno(+)
  1635. order by OPTDATE
  1636. ]]>
  1637. </query>
  1638. <query id="CASData_FLHJ.Query" desc="获取吹氩物料" fetchSize="10">
  1639. <![CDATA[
  1640. select a.HEATNO,
  1641. substr(a.STATIONCODE, 2, 2) STATIONCODE,
  1642. a.DISPOSALTIME,
  1643. a.MATERIELTYPE,
  1644. a.MATERIELCODE,
  1645. t.MATERIELNAME,
  1646. round(sum(nvl(a.JMWGT, 0)) over(partition by a.HEATNO,
  1647. a.STATIONCODE,
  1648. a.DISPOSALTIME,
  1649. a.MATERIELTYPE,
  1650. a.MATERIELCODE),
  1651. 2) MaterielWgt
  1652. from stl_ADDITIVES a, com_MATERIEL t
  1653. where substr(a.STATIONCODE, 1, 1) = 'D'
  1654. and to_char(a.JMDATE, 'yyyy-MM-dd') between ? and ?
  1655. and substr(a.STATIONCODE, 3, 1) =
  1656. decode(?, null, substr(a.STATIONCODE, 3, 1), ?)
  1657. and a.MATERIELCODE = t.MATERIELCODE(+)
  1658. and a.MATERIELTYPE = t.MATERIELTYPE(+)
  1659. ]]>
  1660. </query>
  1661. <query id="JobTime.Query" desc="获取各工序时间信息" fetchSize="10">
  1662. <![CDATA[
  1663. select to_char(a.OPTDATE, 'yyyy-MM-dd') OPTDATE,
  1664. a.HEATNO,
  1665. a.PLANSTEEL,
  1666. x.FACT_ROUTE,
  1667. e.STATIONCODE,
  1668. case substr(a.SHIFTCODE, 1, 1)
  1669. when '1' then
  1670. '早'
  1671. when '2' then
  1672. '中'
  1673. when '3' then
  1674. '晚'
  1675. end BC,
  1676. case substr(a.SHIFTCODE, 2, 1)
  1677. when '1' then
  1678. '甲'
  1679. when '2' then
  1680. '乙'
  1681. when '3' then
  1682. '丙'
  1683. when '4' then
  1684. '丁'
  1685. end BB,
  1686. to_char(a.CHANGESTARTTIME, 'HH24:mi') CHANGESTARTTIME,
  1687. to_char(a.CHANGEENDTIME, 'HH24:mi') CHANGEENDTIME,
  1688. to_char(a.B1STARTTIME, 'HH24:mi') B1STARTTIME,
  1689. to_char(greatest(nvl(a.B1ENDTIME, a.OPTDATE - 7),
  1690. nvl(a.B2ENDTIME, a.OPTDATE - 7),
  1691. nvl(a.B3ENDTIME, a.OPTDATE - 7),
  1692. nvl(a.B4ENDTIME, a.OPTDATE - 7),
  1693. nvl(a.B5ENDTIME, a.OPTDATE - 7)),
  1694. 'HH24:mi') B1ENDTIME,
  1695. to_char(a.TAPPINGSTARTTIME, 'HH24:mi') TAPPINGSTARTTIME,
  1696. to_char(a.TAPPINGENDTIME, 'HH24:mi') TAPPINGENDTIME,
  1697. round((greatest(nvl(a.PSENDTIME, a.TAPPINGENDTIME), a.TAPPINGENDTIME) -
  1698. a.CHANGESTARTTIME) * 24 * 60) SCZQ_BOF,
  1699. to_char(b.ARRIVETIME, 'HH24:mi') ARRIVETIME_CAS,
  1700. to_char(b.LEAVETIME, 'HH24:mi') LEAVETIME_CAS,
  1701. round((b.LEAVETIME - b.ARRIVETIME) * 24 * 60) SCZQ_CAS,
  1702. to_char(c.ARRIVETIME, 'HH24:mi') ARRIVETIME_LFS,
  1703. to_char(c.LEAVETIME, 'HH24:mi') LEAVETIME_LFS,
  1704. round((c.LEAVETIME - c.ARRIVETIME) * 24 * 60) SCZQ_LFS,
  1705. to_char(g.ARRIVETIME, 'HH24:mi') ARRIVETIME_RHS,
  1706. to_char(g.LEAVETIME, 'HH24:mi') LEAVETIME_RHS,
  1707. round((g.LEAVETIME - g.ARRIVETIME) * 24 * 60) SCZQ_RHS,
  1708. to_char(h.ARRIVETIME, 'HH24:mi') ARRIVETIME_VDS,
  1709. to_char(h.LEAVETIME, 'HH24:mi') LEAVETIME_VDS,
  1710. round((h.LEAVETIME - h.ARRIVETIME) * 24 * 60) SCZQ_VDS,
  1711. to_char(e.BALEPFTIME, 'HH24:mi') BALEPFTIME,
  1712. to_char(e.BALESTARTTIME, 'HH24:mi') BALESTARTTIME,
  1713. to_char(e.BALEENDTIME, 'HH24:mi') BALEENDTIME,
  1714. round((e.BALEENDTIME - e.BALESTARTTIME) * 24 * 60) SCZQ_CCM,
  1715. to_char(f.CUTBEGIN, 'HH24:mi') CUTBEGIN,
  1716. to_char(f.CUTEND, 'HH24:mi') CUTEND,
  1717. round((f.CUTEND - f.CUTBEGIN) * 24 * 60) SCZQ_CUT,
  1718. decode(c.isrs, '1', '精炼炉', decode(e.isrs, '1', '连铸机', '')) isrs,
  1719. decode(c.isrs,
  1720. '1',
  1721. decode(e.isrs,
  1722. '1',
  1723. (select sum(WEIGHTOFCVT)
  1724. from (select WEIGHTOFCVT, SMELTINGIDOFCVT
  1725. from STL_es_taphole
  1726. union
  1727. select WEIGHTOFCVT, SMELTINGIDOFCVT
  1728. from STL_mis_taphole)
  1729. where SMELTINGIDOFCVT = a.heatno),
  1730. ''),
  1731. '') isrswgt
  1732. from (select *
  1733. from (select t.*,
  1734. row_number() over(partition by t.HEATNO order by t.OPTDATE) XH
  1735. from (select *
  1736. from STL_BOF_OPTINFO
  1737. where $
  1738. to_char(OPTDATE, 'yyyy-MM-dd hh24:mi:ss') between ? and ?
  1739. and substr(STATIONCODE, 2, 1) = decode(?,null,substr(STATIONCODE, 2, 1),?)
  1740. and UPPER(PLANSTEEL) in (decode(?,null,UPPER(PLANSTEEL),?))
  1741. and substr(SHIFTCODE, 1, 1) = decode(?,null,substr(SHIFTCODE, 1, 1),?)
  1742. and substr(SHIFTCODE, 2, 1) = decode(?,null,substr(SHIFTCODE, 2, 1),?)
  1743. union
  1744. select *
  1745. from J#STL_BOF_OPTINFO
  1746. where $
  1747. to_char(OPTDATE, 'yyyy-MM-dd hh24:mi:ss') between ? and ?
  1748. and substr(STATIONCODE, 2, 1) = decode(?,null,substr(STATIONCODE, 2, 1),?)
  1749. and UPPER(PLANSTEEL) in (decode(?,null,UPPER(PLANSTEEL),?))
  1750. and substr(SHIFTCODE, 1, 1) = decode(?,null,substr(SHIFTCODE, 1, 1),?)
  1751. and substr(SHIFTCODE, 2, 1) = decode(?,null,substr(SHIFTCODE, 2, 1),?)
  1752. ) t)
  1753. where XH = 1) a,
  1754. (select *
  1755. from PPC_STEEL_HEAT
  1756. union
  1757. select * from J#PPC_steel_heat) x,
  1758. (select *
  1759. from (select t.*,
  1760. row_number() over(partition by t.HEATNO order by t.OPTDATE) XH
  1761. from (select *
  1762. from STL_CAS_OPTINFO
  1763. where $
  1764. to_char(OPTDATE, 'yyyy-MM-dd') between ? and ?
  1765. union
  1766. select *
  1767. from J#STL_CAS_OPTINFO
  1768. where $
  1769. to_char(OPTDATE, 'yyyy-MM-dd') between ? and ?) t)
  1770. where XH = 1) b,
  1771. (select *
  1772. from (select t.*,
  1773. row_number() over(partition by t.HEATNO order by t.OPTDATE) XH
  1774. from (select *
  1775. from STL_LFS_OPTINFO
  1776. where $
  1777. to_char(OPTDATE, 'yyyy-MM-dd') between ? and ?
  1778. union
  1779. select *
  1780. from J#STL_LFS_OPTINFO
  1781. where $
  1782. to_char(OPTDATE, 'yyyy-MM-dd') between ? and ?) t)
  1783. where XH = 1) c,
  1784. (select *
  1785. from (select t.*,
  1786. row_number() over(partition by t.HEATNO order by t.OPTDATE) XH
  1787. from (select *
  1788. from STL_RHS_OPTINFO
  1789. where $
  1790. to_char(OPTDATE, 'yyyy-MM-dd') between ? and ?
  1791. union
  1792. select *
  1793. from J#STL_RHS_OPTINFO
  1794. where $
  1795. to_char(OPTDATE, 'yyyy-MM-dd') between ? and ?) t)
  1796. where XH = 1) g,
  1797. (select *
  1798. from (select t.*,
  1799. row_number() over(partition by t.HEATNO order by t.OPTDATE) XH
  1800. from (select *
  1801. from STL_VDS_OPTINFO
  1802. where $
  1803. to_char(OPTDATE, 'yyyy-MM-dd') between ? and ?
  1804. union
  1805. select *
  1806. from J#STL_VDS_OPTINFO
  1807. where $
  1808. to_char(OPTDATE, 'yyyy-MM-dd') between ? and ?) t)
  1809. where XH = 1) h,
  1810. (select *
  1811. from (select t.*,
  1812. row_number() over(partition by t.HEATNO order by t.OPTDATE) XH
  1813. from (select *
  1814. from STL_CCM_OPTINFO
  1815. where $
  1816. to_char(OPTDATE, 'yyyy-MM-dd') between ? and ?
  1817. union
  1818. select *
  1819. from J#STL_CCM_OPTINFO
  1820. where $
  1821. to_char(OPTDATE, 'yyyy-MM-dd') between ? and ?) t)
  1822. where XH = 1) e,
  1823. (select substr(t.HEATNO, 1, 10) HEATNO,
  1824. min(t.CUTTIME) CUTBEGIN,
  1825. max(t.CUTTIME) CUTEND
  1826. from (select *
  1827. from STL_INCISION
  1828. where $
  1829. to_char(CUTTIME, 'yyyy-MM-dd') between ? and ?
  1830. union
  1831. select *
  1832. from J#STL_INCISION
  1833. where $
  1834. to_char(CUTTIME, 'yyyy-MM-dd') between ? and ?) t
  1835. group by substr(t.HEATNO, 1, 10)) f
  1836. where a.HEATNO = b.HEATNO(+)
  1837. and a.HEATNO = c.HEATNO(+)
  1838. and a.HEATNO = e.HEATNO(+)
  1839. and a.HEATNO = f.HEATNO(+)
  1840. and a.HEATNO = x.HEATNO(+)
  1841. and a.HEATNO = g.HEATNO(+)
  1842. and a.HEATNO = h.HEATNO(+)
  1843. order by a.STATIONCODE, a.OPTDATE
  1844. ]]>
  1845. </query>
  1846. <query id="GetreportBOFOggData.Query" desc="获取转炉原始记录数据" fetchSize="10">
  1847. <![CDATA[
  1848. select distinct t.HEATNO,
  1849. t4.aim_grade_code PLANSTEEL,
  1850. t.STATIONCODE,
  1851. t.SAGE,
  1852. t.GAGE,
  1853. t.O2CONSUME,
  1854. nvl(t.IRONPOTWGT, '0') IRONPOTWGT,
  1855. t.BRPSTIME,
  1856. t.POTWRAPSTATE,
  1857. t6.pfbalewgt - t6.baleleavewgt TAPPINGWGT,
  1858. decode(substr(t.shiftcode, 1, 1),
  1859. '1',
  1860. '白班',
  1861. '2',
  1862. '小夜',
  1863. '3',
  1864. '大夜') BC,
  1865. decode(substr(t.shiftcode, 2, 1),
  1866. '1',
  1867. '甲',
  1868. '2',
  1869. '乙',
  1870. '3',
  1871. '丙',
  1872. '4',
  1873. '丁') BB,
  1874. decode(BLKREDEFFECTS,
  1875. '0',
  1876. '失败',
  1877. '1',
  1878. '成功',
  1879. '3',
  1880. '一般') BLKREDEFFECTS,
  1881. t.SUBAGE,
  1882. t.WSTEELWGT,
  1883. t.PIGIRONWGT,
  1884. t.IRONTEMPERATURE,
  1885. t.TERMINUSC,
  1886. t.TERMINUSO2,
  1887. t.B1TEMPERATURE,
  1888. t.B2TEMPERATURE,
  1889. nvl(t.N2CONSUME, 0) + nvl(t.TOPN2CONSUME, 0) N2SUM,
  1890. '0.9' O2PRESS,
  1891. nvl(t.B2TIME,0)+nvl(t.B3TIME,0)+nvl(t.B4TIME,0)+nvl(t.B5TIME,0) DCTIME,
  1892. to_char(t.CHANGESTARTTIME, 'HH24:mi') CHANGESTARTTIME,
  1893. to_char(t.OPENOXYGENTIME, 'HH24:mi') OPENOXYGENTIME,
  1894. round(nvl(t.supplyoxygentime / 60, 0),1) SUPPLYOXYGENTIME,
  1895. round(t.supplyoxygentime,1) SUPPLYOXYGENTIME_S,
  1896. t4.PLAN_LINES PLAN_LINES,
  1897. t.TERMINUSTEPT TAPPINGTEMPERATURE,
  1898. t.TAPPINGTIME,
  1899. t.DRWGT,
  1900. to_char(t.TAPPINGSTARTTIME, 'HH24:mi') TAPPINGSTARTTIME,
  1901. t6.PFBALETEMPT,
  1902. max(case
  1903. when t.HEATNO = t2.HEATNO and t2.xh = t2.cnt then
  1904. t2.C
  1905. end) over(partition by t.HEATNO) F_C,
  1906. max(case
  1907. when t.HEATNO = t2.HEATNO and t2.xh = t2.cnt then
  1908. t2.Mn
  1909. end) over(partition by t.HEATNO) F_MN,
  1910. max(case
  1911. when t.HEATNO = t2.HEATNO and t2.xh = t2.cnt then
  1912. t2.Si
  1913. end) over(partition by t.HEATNO) F_SI,
  1914. max(case
  1915. when t.HEATNO = t2.HEATNO and t2.xh = t2.cnt then
  1916. t2.S
  1917. end) over(partition by t.HEATNO) F_S,
  1918. max(case
  1919. when t.HEATNO = t2.HEATNO and t2.xh = t2.cnt then
  1920. t2.P
  1921. end) over(partition by t.HEATNO) F_P,
  1922. max(case
  1923. when t.HEATNO = t2.HEATNO and t2.xh = t2.cnt then
  1924. t2.V
  1925. end) over(partition by t.HEATNO) F_V,
  1926. max(case
  1927. when t.HEATNO = t2.HEATNO and t2.xh = t2.cnt then
  1928. t2.Als
  1929. end) over(partition by t.HEATNO) F_ALS,
  1930. max(case
  1931. when t.MOLIRNSOURCE = t10.HEATNO then
  1932. t10.Mn
  1933. end) over(partition by t.MOLIRNSOURCE) R_MN,
  1934. max(case
  1935. when t.MOLIRNSOURCE = t10.HEATNO then
  1936. t10.C
  1937. end) over(partition by t.MOLIRNSOURCE) R_C,
  1938. max(case
  1939. when t.MOLIRNSOURCE = t10.HEATNO then
  1940. t10.P
  1941. end) over(partition by t.MOLIRNSOURCE) R_P,
  1942. max(case
  1943. when t.MOLIRNSOURCE = t10.HEATNO then
  1944. t10.S
  1945. end) over(partition by t.MOLIRNSOURCE) R_S,
  1946. max(case
  1947. when t.MOLIRNSOURCE = t10.HEATNO then
  1948. t10.si
  1949. end) over(partition by t.MOLIRNSOURCE) R_SI,
  1950. max(case
  1951. when t.HEATNO = t9.HEATNO and t9.xh = t9.cnt then
  1952. t9.Mn
  1953. end) over(partition by t.HEATNO) Z_MN,
  1954. max(case
  1955. when t.HEATNO = t9.HEATNO and t9.xh = t9.cnt then
  1956. t9.C
  1957. end) over(partition by t.HEATNO) Z_C,
  1958. max(case
  1959. when t.HEATNO = t9.HEATNO and t9.xh = t9.cnt then
  1960. t9.P
  1961. end) over(partition by t.HEATNO) Z_P,
  1962. max(case
  1963. when t.HEATNO = t9.HEATNO and t9.xh = t9.cnt then
  1964. t9.S
  1965. end) over(partition by t.HEATNO) Z_S,
  1966. max(case
  1967. when t.HEATNO = t9.HEATNO and t9.xh = t9.cnt then
  1968. t9.SI
  1969. end) over(partition by t.HEATNO) Z_SI,
  1970. --t4.cast_id||'#铸机' CCMNO,
  1971. (t4.cast_id) || '-' || (t4.cast_seq) CCMNO,
  1972. t.MEMO,
  1973. to_char(t.optdate, 'yyyy-MM-dd hh24:mi') optDisp
  1974. from (select *
  1975. from STL_bof_optinfo
  1976. where 1 = 1
  1977. and to_char(OPTDATE, 'yyyy-MM-dd hh24:mi:ss') between ? and ?
  1978. and substr(STATIONCODE, 2, 1) =
  1979. decode(?, null, substr(STATIONCODE, 2, 1), ?)
  1980. and UPPER(nvl(PLANSTEEL, 'null')) in
  1981. (decode(?, null, UPPER(nvl(PLANSTEEL, 'null')), ?))
  1982. and substr(SHIFTCODE, 1, 1) =
  1983. decode(?, null, substr(SHIFTCODE, 1, 1), ?)
  1984. and substr(SHIFTCODE, 2, 1) =
  1985. decode(?, null, substr(SHIFTCODE, 2, 1), ?)
  1986. union
  1987. select *
  1988. from J#STL_bof_optinfo
  1989. where 1 = 1
  1990. and to_char(OPTDATE, 'yyyy-MM-dd hh24:mi:ss') between ? and ?
  1991. and substr(STATIONCODE, 2, 1) =
  1992. decode(?, null, substr(STATIONCODE, 2, 1), ?)
  1993. and UPPER(nvl(PLANSTEEL, 'null')) in
  1994. (decode(?, null, UPPER(nvl(PLANSTEEL, 'null')), ?))
  1995. and substr(SHIFTCODE, 1, 1) =
  1996. decode(?, null, substr(SHIFTCODE, 1, 1), ?)
  1997. and substr(SHIFTCODE, 2, 1) =
  1998. decode(?, null, substr(SHIFTCODE, 2, 1), ?)) t
  1999. left join (select y.*
  2000. from (select x.*,
  2001. row_number() over(partition by x.HEATNO order by x.ASSAYTYPECODE) xh
  2002. from (select *
  2003. from STL_CHEMELEMENT
  2004. where upper(substr(ASSAYTYPECODE, 1, 1)) = 'C'
  2005. and to_char(ASSAYDATE, 'yyyy-MM-dd') between ? and ?
  2006. union
  2007. select *
  2008. from J#STL_CHEMELEMENT
  2009. where upper(substr(ASSAYTYPECODE, 1, 1)) = 'C'
  2010. and to_char(ASSAYDATE, 'yyyy-MM-dd') between ? and ?) x) y) t1 on t.heatno =
  2011. t1.heatno
  2012. left join (select y.*
  2013. from (select x.*,
  2014. count(1) over(partition by x.HEATNO) cnt,
  2015. row_number() over(partition by x.HEATNO order by x.ASSAYTYPECODE desc, x.assaydate desc) xh,
  2016. substr(x.assaytypecode, 1, 1) gw
  2017. from (select *
  2018. from STL_CHEMELEMENT
  2019. where to_char(ASSAYDATE, 'yyyy-MM-dd') between ? and ?
  2020. and upper(SUBSTR(CHECKNO, -1)) = 'S'
  2021. and upper(SUBSTR(CHECKNO, 10, 2)) = 'GP'
  2022. union
  2023. select *
  2024. from J#STL_CHEMELEMENT
  2025. where to_char(ASSAYDATE, 'yyyy-MM-dd') between ? and ?
  2026. and upper(SUBSTR(CHECKNO, -1)) = 'S'
  2027. and upper(SUBSTR(CHECKNO, 10, 2)) = 'GP') x) y) t2 on t2.heatno =
  2028. t.heatno
  2029. left join (select y.*
  2030. from (select x.*,
  2031. count(1) over(partition by x.HEATNO) cnt,
  2032. row_number() over(partition by x.HEATNO order by x.ASSAYTYPECODE desc, x.assaydate desc) xh,
  2033. substr(x.assaytypecode, 1, 1) gw
  2034. from (select *
  2035. from STL_CHEMELEMENT
  2036. where to_char(ASSAYDATE, 'yyyy-MM-dd') between ? and ?
  2037. and upper(SUBSTR(CHECKNO, 10, 1)) = 'C'
  2038. and upper(SUBSTR(CHECKNO, -1)) = 'I'
  2039. and upper(SUBSTR(CHECKNO, 11, 1)) <> 'P'
  2040. union
  2041. select *
  2042. from J#STL_CHEMELEMENT
  2043. where to_char(ASSAYDATE, 'yyyy-MM-dd') between ? and ?
  2044. and upper(SUBSTR(CHECKNO, 10, 1)) = 'C'
  2045. and upper(SUBSTR(CHECKNO, -1)) = 'I'
  2046. and upper(SUBSTR(CHECKNO, 11, 1)) <> 'P') x) y) t3 on t3.heatno =
  2047. t.heatno
  2048. left join (select y.*
  2049. from (select x.*,
  2050. count(1) over(partition by x.HEATNO) cnt,
  2051. row_number() over(partition by x.HEATNO order by x.ASSAYTYPECODE ) xh,
  2052. substr(x.assaytypecode, 1, 1) gw
  2053. from (select *
  2054. from STL_CHEMELEMENT
  2055. where to_char(ASSAYDATE, 'yyyy-MM-dd') between ? and ?
  2056. and upper(SUBSTR(CHECKNO, 10, 1)) = 'C'
  2057. and upper(SUBSTR(CHECKNO, -1)) = 'S'
  2058. union
  2059. select *
  2060. from J#STL_CHEMELEMENT
  2061. where to_char(ASSAYDATE, 'yyyy-MM-dd') between ? and ?
  2062. and upper(SUBSTR(CHECKNO, 10, 1)) = 'C'
  2063. and upper(SUBSTR(CHECKNO, -1)) = 'S') x) y) t9 on t9.heatno =
  2064. t.heatno
  2065. left join (select *
  2066. from stl_chemelement
  2067. union
  2068. select * from J#stl_chemelement) t10 on t10.heatno =
  2069. t.MOLIRNSOURCE
  2070. left join (select *
  2071. from ppc_steel_heat
  2072. union
  2073. select * from J#ppc_steel_heat) t4 on t.heatno = t4.heatno
  2074. left join (select *
  2075. from ppc_steel_heat
  2076. union
  2077. select * from J#ppc_steel_heat) t5 on t.heatno = t5.heatno
  2078. left join (select heatno,
  2079. PFBALEWGT,
  2080. BALELEAVEWGT,
  2081. isrs,
  2082. MWRAPNO,
  2083. PFBALETEMPT,
  2084. BILLETFIXSIZE
  2085. from stl_ccm_optinfo
  2086. union
  2087. select heatno,
  2088. PFBALEWGT,
  2089. BALELEAVEWGT,
  2090. isrs,
  2091. MWRAPNO,
  2092. PFBALETEMPT,
  2093. BILLETFIXSIZE
  2094. from J#stl_ccm_optinfo) t6 on t.heatno = t6.heatno
  2095. order by optDisp
  2096. ]]>
  2097. </query>
  2098. <query id="BofData_FLHJ.Query" desc="获取转炉物料" fetchSize="10">
  2099. <![CDATA[
  2100. Select t.heatno,
  2101. t.STATIONCODE,
  2102. t.DISPOSALTIME,
  2103. t1.materielcode,
  2104. t1.materieltype,
  2105. t2.materielname,
  2106. round(sum(nvl(t1.JMWGT, 0)) over(partition by t1.HEATNO,
  2107. t1.STATIONCODE,
  2108. t1.DISPOSALTIME,
  2109. t1.MATERIELTYPE,
  2110. t1.MATERIELCODE)) materielWgt
  2111. from (select *
  2112. from stl_bof_optinfo
  2113. where 1 = 1
  2114. and to_char(OPTDATE, 'yyyy-MM-dd') between ? and ?
  2115. and substr(STATIONCODE, 2, 1) =
  2116. decode(?, null, substr(STATIONCODE, 2, 1), ?)
  2117. and UPPER(nvl(PLANSTEEL, 'null')) in
  2118. (decode(?, null, UPPER(nvl(PLANSTEEL, 'null')), ?))
  2119. and substr(SHIFTCODE, 1, 1) =
  2120. decode(?, null, substr(SHIFTCODE, 1, 1), ?)
  2121. and substr(SHIFTCODE, 2, 1) =
  2122. decode(?, null, substr(SHIFTCODE, 2, 1), ?)
  2123. union
  2124. select *
  2125. from J#stl_Bof_Optinfo
  2126. where 1 = 1
  2127. and to_char(OPTDATE, 'yyyy-MM-dd') between ? and ?
  2128. and substr(STATIONCODE, 2, 1) =
  2129. decode(?, null, substr(STATIONCODE, 2, 1), ?)
  2130. and UPPER(nvl(PLANSTEEL, 'null')) in
  2131. (decode(?, null, UPPER(nvl(PLANSTEEL, 'null')), ?))
  2132. and substr(SHIFTCODE, 1, 1) =
  2133. decode(?, null, substr(SHIFTCODE, 1, 1), ?)
  2134. and substr(SHIFTCODE, 2, 1) =
  2135. decode(?, null, substr(SHIFTCODE, 2, 1), ?)) t
  2136. left join stl_ADDITIVES t1 on t.heatno = t1.heatno
  2137. and 'C' || t.stationcode = t1.stationcode
  2138. and t.disposaltime = t1.disposaltime
  2139. left join com_MATERIEL t2 on t1.materielcode = t2.materielcode
  2140. order by t.STATIONCODE, t.HEATNO
  2141. ]]>
  2142. </query>
  2143. <query id="CCMData_HEAT.Query" desc="获取连铸机炉次信息" fetchSize="10">
  2144. <![CDATA[
  2145. select a.HEATNO,
  2146. a.MOULDNO,
  2147. v.aim_grade_code PLANSTEEL,
  2148. v.PLAN_LINES,
  2149. a.BILLETSECTION,
  2150. case a.BALEFLOWFLAG
  2151. when 0 then
  2152. '否'
  2153. when 1 then
  2154. '是'
  2155. end BALEFLOWFLAG,
  2156. a.MOULDSTOVENUM,
  2157. a.PFBALETEMPT,
  2158. to_char(a.BALEPFTIME, 'HH24:mi') BALEPFTIME,
  2159. to_char(a.BALESTARTTIME, 'HH24:mi') BALESTARTTIME,
  2160. to_char(a.BALEENDTIME, 'HH24:mi') BALEENDTIME,
  2161. round((a.BALEENDTIME - a.BALESTARTTIME) * 24 * 60) 周期,
  2162. a.PFBALEWGT,
  2163. a.BALELEAVEWGT,
  2164. nvl(a.PFBALEWGT,0)-nvl(a.BALELEAVEWGT,0) JGWGT,
  2165. to_char(a.BALELEAVETIME,'HH24:mi') BALELEAVETIME,
  2166. v.CAST_ID || '-' || v.cast_seq CAST_ID,
  2167. a.S1BILLETLENGTH LEN_1,
  2168. a.S2BILLETLENGTH LEN_2,
  2169. a.CRYSTALLIZERTIMES CRYSTALLIZERTIMES1,
  2170. a.CRYSTALLIZERTIMES2,
  2171. to_char(a.OPTDATE, 'yyyy-MM-dd hh24:mi') Optdisp
  2172. from (select *
  2173. from STL_CCM_OPTINFO
  2174. where 1 = 1
  2175. and to_char(OPTDATE, 'yyyy-MM-dd hh24:mi:ss') between ? and ?
  2176. and substr(STATIONCODE, 2, 1) =
  2177. decode(?, null, substr(STATIONCODE, 2, 1), ?)
  2178. and UPPER(nvl(PLANSTEEL, 'null')) in
  2179. (decode(?, null, UPPER(nvl(PLANSTEEL, 'null')), ?))
  2180. and substr(SHIFTCODE, 1, 1) =
  2181. decode(?, null, substr(SHIFTCODE, 1, 1), ?)
  2182. and substr(SHIFTCODE, 2, 1) =
  2183. decode(?, null, substr(SHIFTCODE, 2, 1), ?)
  2184. union
  2185. select *
  2186. from J#STL_CCM_OPTINFO
  2187. where 1 = 1
  2188. and to_char(OPTDATE, 'yyyy-MM-dd hh24:mi:ss') between ? and ?
  2189. and substr(STATIONCODE, 2, 1) =
  2190. decode(?, null, substr(STATIONCODE, 2, 1), ?)
  2191. and UPPER(nvl(PLANSTEEL, 'null')) in
  2192. (decode(?, null, UPPER(nvl(PLANSTEEL, 'null')), ?))
  2193. and substr(SHIFTCODE, 1, 1) =
  2194. decode(?, null, substr(SHIFTCODE, 1, 1), ?)
  2195. and substr(SHIFTCODE, 2, 1) =
  2196. decode(?, null, substr(SHIFTCODE, 2, 1), ?)) a,
  2197. STL_CCM_MOULDINFO u,
  2198. (select *
  2199. from PPC_steel_heat
  2200. union
  2201. select * from J#PPC_steel_heat) v
  2202. where a.MOULDNO = u.MOULDNO(+)
  2203. and a.HEATNO = v.heatno(+)
  2204. order by a.optdate
  2205. ]]>
  2206. </query>
  2207. <query id="CCMDataHEAT_Speed.Query" desc="获取连铸中包温度对应的拉速" fetchSize="10">
  2208. <![CDATA[
  2209. select z.*
  2210. from (select Distinct x.Heatno,
  2211. x.STATIONCODE,
  2212. x.DISPOSALTIME,
  2213. x.MIDLADLETEMP,
  2214. to_char(x.LASTFRESHTIME,'HH24:mi') LASTFRESHTIME,
  2215. y.s1castspeed,
  2216. y.s2castspeed,
  2217. y.s3castspeed,
  2218. y.s4castspeed,
  2219. y.s5castspeed,
  2220. row_number() over(partition by x.HEATNO order by x.LASTFRESHTIME) xh,
  2221. count(*) over(partition by x.HEATNO order by x.HEATNO) intcount
  2222. from (SELECT Heatno,
  2223. STATIONCODE,
  2224. DISPOSALTIME,
  2225. MIDLADLETEMP,
  2226. min(LASTFRESHTIME) LASTFRESHTIME
  2227. FROM (select HEATNO,
  2228. STATIONCODE,
  2229. DISPOSALTIME,
  2230. ROUND(greatest(midladletemp1, midladletemp2)) MIDLADLETEMP,
  2231. LASTFRESHTIME from $ b
  2232. where 1 = 1
  2233. and to_char(OPTDATE, 'yyyy-MM-dd') between ? and ?
  2234. and substr(STATIONCODE, 2, 1) =
  2235. decode(?, null, substr(STATIONCODE, 2, 1), ?)
  2236. union
  2237. select HEATNO,
  2238. STATIONCODE,
  2239. DISPOSALTIME,
  2240. ROUND(greatest(midladletemp1, midladletemp2)) MIDLADLETEMP,
  2241. LASTFRESHTIME
  2242. from J#$
  2243. where 1 = 1
  2244. and to_char(OPTDATE, 'yyyy-MM-dd') between ? and ?
  2245. and substr(STATIONCODE, 2, 1) =
  2246. decode(?, null, substr(STATIONCODE, 2, 1), ?)) a
  2247. group by heatno,
  2248. stationcode,
  2249. disposaltime,
  2250. MIDLADLETEMP
  2251. order by heatno) x
  2252. left join (select HEATNO,
  2253. STATIONCODE,
  2254. DISPOSALTIME,
  2255. s1castspeed,
  2256. s2castspeed,
  2257. s3castspeed,
  2258. s4castspeed,
  2259. s5castspeed,
  2260. LASTFRESHTIME,
  2261. ROUND(greatest(midladletemp1, midladletemp2)) MIDLADLETEMP
  2262. from $ b
  2263. where 1 = 1
  2264. and to_char(OPTDATE, 'yyyy-MM-dd') between ? and ?
  2265. and substr(STATIONCODE, 2, 1) =
  2266. decode(?, null, substr(STATIONCODE, 2, 1), ?)
  2267. union
  2268. select HEATNO,
  2269. STATIONCODE,
  2270. DISPOSALTIME,
  2271. s1castspeed,
  2272. s2castspeed,
  2273. s3castspeed,
  2274. s4castspeed,
  2275. s5castspeed,
  2276. LASTFRESHTIME,
  2277. ROUND(greatest(midladletemp1, midladletemp2)) MIDLADLETEMP
  2278. from J#$
  2279. where 1 = 1
  2280. and to_char(OPTDATE, 'yyyy-MM-dd') between ? and ?
  2281. and substr(STATIONCODE, 2, 1) =
  2282. decode(?, null, substr(STATIONCODE, 2, 1), ?)) y on x.heatno =
  2283. y.heatno
  2284. and x.stationcode =
  2285. y.stationcode
  2286. and x.disposaltime =
  2287. y.disposaltime
  2288. where x.LASTFRESHTIME = y.LASTFRESHTIME
  2289. and x.MIDLADLETEMP = y.MIDLADLETEMP
  2290. and x.MIDLADLETEMP > 1410
  2291. order by heatno, LASTFRESHTIME) z
  2292. where z.xh in (1, round(z.intcount / 4), round((z.intcount - 2) / 4) * 2,
  2293. round((z.intcount - 2) / 4) * 3,
  2294. round((z.intcount - 2) / 4) * 4, z.intcount)
  2295. ]]>
  2296. </query>
  2297. <query id="CCMData_CAST.Query" desc="获取连铸机浇次信息" fetchSize="10">
  2298. <![CDATA[
  2299. select u.MOULDNO,
  2300. u.S1CRYSTALCODE,
  2301. u.S2CRYSTALCODE,
  2302. u.S1PLANENDTIME,
  2303. u.S2PLANENDTIME,
  2304. u.MWRAPNO,
  2305. u.STUFFSTICK,
  2306. u.UPGAP,
  2307. u.DIPGAP,
  2308. u.PROTECTDTEGNAME,
  2309. u.MWRAPBESTROWNAME,
  2310. to_char(u.MINFIREBEGINTIME, 'HH24:mi') MINFIREBEGINTIME,
  2311. to_char(u.MIDDLEFIREBEGINTIME, 'HH24:mi') MIDDLEFIREBEGINTIME,
  2312. to_char(u.MAXBEGINTIME, 'HH24:mi') MAXBEGINTIME,
  2313. u.MWRAPFIRINGENDTIME1,
  2314. a.SWRAPENDCAUSE ,
  2315. u.MWRAPREMAIN,
  2316. a.PLANSTEEL,
  2317. u.MEMO,
  2318. to_char(a.OPTDATE, 'yyyy-MM-dd') Optdisp
  2319. from (select *
  2320. from STL_CCM_OPTINFO
  2321. where 1 = 1
  2322. and to_char(OPTDATE, 'yyyy-MM-dd') between ? and ?
  2323. and substr(STATIONCODE, 2, 1) =
  2324. decode(?, null, substr(STATIONCODE, 2, 1), ?)
  2325. and UPPER(nvl(PLANSTEEL, 'null')) in
  2326. (decode(?, null, UPPER(nvl(PLANSTEEL, 'null')), ?))
  2327. and substr(SHIFTCODE, 1, 1) =
  2328. decode(?, null, substr(SHIFTCODE, 1, 1), ?)
  2329. and substr(SHIFTCODE, 2, 1) =
  2330. decode(?, null, substr(SHIFTCODE, 2, 1), ?)
  2331. union
  2332. select *
  2333. from J#STL_CCM_OPTINFO
  2334. where 1 = 1
  2335. and to_char(OPTDATE, 'yyyy-MM-dd') between ? and ?
  2336. and substr(STATIONCODE, 2, 1) =
  2337. decode(?, null, substr(STATIONCODE, 2, 1), ?)
  2338. and UPPER(nvl(PLANSTEEL, 'null')) in
  2339. (decode(?, null, UPPER(nvl(PLANSTEEL, 'null')), ?))
  2340. and substr(SHIFTCODE, 1, 1) =
  2341. decode(?, null, substr(SHIFTCODE, 1, 1), ?)
  2342. and substr(SHIFTCODE, 2, 1) =
  2343. decode(?, null, substr(SHIFTCODE, 2, 1), ?)) a,
  2344. STL_CCM_MOULDINFO u,
  2345. (select *
  2346. from PPC_steel_heat
  2347. union
  2348. select * from J#PPC_steel_heat) v
  2349. where a.MOULDNO = u.MOULDNO(+)
  2350. and a.MOULDNO = v.cast_no(+)
  2351. order by a.optdate
  2352. ]]>
  2353. </query>
  2354. <query id="BOFLG.Query" desc="转炉生产调度——炼钢部分" fetchSize="10">
  2355. <![CDATA[
  2356. select distinct substr(t.STATIONCODE, 2, 1) || '#转炉' STATIONCODE,
  2357. t.HEATNO,
  2358. substr(B.FACT_ROUTE,9,2) LFSGX,
  2359. t.PLANSTEEL,
  2360. to_char(t.CHANGESTARTTIME, 'hh24:mi') CHANGESTARTTIME,
  2361. to_char(t.TAPPINGENDTIME, 'hh24:mi') TAPPINGENDTIME,
  2362. t.IRONPOTWGT,
  2363. t.WSTEELWGT,
  2364. t.PIGIRONWGT,
  2365. t.POTNO,
  2366. (B.cast_id) || '-' || (B.cast_seq) MOULDNO,
  2367. t.POTAGE POAGE,
  2368. t.POTDISTINCTION POLVL,
  2369. t.MEMO,
  2370. to_char(t.optdate, 'yyyy-MM-dd HH24:mi:ss') optDisp
  2371. from (select *
  2372. from STL_bof_optinfo
  2373. where 1 = 1
  2374. and to_char(OPTDATE, 'yyyy-MM-dd') between ? and ?
  2375. union
  2376. select *
  2377. from J#STL_bof_optinfo
  2378. where 1 = 1
  2379. and to_char(OPTDATE, 'yyyy-MM-dd') between ? and
  2380. ? ) t
  2381. left join (select *
  2382. from STL_ccm_optinfo
  2383. union
  2384. select * from J#STL_ccm_optinfo) C on t.heatno = c.heatno
  2385. left join (select *
  2386. from ppc_steel_heat
  2387. union
  2388. select * from J#ppc_steel_heat) B on t.heatno = B.heatno
  2389. order by STATIONCODE, optDisp
  2390. ]]>
  2391. </query>
  2392. <query id="CCMSLG.Query" desc="转炉生产调度——连铸部分" fetchSize="10">
  2393. <![CDATA[
  2394. select distinct substr(t.STATIONCODE, 2, 1) || '#连铸' STATIONCODE,
  2395. t.HEATNO,
  2396. t.PLANSTEEL,
  2397. t.BILLETSECTION,
  2398. to_char(t.BALESTARTTIME,'hh24:mi') BALESTARTTIME,
  2399. to_char(t.BALEENDTIME,'hh24:mi') BALEENDTIME,
  2400. (t.PFBALEWGT-t.BALELEAVEWGT) PFBALEWGT,
  2401. round(nvl(D.WEIGHT / 1000, 0), 1) BILLETWGT,
  2402. t.MEMO,
  2403. to_char(t.optdate, 'yyyy-MM-dd HH24:mi:ss') optDisp
  2404. from (select *
  2405. from STL_ccm_optinfo
  2406. where 1 = 1
  2407. and to_char(OPTDATE, 'yyyy-MM-dd') between ? and ?
  2408. union
  2409. select *
  2410. from J#STL_ccm_optinfo
  2411. where 1 = 1
  2412. and to_char(OPTDATE, 'yyyy-MM-dd') between ? and
  2413. ? ) t
  2414. left join (select *
  2415. from ppc_steel_heat
  2416. union
  2417. select * from J#ppc_steel_heat) B on t.heatno = B.heatno
  2418. left join (select t.HEATNO, sum(t.WEIGHT) WEIGHT from stl_incision_view t Group by t.HEATNO ) D
  2419. on t.heatno =D.HEATNO
  2420. order by STATIONCODE, optDisp
  2421. ]]>
  2422. </query>
  2423. <query id="BOFCCM.Query" desc="转炉生产调度——连铸" fetchSize="10">
  2424. <![CDATA[
  2425. select distinct a.HEATNO,
  2426. substr(a.STATIONCODE, 2, 1) || '#炉' STATIONCODE,
  2427. a.BILLETSECTION,
  2428. v.aim_grade_code PLANSTEEL,
  2429. a.BALESTARTTIME,
  2430. a.BALEENDTIME,
  2431. a.BILLETWGT,
  2432. a.PFBALEWGT,
  2433. a.MEMO,
  2434. to_char(a.OPTDATE, 'yyyy-MM-dd') Optdisp
  2435. from (select *
  2436. from STL_CCM_OPTINFO
  2437. where 1 = 1
  2438. and to_char(OPTDATE, 'yyyy-MM-dd') between ? and
  2439. ?
  2440. and substr(STATIONCODE, 2, 1) = '1'
  2441. or substr(STATIONCODE, 2, 2) = '2'
  2442. union
  2443. select *
  2444. from J#STL_CCM_OPTINFO
  2445. where 1 = 1
  2446. and to_char(OPTDATE, 'yyyy-MM-dd') between ? and
  2447. ?
  2448. and substr(STATIONCODE, 2, 1) = '1'
  2449. or substr(STATIONCODE, 2, 2) = '2') a,
  2450. STL_CCM_MOULDINFO u,
  2451. (select *
  2452. from PPC_steel_heat
  2453. union
  2454. select * from J#PPC_steel_heat) v
  2455. where a.MOULDNO = u.MOULDNO(+)
  2456. and a.HEATNO = v.heatno(+)
  2457. order by STATIONCODE, optDisp
  2458. ]]>
  2459. </query>
  2460. <query id="frmRTDCons.Query" desc="RTD" fetchSize="10">
  2461. <![CDATA[
  2462. SELECT row_number() over(order by USER_TAB_COLS.COLUMN_ID) ID, USER_TAB_COLS.COLUMN_NAME as FIELDS
  2463. FROM USER_TAB_COLS
  2464. where USER_TAB_COLS.TABLE_NAME = ?
  2465. ]]>
  2466. </query>
  2467. <query id="RtdDataQuery.Query" desc="RTD" fetchSize="10">
  2468. <![CDATA[
  2469. select t.* from $ t
  2470. ]]>
  2471. </query>
  2472. <query id="proc_RTDTable.Query" desc="加载RTD表" fetchSize="10">
  2473. <![CDATA[
  2474. select table_name
  2475. from user_tables
  2476. where table_name like 'RTD_POIN%'
  2477. and table_name not in
  2478. (select table_name
  2479. from user_tables
  2480. where table_name like 'RTD_POIN%RH%'
  2481. or table_name like 'RTD_POIN%VD%')
  2482. ]]>
  2483. </query>
  2484. <query id="reportRHElement.Query" desc="RH炉CP化学成分报表查询" fetchSize="10">
  2485. <![CDATA[
  2486. select distinct to_char(a.OPTDATE, 'yyyy-MM-dd') OPTDATE,--日期
  2487. decode(a.SHIFTCODE,'11','甲白','12','乙白','13','丙白','14','丁白','21','甲中','22','乙中','23','丙中','24','丁中','31','甲夜','32','乙夜','33','丙夜','34','丁夜')SHIFTCODE ,--班组
  2488. a.HEATNO HEATNO, --炉号
  2489. a.PLANSTEEL PLANSTEEL,--钢种
  2490. p.FLAG FLAG, --是否改判
  2491. --CP化学成分
  2492. max(case when a.HEATNO = w.HEATNO and w.xh = w.cnt then w.C end) over(partition by a.HEATNO) Y_C,
  2493. max(case when a.HEATNO = w.HEATNO and w.xh = w.cnt then w.MN end) over(partition by a.HEATNO) Y_MN,
  2494. max(case when a.HEATNO = w.HEATNO and w.xh = w.cnt then w.S end) over(partition by a.HEATNO) Y_S,
  2495. max(case when a.HEATNO = w.HEATNO and w.xh = w.cnt then w.P end) over(partition by a.HEATNO) Y_P,
  2496. max(case when a.HEATNO = w.HEATNO and w.xh = w.cnt then w.SI end) over(partition by a.HEATNO) Y_SI,
  2497. max(case when a.HEATNO = w.HEATNO and w.xh = w.cnt then w.V end) over(partition by a.HEATNO) Y_V,
  2498. max(case when a.HEATNO = w.HEATNO and w.xh = w.cnt then w.TI end) over(partition by a.HEATNO) Y_TI,
  2499. max(case when a.HEATNO = w.HEATNO and w.xh = w.cnt then w.NB end) over(partition by a.HEATNO) Y_NB,
  2500. max(case when a.HEATNO = w.HEATNO and w.xh = w.cnt then w.CR end) over(partition by a.HEATNO) Y_CR,
  2501. max(case when a.HEATNO = w.HEATNO and w.xh = w.cnt then w.NI end) over(partition by a.HEATNO) Y_NI,
  2502. max(case when a.HEATNO = w.HEATNO and w.xh = w.cnt then w.MO end) over(partition by a.HEATNO) Y_MO,
  2503. max(case when a.HEATNO = w.HEATNO and w.xh = w.cnt then w.CU end) over(partition by a.HEATNO) Y_CU,
  2504. max(case when a.HEATNO = w.HEATNO and w.xh = w.cnt then w.ALS end) over(partition by a.HEATNO) Y_ALS,
  2505. max(case when a.HEATNO = w.HEATNO and w.xh = w.cnt then w.ALT end) over(partition by a.HEATNO) Y_ALT,
  2506. --内控下限化学成分
  2507. max(case when a.HEATNO = u.GYCODE then decode(u.itemcode,'C',u.stdmin,'') end) over(partition by a.HEATNO) C_C,
  2508. max(case when a.HEATNO = u.GYCODE then decode(u.itemcode,'Mn',u.stdmin,'') end) over(partition by a.HEATNO) C_MN,
  2509. max(case when a.HEATNO = u.GYCODE then decode(u.itemcode,'S',u.stdmin,'') end) over(partition by a.HEATNO) C_S,
  2510. max(case when a.HEATNO = u.GYCODE then decode(u.itemcode,'P',u.stdmin,'') end) over(partition by a.HEATNO) C_P,
  2511. max(case when a.HEATNO = u.GYCODE then decode(u.itemcode,'Si',u.stdmin,'') end) over(partition by a.HEATNO) C_SI,
  2512. max(case when a.HEATNO = u.GYCODE then decode(u.itemcode,'V',u.stdmin,'') end) over(partition by a.HEATNO) C_V,
  2513. max(case when a.HEATNO = u.GYCODE then decode(u.itemcode,'Ti',u.stdmin,'') end) over(partition by a.HEATNO) C_TI,
  2514. max(case when a.HEATNO = u.GYCODE then decode(u.itemcode,'Nb',u.stdmin,'') end) over(partition by a.HEATNO) C_NB,
  2515. max(case when a.HEATNO = u.GYCODE then decode(u.itemcode,'Cr',u.stdmin,'') end) over(partition by a.HEATNO) C_CR,
  2516. max(case when a.HEATNO = u.GYCODE then decode(u.itemcode,'Ni',u.stdmin,'') end) over(partition by a.HEATNO) C_NI,
  2517. max(case when a.HEATNO = u.GYCODE then decode(u.itemcode,'Mo',u.stdmin,'') end) over(partition by a.HEATNO) C_MO,
  2518. max(case when a.HEATNO = u.GYCODE then decode(u.itemcode,'Cu',u.stdmin,'') end) over(partition by a.HEATNO) C_CU,
  2519. max(case when a.HEATNO = u.GYCODE then decode(u.itemcode,'Als',u.stdmin,'') end) over(partition by a.HEATNO) C_ALS,
  2520. max(case when a.HEATNO = u.GYCODE then decode(u.itemcode,'Alt',u.stdmin,'') end) over(partition by a.HEATNO) C_ALT,
  2521. --内控上限化学成分
  2522. max(case when a.HEATNO = u.GYCODE then decode(u.itemcode,'C',u.stdmax,'') end) over(partition by a.HEATNO) S_C,
  2523. max(case when a.HEATNO = u.GYCODE then decode(u.itemcode,'Mn',u.stdmax,'') end) over(partition by a.HEATNO) S_MN,
  2524. max(case when a.HEATNO = u.GYCODE then decode(u.itemcode,'S',u.stdmax,'') end) over(partition by a.HEATNO) S_S,
  2525. max(case when a.HEATNO = u.GYCODE then decode(u.itemcode,'P',u.stdmax,'') end) over(partition by a.HEATNO) S_P,
  2526. max(case when a.HEATNO = u.GYCODE then decode(u.itemcode,'Si',u.stdmax,'') end) over(partition by a.HEATNO) S_SI,
  2527. max(case when a.HEATNO = u.GYCODE then decode(u.itemcode,'V',u.stdmax,'') end) over(partition by a.HEATNO) S_V,
  2528. max(case when a.HEATNO = u.GYCODE then decode(u.itemcode,'Ti',u.stdmax,'') end) over(partition by a.HEATNO) S_TI,
  2529. max(case when a.HEATNO = u.GYCODE then decode(u.itemcode,'Nb',u.stdmax,'') end) over(partition by a.HEATNO) S_NB,
  2530. max(case when a.HEATNO = u.GYCODE then decode(u.itemcode,'Cr',u.stdmax,'') end) over(partition by a.HEATNO) S_CR,
  2531. max(case when a.HEATNO = u.GYCODE then decode(u.itemcode,'Ni',u.stdmax,'') end) over(partition by a.HEATNO) S_NI,
  2532. max(case when a.HEATNO = u.GYCODE then decode(u.itemcode,'Mo',u.stdmax,'') end) over(partition by a.HEATNO) S_MO,
  2533. max(case when a.HEATNO = u.GYCODE then decode(u.itemcode,'Cu',u.stdmax,'') end) over(partition by a.HEATNO) S_CU,
  2534. max(case when a.HEATNO = u.GYCODE then decode(u.itemcode,'Als',u.stdmax,'') end) over(partition by a.HEATNO) S_ALS,
  2535. max(case when a.HEATNO = u.GYCODE then decode(u.itemcode,'Alt',u.stdmax,'') end) over(partition by a.HEATNO) S_ALT
  2536. from (select *
  2537. from STL_RHS_OPTINFO
  2538. where $
  2539. union
  2540. select * from J#stl_RHS_OPTINFO where $) a,
  2541. (select t.charge_no,t.judge_stl_grd,decode(t.judge_stl_grd,'','否','是') FLAG from stl_judge_result t) p,
  2542. (select y.*
  2543. from (select x.*,
  2544. count(1) over(partition by x.HEATNO) cnt,
  2545. row_number() over(partition by x.HEATNO order by x.ASSAYTYPECODE desc) xh
  2546. from (select *
  2547. from stl_CHEMELEMENT
  2548. where (upper(SUBSTR(CHECKNO, 12, 1)) = 'F'
  2549. or upper(SUBSTR(CHECKNO, 12, 2)) = 'GP')
  2550. and upper(SUBSTR(CHECKNO, -1)) = 'S'
  2551. and $
  2552. union
  2553. select t.*
  2554. from j#stl_CHEMELEMENT t
  2555. where (upper(SUBSTR(CHECKNO, 12, 1)) = 'F'
  2556. or upper(SUBSTR(CHECKNO, 12, 2)) = 'GP')
  2557. and upper(SUBSTR(CHECKNO, -1)) = 'S'
  2558. and $ ) x) y
  2559. where y.xh = y.cnt) w,
  2560. (select t.itemcode,t.stdmin,t.stdmax,s.gycode from com_standard_chem t,com_sortcode_chem s where t.cic=s.cic and s.stdstyle='1') u
  2561. where a.HEATNO = w.HEATNO(+)
  2562. and a.HEATNO = p.charge_no(+)
  2563. and a.HEATNO = u.GYCODE(+)
  2564. order by to_char(a.OPTDATE, 'yyyy-MM-dd')
  2565. ]]>
  2566. </query>
  2567. <query id="reportLFElement.Query" desc="LF炉成分报表查询" fetchSize="10">
  2568. <![CDATA[
  2569. select distinct to_char(a.OPTDATE, 'yyyy-MM-dd') OPTDATE,--日期
  2570. decode(a.SHIFTCODE,'11','甲白','12','乙白','13','丙白','14','丁白','21','甲中','22','乙中','23','丙中','24','丁中','31','甲夜','32','乙夜','33','丙夜','34','丁夜')SHIFTCODE ,--班组
  2571. a.HEATNO HEATNO, --炉号
  2572. a.PLANSTEEL PLANSTEEL,--钢种
  2573. w.CEQ, --碳当量
  2574. p.FLAG FLAG, --是否改判
  2575. --CP化学成分
  2576. max(case when a.HEATNO = w.HEATNO and w.xh = w.cnt then w.C end) over(partition by a.HEATNO) Y_C,
  2577. max(case when a.HEATNO = w.HEATNO and w.xh = w.cnt then w.MN end) over(partition by a.HEATNO) Y_MN,
  2578. max(case when a.HEATNO = w.HEATNO and w.xh = w.cnt then w.S end) over(partition by a.HEATNO) Y_S,
  2579. max(case when a.HEATNO = w.HEATNO and w.xh = w.cnt then w.P end) over(partition by a.HEATNO) Y_P,
  2580. max(case when a.HEATNO = w.HEATNO and w.xh = w.cnt then w.SI end) over(partition by a.HEATNO) Y_SI,
  2581. max(case when a.HEATNO = w.HEATNO and w.xh = w.cnt then w.V end) over(partition by a.HEATNO) Y_V,
  2582. max(case when a.HEATNO = w.HEATNO and w.xh = w.cnt then w.TI end) over(partition by a.HEATNO) Y_TI,
  2583. max(case when a.HEATNO = w.HEATNO and w.xh = w.cnt then w.NB end) over(partition by a.HEATNO) Y_NB,
  2584. max(case when a.HEATNO = w.HEATNO and w.xh = w.cnt then w.CR end) over(partition by a.HEATNO) Y_CR,
  2585. max(case when a.HEATNO = w.HEATNO and w.xh = w.cnt then w.NI end) over(partition by a.HEATNO) Y_NI,
  2586. max(case when a.HEATNO = w.HEATNO and w.xh = w.cnt then w.MO end) over(partition by a.HEATNO) Y_MO,
  2587. max(case when a.HEATNO = w.HEATNO and w.xh = w.cnt then w.CU end) over(partition by a.HEATNO) Y_CU,
  2588. max(case when a.HEATNO = w.HEATNO and w.xh = w.cnt then w.ALS end) over(partition by a.HEATNO) Y_ALS,
  2589. max(case when a.HEATNO = w.HEATNO and w.xh = w.cnt then w.ALT end) over(partition by a.HEATNO) Y_ALT,
  2590. --内控下限化学成分
  2591. max(case when a.HEATNO = u.GYCODE then decode(u.itemcode,'C',u.stdmin,'') end) over(partition by a.HEATNO) C_C,
  2592. max(case when a.HEATNO = u.GYCODE then decode(u.itemcode,'Mn',u.stdmin,'') end) over(partition by a.HEATNO) C_MN,
  2593. max(case when a.HEATNO = u.GYCODE then decode(u.itemcode,'S',u.stdmin,'') end) over(partition by a.HEATNO) C_S,
  2594. max(case when a.HEATNO = u.GYCODE then decode(u.itemcode,'P',u.stdmin,'') end) over(partition by a.HEATNO) C_P,
  2595. max(case when a.HEATNO = u.GYCODE then decode(u.itemcode,'Si',u.stdmin,'') end) over(partition by a.HEATNO) C_SI,
  2596. max(case when a.HEATNO = u.GYCODE then decode(u.itemcode,'V',u.stdmin,'') end) over(partition by a.HEATNO) C_V,
  2597. max(case when a.HEATNO = u.GYCODE then decode(u.itemcode,'Ti',u.stdmin,'') end) over(partition by a.HEATNO) C_TI,
  2598. max(case when a.HEATNO = u.GYCODE then decode(u.itemcode,'Nb',u.stdmin,'') end) over(partition by a.HEATNO) C_NB,
  2599. max(case when a.HEATNO = u.GYCODE then decode(u.itemcode,'Cr',u.stdmin,'') end) over(partition by a.HEATNO) C_CR,
  2600. max(case when a.HEATNO = u.GYCODE then decode(u.itemcode,'Ni',u.stdmin,'') end) over(partition by a.HEATNO) C_NI,
  2601. max(case when a.HEATNO = u.GYCODE then decode(u.itemcode,'Mo',u.stdmin,'') end) over(partition by a.HEATNO) C_MO,
  2602. max(case when a.HEATNO = u.GYCODE then decode(u.itemcode,'Cu',u.stdmin,'') end) over(partition by a.HEATNO) C_CU,
  2603. max(case when a.HEATNO = u.GYCODE then decode(u.itemcode,'Als',u.stdmin,'') end) over(partition by a.HEATNO) C_ALS,
  2604. max(case when a.HEATNO = u.GYCODE then decode(u.itemcode,'Alt',u.stdmin,'') end) over(partition by a.HEATNO) C_ALT,
  2605. --内控上限化学成分
  2606. max(case when a.HEATNO = u.GYCODE then decode(u.itemcode,'C',u.stdmax,'') end) over(partition by a.HEATNO) S_C,
  2607. max(case when a.HEATNO = u.GYCODE then decode(u.itemcode,'Mn',u.stdmax,'') end) over(partition by a.HEATNO) S_MN,
  2608. max(case when a.HEATNO = u.GYCODE then decode(u.itemcode,'S',u.stdmax,'') end) over(partition by a.HEATNO) S_S,
  2609. max(case when a.HEATNO = u.GYCODE then decode(u.itemcode,'P',u.stdmax,'') end) over(partition by a.HEATNO) S_P,
  2610. max(case when a.HEATNO = u.GYCODE then decode(u.itemcode,'Si',u.stdmax,'') end) over(partition by a.HEATNO) S_SI,
  2611. max(case when a.HEATNO = u.GYCODE then decode(u.itemcode,'V',u.stdmax,'') end) over(partition by a.HEATNO) S_V,
  2612. max(case when a.HEATNO = u.GYCODE then decode(u.itemcode,'Ti',u.stdmax,'') end) over(partition by a.HEATNO) S_TI,
  2613. max(case when a.HEATNO = u.GYCODE then decode(u.itemcode,'Nb',u.stdmax,'') end) over(partition by a.HEATNO) S_NB,
  2614. max(case when a.HEATNO = u.GYCODE then decode(u.itemcode,'Cr',u.stdmax,'') end) over(partition by a.HEATNO) S_CR,
  2615. max(case when a.HEATNO = u.GYCODE then decode(u.itemcode,'Ni',u.stdmax,'') end) over(partition by a.HEATNO) S_NI,
  2616. max(case when a.HEATNO = u.GYCODE then decode(u.itemcode,'Mo',u.stdmax,'') end) over(partition by a.HEATNO) S_MO,
  2617. max(case when a.HEATNO = u.GYCODE then decode(u.itemcode,'Cu',u.stdmax,'') end) over(partition by a.HEATNO) S_CU,
  2618. max(case when a.HEATNO = u.GYCODE then decode(u.itemcode,'Als',u.stdmax,'') end) over(partition by a.HEATNO) S_ALS,
  2619. max(case when a.HEATNO = u.GYCODE then decode(u.itemcode,'Alt',u.stdmax,'') end) over(partition by a.HEATNO) S_ALT
  2620. from (select *
  2621. from stl_LFS_OPTINFO
  2622. where $
  2623. union
  2624. select * from J#stl_LFS_OPTINFO where $) a,
  2625. (select t.charge_no,t.judge_stl_grd,decode(t.judge_stl_grd,'','否','是') FLAG from stl_judge_result t) p,
  2626. (select y.*
  2627. from (select x.*,
  2628. count(1) over(partition by x.HEATNO) cnt,
  2629. row_number() over(partition by x.HEATNO order by x.ASSAYTYPECODE desc) xh
  2630. from (select *
  2631. from stl_CHEMELEMENT
  2632. where (upper(SUBSTR(CHECKNO, 12, 1)) = 'E'
  2633. or upper(SUBSTR(CHECKNO, 12, 2)) = 'GP')
  2634. and upper(SUBSTR(CHECKNO, -1)) = 'S'
  2635. and $
  2636. union
  2637. select t.*
  2638. from j#stl_CHEMELEMENT t
  2639. where (upper(SUBSTR(CHECKNO, 12, 1)) = 'E'
  2640. or upper(SUBSTR(CHECKNO, 12, 2)) = 'GP')
  2641. and upper(SUBSTR(CHECKNO, -1)) = 'S'
  2642. and $ ) x) y
  2643. where y.xh = y.cnt) w,
  2644. (select t.itemcode,t.stdmin,t.stdmax,s.gycode from com_standard_chem t,com_sortcode_chem s where t.cic=s.cic and s.stdstyle='1') u
  2645. where a.HEATNO = w.HEATNO(+)
  2646. and a.HEATNO = u.GYCODE(+)
  2647. and a.HEATNO = p.charge_no(+)
  2648. order by to_char(a.OPTDATE, 'yyyy-MM-dd')
  2649. ]]>
  2650. </query>
  2651. <query id="reportVDElement.Query" desc="VD炉成分报表查询" fetchSize="10">
  2652. <![CDATA[
  2653. select distinct to_char(a.OPTDATE, 'yyyy-MM-dd') OPTDATE,--日期
  2654. decode(a.SHIFTCODE,'11','甲白','12','乙白','13','丙白','14','丁白','21','甲中','22','乙中','23','丙中','24','丁中','31','甲夜','32','乙夜','33','丙夜','34','丁夜')SHIFTCODE ,--班组
  2655. a.HEATNO HEATNO, --炉号
  2656. a.PLANSTEEL PLANSTEEL,--钢种
  2657. w.CEQ, --碳当量
  2658. p.FLAG FLAG, --是否改判
  2659. --CP化学成分
  2660. max(case when a.HEATNO = w.HEATNO and w.xh = w.cnt then w.C end) over(partition by a.HEATNO) Y_C,
  2661. max(case when a.HEATNO = w.HEATNO and w.xh = w.cnt then w.MN end) over(partition by a.HEATNO) Y_MN,
  2662. max(case when a.HEATNO = w.HEATNO and w.xh = w.cnt then w.S end) over(partition by a.HEATNO) Y_S,
  2663. max(case when a.HEATNO = w.HEATNO and w.xh = w.cnt then w.P end) over(partition by a.HEATNO) Y_P,
  2664. max(case when a.HEATNO = w.HEATNO and w.xh = w.cnt then w.SI end) over(partition by a.HEATNO) Y_SI,
  2665. max(case when a.HEATNO = w.HEATNO and w.xh = w.cnt then w.V end) over(partition by a.HEATNO) Y_V,
  2666. max(case when a.HEATNO = w.HEATNO and w.xh = w.cnt then w.TI end) over(partition by a.HEATNO) Y_TI,
  2667. max(case when a.HEATNO = w.HEATNO and w.xh = w.cnt then w.NB end) over(partition by a.HEATNO) Y_NB,
  2668. max(case when a.HEATNO = w.HEATNO and w.xh = w.cnt then w.CR end) over(partition by a.HEATNO) Y_CR,
  2669. max(case when a.HEATNO = w.HEATNO and w.xh = w.cnt then w.NI end) over(partition by a.HEATNO) Y_NI,
  2670. max(case when a.HEATNO = w.HEATNO and w.xh = w.cnt then w.MO end) over(partition by a.HEATNO) Y_MO,
  2671. max(case when a.HEATNO = w.HEATNO and w.xh = w.cnt then w.CU end) over(partition by a.HEATNO) Y_CU,
  2672. max(case when a.HEATNO = w.HEATNO and w.xh = w.cnt then w.ALS end) over(partition by a.HEATNO) Y_ALS,
  2673. max(case when a.HEATNO = w.HEATNO and w.xh = w.cnt then w.ALT end) over(partition by a.HEATNO) Y_ALT,
  2674. --内控下限化学成分
  2675. max(case when a.HEATNO = u.GYCODE then decode(u.itemcode,'C',u.stdmin,'') end) over(partition by a.HEATNO) C_C,
  2676. max(case when a.HEATNO = u.GYCODE then decode(u.itemcode,'Mn',u.stdmin,'') end) over(partition by a.HEATNO) C_MN,
  2677. max(case when a.HEATNO = u.GYCODE then decode(u.itemcode,'S',u.stdmin,'') end) over(partition by a.HEATNO) C_S,
  2678. max(case when a.HEATNO = u.GYCODE then decode(u.itemcode,'P',u.stdmin,'') end) over(partition by a.HEATNO) C_P,
  2679. max(case when a.HEATNO = u.GYCODE then decode(u.itemcode,'Si',u.stdmin,'') end) over(partition by a.HEATNO) C_SI,
  2680. max(case when a.HEATNO = u.GYCODE then decode(u.itemcode,'V',u.stdmin,'') end) over(partition by a.HEATNO) C_V,
  2681. max(case when a.HEATNO = u.GYCODE then decode(u.itemcode,'Ti',u.stdmin,'') end) over(partition by a.HEATNO) C_TI,
  2682. max(case when a.HEATNO = u.GYCODE then decode(u.itemcode,'Nb',u.stdmin,'') end) over(partition by a.HEATNO) C_NB,
  2683. max(case when a.HEATNO = u.GYCODE then decode(u.itemcode,'Cr',u.stdmin,'') end) over(partition by a.HEATNO) C_CR,
  2684. max(case when a.HEATNO = u.GYCODE then decode(u.itemcode,'Ni',u.stdmin,'') end) over(partition by a.HEATNO) C_NI,
  2685. max(case when a.HEATNO = u.GYCODE then decode(u.itemcode,'Mo',u.stdmin,'') end) over(partition by a.HEATNO) C_MO,
  2686. max(case when a.HEATNO = u.GYCODE then decode(u.itemcode,'Cu',u.stdmin,'') end) over(partition by a.HEATNO) C_CU,
  2687. max(case when a.HEATNO = u.GYCODE then decode(u.itemcode,'Als',u.stdmin,'') end) over(partition by a.HEATNO) C_ALS,
  2688. max(case when a.HEATNO = u.GYCODE then decode(u.itemcode,'Alt',u.stdmin,'') end) over(partition by a.HEATNO) C_ALT,
  2689. --内控上限化学成分
  2690. max(case when a.HEATNO = u.GYCODE then decode(u.itemcode,'C',u.stdmax,'') end) over(partition by a.HEATNO) S_C,
  2691. max(case when a.HEATNO = u.GYCODE then decode(u.itemcode,'Mn',u.stdmax,'') end) over(partition by a.HEATNO) S_MN,
  2692. max(case when a.HEATNO = u.GYCODE then decode(u.itemcode,'S',u.stdmax,'') end) over(partition by a.HEATNO) S_S,
  2693. max(case when a.HEATNO = u.GYCODE then decode(u.itemcode,'P',u.stdmax,'') end) over(partition by a.HEATNO) S_P,
  2694. max(case when a.HEATNO = u.GYCODE then decode(u.itemcode,'Si',u.stdmax,'') end) over(partition by a.HEATNO) S_SI,
  2695. max(case when a.HEATNO = u.GYCODE then decode(u.itemcode,'V',u.stdmax,'') end) over(partition by a.HEATNO) S_V,
  2696. max(case when a.HEATNO = u.GYCODE then decode(u.itemcode,'Ti',u.stdmax,'') end) over(partition by a.HEATNO) S_TI,
  2697. max(case when a.HEATNO = u.GYCODE then decode(u.itemcode,'Nb',u.stdmax,'') end) over(partition by a.HEATNO) S_NB,
  2698. max(case when a.HEATNO = u.GYCODE then decode(u.itemcode,'Cr',u.stdmax,'') end) over(partition by a.HEATNO) S_CR,
  2699. max(case when a.HEATNO = u.GYCODE then decode(u.itemcode,'Ni',u.stdmax,'') end) over(partition by a.HEATNO) S_NI,
  2700. max(case when a.HEATNO = u.GYCODE then decode(u.itemcode,'Mo',u.stdmax,'') end) over(partition by a.HEATNO) S_MO,
  2701. max(case when a.HEATNO = u.GYCODE then decode(u.itemcode,'Cu',u.stdmax,'') end) over(partition by a.HEATNO) S_CU,
  2702. max(case when a.HEATNO = u.GYCODE then decode(u.itemcode,'Als',u.stdmax,'') end) over(partition by a.HEATNO) S_ALS,
  2703. max(case when a.HEATNO = u.GYCODE then decode(u.itemcode,'Alt',u.stdmax,'') end) over(partition by a.HEATNO) S_ALT
  2704. from (select *
  2705. from stl_vds_optinfo
  2706. where $
  2707. union
  2708. select * from J#stl_vds_optinfo where $) a,
  2709. (select t.charge_no,t.judge_stl_grd,decode(t.judge_stl_grd,'','否','是') FLAG from stl_judge_result t) p,
  2710. (select y.*
  2711. from (select x.*,
  2712. count(1) over(partition by x.HEATNO) cnt,
  2713. row_number() over(partition by x.HEATNO order by x.ASSAYTYPECODE desc) xh
  2714. from (select *
  2715. from stl_CHEMELEMENT
  2716. where (upper(SUBSTR(CHECKNO, 12, 1)) = 'I'
  2717. or upper(SUBSTR(CHECKNO, 12, 2)) = 'GP')
  2718. and upper(SUBSTR(CHECKNO, -1)) = 'S'
  2719. and $
  2720. union
  2721. select t.*
  2722. from j#stl_CHEMELEMENT t
  2723. where (upper(SUBSTR(CHECKNO, 12, 1)) = 'I'
  2724. or upper(SUBSTR(CHECKNO, 12, 2)) = 'GP')
  2725. and upper(SUBSTR(CHECKNO, -1)) = 'S'
  2726. and $ ) x) y
  2727. where y.xh = y.cnt) w,
  2728. (select t.itemcode,t.stdmin,t.stdmax,s.gycode from com_standard_chem t,com_sortcode_chem s where t.cic=s.cic and s.stdstyle='1') u
  2729. where a.HEATNO = w.HEATNO(+)
  2730. and a.HEATNO = u.GYCODE(+)
  2731. and a.HEATNO = p.charge_no(+)
  2732. order by to_char(a.OPTDATE, 'yyyy-MM-dd')
  2733. ]]>
  2734. </query>
  2735. <query id="reportLFSMetal.Query" desc="LF炉合金加入报表查询" fetchSize="10">
  2736. <![CDATA[
  2737. select distinct v.heatprocessno, --加热处理号
  2738. v.OPTDATE, --日期
  2739. decode(v.SHIFTCODE,'11','甲白','12','乙白','13','丙白','14','丁白','21','甲中','22','乙中','23','丙中','24','丁中','31','甲夜','32','乙夜','33','丙夜','34','丁夜')SHIFTCODE ,--班组
  2740. v.HEATNO, --炉号
  2741. v.PLANSTEEL STEEL,--钢种
  2742. v.STATIONCODE, --设备号
  2743. substr(v.stationcode,3,1) ||'#'||
  2744. decode(substr(v.STATIONCODE, 1, 1), 'C','转炉',
  2745. decode(substr(v.STATIONCODE, 1, 1), 'D','吹氩站',
  2746. decode(substr(v.STATIONCODE, 1, 1), 'E','精炼炉',
  2747. decode(substr(v.STATIONCODE, 1, 1), 'F','RH炉',
  2748. decode(substr(v.STATIONCODE, 1, 1), 'B','脱硫',''))))) wsid,
  2749. d.materielname, --物料名
  2750. v.MATERIELCODE vCODE, --LF物料编码
  2751. v.MATERIELTYPE vTYPE, --LF物料类型
  2752. round(v.JMWGT,2) vJMWGT,--LF加料重量(Kg)
  2753. w.MATERIELCODE wCODE, --BF物料编码
  2754. w.MATERIELTYPE wTYPE, --BF物料类型
  2755. round(w.JMWGT,2) wJMWGT --BF加料重量(Kg)
  2756. from
  2757. (select * from com_materiel) d,
  2758. (select distinct a.heatprocessno,
  2759. a.heatno,
  2760. a.optdate,
  2761. a.PLANSTEEL,
  2762. b.STATIONCODE,
  2763. a.wsid,
  2764. a.SHIFTCODE,
  2765. b.MATERIELCODE,
  2766. b.MATERIELTYPE,
  2767. round(sum(nvl(b.JMWGT,0)) over (partition by b.HEATNO, b.STATIONCODE, b.DISPOSALTIME, b.MATERIELTYPE, b.MATERIELCODE),2) JMWGT
  2768. from (select * from STL_LFS_Optinfo union select * from J#STL_LFS_Optinfo ) a, stl_additives b where a.heatno =b.heatno and 'E'|| a.stationcode = b.stationcode and a.disposaltime = b.disposaltime $ and b.MATERIELTYPE='HJ'
  2769. )v ,
  2770. (select distinct a.heatprocessno,
  2771. a.heatno,
  2772. a.optdate,
  2773. a.PLANSTEEL,
  2774. b.STATIONCODE,
  2775. a.wsid,
  2776. a.SHIFTCODE,
  2777. b.MATERIELCODE,
  2778. b.MATERIELTYPE,
  2779. round(sum(nvl(b.JMWGT,0)) over (partition by b.HEATNO, b.STATIONCODE, b.DISPOSALTIME, b.MATERIELTYPE, b.MATERIELCODE),2) JMWGT
  2780. from (select * from STL_LFS_Optinfo union select * from J#STL_LFS_Optinfo) a,stl_additives b where a.heatno =b.heatno and substr(b.stationcode, 1, 1) = 'C' $ and b.materieltype='HJ') w
  2781. where d.materielcode (+)= v.materielcode
  2782. --and d.materielcode = w.materielcode (+)
  2783. and v.heatno = w.heatno
  2784. order by v.heatprocessno desc
  2785. ]]>
  2786. </query>
  2787. <query id="reportLFS_Metal_Load.select" desc="获取LF炉合金 初始化物料信息列名" fetchSize="10">
  2788. <![CDATA[
  2789. select distinct (a.materielcode) materielcode,
  2790. a.MATERIELTYPE,
  2791. b.materielforshort
  2792. from stl_additives a, com_materiel b
  2793. where a.materielcode = b.materielcode
  2794. and b.MATERIELTYPE= ? and to_char(a.updatetime, 'yyyy-MM-dd')
  2795. between ? and ?
  2796. ]]>
  2797. </query>
  2798. <query id="reportVDSMetal.Query" desc="VD炉合金加入报表查询" fetchSize="10">
  2799. <![CDATA[
  2800. select v.heatprocessno, --加热处理号
  2801. v.OPTDATE, --日期
  2802. decode(v.SHIFTCODE,'11','甲白','12','乙白','13','丙白','14','丁白','21','甲中','22','乙中','23','丙中','24','丁中','31','甲夜','32','乙夜','33','丙夜','34','丁夜')SHIFTCODE ,--班组
  2803. v.HEATNO, --炉号
  2804. v.PLANSTEEL STEEL,--钢种
  2805. v.STATIONCODE, --设备号
  2806. substr(v.stationcode,3,1) ||'#'||
  2807. decode(substr(v.STATIONCODE, 1, 1), 'C','转炉',
  2808. decode(substr(v.STATIONCODE, 1, 1), 'D','吹氩站',
  2809. decode(substr(v.STATIONCODE, 1, 1), 'E','精炼炉',
  2810. decode(substr(v.STATIONCODE, 1, 1), 'F','RH炉',
  2811. decode(substr(v.STATIONCODE, 1, 1), 'B','脱硫',''))))) wsid,
  2812. v.MATERIELCODE, --物料编码
  2813. d.materielname, --物料名
  2814. v.MATERIELTYPE, --物料类型
  2815. round(v.JMWGT,2) JMWGT --加料重量(Kg)
  2816. from
  2817. (select * from com_materiel) d,
  2818. (select distinct a.heatprocessno,
  2819. a.heatno,
  2820. a.optdate,
  2821. a.PLANSTEEL,
  2822. b.STATIONCODE,
  2823. a.wsid,
  2824. a.SHIFTCODE,
  2825. b.MATERIELCODE,
  2826. b.MATERIELTYPE,
  2827. round(sum(nvl(b.JMWGT,0)) over (partition by b.HEATNO, b.STATIONCODE, b.DISPOSALTIME, b.MATERIELTYPE, b.MATERIELCODE),2) JMWGT
  2828. from (select * from STL_VDS_Optinfo union select * from J#STL_VDS_Optinfo ) a, stl_additives b
  2829. where a.heatno =b.heatno and 'I'|| a.stationcode = b.stationcode and a.disposaltime = b.disposaltime $ and b.MATERIELTYPE='HJ') v
  2830. where d.materielcode (+)= v.materielcode order by v.heatprocessno desc
  2831. ]]>
  2832. </query>
  2833. <query id="reportVDS_Metal_Load.select" desc="获取VD炉合金初始化物料信息列名" fetchSize="10">
  2834. <![CDATA[
  2835. select distinct (a.materielcode) materielcode,
  2836. a.MATERIELTYPE,
  2837. b.materielforshort
  2838. from stl_additives a, com_materiel b
  2839. where a.materielcode = b.materielcode
  2840. and b.MATERIELTYPE= ? and to_char(a.updatetime, 'yyyy-MM-dd')
  2841. between ? and ?
  2842. ]]>
  2843. </query>
  2844. <query id="reportBOF.Query" desc="转炉生产日报统计表--所有炉号查询" fetchSize="10">
  2845. <![CDATA[
  2846. select A.HEATNO, --炉号
  2847. A.station STATIONCODE, --岗位编码
  2848. nvl(round(B.CPL, 3), 0) CPL, --合格铸坯量(T)
  2849. case
  2850. when (nvl(A.PFBALEWGT, 0) - nvl(A.BALELEAVEWGT, 0)) > 0 then
  2851. round((nvl(A.PFBALEWGT, 0) - nvl(A.BALELEAVEWGT, 0)), 3)
  2852. else
  2853. 0
  2854. end GSL, --GSL(合格钢水量) = (上台大包重量-下台大包重量)
  2855. (select substr(mes_lg_common.getlgshift1(A.RecFlag), 2, 1) from dual) SHIFTCODE,--班组
  2856. case
  2857. when to_char(A.RecFlag, 'yyyy-MM-dd HH24:mi') between ? and ? then
  2858. '1'
  2859. else
  2860. '0'
  2861. end BECURR --1#吹开始时刻(操作时间)
  2862. from (select *
  2863. from (select t.*,
  2864. row_number() over(partition by HEATNO order by RecFlag) XH
  2865. from (select t.recflag,station, t2.*
  2866. from (select t.heatno,
  2867. case
  2868. when B1STARTTIME is not null then
  2869. B1STARTTIME
  2870. else
  2871. OPTDATE
  2872. end RecFlag,t.stationcode station
  2873. from STL_bof_optinfo t
  2874. where to_char(case when
  2875. B1STARTTIME is not null then
  2876. B1STARTTIME else OPTDATE end,
  2877. 'yyyy-MM-dd') between ? and ?
  2878. union all
  2879. select t.heatno,
  2880. case
  2881. when B1STARTTIME is not null then
  2882. B1STARTTIME
  2883. else
  2884. OPTDATE
  2885. end RecFlag,t.stationcode station
  2886. from J#STL_bof_optinfo t
  2887. where to_char(case when
  2888. B1STARTTIME is not null then
  2889. B1STARTTIME else OPTDATE end,
  2890. 'yyyy-MM-dd') between ? and ?) t,
  2891. (select *
  2892. from STL_ccm_optinfo
  2893. union
  2894. select * from J#STL_Ccm_Optinfo) t2
  2895. where t.heatno = t2.heatno) t)
  2896. where XH = 1) A,
  2897. (select distinct substr(CHARGE_NO, 1, 10) HEATNO,
  2898. sum(nvl(SLAB_WGT, 0)) over(partition by substr(CHARGE_NO, 1, 10)) CPL
  2899. from (select CHARGE_NO, (SLAB_WGT/1000) SLAB_WGT --合格铸坯量(T)
  2900. from stl_incision_view
  2901. where to_char(to_date(substr(SLAB_CUT_DTIME,1,8),'yyyy-MM-dd hh24:mi:ss'),'yyyy-MM-dd') between ? and ?
  2902. ) t) B
  2903. where A.HEATNO = B.HEATNO(+)
  2904. ]]>
  2905. </query>
  2906. <query id="proc_GetBOFInfo.Query" desc="转炉生产日报统计表--转炉信息查询" fetchSize="10">
  2907. <![CDATA[
  2908. select distinct b.HEATNO, --炉号
  2909. b.STATIONCODE, --岗位编号
  2910. substr(b.SHIFTCODE, 2, 1) SHIFTCODE,--班组(甲、乙、丙、丁)
  2911. nvl(b.IRONPOTWGT, 0) TSL, --装入铁水量
  2912. nvl(b.PIGIRONWGT, 0) STL, --装入生铁量(T)
  2913. nvl(b.WSTEELWGT, 0) FGL, --装入废钢量(T)
  2914. nvl(b.RSWGT, 0) HLL, --回炉重量(T)
  2915. nvl(h.jmwgt,0) HJL, --加入合金量(Kg)
  2916. to_char(b.CHANGESTARTTIME,'yyyy-mm-dd hh24:mi:ss') starttime, --兑铁开始时刻
  2917. to_char(b.TAPPINGENDTIME,'yyyy-mm-dd hh24:mi:ss') endtime, --出钢结束时刻
  2918. nvl((b.TAPPINGENDTIME-b.CHANGESTARTTIME )*24*60,0) time, --作业时间(min)
  2919. case
  2920. when to_char(RecFlag, 'yyyy-MM-dd HH24:mi') between ? and ? then
  2921. '1'
  2922. else
  2923. '0'
  2924. end BECURR --1#吹开始时刻(操作时间)
  2925. from (select *
  2926. from (select t.*,
  2927. row_number() over(partition by t.HEATNO order by t.RecFlag) XH
  2928. from (select t.*,
  2929. case
  2930. when B1STARTTIME is not null then
  2931. B1STARTTIME
  2932. else
  2933. OPTDATE
  2934. end RecFlag
  2935. from STL_BOF_OPTINFO t
  2936. where to_char(case when B1STARTTIME is not null then
  2937. B1STARTTIME else OPTDATE end,
  2938. 'yyyy-MM-dd') between ? and ?
  2939. union all
  2940. select t.*,
  2941. case
  2942. when B1STARTTIME is not null then
  2943. B1STARTTIME
  2944. else
  2945. OPTDATE
  2946. end RecFlag
  2947. from J#STL_BOF_OPTINFO t
  2948. where to_char(case when B1STARTTIME is not null then
  2949. B1STARTTIME else OPTDATE end,
  2950. 'yyyy-MM-dd') between ? and ?) t) v where XH = 1) b,
  2951. (select distinct s.heatno,
  2952. sum(s.jmwgt) over(partition by s.heatno order by s.heatno) jmwgt,
  2953. s.materieltype,
  2954. substr(s.stationcode, 2, 2) code
  2955. from stl_additives s
  2956. where s.materieltype = 'HJ'
  2957. and substr(s.stationcode, 1, 1) = 'C'
  2958. union
  2959. select distinct s.heatno,
  2960. sum(s.jmwgt) over(partition by s.heatno order by s.heatno) jmwgt,
  2961. s.materieltype,
  2962. substr(s.stationcode, 2, 2) code
  2963. from j#stl_additives s
  2964. where s.materieltype = 'HJ'
  2965. and substr(s.stationcode, 1, 1) = 'C') h
  2966. where b.heatno = h.heatno(+) order by b.heatno
  2967. ]]>
  2968. </query>
  2969. <query id="proc_GetBOFInfo_RHS.Query" desc="转炉生产日报统计表--经过RH炉的转炉信息查询" fetchSize="10">
  2970. <![CDATA[
  2971. select distinct p.heatno, --炉号
  2972. s.stationcode, --岗位编号
  2973. substr(s.SHIFTCODE, 2, 1) SHIFTCODE, --班组(甲、乙、丙、丁)
  2974. p.FACT_ROUTE, --实绩工艺路线
  2975. case
  2976. when to_char(RecFlag, 'yyyy-MM-dd HH24:mi') between ? and ? then
  2977. '1'
  2978. else
  2979. '0'
  2980. end BECURR --1#吹开始时刻(操作时间)
  2981. from (select p.FACT_ROUTE,p.heatno
  2982. from PPC_STEEL_HEAT p
  2983. union
  2984. select p.FACT_ROUTE,p.heatno
  2985. from j#PPC_STEEL_HEAT p
  2986. ) p,
  2987. (select *
  2988. from (select t.*,
  2989. row_number() over(partition by t.HEATNO order by t.RecFlag) XH
  2990. from (select t.*,
  2991. case
  2992. when B1STARTTIME is not null then
  2993. B1STARTTIME
  2994. else
  2995. OPTDATE
  2996. end RecFlag
  2997. from STL_BOF_OPTINFO t
  2998. where to_char(case when B1STARTTIME is not null then
  2999. B1STARTTIME else OPTDATE end,
  3000. 'yyyy-MM-dd') between ? and ?
  3001. union all
  3002. select t.*,
  3003. case
  3004. when B1STARTTIME is not null then
  3005. B1STARTTIME
  3006. else
  3007. OPTDATE
  3008. end RecFlag
  3009. from J#STL_BOF_OPTINFO t
  3010. where to_char(case when B1STARTTIME is not null then
  3011. B1STARTTIME else OPTDATE end,
  3012. 'yyyy-MM-dd') between ? and ?) t) v where XH = 1) s
  3013. where substr(p.FACT_ROUTE, 11, 2) = 'F1'
  3014. and s.HEATNO = p.HEATNO(+)
  3015. order by heatno
  3016. ]]>
  3017. </query>
  3018. <query id="GetreportEAFOggData.Query" desc="获取电炉原始记录数据" fetchSize="10">
  3019. <![CDATA[
  3020. select distinct t.HEATNO, --炉号
  3021. t4.aim_grade_code PLANSTEEL, --目标钢号
  3022. t.STATIONCODE, --岗位编号
  3023. t.SAGE, --炉龄
  3024. t.GAGE, --枪龄
  3025. t.O2CONSUME, --供氧耗量
  3026. t.PIGIRONWGT, --装入生铁量
  3027. t.POTWRAPSTATE, --大包包况
  3028. t.SCRAPWGT, --装入废钢量
  3029. t.CHANGESTARTTIME,--兑铁兑钢开始时刻
  3030. t.OPENOXYGENTIME, --开氧时刻
  3031. t.MOLSTLTEMPERATURE,--钢水温度
  3032. t.TERMINUSC, --终点定碳
  3033. t.TERMINUSO2, --终点定氧
  3034. t.MOLSTLTEMPERATURE,--钢水温度
  3035. t.O2PRESS, --氧气压力
  3036. to_char(t.CHANGESTARTTIME, 'HH24:mi') CHANGESTARTTIME, --兑铁兑钢开始时刻
  3037. to_char(t.OPENOXYGENTIME, 'HH24:mi') OPENOXYGENTIME, --开氧时刻
  3038. FLOOR(nvl(t.SUPPLYOXYGENTIME / 60, 0)) SUPPLYOXYGENTIME,--供氧时间
  3039. t.supplyoxygentime SUPPLYOXYGENTIME_S,
  3040. t.TERMINUSTEPT TAPPINGTEMPERATURE, --终点温度
  3041. t.TAPPINGTIME, --出钢时间
  3042. to_char(t.TAPPINGSTARTTIME, 'HH24:mi') TAPPINGSTARTTIME,--出钢开始时刻
  3043. max(case
  3044. when t.HEATNO = t2.HEATNO and t2.xh = t2.cnt then
  3045. t2.C
  3046. end) over(partition by t.HEATNO) F_C,
  3047. max(case
  3048. when t.HEATNO = t2.HEATNO and t2.xh = t2.cnt then
  3049. t2.Mn
  3050. end) over(partition by t.HEATNO) F_MN,
  3051. max(case
  3052. when t.HEATNO = t2.HEATNO and t2.xh = t2.cnt then
  3053. t2.Si
  3054. end) over(partition by t.HEATNO) F_SI,
  3055. max(case
  3056. when t.HEATNO = t2.HEATNO and t2.xh = t2.cnt then
  3057. t2.S
  3058. end) over(partition by t.HEATNO) F_S,
  3059. max(case
  3060. when t.HEATNO = t2.HEATNO and t2.xh = t2.cnt then
  3061. t2.P
  3062. end) over(partition by t.HEATNO) F_P,
  3063. max(case
  3064. when t.HEATNO = t2.HEATNO and t2.xh = t2.cnt then
  3065. t2.Als
  3066. end) over(partition by t.HEATNO) F_ALS,
  3067. max(case
  3068. when t.HEATNO = t3.HEATNO and t3.xh = t3.cnt then
  3069. t3.Mn
  3070. end) over(partition by t.HEATNO) R_MN,
  3071. max(case
  3072. when t.HEATNO = t3.HEATNO and t3.xh = t3.cnt then
  3073. t3.C
  3074. end) over(partition by t.HEATNO) R_C,
  3075. max(case
  3076. when t.HEATNO = t3.HEATNO and t3.xh = t3.cnt then
  3077. t3.P
  3078. end) over(partition by t.HEATNO) R_P,
  3079. max(case
  3080. when t.HEATNO = t3.HEATNO and t3.xh = t3.cnt then
  3081. t3.S
  3082. end) over(partition by t.HEATNO) R_S,
  3083. max(case
  3084. when t.HEATNO = t3.HEATNO and t3.xh = t3.cnt then
  3085. t3.SI
  3086. end) over(partition by t.HEATNO) R_SI,
  3087. max(case
  3088. when t.HEATNO = t9.HEATNO and t9.xh = t9.cnt then
  3089. t9.Mn
  3090. end) over(partition by t.HEATNO) Z_MN,
  3091. max(case
  3092. when t.HEATNO = t9.HEATNO and t9.xh = t9.cnt then
  3093. t9.C
  3094. end) over(partition by t.HEATNO) Z_C,
  3095. max(case
  3096. when t.HEATNO = t9.HEATNO and t9.xh = t9.cnt then
  3097. t9.P
  3098. end) over(partition by t.HEATNO) Z_P,
  3099. max(case
  3100. when t.HEATNO = t9.HEATNO and t9.xh = t9.cnt then
  3101. t9.S
  3102. end) over(partition by t.HEATNO) Z_S,
  3103. max(case
  3104. when t.HEATNO = t9.HEATNO and t9.xh = t9.cnt then
  3105. t9.SI
  3106. end) over(partition by t.HEATNO) Z_SI,
  3107. t4.cast_id CCMNO, --连铸机号
  3108. t.REMARK, --备注
  3109. to_char(t.optdate, 'yyyy-MM-dd') optDisp --操作时间
  3110. from (select * from stl_eaf_optinfo
  3111. where 1 = 1
  3112. and to_char(OPTDATE, 'yyyy-MM-dd') between ? and ?
  3113. and substr(STATIONCODE, 2, 1) =
  3114. decode(?, null, substr(STATIONCODE, 2, 1), ?)
  3115. and UPPER(nvl(PLANSTEEL, 'null')) in
  3116. (decode(?, null, UPPER(nvl(PLANSTEEL, 'null')), ?))
  3117. and substr(SHIFTCODE, 1, 1) =
  3118. decode(?, null, substr(SHIFTCODE, 1, 1), ?)
  3119. and substr(SHIFTCODE, 2, 1) =
  3120. decode(?, null, substr(SHIFTCODE, 2, 1), ?)
  3121. union
  3122. select * from J#stl_eaf_optinfo
  3123. where 1 = 1
  3124. and to_char(OPTDATE, 'yyyy-MM-dd') between ? and ?
  3125. and substr(STATIONCODE, 2, 1) =
  3126. decode(?, null, substr(STATIONCODE, 2, 1), ?)
  3127. and UPPER(nvl(PLANSTEEL, 'null')) in
  3128. (decode(?, null, UPPER(nvl(PLANSTEEL, 'null')), ?))
  3129. and substr(SHIFTCODE, 1, 1) =
  3130. decode(?, null, substr(SHIFTCODE, 1, 1), ?)
  3131. and substr(SHIFTCODE, 2, 1) =
  3132. decode(?, null, substr(SHIFTCODE, 2, 1), ?)
  3133. ) t
  3134. left join (select y.*
  3135. from (select x.*,
  3136. row_number() over(partition by x.HEATNO order by x.ASSAYTYPECODE) xh
  3137. from (select *
  3138. from STL_CHEMELEMENT
  3139. where upper(substr(ASSAYTYPECODE, 1, 1)) = 'A'
  3140. and to_char(ASSAYDATE, 'yyyy-MM-dd') between ? and ?
  3141. union
  3142. select *
  3143. from J#STL_CHEMELEMENT
  3144. where upper(substr(ASSAYTYPECODE, 1, 1)) = 'A'
  3145. and to_char(ASSAYDATE, 'yyyy-MM-dd') between ? and ?
  3146. ) x) y) t1 on t.heatno = t1.heatno
  3147. left join (select y.*
  3148. from (select x.*,
  3149. count(1) over(partition by x.HEATNO) cnt,
  3150. row_number() over(partition by x.HEATNO order by x.ASSAYTYPECODE desc, x.assaydate desc) xh,
  3151. substr(x.assaytypecode, 1, 1) gw
  3152. from (select *
  3153. from STL_CHEMELEMENT
  3154. where to_char(ASSAYDATE, 'yyyy-MM-dd') between ? and ?
  3155. and upper(SUBSTR(CHECKNO, 12, 1)) = 'C'
  3156. and upper(SUBSTR(CHECKNO, -1)) = 'S'
  3157. and upper(SUBSTR(CHECKNO, 13, 1)) = 'P'
  3158. union
  3159. select *
  3160. from J#STL_CHEMELEMENT
  3161. where to_char(ASSAYDATE, 'yyyy-MM-dd') between ? and ?
  3162. and upper(SUBSTR(CHECKNO, 12, 1)) = 'C'
  3163. and upper(SUBSTR(CHECKNO, -1)) = 'S'
  3164. and upper(SUBSTR(CHECKNO, 13, 1)) = 'P') x) y) t2 on t2.heatno = t.heatno
  3165. left join (select y.*
  3166. from (select x.*,
  3167. count(1) over(partition by x.HEATNO) cnt,
  3168. row_number() over(partition by x.HEATNO order by x.ASSAYTYPECODE desc, x.assaydate desc) xh,
  3169. substr(x.assaytypecode, 1, 1) gw
  3170. from (select *
  3171. from STL_CHEMELEMENT
  3172. where to_char(ASSAYDATE, 'yyyy-MM-dd') between ? and ?
  3173. and upper(SUBSTR(CHECKNO, 12, 1)) = 'C'
  3174. and upper(SUBSTR(CHECKNO, -1)) = 'I'
  3175. and upper(SUBSTR(CHECKNO, 13, 1)) <> 'P'
  3176. union
  3177. select *
  3178. from J#STL_CHEMELEMENT
  3179. where to_char(ASSAYDATE, 'yyyy-MM-dd') between ? and ?
  3180. and upper(SUBSTR(CHECKNO, 12, 1)) = 'C'
  3181. and upper(SUBSTR(CHECKNO, -1)) = 'I'
  3182. and upper(SUBSTR(CHECKNO, 13, 1)) <> 'P') x) y) t3 on t3.heatno = t.heatno
  3183. left join (select y.*
  3184. from (select x.*,
  3185. count(1) over(partition by x.HEATNO) cnt,
  3186. row_number() over(partition by x.HEATNO order by x.ASSAYTYPECODE desc, x.assaydate desc) xh,
  3187. substr(x.assaytypecode, 1, 1) gw
  3188. from (select *
  3189. from STL_CHEMELEMENT
  3190. where to_char(ASSAYDATE, 'yyyy-MM-dd') between ? and ?
  3191. and upper(SUBSTR(CHECKNO, 12, 1)) = 'C'
  3192. and upper(SUBSTR(CHECKNO, -1)) = 'S'
  3193. and upper(SUBSTR(CHECKNO, 13, 1)) = 'P'
  3194. union
  3195. select *
  3196. from J#STL_CHEMELEMENT
  3197. where to_char(ASSAYDATE, 'yyyy-MM-dd') between ? and ?
  3198. and upper(SUBSTR(CHECKNO, 12, 1)) = 'C'
  3199. and upper(SUBSTR(CHECKNO, -1)) = 'S'
  3200. and upper(SUBSTR(CHECKNO, 13, 1)) = 'P') x) y) t9 on t9.heatno = t.heatno
  3201. left join (select * from ppc_steel_heat
  3202. union
  3203. select * from J#ppc_steel_heat) t4 on t.heatno = t4.heatno
  3204. /**left join (select *
  3205. from (select misid, C, Si, Mn, P, S, Asn, Cu, Sn, Sb
  3206. from stl_es_taphole
  3207. union
  3208. select misid, C, Si, Mn, P, S, Asn, Cu, Sn, Sb
  3209. from stl_mis_taphole)) t5 on t.MOLIRNSOURCE = t5.misid**/
  3210. left join (select heatno, PFBALEWGT, BALELEAVEWGT, isrs from STL_ccm_optinfo
  3211. union --PFBALEWGT上台大包重量 BALELEAVEWGT下台大包重量 isrs是否回炉
  3212. select heatno, PFBALEWGT, BALELEAVEWGT, isrs from J#STL_ccm_optinfo) t6 on t.heatno = t6.heatno
  3213. left join (select heatno, ARFTEMPT, ARBTEMPT from STL_cas_optinfo
  3214. union --ARFTEMPT氩前温度 ARFTEMPT氩后温度
  3215. select heatno, ARFTEMPT, ARBTEMPT from J#STL_cas_optinfo) t7 on t.heatno = t7.heatno
  3216. left join (select heatno, isrs from STL_lfs_optinfo
  3217. union --isrs是否回炉
  3218. select heatno, isrs from J#STL_lfs_optinfo) t8 on t.heatno = t8.heatno
  3219. order by optDisp
  3220. ]]>
  3221. </query>
  3222. <query id="EafData_FLHJ.Query" desc="炼钢生产报表--取电炉辅料合金数据" fetchSize="10">
  3223. <![CDATA[
  3224. Select t.heatno,
  3225. t.STATIONCODE,
  3226. t.DISPOSALTIME,
  3227. t1.materielcode,
  3228. t1.materieltype,
  3229. t2.materielname,
  3230. round(sum(nvl(t1.JMWGT, 0)) over(partition by t1.HEATNO,
  3231. t1.STATIONCODE,
  3232. t1.DISPOSALTIME,
  3233. t1.MATERIELTYPE,
  3234. t1.MATERIELCODE)) materielWgt
  3235. from (select *
  3236. from stl_eaf_optinfo
  3237. where 1 = 1 $
  3238. union
  3239. select * from J#stl_eaf_optinfo where 1 = 1 $ ) t
  3240. left join stl_additives t1 on t.heatno = t1.heatno
  3241. and 'A' || t.stationcode = t1.stationcode
  3242. and t.disposaltime = t1.disposaltime
  3243. left join com_materiel t2 on t1.materielcode = t2.materielcode
  3244. order by t.STATIONCODE, t.HEATNO
  3245. ]]>
  3246. </query>
  3247. <query id="reportAll.Select" desc="各工序炉号、岗位、班次、钢种、日期记录查询" fetchSize="10">
  3248. <![CDATA[
  3249. select A.HEATNO,
  3250. A.STATIONCODE,
  3251. B.FACT_ROUTE,
  3252. substr(A.SHIFTCODE, 2, 1) SHIFTCODE,
  3253. case
  3254. when B.AIM_GRADE_CODE is null then
  3255. B.AIM_GRADE_CODE
  3256. else
  3257. B.AIM_GRADE_CODE
  3258. end PLANSTEEL,
  3259. case
  3260. when $ then
  3261. '1'
  3262. else
  3263. '0'
  3264. end BECURR
  3265. from (select *
  3266. from (select t.*,
  3267. row_number() over(partition by t.HEATNO order by t.OPTDATE) XH
  3268. from (select *
  3269. from $ t
  3270. where $
  3271. union all
  3272. select * from J#$ t where $) t
  3273. )
  3274. where XH = 1) A,
  3275. (select HEATNO, AIM_GRADE_CODE,FACT_ROUTE
  3276. from (select t.*,
  3277. row_number() over(partition by t.HEATNO order by V_HEAT_ID desc) XH
  3278. from ppc_steel_heat t
  3279. where t.HEATNO is not null
  3280. and $)
  3281. where XH = 1) B
  3282. where A.HEATNO = B.HEATNO(+)
  3283. ]]>
  3284. </query>
  3285. <query id="reportStl_Chemelement.Select" desc="查询对应炉号化学检验表值记录" fetchSize="10">
  3286. <![CDATA[
  3287. select *
  3288. from (select t.*,
  3289. row_number() over(partition by t.heatno order by t.assaydate desc) XH
  3290. from (select *
  3291. from stl_chemelement
  3292. where 1=1 and $
  3293. and (substr(stationcode, 1, 1) = 'G' or
  3294. upper(substr(assaytypecode, 1, 2)) = 'GP')
  3295. union
  3296. select *
  3297. from j#stl_chemelement
  3298. where 1=1 and $
  3299. and (substr(stationcode, 1, 1) = 'G' or
  3300. upper(substr(assaytypecode, 1, 2)) = 'GP')
  3301. ) t
  3302. )
  3303. where XH = 1
  3304. ]]>
  3305. </query>
  3306. <query id="reportScm_Standard_Chem.Select" desc="查询对应炉号化学成份标准记录" fetchSize="10">
  3307. <![CDATA[
  3308. select distinct t1.steel STEELNAME, --牌号
  3309. t.itemcode ELENAME, --描述
  3310. trim(t.stdsign) STDSIGN, --范围符号
  3311. trim(t.stdmin) STDMIN, --最小值
  3312. trim(t.stdmax) STDMAX --最大值
  3313. from com_standard_chem t, com_sortcode_chem t1
  3314. where t.cic = t1.cic
  3315. and t1.stdstyle = '1' --标准內型(1内控 2放行)
  3316. and $ --and t1.STEEL in('','')
  3317. ]]>
  3318. </query>
  3319. <query id="reportFXMZL_Standard_Chem.Select" desc="放行命中率查询对应炉号化学成份标准记录" fetchSize="10">
  3320. <![CDATA[
  3321. select t1.steel STEELNAME, --牌号
  3322. t.itemcode ELENAME, --描述
  3323. trim(t.stdsign) STDSIGN, --范围符号
  3324. trim(t.stdmin) STDMIN, --最小值
  3325. trim(t.stdmax) STDMAX --最大值
  3326. from com_standard_chem t, com_sortcode_chem t1
  3327. where t.cic = t1.cic
  3328. and t1.stdstyle = '2' --标准內型(1内控 2放行)
  3329. and $
  3330. order by t.cic
  3331. ]]>
  3332. </query>
  3333. <query id="reportBOF_Forward.Query" desc="查询转炉炉前铁水信息" fetchSize="10">
  3334. <![CDATA[
  3335. select distinct t.HEATNO, --炉次号
  3336. t.IRONPOTID, --铁水编号
  3337. t4.aim_grade_code PLANSTEEL, --钢种计划
  3338. nvl(t.IRONPOTWGT, '0') IRONPOTWGT,--铁水重量
  3339. t.IRONTEMPERATURE, --铁水温度
  3340. case substr(t.SHIFTCODE, 2, 1) --班组
  3341. when '1' then
  3342. '甲'
  3343. when '2' then
  3344. '乙'
  3345. when '3' then
  3346. '丙'
  3347. when '4' then
  3348. '丁'
  3349. end BB,
  3350. case substr(t.SHIFTCODE, 1, 1) --班次
  3351. when '1' then
  3352. '白'
  3353. when '2' then
  3354. '中'
  3355. when '3' then
  3356. '夜'
  3357. end BC,
  3358. --入炉铁水信息
  3359. max(case
  3360. when t.MOLIRNSOURCE = t10.HEATNO then
  3361. t10.Mn
  3362. end) over(partition by t.MOLIRNSOURCE) R_MN,
  3363. max(case
  3364. when t.MOLIRNSOURCE = t10.HEATNO then
  3365. t10.C
  3366. end) over(partition by t.MOLIRNSOURCE) R_C,
  3367. max(case
  3368. when t.MOLIRNSOURCE = t10.HEATNO then
  3369. t10.P
  3370. end) over(partition by t.MOLIRNSOURCE) R_P,
  3371. max(case
  3372. when t.MOLIRNSOURCE = t10.HEATNO then
  3373. t10.S
  3374. end) over(partition by t.MOLIRNSOURCE) R_S,
  3375. max(case
  3376. when t.MOLIRNSOURCE = t10.HEATNO then
  3377. t10.si
  3378. end) over(partition by t.MOLIRNSOURCE) R_SI,
  3379. --TSO试样
  3380. max(case
  3381. when t.HEATNO = t9.HEATNO and t9.xh = t9.cnt then
  3382. t9.Mn
  3383. end) over(partition by t.HEATNO) Z_MN,
  3384. max(case
  3385. when t.HEATNO = t9.HEATNO and t9.xh = t9.cnt then
  3386. t9.C
  3387. end) over(partition by t.HEATNO) Z_C,
  3388. max(case
  3389. when t.HEATNO = t9.HEATNO and t9.xh = t9.cnt then
  3390. t9.P
  3391. end) over(partition by t.HEATNO) Z_P,
  3392. to_char(t.optdate, 'yyyy-MM-dd hh24:mi') OPTDISP --操作时间
  3393. from (select *
  3394. from STL_bof_optinfo
  3395. where 1 = 1
  3396. and to_char(OPTDATE, 'yyyy-MM-dd hh24:mi:ss') between ? and ?
  3397. and substr(STATIONCODE, 2, 1) =
  3398. decode(?, null, substr(STATIONCODE, 2, 1), ?)
  3399. and UPPER(nvl(PLANSTEEL, 'null')) in
  3400. (decode(?, null, UPPER(nvl(PLANSTEEL, 'null')), ?))
  3401. and substr(SHIFTCODE, 1, 1) =
  3402. decode(?, null, substr(SHIFTCODE, 1, 1), ?)
  3403. and substr(SHIFTCODE, 2, 1) =
  3404. decode(?, null, substr(SHIFTCODE, 2, 1), ?)
  3405. union
  3406. select *
  3407. from J#STL_bof_optinfo
  3408. where 1 = 1
  3409. and to_char(OPTDATE, 'yyyy-MM-dd hh24:mi:ss') between ? and ?
  3410. and substr(STATIONCODE, 2, 1) =
  3411. decode(?, null, substr(STATIONCODE, 2, 1), ?)
  3412. and UPPER(nvl(PLANSTEEL, 'null')) in
  3413. (decode(?, null, UPPER(nvl(PLANSTEEL, 'null')), ?))
  3414. and substr(SHIFTCODE, 1, 1) =
  3415. decode(?, null, substr(SHIFTCODE, 1, 1), ?)
  3416. and substr(SHIFTCODE, 2, 1) =
  3417. decode(?, null, substr(SHIFTCODE, 2, 1), ?)
  3418. ) t
  3419. left join (select y.*
  3420. from (select x.*,
  3421. row_number() over(partition by x.HEATNO order by x.ASSAYTYPECODE) xh
  3422. from (select *
  3423. from STL_CHEMELEMENT
  3424. where upper(substr(ASSAYTYPECODE, 1, 1)) = 'C'
  3425. and to_char(ASSAYDATE, 'yyyy-MM-dd') between ? and ?
  3426. union
  3427. select *
  3428. from J#STL_CHEMELEMENT
  3429. where upper(substr(ASSAYTYPECODE, 1, 1)) = 'C'
  3430. and to_char(ASSAYDATE, 'yyyy-MM-dd') between ? and ?
  3431. ) x) y) t1 on t.heatno = t1.heatno
  3432. left join (select y.*
  3433. from (select x.*,
  3434. count(1) over(partition by x.HEATNO) cnt,
  3435. row_number() over(partition by x.HEATNO order by x.ASSAYTYPECODE asc, x.assaydate asc) xh,
  3436. substr(x.assaytypecode, 1, 1) gw
  3437. from (select *
  3438. from STL_CHEMELEMENT
  3439. where to_char(ASSAYDATE, 'yyyy-MM-dd') between ? and ? and
  3440. upper(SUBSTR(CHECKNO, 12, 1)) = 'C'
  3441. and upper(SUBSTR(CHECKNO, -1)) = 'S'
  3442. union
  3443. select *
  3444. from J#STL_CHEMELEMENT
  3445. where to_char(ASSAYDATE, 'yyyy-MM-dd') between ? and ? and
  3446. upper(SUBSTR(CHECKNO, 12, 1)) = 'C'
  3447. and upper(SUBSTR(CHECKNO, -1)) = 'S') x) y) t9 on t9.heatno = t.heatno
  3448. left join (select *
  3449. from stl_chemelement
  3450. union
  3451. select * from J#stl_chemelement) t10 on t10.heatno = t.MOLIRNSOURCE
  3452. left join (select *
  3453. from ppc_steel_heat
  3454. union
  3455. select * from J#ppc_steel_heat) t4 on t.heatno = t4.heatno
  3456. order by OPTDISP
  3457. ]]>
  3458. </query>
  3459. <query id="reportBOF_Tapp.Query" desc="查询转炉二次取样信息" fetchSize="10">
  3460. <![CDATA[
  3461. select distinct t.HEATNO, --炉号
  3462. t4.aim_grade_code PLANSTEEL, --钢种
  3463. case substr(t.SHIFTCODE, 2, 1)--班组
  3464. when '1' then
  3465. '甲'
  3466. when '2' then
  3467. '乙'
  3468. when '3' then
  3469. '丙'
  3470. when '4' then
  3471. '丁'
  3472. end BB,
  3473. case substr(t.SHIFTCODE, 1, 1)--班次
  3474. when '1' then
  3475. '白'
  3476. when '2' then
  3477. '中'
  3478. when '3' then
  3479. '夜'
  3480. end BC,
  3481. nvl(t.B2TIME,0) B2TIME, --2#吹时间(s)
  3482. nvl(t.B3TIME,0) B3TIME, --3#吹时间(s)
  3483. nvl(t.B4TIME,0) B4TIME, --4#吹时间(s)
  3484. nvl(t.B5TIME,0) B5TIME, --5#吹时间(s)
  3485. --LD2(第二次取样)
  3486. max(case
  3487. when t.HEATNO = t3.HEATNO and t3.xh = t3.cnt then
  3488. t3.Mn
  3489. end) over(partition by t.HEATNO) Z_MN,
  3490. max(case
  3491. when t.HEATNO = t3.HEATNO and t3.xh = t3.cnt then
  3492. t3.C
  3493. end) over(partition by t.HEATNO) Z_C,
  3494. max(case
  3495. when t.HEATNO = t3.HEATNO and t3.xh = t3.cnt then
  3496. t3.P
  3497. end) over(partition by t.HEATNO) Z_P,
  3498. max(case
  3499. when t.HEATNO = t3.HEATNO and t3.xh = t3.cnt then
  3500. t3.S
  3501. end) over(partition by t.HEATNO) Z_S,
  3502. to_char(t.optdate, 'yyyy-MM-dd hh24:mi') OPTDISP --操作时间
  3503. from (select *
  3504. from STL_bof_optinfo
  3505. where 1 = 1
  3506. and to_char(OPTDATE, 'yyyy-MM-dd') between ? and ?
  3507. and substr(STATIONCODE, 2, 1) =
  3508. decode(?, null, substr(STATIONCODE, 2, 1), ?)
  3509. and UPPER(nvl(PLANSTEEL, 'null')) in
  3510. (decode(?, null, UPPER(nvl(PLANSTEEL, 'null')), ?))
  3511. and substr(SHIFTCODE, 1, 1) =
  3512. decode(?, null, substr(SHIFTCODE, 1, 1), ?)
  3513. and substr(SHIFTCODE, 2, 1) =
  3514. decode(?, null, substr(SHIFTCODE, 2, 1), ?)
  3515. union
  3516. select *
  3517. from J#STL_bof_optinfo
  3518. where 1 = 1
  3519. and to_char(OPTDATE, 'yyyy-MM-dd') between ? and ?
  3520. and substr(STATIONCODE, 2, 1) =
  3521. decode(?, null, substr(STATIONCODE, 2, 1), ?)
  3522. and UPPER(nvl(PLANSTEEL, 'null')) in
  3523. (decode(?, null, UPPER(nvl(PLANSTEEL, 'null')), ?))
  3524. and substr(SHIFTCODE, 1, 1) =
  3525. decode(?, null, substr(SHIFTCODE, 1, 1), ?)
  3526. and substr(SHIFTCODE, 2, 1) =
  3527. decode(?, null, substr(SHIFTCODE, 2, 1), ?)
  3528. ) t
  3529. left join (select y.*
  3530. from (select x.*,
  3531. count(1) over(partition by x.HEATNO) cnt,
  3532. row_number() over(partition by x.HEATNO order by x.ASSAYTYPECODE asc, x.assaydate asc) xh,
  3533. substr(x.assaytypecode, 1, 1) gw
  3534. from (select *
  3535. from STL_CHEMELEMENT
  3536. where to_char(ASSAYDATE, 'yyyy-MM-dd') between ? and ? and
  3537. upper(SUBSTR(CHECKNO, 12, 1)) = 'C'
  3538. and upper(SUBSTR(CHECKNO, -1)) = 'S'
  3539. union
  3540. select *
  3541. from J#STL_CHEMELEMENT
  3542. where to_char(ASSAYDATE, 'yyyy-MM-dd') between ? and ? and
  3543. upper(SUBSTR(CHECKNO, 12, 1)) = 'C'
  3544. and upper(SUBSTR(CHECKNO, -1)) = 'S') x) y ) t3 on t.heatno = t3.heatno
  3545. left join (select *
  3546. from ppc_steel_heat
  3547. union
  3548. select * from J#ppc_steel_heat) t4 on t.heatno = t4.heatno
  3549. order by OPTDISP
  3550. ]]>
  3551. </query>
  3552. <query id="reportBOF_CheckEndMn.Query" desc="获取当月各岗位所有班次的终点MN考核记录" fetchSize="10">
  3553. <![CDATA[
  3554. select distinct t.HEATNO,--炉号
  3555. t.STATIONCODE, --岗位编号
  3556. substr(t.SHIFTCODE, 2, 1) SHIFTCODE, --班组(甲、乙、丙、丁)
  3557. max(case
  3558. when t.HEATNO = t1.HEATNO and t1.xh = t1.cnt then
  3559. t1.Mn
  3560. end) over(partition by t.HEATNO) Z_MN,
  3561. t2.stdmin, --最小值(内控)
  3562. t2.stdmax, --最大值(内控)
  3563. to_char(t.optdate, 'yyyy-MM-dd') OPTDISP --日期
  3564. from (select * from stl_bof_optinfo where 1 = 1
  3565. and to_char(OPTDATE, 'yyyy-MM') = ?
  3566. union select * from j#stl_bof_optinfo where 1 = 1
  3567. and to_char(OPTDATE, 'yyyy-MM') = ?
  3568. ) t
  3569. left join (select y.*
  3570. from (select x.*,
  3571. count(1) over(partition by x.HEATNO) cnt,
  3572. row_number() over(partition by x.HEATNO order by x.ASSAYTYPECODE asc, x.assaydate asc) xh,
  3573. substr(x.assaytypecode, 1, 1) gw
  3574. from (select *
  3575. from STL_CHEMELEMENT
  3576. where to_char(ASSAYDATE, 'yyyy-MM') = ?
  3577. and upper(SUBSTR(CHECKNO, 12, 1)) = 'C'
  3578. and upper(SUBSTR(CHECKNO, -1)) = 'S'
  3579. union
  3580. select *
  3581. from J#STL_CHEMELEMENT
  3582. where to_char(ASSAYDATE, 'yyyy-MM') = ?
  3583. and upper(SUBSTR(CHECKNO, 12, 1)) = 'C'
  3584. and upper(SUBSTR(CHECKNO, -1)) = 'S') x) y) t1 on t1.heatno = t.heatno
  3585. left join ( select distinct t3.gycode,t4.itemcode,t4.stdmin,t4.stdmax --decode(t1.itemcode,'Mn',t1.stdmin,'') MN_Min, decode(t1.itemcode,'Mn',t1.stdmax,'') MN_Max
  3586. from com_sortcode_chem t3, com_standard_chem t4
  3587. where t3.cic = t4.cic
  3588. and t3.stdstyle = '1'
  3589. and t4.itemcode= 'Mn' ) t2 on t2.gycode = t.heatno
  3590. order by substr(OPTDISP,9,2)
  3591. ]]>
  3592. </query>
  3593. <query id="GetMonthDate.Select" desc="获取当月的生产日期_转炉" fetchSize="10">
  3594. <![CDATA[
  3595. select distinct to_char(OPTDATE, 'yyyy-MM-dd') ddate
  3596. from j#stl_bof_optinfo
  3597. where to_char(OPTDATE, 'yyyy-MM') = ?
  3598. order by ddate
  3599. ]]>
  3600. </query>
  3601. <query id="GetMnStandardElement.Select" desc="获取Mn元素内控标准信息" fetchSize="10">
  3602. <![CDATA[
  3603. select distinct t.gycode,t1.itemcode,t1.stdmin,t1.stdmax --decode(t1.itemcode,'Mn',t1.stdmin,'') MN_Min, decode(t1.itemcode,'Mn',t1.stdmax,'') MN_Max
  3604. from com_sortcode_chem t, com_standard_chem t1
  3605. where t.cic = t1.cic
  3606. and t.stdstyle = '1'
  3607. and t1.itemcode= 'Mn'
  3608. order by gycode
  3609. ]]>
  3610. </query>
  3611. <query id="reportBOF_AdditStat.Select" desc="查询转炉消耗统计信息-按班统计物料消耗重量" fetchSize="10">
  3612. <![CDATA[
  3613. select distinct t.MATERIELCODE,
  3614. t.materielname,
  3615. t.MATERIELTYPE,
  3616. case substr(t.SHIFTCODE, 1, 1)
  3617. when '1' then
  3618. '白'
  3619. when '2' then
  3620. '中'
  3621. when '3' then
  3622. '夜'
  3623. end BC,
  3624. case substr(t.SHIFTCODE, 2, 1)
  3625. when '1' then
  3626. '甲'
  3627. when '2' then
  3628. '乙'
  3629. when '3' then
  3630. '丙'
  3631. when '4' then
  3632. '丁'
  3633. end BB,
  3634. t.SHIFTCODE,
  3635. sum(nvl(t.JMWGT, 0)) over(partition by t.ddate, substr(t.SHIFTCODE, 2, 1), t.MATERIELCODE, t.MATERIELTYPE) JMWGT, --加料重量
  3636. t.DDATE --日期
  3637. from (select v.heatprocessno,
  3638. v.heatno,
  3639. v.PLANSTEEL STEEL,
  3640. v.STATIONCODE,
  3641. v.SHIFTCODE,
  3642. v.MATERIELCODE,
  3643. d.materielname,
  3644. v.MATERIELTYPE,
  3645. round(v.JMWGT, 2) JMWGT,
  3646. to_char(v.optdate, 'yyyy-MM-dd') DDATE --日期
  3647. from (select distinct a.heatprocessno,
  3648. a.heatno,
  3649. a.optdate,
  3650. a.PLANSTEEL,
  3651. b.STATIONCODE,
  3652. a.SHIFTCODE,
  3653. b.MATERIELCODE,
  3654. b.MATERIELTYPE,
  3655. round(sum(nvl(b.JMWGT, 0))
  3656. over(partition by b.HEATNO,
  3657. b.STATIONCODE,
  3658. b.DISPOSALTIME,
  3659. b.MATERIELTYPE,
  3660. b.MATERIELCODE),
  3661. 2) JMWGT
  3662. from (select *
  3663. from STL_bof_optinfo
  3664. where 1 = 1
  3665. and to_char(OPTDATE, 'yyyy-MM-dd') between
  3666. ? and ?
  3667. and substr(STATIONCODE, 2, 1) =
  3668. decode(?, null, substr(STATIONCODE, 2, 1), ?)
  3669. and UPPER(nvl(PLANSTEEL, 'null')) in
  3670. (decode(?,
  3671. null,
  3672. UPPER(nvl(PLANSTEEL, 'null')),
  3673. ?))
  3674. and substr(SHIFTCODE, 1, 1) =
  3675. decode(?, null, substr(SHIFTCODE, 1, 1), ?)
  3676. and substr(SHIFTCODE, 2, 1) =
  3677. decode(?, null, substr(SHIFTCODE, 2, 1), ?)
  3678. union
  3679. select *
  3680. from J#STL_bof_optinfo
  3681. where 1 = 1
  3682. and to_char(OPTDATE, 'yyyy-MM-dd') between
  3683. ? and ?
  3684. and substr(STATIONCODE, 2, 1) =
  3685. decode(?, null, substr(STATIONCODE, 2, 1), ?)
  3686. and UPPER(nvl(PLANSTEEL, 'null')) in
  3687. (decode(?,
  3688. null,
  3689. UPPER(nvl(PLANSTEEL, 'null')),
  3690. ?))
  3691. and substr(SHIFTCODE, 1, 1) =
  3692. decode(?, null, substr(SHIFTCODE, 1, 1), ?)
  3693. and substr(SHIFTCODE, 2, 1) =
  3694. decode(?, null, substr(SHIFTCODE, 2, 1), ?)) a,
  3695. stl_additives b
  3696. where a.heatno = b.heatno
  3697. and 'C' || a.stationcode = b.stationcode
  3698. and a.disposaltime = b.disposaltime
  3699. and b.MATERIELTYPE in ('FL', 'HJ')) v
  3700. left join (select * from com_materiel) d on v.materielcode =
  3701. d.materielcode
  3702. order by to_char(v.optdate, 'yyyy-MM-dd HH24:ss') desc) t
  3703. order by DDATE, MATERIELTYPE, substr(SHIFTCODE, 2, 1)
  3704. ]]>
  3705. </query>
  3706. <query id="getProduction.Select" desc="统计每个班的产量" fetchSize="10">
  3707. <![CDATA[
  3708. select distinct to_char(a.optdate, 'yyyy-MM-dd') optdate,
  3709. substr(a.shiftcode, 2, 1) shiftcode,
  3710. sum(nvl(WEIGHT,0)) WEIGHT,
  3711. count(a.heatno) intCount
  3712. from (select *
  3713. from stl_bof_optinfo
  3714. where to_char(optdate, 'yyyy-MM-dd') between ? and
  3715. ?
  3716. and substr(STATIONCODE, 2, 1) =
  3717. decode(?, null, substr(STATIONCODE, 2, 1), ?)
  3718. and UPPER(nvl(PLANSTEEL, 'null')) in
  3719. (decode(?, null, UPPER(nvl(PLANSTEEL, 'null')), ?))
  3720. and substr(SHIFTCODE, 1, 1) =
  3721. decode(?, null, substr(SHIFTCODE, 1, 1), ?)
  3722. and substr(SHIFTCODE, 2, 1) =
  3723. decode(?, null, substr(SHIFTCODE, 2, 1), ?)
  3724. union
  3725. select *
  3726. from J#STL_bof_optinfo
  3727. where to_char(optdate, 'yyyy-MM-dd') between ? and
  3728. ?
  3729. and substr(STATIONCODE, 2, 1) =
  3730. decode(?, null, substr(STATIONCODE, 2, 1), ?)
  3731. and UPPER(nvl(PLANSTEEL, 'null')) in
  3732. (decode(?, null, UPPER(nvl(PLANSTEEL, 'null')), ?))
  3733. and substr(SHIFTCODE, 1, 1) =
  3734. decode(?, null, substr(SHIFTCODE, 1, 1), ?)
  3735. and substr(SHIFTCODE, 2, 1) =
  3736. decode(?, null, substr(SHIFTCODE, 2, 1), ?)) a,
  3737. (select heatno,
  3738. case
  3739. when (nvl(PFBALEWGT, 0) - nvl(BALELEAVEWGT, 0)) > 0 then
  3740. round((nvl(PFBALEWGT, 0) - nvl(BALELEAVEWGT, 0)), 1)
  3741. else
  3742. 0
  3743. end WEIGHT
  3744. from STL_CCM_OPTINFO
  3745. union
  3746. select heatno,
  3747. case
  3748. when (nvl(PFBALEWGT, 0) - nvl(BALELEAVEWGT, 0)) > 0 then
  3749. round((nvl(PFBALEWGT, 0) - nvl(BALELEAVEWGT, 0)), 1)
  3750. else
  3751. 0
  3752. end WEIGHT
  3753. from J#STL_CCM_OPTINFO) b
  3754. where a.heatno = b.heatno(+)
  3755. group by to_char(a.optdate, 'yyyy-MM-dd'), substr(a.shiftcode, 2, 1)
  3756. order by to_char(a.optdate, 'yyyy-MM-dd'), substr(a.shiftcode, 2, 1)
  3757. ]]>
  3758. </query>
  3759. <query id="reportBOF_AdditStat_Load.Select" desc="获取转炉合金 、辅料初始化物料信息列名" fetchSize="10">
  3760. <![CDATA[
  3761. select distinct (a.materielcode) materielcode,
  3762. a.MATERIELTYPE,
  3763. b.materielforshort
  3764. from (Select HEATNO, stationcode
  3765. from stl_bof_optinfo t
  3766. where to_char(t.optdate, 'yyyy-MM-dd') between ? and
  3767. ?
  3768. union
  3769. Select HEATNO, stationcode
  3770. from J#stl_bof_optinfo t
  3771. where to_char(t.optdate, 'yyyy-MM-dd') between ? and
  3772. ?) t,
  3773. stl_additives a,
  3774. com_materiel b
  3775. where t.heatno = a.heatno
  3776. and 'C' || t.stationcode = a.stationcode
  3777. and a.materielcode = b.materielcode
  3778. and b.MATERIELTYPE IN ('HJ', 'FL') order by materieltype
  3779. ]]>
  3780. </query>
  3781. <query id="getMaterieltype.Select" desc="判断物料信息是合金 还是辅料" fetchSize="10">
  3782. <![CDATA[
  3783. select a.materieltype from com_materiel a where a.materielcode = ?
  3784. ]]>
  3785. </query>
  3786. <query id="proc_GetBOFInfo.Select" desc="钢铁料消耗报表(设计)--转炉信息查询" fetchSize="10">
  3787. <![CDATA[
  3788. select distinct b.HEATNO, --炉号
  3789. b.STATIONCODE, --岗位编号
  3790. substr(b.SHIFTCODE, 2, 1) SHIFTCODE,--班组(甲、乙、丙、丁)
  3791. nvl(b.IRONPOTWGT, 0) TSL, --装入铁水量
  3792. nvl(b.PIGIRONWGT, 0) STL, --装入生铁量(T)
  3793. nvl(b.WSTEELWGT, 0) FGL, --装入废钢量(T)
  3794. round(nvl(h.jmwgt/1000,0),2) HJL, --加入合金量(Kg)
  3795. round(nvl(d.jmwgt/1000,0),2) KSL, --加入矿石量(Kg)
  3796. to_char(b.CHANGESTARTTIME,'yyyy-mm-dd hh24:mi:ss') starttime, --兑铁开始时刻
  3797. to_char(b.TAPPINGENDTIME,'yyyy-mm-dd hh24:mi:ss') endtime, --出钢结束时刻
  3798. case
  3799. when to_char(RecFlag, 'yyyy-MM-dd HH24:mi') between ? and ? then
  3800. '1'
  3801. else
  3802. '0'
  3803. end BECURR --1#吹开始时刻(操作时间)
  3804. from (select *
  3805. from (select t.*,
  3806. row_number() over(partition by t.HEATNO order by t.RecFlag) XH
  3807. from (select t.*,
  3808. case
  3809. when B1STARTTIME is not null then
  3810. B1STARTTIME
  3811. else
  3812. OPTDATE
  3813. end RecFlag
  3814. from STL_BOF_OPTINFO t
  3815. where to_char(case when B1STARTTIME is not null then
  3816. B1STARTTIME else OPTDATE end,
  3817. 'yyyy-MM-dd') between ? and ?
  3818. union all
  3819. select t.*,
  3820. case
  3821. when B1STARTTIME is not null then
  3822. B1STARTTIME
  3823. else
  3824. OPTDATE
  3825. end RecFlag
  3826. from J#STL_BOF_OPTINFO t
  3827. where to_char(case when B1STARTTIME is not null then
  3828. B1STARTTIME else OPTDATE end,
  3829. 'yyyy-MM-dd') between ? and ?) t) v where XH = 1) b,
  3830. (select distinct s.heatno,
  3831. sum(s.jmwgt) over(partition by s.heatno order by s.heatno) jmwgt,
  3832. s.materieltype,
  3833. substr(s.stationcode, 2, 2) code
  3834. from stl_additives s
  3835. where s.materieltype = 'HJ'
  3836. --and substr(s.stationcode, 1, 1) = 'C'
  3837. union
  3838. select distinct s.heatno,
  3839. sum(s.jmwgt) over(partition by s.heatno order by s.heatno) jmwgt,
  3840. s.materieltype,
  3841. substr(s.stationcode, 2, 2) code
  3842. from j#stl_additives s
  3843. where s.materieltype = 'HJ'
  3844. --and substr(s.stationcode, 1, 1) = 'C'
  3845. ) h,
  3846. (select distinct s.heatno,
  3847. sum(s.jmwgt) over(partition by s.heatno order by s.heatno) jmwgt,
  3848. s.materieltype,
  3849. substr(s.stationcode, 2, 2) code
  3850. from stl_additives s
  3851. where s.materieltype = 'FL'
  3852. and substr(s.stationcode, 1, 1) = 'C'
  3853. and s.materielcode in ('10301010078','10301010084')--高磷矿石 + 球团
  3854. union
  3855. select distinct s.heatno,
  3856. sum(s.jmwgt) over(partition by s.heatno order by s.heatno) jmwgt,
  3857. s.materieltype,
  3858. substr(s.stationcode, 2, 2) code
  3859. from j#stl_additives s
  3860. where s.materieltype = 'FL'
  3861. and substr(s.stationcode, 1, 1) = 'C'
  3862. and s.materielcode in ('10301010078','10301010084')--高磷矿石 + 球团
  3863. ) d
  3864. where b.heatno = h.heatno(+)
  3865. and b.heatno = d.heatno(+)
  3866. order by b.heatno
  3867. ]]>
  3868. </query>
  3869. <query id="reportAll_Flow.Query" desc="自开率统计报表 --各工序炉号查询" fetchSize="10">
  3870. <![CDATA[
  3871. select HEATNO, --炉号
  3872. STATIONCODE, --岗位
  3873. substr(SHIFTCODE, 2, 1) SHIFTCODE,--班次
  3874. $ DEALTIME, --出钢结束时刻
  3875. case
  3876. when $ --to_char(OPTDATE, 'yyyy-MM-dd') between '2011-08-26' and '2011-08-29'
  3877. then '1' else '0'
  3878. end BECURR
  3879. from (select t.*,
  3880. row_number() over(partition by t.HEATNO order by t.OPTDATE) XH
  3881. from (select *
  3882. from $
  3883. where $ --to_char(OPTDATE, 'yyyy-MM') = '2011-08'
  3884. union all
  3885. select *
  3886. from J#$
  3887. where $ --to_char(OPTDATE, 'yyyy-MM') = '2011-08'
  3888. ) t)
  3889. where XH = 1
  3890. ]]>
  3891. </query>
  3892. <query id="reportCCM_Flag.Query" desc="自开率统计报表 --连铸大包是否引流炉号查询" fetchSize="10">
  3893. <![CDATA[
  3894. select HEATNO,
  3895. SHIFTCODE,
  3896. substr(STATIONCODE, 2, 1) STATIONCODE,
  3897. to_char(BALESTARTTIME, 'yyyy-MM-dd HH24:mi:ss') BALESTARTTIME,--大包开浇时刻
  3898. BALEFLOWTIEMS,--引流次数
  3899. case nvl(BALEFLOWFLAG, 0)
  3900. when 1 then
  3901. '0'
  3902. else
  3903. '1'
  3904. end FLOWFLAG --大包是否自动引流
  3905. from (select t.*,
  3906. row_number() over(partition by t.HEATNO order by t.OPTDATE) XH
  3907. from (select *
  3908. from STL_CCM_OPTINFO
  3909. where $ --HEATNO in ()
  3910. union
  3911. select * from J#STL_CCM_OPTINFO
  3912. where $ --HEATNO in ()
  3913. ) t)
  3914. where XH = 1
  3915. order by STATIONCODE, OPTDATE
  3916. ]]>
  3917. </query>
  3918. <query id="reportCCM_DianLaBP_Query" desc="铸机典拉表" fetchSize="10">
  3919. <![CDATA[
  3920. select RQ "日期",
  3921. BC "班次",
  3922. BB "班别",
  3923. HEATNO "炉号",
  3924. PLANSTEEL "钢种",
  3925. BJZCX "班浇注次序",
  3926. ZBCX "中包次序",
  3927. SUBSTR(STATIONCODE,2,1) CCM_ID,
  3928. trim(to_char(JZDW, '990.0')) "浇注吨位",
  3929. SFYL "是否引流",
  3930. to_char(BALESTARTTIME, 'HH24:mi') "大包开浇时间",
  3931. to_char(BALEENDTIME, 'HH24:mi') "大包关闭时间",
  3932. trim(to_char(round((case
  3933. when CAST_NO = CAST_NO_NEXT then
  3934. BALESTARTTIME_NEXT
  3935. else
  3936. BALEENDTIME
  3937. end - BALESTARTTIME) * 24 * 60,
  3938. 1),
  3939. '990.0')) "浇注周期",
  3940. TEMP_MIN "最低_1",
  3941. TEMP_MAX "最高_1",
  3942. WC "温差",
  3943. round(SPD_MIN, 2) "最低_2",
  3944. round(SPD_MAX, 2) "最高_2",
  3945. round(BD, 2) "波动",
  3946. S "S",
  3947. Als "Als",
  3948. N "N",
  3949. MEMO "备注"
  3950. from (select to_char(case
  3951. when a.BALESTARTTIME is not null then
  3952. a.BALESTARTTIME
  3953. else
  3954. a.OPTDATE
  3955. end,
  3956. 'yyyy-MM-dd') RQ,
  3957. case substr(a.SHIFTCODE, 1, 1)
  3958. when '1' then
  3959. '白'
  3960. when '2' then
  3961. '中'
  3962. when '3' then
  3963. '夜'
  3964. end BC,
  3965. case substr(a.SHIFTCODE, 2, 1)
  3966. when '1' then
  3967. '甲'
  3968. when '2' then
  3969. '乙'
  3970. when '3' then
  3971. '丙'
  3972. when '4' then
  3973. '丁'
  3974. end BB,
  3975. a.HEATNO,
  3976. a.STATIONCODE,
  3977. a.PLANSTEEL,
  3978. row_number() over(partition by to_char(case
  3979. when a.BALESTARTTIME is not null then
  3980. a.BALESTARTTIME
  3981. else
  3982. a.OPTDATE
  3983. end, 'yyyy-MM-dd'), a.SHIFTCODE order by a.BALESTARTTIME) BJZCX,
  3984. row_number() over(partition by b.CAST_NO order by a.BALESTARTTIME) ZBCX,
  3985. round(nvl(a.PFBALEWGT, 0) - nvl(a.BALELEAVEWGT, 0), 1) JZDW,
  3986. case nvl(a.BALEFLOWFLAG, 0)
  3987. when 1 then
  3988. '×'
  3989. end SFYL,
  3990. a.BALESTARTTIME,
  3991. a.BALEENDTIME,
  3992. nvl(b.CAST_NO, a.MOULDNO) CAST_NO,
  3993. lead(a.BALESTARTTIME, 1, a.BALEENDTIME) over(order by a.BALESTARTTIME) BALESTARTTIME_NEXT,
  3994. lead(b.CAST_NO, 1, a.MOULDNO) over(order by a.BALESTARTTIME) CAST_NO_NEXT,
  3995. round(c.TEMP_MIN) TEMP_MIN,
  3996. round(c.TEMP_MAX) TEMP_MAX,
  3997. round((c.TEMP_MAX - c.TEMP_MIN)) WC,
  3998. c.SPD_MIN,
  3999. c.SPD_MAX,
  4000. (c.SPD_MAX - c.SPD_MIN) BD,
  4001. trim(to_char(d.S, '0.000')) S,
  4002. trim(to_char(d.Als, '0.000')) Als,
  4003. trim(to_char(d.N, '0.0000')) N,
  4004. a.MEMO
  4005. from (select *
  4006. from STL_CCM_OPTINFO
  4007. where $
  4008. union
  4009. select *
  4010. from J#STL_CCM_OPTINFO
  4011. where $) a,
  4012. (select *
  4013. from ppc_STEEL_HEAT
  4014. where $) b,
  4015. (select distinct x.HEATNO,
  4016. min(case
  4017. when nvl(x.MIDLADLETEMP, 0) between ? and ? then
  4018. nvl(x.MIDLADLETEMP, 0)
  4019. end) over(partition by x.HEATNO) TEMP_MIN,
  4020. max(case
  4021. when nvl(x.MIDLADLETEMP, 0) between ? and ? then
  4022. nvl(x.MIDLADLETEMP, 0)
  4023. end) over(partition by x.HEATNO) TEMP_MAX,
  4024. min(LEAST(x.S1CASTSPEED,X.S2CASTSPEED)) over(partition by x.HEATNO) SPD_MIN,
  4025. max(GREATEST(x.S1CASTSPEED,x.S2CASTSPEED)) over(partition by x.HEATNO) SPD_MAX
  4026. from (select *
  4027. from $
  4028. where $
  4029. union
  4030. select *
  4031. from J#$
  4032. where $) x) c,
  4033. (select y.*
  4034. from (select x.*,
  4035. row_number() over(partition by x.HEATNO order by x.ASSAYDATE) xh
  4036. from (select *
  4037. from STL_CHEMELEMENT
  4038. where (upper(substr(ASSAYTYPECODE, 1, 2)) = 'CP' or
  4039. upper(substr(STATIONCODE, 1, 1)) = 'G')
  4040. and $
  4041. union
  4042. select *
  4043. from J#STL_CHEMELEMENT
  4044. where (upper(substr(ASSAYTYPECODE, 1, 2)) = 'CP' or
  4045. upper(substr(STATIONCODE, 1, 1)) = 'G')
  4046. and $) x) y
  4047. where y.xh = 1) d
  4048. where a.HEATNO = b.HEATNO(+)
  4049. and a.HEATNO = c.HEATNO(+)
  4050. and a.HEATNO = d.HEATNO(+)
  4051. order by a.BALESTARTTIME)
  4052. where RQ between ? and ?
  4053. ]]>
  4054. </query>
  4055. <query id="LFSDataHEAT_Speed.Query" desc="" fetchSize="10">
  4056. <![CDATA[
  4057. select z.*
  4058. from (select Distinct x.Heatno,
  4059. x.STATIONCODE,
  4060. x.DISPOSALTIME,
  4061. x.MIDLADLETEMP,
  4062. to_char(x.LASTFRESHTIME, 'HH24:mi') LASTFRESHTIME,
  4063. row_number() over(partition by x.HEATNO order by x.LASTFRESHTIME) xh,
  4064. count(*) over(partition by x.HEATNO order by x.HEATNO) intcount
  4065. from (SELECT Heatno,
  4066. STATIONCODE,
  4067. DISPOSALTIME,
  4068. MIDLADLETEMP,
  4069. min(LASTFRESHTIME) LASTFRESHTIME
  4070. FROM (select HEATNO,
  4071. STATIONCODE,
  4072. DISPOSALTIME,
  4073. ROUND(greatest(midladletemp1, midladletemp2)) MIDLADLETEMP,
  4074. LASTFRESHTIME from stl_ccm_f1sampling b
  4075. where 1 = 1
  4076. and to_char(OPTDATE, 'yyyy-MM-dd') between
  4077. ? and ?
  4078. union
  4079. select HEATNO,
  4080. STATIONCODE,
  4081. DISPOSALTIME,
  4082. ROUND(greatest(midladletemp1, midladletemp2)) MIDLADLETEMP,
  4083. LASTFRESHTIME from j#stl_ccm_f1sampling b
  4084. where 1 = 1
  4085. and to_char(OPTDATE, 'yyyy-MM-dd') between
  4086. ? and ?
  4087. union
  4088. select HEATNO,
  4089. STATIONCODE,
  4090. DISPOSALTIME,
  4091. ROUND(greatest(midladletemp1, midladletemp2)) MIDLADLETEMP,
  4092. LASTFRESHTIME from stl_ccm_f2sampling b
  4093. where 1 = 1
  4094. and to_char(OPTDATE, 'yyyy-MM-dd') between
  4095. ? and ?
  4096. union
  4097. select HEATNO,
  4098. STATIONCODE,
  4099. DISPOSALTIME,
  4100. ROUND(greatest(midladletemp1, midladletemp2)) MIDLADLETEMP,
  4101. LASTFRESHTIME from j#stl_ccm_f2sampling b
  4102. where 1 = 1
  4103. and to_char(OPTDATE, 'yyyy-MM-dd') between
  4104. ? and ?
  4105. union
  4106. select HEATNO,
  4107. STATIONCODE,
  4108. DISPOSALTIME,
  4109. ROUND(greatest(midladletemp1, midladletemp2)) MIDLADLETEMP,
  4110. LASTFRESHTIME from stl_ccm_f3sampling b
  4111. where 1 = 1
  4112. and to_char(OPTDATE, 'yyyy-MM-dd') between
  4113. ? and ?
  4114. union
  4115. select HEATNO,
  4116. STATIONCODE,
  4117. DISPOSALTIME,
  4118. ROUND(greatest(midladletemp1, midladletemp2)) MIDLADLETEMP,
  4119. LASTFRESHTIME
  4120. from J#stl_ccm_f3sampling
  4121. where 1 = 1
  4122. and to_char(OPTDATE, 'yyyy-MM-dd') between
  4123. ? and ?) a
  4124. group by heatno, stationcode, disposaltime, MIDLADLETEMP
  4125. order by heatno) x
  4126. where x.MIDLADLETEMP > 1410
  4127. order by heatno, LASTFRESHTIME) z
  4128. where z.xh in (1, round(z.intcount / 4), round((z.intcount - 2) / 4) * 2,
  4129. round((z.intcount - 2) / 4) * 3,
  4130. round((z.intcount - 2) / 4) * 4, z.intcount)
  4131. ]]>
  4132. </query>
  4133. <query id="reportCAS_All.Select" desc="吹氩炉号、岗位、班次、钢种、日期记录查询" fetchSize="10">
  4134. <![CDATA[
  4135. select A.HEATNO,
  4136. A.STATIONCODE,
  4137. V.FACT_ROUTE,
  4138. substr(A.SHIFTCODE, 2, 1) SHIFTCODE,
  4139. case
  4140. when B.AIM_GRADE_CODE is null then
  4141. B.AIM_GRADE_CODE
  4142. else
  4143. B.AIM_GRADE_CODE
  4144. end PLANSTEEL,
  4145. max(case when a.HEATNO = C.HEATNO and C.xh = C.cnt then C.MN end) over(partition by a.HEATNO) MN,
  4146. max(case when a.HEATNO = C.HEATNO and C.xh = C.cnt then C.SI end) over(partition by a.HEATNO) SI,
  4147. max(case
  4148. when a.HEATNO = C.HEATNO and C.xh = C.cnt then
  4149. C.ALS
  4150. end) over(partition by a.HEATNO) ALS,
  4151. NVL((select d.stdmin
  4152. from com_standard_chem_view d,
  4153. ( select *
  4154. from com_base_info d
  4155. where d.sortcode = '1006'
  4156. order by d.basecode) h
  4157. where d.ITEMCODE = h.basename
  4158. and steel = B.AIM_GRADE_CODE
  4159. and stdstyle = '2'
  4160. and d.ITEMCODE = 'Als'
  4161. group by steel, stdstyle, itemcode, std, stdmin, stdmax, basename,basecode
  4162. ),0) FXALSBZ,
  4163. case
  4164. when $ then
  4165. '1'
  4166. else
  4167. '0'
  4168. end BECURR
  4169. from (select *
  4170. from (select t.*,
  4171. row_number() over(partition by t.HEATNO order by t.OPTDATE) XH
  4172. from (select *
  4173. from $ t
  4174. where $
  4175. union all
  4176. select * from J#$ t where $) t
  4177. )
  4178. where XH = 1) A,
  4179. (select HEATNO, AIM_GRADE_CODE
  4180. from (select t.*,
  4181. row_number() over(partition by t.HEATNO order by V_HEAT_ID desc) XH
  4182. from ppc_steel_heat t
  4183. where t.HEATNO is not null
  4184. and $)
  4185. where XH = 1) B,
  4186. (select y.*
  4187. from (select x.*,
  4188. count(1) over(partition by x.HEATNO) cnt,
  4189. row_number() over(partition by x.HEATNO order by x.ASSAYTYPECODE desc) xh
  4190. from (select *
  4191. from stl_CHEMELEMENT
  4192. where upper(SUBSTR(CHECKNO, 12, 2)) = 'DQ'
  4193. and upper(SUBSTR(CHECKNO, -1)) = 'S'
  4194. union
  4195. select t.*
  4196. from j#stl_CHEMELEMENT t
  4197. where upper(SUBSTR(CHECKNO, 12, 2)) = 'DQ'
  4198. and upper(SUBSTR(CHECKNO, -1)) = 'S'
  4199. ) x) y
  4200. where y.xh = y.cnt) C,
  4201. (select *
  4202. from ppc_steel_heat
  4203. union
  4204. select * from J#ppc_steel_heat) V
  4205. where A.HEATNO = B.HEATNO(+)
  4206. and A.HEATNO = C.HEATNO(+)
  4207. and A.HEATNO = V.HEATNO(+)
  4208. ]]>
  4209. </query>
  4210. <query id="reportCCM_AddN.Select" desc="连铸增N报表" fetchSize="10">
  4211. <![CDATA[
  4212. select distinct t.HEATNO,
  4213. t.STATIONCODE,
  4214. substr(t.SHIFTCODE, 2, 1) SHIFTCODE,
  4215. t4.PLAN_ROUTE,
  4216. max(case when t.HEATNO = t2.HEATNO and t2.xh = t2.cnt then t2.N end) over(partition by t.HEATNO) F_N,
  4217. case
  4218. when substr(t4.PLAN_ROUTE, 9, 2) = 'E0' and
  4219. substr(t4.PLAN_ROUTE, 11, 2) = 'F0' and
  4220. substr(t4.PLAN_ROUTE, 13, 2) = 'I0' then
  4221. max(case when t.HEATNO = t3.HEATNO and t3.xh = t3.cnt then t3.N end) over(partition by t.HEATNO) --氩站
  4222. when substr(t4.PLAN_ROUTE, 9, 2) != 'E0' and
  4223. substr(t4.PLAN_ROUTE, 11, 2) = 'F0' and
  4224. substr(t4.PLAN_ROUTE, 13, 2) = 'I0' then
  4225. max(case when t.HEATNO = t7.HEATNO and t7.xh = t7.cnt then t7.N end) over(partition by t.HEATNO) --精炼
  4226. when substr(t4.PLAN_ROUTE, 9, 2) = 'E0' and
  4227. substr(t4.PLAN_ROUTE, 11, 2) != 'F0' and
  4228. substr(t4.PLAN_ROUTE, 13, 2) = 'I0' then
  4229. max(case when t.HEATNO = t6.HEATNO and t6.xh = t6.cnt then t6.N end) over(partition by t.HEATNO) --RH
  4230. when substr(t4.PLAN_ROUTE, 9, 2) != 'E0' and
  4231. substr(t4.PLAN_ROUTE, 11, 2) != 'F0' and
  4232. substr(t4.PLAN_ROUTE, 13, 2) = 'I0' then
  4233. max(case when t.HEATNO = t6.HEATNO and t6.xh = t6.cnt then t6.N end) over(partition by t.HEATNO) --RH
  4234. when substr(t4.PLAN_ROUTE, 9, 2) != 'E0' and
  4235. substr(t4.PLAN_ROUTE, 11, 2) = 'F0' and
  4236. substr(t4.PLAN_ROUTE, 13, 2) != 'I0' then
  4237. max(case when t.HEATNO = t5.HEATNO and t5.xh = t5.cnt then t5.N end) over(partition by t.HEATNO) --vd
  4238. when substr(t4.PLAN_ROUTE, 9, 2) != 'E0' and
  4239. substr(t4.PLAN_ROUTE, 11, 2) != 'F0' and
  4240. substr(t4.PLAN_ROUTE, 13, 2) != 'I0' then
  4241. max(case when t.HEATNO = t5.HEATNO and t5.xh = t5.cnt then t5.N end) over(partition by t.HEATNO) --vd
  4242. else
  4243. '0'
  4244. end N,
  4245. to_char(t.OPTDATE, 'yyyy-MM-dd hh24:mi') Optdisp
  4246. from (select *
  4247. from $
  4248. where $
  4249. union all
  4250. select *
  4251. from J#$
  4252. where $ ) t
  4253. left join (select y.*
  4254. from (select x.*,
  4255. count(1) over(partition by x.HEATNO) cnt,
  4256. row_number() over(partition by x.HEATNO order by x.ASSAYTYPECODE desc, x.assaydate desc) xh,
  4257. substr(x.assaytypecode, 1, 1) gw
  4258. from (select *
  4259. from STL_CHEMELEMENT
  4260. where upper(SUBSTR(CHECKNO, -1)) = 'S'
  4261. and upper(SUBSTR(CHECKNO, 12, 2)) = 'GP'
  4262. union
  4263. select *
  4264. from J#STL_CHEMELEMENT
  4265. where upper(SUBSTR(CHECKNO, -1)) = 'S'
  4266. and upper(SUBSTR(CHECKNO, 12, 2)) = 'GP') x) y) t2 on t.heatno =
  4267. t2.heatno
  4268. left join (select y.*--氩站
  4269. from (select x.*,
  4270. count(1) over(partition by x.HEATNO) cnt,
  4271. row_number() over(partition by x.HEATNO order by x.ASSAYTYPECODE desc, x.assaydate desc) xh,
  4272. substr(x.assaytypecode, 1, 1) gw
  4273. from (select *
  4274. from STL_CHEMELEMENT
  4275. where upper(SUBSTR(CHECKNO, -1)) = 'S'
  4276. and upper(SUBSTR(CHECKNO, 12, 2)) = 'DH'
  4277. union
  4278. select *
  4279. from J#STL_CHEMELEMENT
  4280. where upper(SUBSTR(CHECKNO, -1)) = 'S'
  4281. and upper(SUBSTR(CHECKNO, 12, 2)) = 'DH') x) y) t3 on t.heatno =
  4282. t3.heatno
  4283. left join (select y.*--vd
  4284. from (select x.*,
  4285. count(1) over(partition by x.HEATNO) cnt,
  4286. row_number() over(partition by x.HEATNO order by x.ASSAYTYPECODE desc, x.assaydate desc) xh,
  4287. substr(x.assaytypecode, 1, 1) gw
  4288. from (select *
  4289. from STL_CHEMELEMENT
  4290. where upper(SUBSTR(CHECKNO, 12, 1)) = 'I'
  4291. and upper(SUBSTR(CHECKNO, -1)) = 'S'
  4292. union
  4293. select *
  4294. from J#STL_CHEMELEMENT
  4295. where upper(SUBSTR(CHECKNO, 12, 1)) = 'I'
  4296. and upper(SUBSTR(CHECKNO, -1)) = 'S') x) y) t5 on t.heatno =
  4297. t5.heatno
  4298. left join (select y.*--RH
  4299. from (select x.*,
  4300. count(1) over(partition by x.HEATNO) cnt,
  4301. row_number() over(partition by x.HEATNO order by x.ASSAYTYPECODE desc, x.assaydate desc) xh,
  4302. substr(x.assaytypecode, 1, 1) gw
  4303. from (select *
  4304. from STL_CHEMELEMENT
  4305. where upper(SUBSTR(CHECKNO, 12, 1)) = 'F'
  4306. and upper(SUBSTR(CHECKNO, -1)) = 'S'
  4307. union
  4308. select *
  4309. from J#STL_CHEMELEMENT
  4310. where upper(SUBSTR(CHECKNO, 12, 1)) = 'F'
  4311. and upper(SUBSTR(CHECKNO, -1)) = 'S') x) y) t6 on t.heatno =
  4312. t6.heatno
  4313. left join (select y.*--LFS
  4314. from (select x.*,
  4315. count(1) over(partition by x.HEATNO) cnt,
  4316. row_number() over(partition by x.HEATNO order by x.ASSAYTYPECODE desc, x.assaydate desc) xh,
  4317. substr(x.assaytypecode, 1, 1) gw
  4318. from (select *
  4319. from STL_CHEMELEMENT
  4320. where upper(SUBSTR(CHECKNO, 12, 1)) = 'E'
  4321. and upper(SUBSTR(CHECKNO, -1)) = 'S'
  4322. union
  4323. select *
  4324. from J#STL_CHEMELEMENT
  4325. where upper(SUBSTR(CHECKNO, 12, 1)) = 'E'
  4326. and upper(SUBSTR(CHECKNO, -1)) = 'S') x) y) t7 on t.heatno =
  4327. t7.heatno
  4328. left join (select *
  4329. from ppc_steel_heat
  4330. union
  4331. select * from J#ppc_steel_heat) t4 on t.heatno = t4.heatno
  4332. order by Optdisp
  4333. ]]>
  4334. </query>
  4335. <query id="reportBof_LZZB.Select" desc="连铸增N报表" fetchSize="10">
  4336. <![CDATA[
  4337. select * from ( select distinct to_char(a.OPTDATE, 'yyyy-MM-dd') ,
  4338. a.HEATNO ,
  4339. a.PLANSTEEL ,
  4340. a.SUPPLYOXYGENTIME ,
  4341. --f.SAMPLINGDEPICT,
  4342. --f.SAMPLINGVALUE,
  4343. substr(a.SHIFTCODE,2,1) SHIFTCODE,
  4344. a.STATIONCODE,
  4345. case a.BLKREDEFFECTS when '0' then '失败' when '1' then '成功' when '3' then '一般' end BLKREDEFFECTS,
  4346. trim(to_char(c.C, '0.00')) 倒炉C,
  4347. '' 终点出钢合格, '' 双渣, case when a.B2TIME is null then '1' end YDHG,
  4348. '' 到站温度合格,
  4349. case when count(case when f.HeatNo = a.HeatNo
  4350. and f.SAMPLINGNAME = 'GUN' || a.OGGNUMID || 'HIGH' and f.SAMPLINGVALUE < 1350
  4351. and f.SAMPLINGDATE <= a.B1ENDTIME + (1/24/60/60)*60 then 1 end) over(partition by f.HeatNo) >= 2 then '1' end ZDYY,
  4352. case when count(case when f.HeatNo = a.HeatNo and f.SAMPLINGNAME = 'BOFANGLE'
  4353. and f.SAMPLINGVALUE <= -2 and f.SAMPLINGDATE >=
  4354. case when a.PSSTARTTIME is null then a.TAPPINGENDTIME + 1.5/24/60
  4355. else a.PSSTARTTIME - 3/24/60 end then 1 end) over(partition by f.HeatNo) >= 1 then '1' end JZJD,
  4356. case when count(case when f.HeatNo = a.HeatNo and f.SAMPLINGNAME = 'BOFANGLE' and f.SAMPLINGVALUE >= 115
  4357. and f.SAMPLINGDATE >= a.PSENDTIME then 1 end) over(partition by f.HeatNo) >= 1 then '1' end ZZJD,
  4358. case when sum(case when g.HeatNo = a.HeatNo and g.MATERIELCODE = '10301010039'
  4359. and g.JMDATE >= a.B1STARTTIME + (750/24/60/60)
  4360. then nvl(g.JMWGT, 0) end) over(partition by g.HeatNo) > 0 then '1' end JKS,
  4361. case when count(case when f.HeatNo = a.HeatNo and f.SAMPLINGNAME = 'GUN' || a.OGGNUMID || 'HIGH'
  4362. and f.SAMPLINGVALUE > 1500 and f.SAMPLINGDATE <= a.B1ENDTIME - (10/24/60/60)
  4363. and f.SAMPLINGDATE > a.B1STARTTIME + (750/24/60/60) then 1 end) over(partition by f.HeatNo) <= 0 then '1' end QWS,
  4364. '' 溅渣未加料, '' 到站化学成分未命中
  4365. from
  4366. (select *
  4367. from STL_BOF_OPTINFO
  4368. where to_char(OPTDATE,'yyyy-mm-dd') between ? and
  4369. ?
  4370. union
  4371. select *
  4372. from J#STL_BOF_OPTINFO
  4373. where to_char(OPTDATE,'yyyy-mm-dd') between ? and
  4374. ?) a,
  4375. (select y.* from (select x.*,
  4376. row_number() over(partition by x.HEATNO order by x.ASSAYDATE) xh
  4377. from (select *
  4378. from STL_CHEMELEMENT
  4379. where (upper(substr(ASSAYTYPECODE, 1, 2)) = 'LD' or
  4380. upper(substr(STATIONCODE, 1, 1)) = 'C')
  4381. and to_char(ASSAYDATE,'yyyy-mm-dd') between ? and
  4382. ?
  4383. union
  4384. select *
  4385. from J#STL_CHEMELEMENT
  4386. where (upper(substr(ASSAYTYPECODE, 1, 2)) = 'LD' or
  4387. upper(substr(STATIONCODE, 1, 1)) = 'C')
  4388. and to_char(ASSAYDATE,'yyyy-mm-dd') between ? and
  4389. ? ) x) y
  4390. where y.xh = 1) c,
  4391. (select HeatNo,SAMPLINGNAME,SAMPLINGVALUE,max(SAMPLINGDATE) SAMPLINGDATE
  4392. from STL_BOF_SAMPLING
  4393. where (SAMPLINGNAME = 'GUNAHIGH' or SAMPLINGNAME = 'GUNBHIGH' or
  4394. SAMPLINGNAME = 'BOFANGLE')
  4395. and to_char(SAMPLINGDATE,'yyyy-mm-dd') between ? and
  4396. ? group by HEATNO,SAMPLINGNAME,SAMPLINGVALUE
  4397. union
  4398. select HeatNo,SAMPLINGNAME,SAMPLINGVALUE,max(SAMPLINGDATE) SAMPLINGDATE
  4399. from J#STL_BOF_SAMPLING
  4400. where (SAMPLINGNAME = 'GUNAHIGH' or SAMPLINGNAME = 'GUNBHIGH' or
  4401. SAMPLINGNAME = 'BOFANGLE')
  4402. and to_char(SAMPLINGDATE,'yyyy-mm-dd') between ? and
  4403. ? group by HEATNO,SAMPLINGNAME,SAMPLINGVALUE ) f,
  4404. (select HeatNo,MATERIELCODE,JMDATE,JMWGT
  4405. from STL_BOF_ADDITIVES
  4406. where to_char(JMDATE,'yyyy-mm-dd') between ? and
  4407. ?
  4408. union
  4409. select HeatNo,MATERIELCODE,JMDATE,JMWGT
  4410. from J#STL_BOF_ADDITIVES
  4411. where to_char(JMDATE,'yyyy-mm-dd') between ? and
  4412. ? ) g
  4413. where a.HEATNO = c.HEATNO(+)
  4414. and a.HEATNO = f.HEATNO(+)
  4415. and a.HEATNO = g.HEATNO) order by STATIONCODE, HEATNO desc
  4416. ]]>
  4417. </query>
  4418. <query id="reportBOF_TSCTSO.Query" desc="转炉小指标 TSC/TSO" fetchSize="10">
  4419. <![CDATA[
  4420. select a.HEATNO,
  4421. a.STATIONCODE,
  4422. substr(a.SHIFTCODE,2,1) SHIFTCODE,
  4423. b.SAMPLINGTYPE,
  4424. b.TEMPERATURE,
  4425. b.TERMINUSC_O2C,
  4426. b.TERMINUSO2
  4427. from (select HEATNO,STATIONCODE, SHIFTCODE,OPTDATE
  4428. from STL_BOF_OPTINFO
  4429. where to_char(OPTDATE, 'yyyy-mm-dd') between ? and
  4430. ?
  4431. union
  4432. select HEATNO,STATIONCODE, SHIFTCODE,OPTDATE
  4433. from J#STL_BOF_OPTINFO
  4434. where to_char(OPTDATE, 'yyyy-mm-dd') between ? and
  4435. ?) a,
  4436. (select SAMPLINGTYPE,
  4437. TEMPERATURE,
  4438. HEATNO,
  4439. TERMINUSC_O2C,
  4440. TERMINUSO2,
  4441. SAMPLINGDATE
  4442. from STL_BOF_SUBSAMPLING t
  4443. where to_char(t.samplingdate, 'yyyy-mm-dd') between ? and
  4444. ?
  4445. union
  4446. select SAMPLINGTYPE,
  4447. TEMPERATURE,
  4448. HEATNO,
  4449. TERMINUSC_O2C,
  4450. TERMINUSO2,
  4451. SAMPLINGDATE
  4452. from j#STL_BOF_SUBSAMPLING g
  4453. where to_char(g.samplingdate, 'yyyy-mm-dd') between ? and
  4454. ?) b
  4455. where a.HEATNO = b.HEATNO(+) order by a.HEATNO
  4456. ]]>
  4457. </query>
  4458. <query id="reportBOF_CountHeaTNO.Query" desc="统计转炉生产总炉数" fetchSize="10">
  4459. <![CDATA[
  4460. select DISTINCT a.HEATNO,
  4461. a.STATIONCODE,
  4462. substr(a.SHIFTCODE,2,1) SHIFTCODE
  4463. from (select HEATNO,STATIONCODE, SHIFTCODE,OPTDATE
  4464. from STL_BOF_OPTINFO
  4465. where to_char(OPTDATE, 'yyyy-mm-dd') between ? and
  4466. ?
  4467. union
  4468. select HEATNO,STATIONCODE, SHIFTCODE,OPTDATE
  4469. from J#STL_BOF_OPTINFO
  4470. where to_char(OPTDATE, 'yyyy-mm-dd') between ? and
  4471. ?) a
  4472. ]]>
  4473. </query>
  4474. <query id="LoadGetYQ.Query" desc="氧枪喷头厂家信息加载" fetchSize="10">
  4475. <![CDATA[
  4476. select basename,basecode
  4477. from com_base_info
  4478. where sortcode = '40030401'
  4479. order by basecode
  4480. ]]>
  4481. </query>
  4482. <query id="LoadGetYQBy_ID.Query" desc="根据ID获取基础信息" fetchSize="10">
  4483. <![CDATA[
  4484. select basename,basecode,MEMO
  4485. from com_base_info
  4486. where basecode = ?
  4487. order by basecode
  4488. ]]>
  4489. </query>
  4490. <query id="report_BoF_Target.Select" desc="转炉炉长指示统计" fetchSize="10">
  4491. <![CDATA[
  4492. select * from ( select distinct to_char(a.OPTDATE, 'yyyy-MM-dd') 日期,
  4493. a.HEATNO 炉号,
  4494. a.PLANSTEEL 钢种,
  4495. case substr(a.SHIFTCODE,1,1) when '1' then '白' when '2' then '中' when '3' then '夜' end 班次,
  4496. case substr(a.SHIFTCODE,2,1) when '1' then '甲' when '2' then '乙' when '3' then '丙' when '4' then '丁' end 班别,
  4497. substr(a.STATIONCODE, 2, 1) 炉座, case a.BLKREDEFFECTS when '0' then '失败' when '1' then '成功' when '3' then '一般' end 挡渣成功,
  4498. trim(to_char(c.C, '0.00')) 倒炉C,
  4499. nvl(a.B2TIME, 0) + nvl(a.B3TIME, 0) + nvl(a.B4TIME, 0) + nvl(a.B5TIME, 0) 补吹时间 ,
  4500. '' 终点出钢合格, '' 双渣, case when a.B2TIME is null then '1' else '0' end 一倒合格,
  4501. '' 到站温度合格,
  4502. case when count(case when f.HeatNo = a.HeatNo
  4503. and (substr((h.FACT_ROUTE),9,2) ='E1' OR substr((h.FACT_ROUTE),9,2) = 'E2')
  4504. and f.SAMPLINGNAME = 'GUN' || a.OGGNUMID || 'HIGH' and f.SAMPLINGVALUE <= 1400
  4505. and f.SAMPLINGDATE <= a.STOPOXYGENTIME + (1/24/60/60)*50 then 1 end) over(partition by f.HeatNo) >= 2 then '1' end YQLF,
  4506. case when count(case when f.HeatNo = a.HeatNo
  4507. and substr((h.FACT_ROUTE),9,2) = 'E0'
  4508. and f.SAMPLINGNAME = 'GUN' || a.OGGNUMID || 'HIGH' and f.SAMPLINGVALUE <= 1460
  4509. and f.SAMPLINGDATE <= a.STOPOXYGENTIME + (1/24/60/60)*50 then 1 end) over(partition by f.HeatNo) >= 2 then '1' end YQFLF,
  4510. case when count(case when f.HeatNo = a.HeatNo and f.SAMPLINGNAME = 'BOFANGLE'
  4511. and f.SAMPLINGVALUE <= -3 and f.SAMPLINGDATE >=
  4512. case when a.PSSTARTTIME is null then a.TAPPINGENDTIME + 1.5/24/60
  4513. else a.PSSTARTTIME - 1/24/60 end then 1 end) over(partition by f.HeatNo) >= 1 then '1' else '0' end 溅渣角度合格,
  4514. case when count(case when f.HeatNo = a.HeatNo and f.SAMPLINGNAME = 'BOFANGLE' and f.SAMPLINGVALUE >= 105
  4515. and f.SAMPLINGDATE >= a.PSENDTIME then 1 end) over(partition by f.HeatNo) >= 1 then '1' else '0' end 粘渣角度合格,
  4516. case when sum(case when g.HeatNo = a.HeatNo and g.MATERIELCODE = '10301010078'
  4517. and g.JMDATE >= a.OPENOXYGENTIME + (700/24/60/60)
  4518. then nvl(g.JMWGT, 0) end) over(partition by g.HeatNo) > 0 then '1' else '0' end 加矿石,
  4519. case when substr((select FACT_ROUTE from ppc_steel_heat t where t.heatno=a.HEATNO),9,2) ='E0' then
  4520. '是'
  4521. else
  4522. '否'
  4523. end FACT_ROUTE,
  4524. case when count(case when f.HeatNo = a.HeatNo and f.SAMPLINGNAME = 'GUN' || a.OGGNUMID || 'HIGH'
  4525. and (substr((h.FACT_ROUTE),9,2) ='E1' OR substr((h.FACT_ROUTE),9,2) = 'E2')
  4526. and f.SAMPLINGVALUE <= 1460 and f.SAMPLINGDATE <= a.STOPOXYGENTIME - (10/24/60/60)
  4527. and f.SAMPLINGDATE > a.OPENOXYGENTIME + (700/24/60/60) then 1 end) over(partition by f.HeatNo) <= 0 then '1' end QWLF,
  4528. case when count(case when f.HeatNo = a.HeatNo and f.SAMPLINGNAME = 'GUN' || a.OGGNUMID || 'HIGH'
  4529. and substr((h.FACT_ROUTE),9,2) = 'E0'
  4530. and f.SAMPLINGVALUE <= 1500 and f.SAMPLINGDATE <= a.STOPOXYGENTIME - (10/24/60/60)
  4531. and f.SAMPLINGDATE > a.OPENOXYGENTIME + (700/24/60/60) then 1 end) over(partition by f.HeatNo) <= 0 then '1' end QWFLF,
  4532. '' 溅渣未加料, '' 到站化学成分未命中
  4533. from
  4534. (select *
  4535. from STL_BOF_OPTINFO
  4536. where $
  4537. union
  4538. select *
  4539. from J#STL_BOF_OPTINFO
  4540. where $ ) a,
  4541. (select y.* from (select x.*,
  4542. row_number() over(partition by x.HEATNO order by x.ASSAYDATE desc) xh
  4543. from (select *
  4544. from STL_CHEMELEMENT
  4545. where (upper(substr(ASSAYTYPECODE, 1, 2)) = 'LD' or
  4546. upper(substr(STATIONCODE, 1, 1)) = 'C')
  4547. and to_char(ASSAYDATE,'yyyy-mm-dd') between ? and
  4548. ?
  4549. union
  4550. select *
  4551. from J#STL_CHEMELEMENT
  4552. where (upper(substr(ASSAYTYPECODE, 1, 2)) = 'LD' or
  4553. upper(substr(STATIONCODE, 1, 1)) = 'C')
  4554. and to_char(ASSAYDATE,'yyyy-mm-dd') between ? and
  4555. ? ) x) y
  4556. where y.xh = 1) c,
  4557. (select HeatNo,SAMPLINGNAME,SAMPLINGVALUE,max(SAMPLINGDATE) SAMPLINGDATE
  4558. from STL_BOF_SAMPLING
  4559. where (SAMPLINGNAME = 'GUNAHIGH' or SAMPLINGNAME = 'GUNBHIGH' or
  4560. SAMPLINGNAME = 'BOFANGLE')
  4561. and to_char(SAMPLINGDATE,'yyyy-mm-dd') between ? and
  4562. ? group by HEATNO,SAMPLINGNAME,SAMPLINGVALUE
  4563. union
  4564. select HeatNo,SAMPLINGNAME,SAMPLINGVALUE,max(SAMPLINGDATE) SAMPLINGDATE
  4565. from J#STL_BOF_SAMPLING
  4566. where (SAMPLINGNAME = 'GUNAHIGH' or SAMPLINGNAME = 'GUNBHIGH' or
  4567. SAMPLINGNAME = 'BOFANGLE')
  4568. and to_char(SAMPLINGDATE,'yyyy-mm-dd') between ? and
  4569. ? group by HEATNO,SAMPLINGNAME,SAMPLINGVALUE ) f,
  4570. (select HeatNo,MATERIELCODE,JMDATE,JMWGT
  4571. from STL_BOF_ADDITIVES
  4572. where to_char(JMDATE,'yyyy-mm-dd') between ? and
  4573. ?
  4574. union
  4575. select HeatNo,MATERIELCODE,JMDATE,JMWGT
  4576. from J#STL_BOF_ADDITIVES
  4577. where to_char(JMDATE,'yyyy-mm-dd') between ? and
  4578. ? ) g ,
  4579. (select HEATNO,FACT_ROUTE,PLAN_MAKING_TIME
  4580. from ppc_steel_heat a
  4581. where to_char(PLAN_MAKING_TIME,'yyyy-mm-dd') between ? and
  4582. ?
  4583. union
  4584. select HEATNO,FACT_ROUTE,PLAN_MAKING_TIME
  4585. from J#ppc_steel_heat b
  4586. where to_char(PLAN_MAKING_TIME,'yyyy-mm-dd') between ? and
  4587. ? ) h
  4588. where a.HEATNO = c.HEATNO(+)
  4589. and a.HEATNO = f.HEATNO(+)
  4590. and a.HEATNO = g.HEATNO(+)
  4591. and a.HEATNO = h.HEATNO(+) ) order by 炉座, 炉号 desc
  4592. ]]>
  4593. </query>
  4594. <query id="GetSlagSplashInfo_EG.select" desc="获取在二炼钢服务器的二炼渣样信息" fetchSize="10">
  4595. <![CDATA[
  4596. select A.HEATNO,
  4597. case substr(a.SHIFTCODE, 1, 1)
  4598. when '1' then
  4599. '白'
  4600. when '2' then
  4601. '中'
  4602. when '3' then
  4603. '夜'
  4604. end BC,
  4605. case substr(a.SHIFTCODE, 2, 1)
  4606. when '1' then
  4607. '甲'
  4608. when '2' then
  4609. '乙'
  4610. when '3' then
  4611. '丙'
  4612. when '4' then
  4613. '丁'
  4614. end BB,
  4615. A.CaO,
  4616. A.SiO2,
  4617. A.Al2O3,
  4618. A.TFe,
  4619. A.MnO,
  4620. A.S,
  4621. A.MgO,
  4622. A.P2O5,
  4623. A.JIANDU,
  4624. to_char(A.ASSAYDATE, 'yyyy-MM-dd HH24:mi:ss') ASSAYDATE
  4625. from (select t.*,
  4626. case
  4627. when nvl(SiO2, 0) <> 0 then
  4628. trim(to_char(round(CaO / (SiO2), 3), '9990.000'))
  4629. else
  4630. ''
  4631. end JIANDU
  4632. from STL_CHEMELEMENT t
  4633. where substr(t.checkno, length(t.checkno) - 1, 2) = '-4'
  4634. and to_char(ASSAYDATE, 'yyyy-MM-dd') between ? and
  4635. ?
  4636. union
  4637. select t.*,
  4638. case
  4639. when nvl(SiO2, 0) <> 0 then
  4640. trim(to_char(round(CaO / (SiO2), 3), '9990.000'))
  4641. else
  4642. ''
  4643. end JIANDU
  4644. from J#STL_CHEMELEMENT t
  4645. where substr(t.checkno, length(t.checkno) - 1, 2) = '-4'
  4646. and to_char(ASSAYDATE, 'yyyy-MM-dd') between ? and
  4647. ? ) A
  4648. order by A.ASSAYDATE
  4649. ]]>
  4650. </query>
  4651. </queryMap>