ReportLgJobMgt.xml 222 KB

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