| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860186118621863186418651866186718681869187018711872187318741875187618771878187918801881188218831884188518861887188818891890189118921893189418951896189718981899190019011902190319041905190619071908190919101911191219131914191519161917191819191920192119221923192419251926192719281929193019311932193319341935193619371938193919401941194219431944194519461947194819491950195119521953195419551956195719581959196019611962196319641965196619671968196919701971197219731974197519761977197819791980198119821983198419851986198719881989199019911992199319941995199619971998199920002001200220032004200520062007200820092010201120122013201420152016201720182019202020212022202320242025202620272028202920302031203220332034203520362037203820392040204120422043204420452046204720482049205020512052205320542055205620572058205920602061206220632064206520662067206820692070207120722073207420752076207720782079208020812082208320842085208620872088208920902091209220932094209520962097209820992100210121022103210421052106210721082109211021112112211321142115211621172118211921202121212221232124212521262127212821292130213121322133213421352136213721382139214021412142214321442145214621472148214921502151215221532154215521562157215821592160216121622163216421652166216721682169217021712172217321742175217621772178217921802181218221832184218521862187218821892190219121922193219421952196219721982199220022012202220322042205220622072208220922102211221222132214221522162217221822192220222122222223222422252226222722282229223022312232223322342235223622372238223922402241224222432244224522462247224822492250225122522253225422552256225722582259226022612262226322642265226622672268226922702271227222732274227522762277227822792280228122822283228422852286228722882289229022912292229322942295229622972298229923002301230223032304230523062307230823092310231123122313231423152316231723182319232023212322232323242325232623272328232923302331233223332334233523362337233823392340234123422343234423452346234723482349235023512352235323542355235623572358235923602361236223632364236523662367236823692370237123722373237423752376237723782379238023812382238323842385238623872388238923902391239223932394239523962397239823992400240124022403240424052406240724082409241024112412241324142415241624172418241924202421242224232424242524262427242824292430243124322433243424352436243724382439244024412442244324442445244624472448244924502451245224532454245524562457245824592460246124622463246424652466246724682469247024712472247324742475247624772478247924802481248224832484248524862487248824892490249124922493249424952496249724982499250025012502250325042505250625072508250925102511251225132514251525162517251825192520252125222523252425252526252725282529253025312532253325342535253625372538253925402541254225432544254525462547254825492550255125522553255425552556255725582559256025612562256325642565256625672568256925702571257225732574257525762577257825792580258125822583258425852586258725882589259025912592259325942595259625972598259926002601260226032604260526062607260826092610261126122613261426152616261726182619262026212622262326242625262626272628262926302631263226332634263526362637263826392640264126422643264426452646264726482649265026512652265326542655265626572658265926602661266226632664266526662667266826692670267126722673267426752676267726782679268026812682268326842685268626872688268926902691269226932694269526962697269826992700270127022703270427052706270727082709271027112712271327142715271627172718271927202721272227232724272527262727272827292730273127322733273427352736273727382739274027412742274327442745274627472748274927502751275227532754275527562757275827592760276127622763276427652766276727682769277027712772277327742775277627772778277927802781278227832784278527862787278827892790279127922793279427952796279727982799280028012802280328042805280628072808280928102811281228132814281528162817281828192820282128222823282428252826282728282829283028312832283328342835283628372838283928402841284228432844284528462847284828492850285128522853285428552856285728582859286028612862286328642865286628672868286928702871287228732874287528762877287828792880288128822883288428852886288728882889289028912892289328942895289628972898289929002901290229032904290529062907290829092910291129122913291429152916291729182919292029212922292329242925292629272928292929302931293229332934293529362937293829392940294129422943294429452946294729482949295029512952295329542955295629572958295929602961296229632964296529662967296829692970297129722973297429752976297729782979298029812982298329842985298629872988298929902991299229932994299529962997299829993000300130023003300430053006300730083009301030113012301330143015301630173018301930203021302230233024302530263027302830293030303130323033303430353036303730383039304030413042304330443045304630473048304930503051305230533054305530563057305830593060306130623063306430653066306730683069307030713072307330743075307630773078307930803081308230833084308530863087308830893090309130923093309430953096309730983099310031013102310331043105310631073108310931103111311231133114311531163117311831193120312131223123312431253126312731283129313031313132313331343135313631373138313931403141314231433144314531463147314831493150315131523153315431553156315731583159316031613162316331643165316631673168316931703171317231733174317531763177317831793180318131823183318431853186318731883189319031913192319331943195319631973198319932003201320232033204320532063207320832093210321132123213321432153216321732183219322032213222322332243225322632273228322932303231323232333234323532363237323832393240324132423243324432453246324732483249325032513252325332543255325632573258325932603261326232633264326532663267326832693270327132723273327432753276327732783279328032813282328332843285328632873288328932903291329232933294329532963297329832993300330133023303330433053306330733083309331033113312331333143315331633173318331933203321332233233324332533263327332833293330333133323333333433353336333733383339334033413342334333443345334633473348334933503351335233533354335533563357335833593360336133623363336433653366336733683369337033713372337333743375337633773378337933803381338233833384338533863387338833893390339133923393339433953396339733983399340034013402340334043405340634073408340934103411341234133414341534163417341834193420342134223423342434253426342734283429343034313432343334343435343634373438343934403441344234433444344534463447344834493450345134523453345434553456345734583459346034613462346334643465346634673468346934703471347234733474347534763477347834793480348134823483348434853486348734883489349034913492349334943495349634973498349935003501350235033504350535063507350835093510351135123513351435153516351735183519352035213522352335243525352635273528352935303531353235333534353535363537353835393540354135423543354435453546354735483549355035513552355335543555355635573558355935603561356235633564356535663567356835693570357135723573357435753576357735783579358035813582358335843585358635873588358935903591359235933594359535963597359835993600360136023603360436053606360736083609361036113612361336143615361636173618361936203621362236233624362536263627362836293630363136323633363436353636363736383639364036413642364336443645364636473648364936503651365236533654365536563657365836593660366136623663366436653666366736683669367036713672367336743675367636773678367936803681368236833684368536863687368836893690369136923693369436953696369736983699370037013702370337043705370637073708370937103711371237133714371537163717371837193720372137223723372437253726372737283729373037313732373337343735373637373738373937403741374237433744374537463747374837493750375137523753375437553756375737583759376037613762376337643765376637673768376937703771377237733774377537763777377837793780378137823783378437853786378737883789379037913792379337943795379637973798379938003801380238033804380538063807380838093810381138123813381438153816381738183819382038213822382338243825382638273828382938303831383238333834383538363837383838393840384138423843384438453846384738483849385038513852385338543855385638573858385938603861386238633864386538663867386838693870387138723873387438753876387738783879388038813882388338843885388638873888388938903891389238933894389538963897389838993900390139023903390439053906390739083909391039113912391339143915391639173918391939203921392239233924392539263927392839293930393139323933393439353936393739383939394039413942394339443945394639473948394939503951395239533954395539563957395839593960396139623963396439653966396739683969397039713972397339743975397639773978397939803981398239833984398539863987398839893990399139923993399439953996399739983999400040014002400340044005400640074008400940104011401240134014401540164017401840194020402140224023402440254026402740284029403040314032403340344035403640374038403940404041404240434044404540464047404840494050405140524053405440554056405740584059406040614062406340644065406640674068406940704071407240734074407540764077407840794080408140824083408440854086408740884089409040914092409340944095409640974098409941004101410241034104410541064107410841094110411141124113411441154116411741184119412041214122412341244125412641274128412941304131413241334134413541364137413841394140414141424143414441454146414741484149415041514152415341544155415641574158415941604161416241634164416541664167416841694170417141724173417441754176417741784179418041814182418341844185418641874188418941904191419241934194419541964197419841994200420142024203420442054206420742084209421042114212421342144215421642174218421942204221422242234224422542264227422842294230423142324233423442354236423742384239424042414242424342444245424642474248424942504251425242534254425542564257425842594260426142624263426442654266426742684269427042714272427342744275427642774278427942804281428242834284428542864287428842894290429142924293429442954296429742984299430043014302430343044305430643074308430943104311431243134314431543164317431843194320432143224323432443254326432743284329433043314332433343344335433643374338433943404341434243434344434543464347434843494350435143524353435443554356435743584359436043614362436343644365436643674368436943704371437243734374437543764377437843794380438143824383438443854386438743884389439043914392439343944395439643974398439944004401440244034404440544064407440844094410441144124413441444154416441744184419442044214422442344244425442644274428442944304431443244334434443544364437443844394440444144424443444444454446444744484449445044514452445344544455445644574458445944604461446244634464446544664467446844694470447144724473447444754476447744784479448044814482448344844485448644874488448944904491449244934494449544964497449844994500450145024503450445054506450745084509451045114512451345144515451645174518451945204521452245234524452545264527452845294530453145324533453445354536453745384539454045414542454345444545454645474548454945504551455245534554455545564557455845594560456145624563456445654566456745684569457045714572457345744575457645774578457945804581458245834584458545864587458845894590459145924593459445954596459745984599460046014602460346044605460646074608460946104611461246134614461546164617461846194620462146224623462446254626462746284629463046314632463346344635463646374638463946404641464246434644464546464647464846494650465146524653465446554656465746584659466046614662466346644665466646674668466946704671467246734674467546764677467846794680468146824683468446854686468746884689469046914692469346944695469646974698469947004701470247034704470547064707470847094710471147124713471447154716471747184719472047214722472347244725472647274728472947304731473247334734473547364737473847394740474147424743474447454746474747484749475047514752475347544755475647574758475947604761476247634764476547664767476847694770477147724773477447754776477747784779478047814782478347844785478647874788478947904791479247934794479547964797479847994800480148024803480448054806480748084809481048114812481348144815481648174818481948204821482248234824482548264827482848294830483148324833483448354836483748384839484048414842484348444845484648474848484948504851485248534854485548564857485848594860486148624863486448654866486748684869487048714872487348744875487648774878487948804881488248834884488548864887488848894890489148924893489448954896489748984899490049014902490349044905490649074908490949104911491249134914 |
- <?xml version="1.0" encoding="UTF-8"?>
- <queryMap desc="炼钢报表">
- <query id="reportGBData.Query" desc="钢包使用记录原始台账" fetchSize="10">
- <![CDATA[
- select to_char(OPTDATE, 'yyyy-MM-dd hh24:mi:ss') OPTDATE,
- HEATNO,
- CVTPOS,
- LADLEID,
- AGE,
- LVL,
- INSTANCE,
- VDSMELTTIME VDSTIME,
- '' ARFLUX,
- (select t.basename
- from scm_base_info t
- where t.basecode = a.skatefactory) SKATEFACTORY,
- (select b.PLANSTEEL
- from stl_bof_optinfo b
- where b.heatno = a.heatno
- union
- select c.PLANSTEEL
- from j#stl_bof_optinfo c
- where c.heatno = a.heatno) PLANSTEEL,
- (select d.SELETIME
- from stl_lfs_optinfo d
- where d.heatno = a.heatno
- and rownum = 1
- union
- select f.SELETIME
- from j#stl_lfs_optinfo f
- where f.heatno = a.heatno
- and rownum = 1) LFSSMELTTIME,
- (select USETIMES from dev_gb_base_info b where b.ladleid = a.ladleid) USETIMES
- from dev_gb_use_detail a $
- order by OPTDATE desc
- ]]>
- </query>
- <query id="LoadGBPno.Query" desc="初始化钢包号" fetchSize="10">
- <![CDATA[
- select t.ladleid from dev_gb_base_info t
- ]]>
- </query>
- <query id="LoadGetSteel.Query" desc="RH炉操作记录报表--加载钢种" fetchSize="10">
- <![CDATA[
- Select steel from scm_steel where LARGEFLAG='1' ORDER BY steel
- ]]>
- </query>
- <query id="LgRHReport.Query" desc="RH炉操作记录报表" fetchSize="10">
- <![CDATA[
- select distinct to_char(a.OPTDATE, 'yyyy-MM-dd hh24:mi') OPTDATE,
- a.HEATNO HEATNO,
- a.LMLTEMPT,
- decode(substr(a.shiftcode, 1, 1),
- '1',
- '白',
- '2',
- '中',
- '3',
- '晚') BC,
- decode(substr(a.shiftcode, 2, 1),
- '1',
- '甲',
- '2',
- '乙',
- '3',
- '丙',
- '4',
- '丁') BB,
- to_char(b.BALEPFTIME,'hh24:mi') DCCMTIME,
- e.MaxSPvalue,
- e.MinSPVALUE,
- e.AvgSPVALUE,
- a.PLANSTEEL PLANSTEEL,
- a.RHSNO RHSNO,
- I.POTNO POTNO,
- a.VACGROOVEID VACGROOVEID,
- a.ARRIVEO2,
- a.LEAVEO2,
- to_char(a.ARRIVETIME,'hh24:mi') ARRIVETIME,
- a.RESIDUETHICKNESS RESIDUETHICKNESS,
- to_char(a.REPOSEBEGINTIME, 'hh24:mi') STARTTIME,
- a.ARFTEMPT ARFTEMPT_A,
- case
- when a.REPOSECLOSETIME is not null then
- to_char(a.REPOSECLOSETIME, 'hh24:mi')
- when a.LD_DOWN_DTIME is not null then
- to_char(a.LD_DOWN_DTIME, 'hh24:mi')
- else
- to_char(a.LEAVETIME, 'hh24:mi')
- end ENDTIME,
- a.ARBTEMPT ARBTEMPT_B,
- a.O2USEDTOTALC O2USEDTOTALC,
- '' LANCE_A,
- a.O2USEDTOTALAL O2USEDTOTALAL,
- '' LANCE_B,
- '' OBFLOW,
- a.VAC_MIN VAC_MIN,
- a.VAC_TIME VAC_TIME,
- a.PURE_TIME PURE_TIME,
- a.N2_CONS_S N2_CONS_S,
- a.STEAMTEMPT STEAMTEMPT,
- a.STEAMPRESS STEAMPRESS,
- a.STEAMFLUX STEAMFLUX,
- round(u.JMWGT, 2) JMWGT,
- to_char(a.LEAVETIME,'hh24:mi') LEAVETIME,
- v.PLAN_LINES PLAN_LINES,
- a.ARBTEMPT ARBTEMPT,
- b.PFBALETEMPT,
- a.STATIONCODE STATIONCODE,
- a.DISPOSALTIME DISPOSALTIME,
-
- max(case when a.HEATNO = w.HEATNO and w.xh = w.cnt then w.C end) over(partition by a.HEATNO) Y_C,
- max(case when a.HEATNO = w.HEATNO and w.xh = w.cnt then w.SI end) over(partition by a.HEATNO) Y_SI,
- max(case when a.HEATNO = w.HEATNO and w.xh = w.cnt then w.MN end) over(partition by a.HEATNO) Y_MN,
- max(case when a.HEATNO = w.HEATNO and w.xh = w.cnt then w.P end) over(partition by a.HEATNO) Y_P,
- max(case when a.HEATNO = w.HEATNO and w.xh = w.cnt then w.S end) over(partition by a.HEATNO) Y_S,
- max(case when a.HEATNO = w.HEATNO and w.xh = w.cnt then w.ALS end) over(partition by a.HEATNO) Y_ALS,
- max(case when a.HEATNO = w.HEATNO and w.xh = w.cnt then w.Nb end) over(partition by a.HEATNO) Y_NB,
- max(case when a.HEATNO = w.HEATNO and w.xh = w.cnt then w.V end) over(partition by a.HEATNO) Y_V,
- max(case when a.HEATNO = t4.HEATNO and t4.xh = t4.cnt then t4.C end) over(partition by a.HEATNO) C_C,
- max(case when a.HEATNO = t4.HEATNO and t4.xh = t4.cnt then t4.SI end) over(partition by a.HEATNO) C_SI,
- max(case when a.HEATNO = t4.HEATNO and t4.xh = t4.cnt then t4.MN end) over(partition by a.HEATNO) C_MN,
- max(case when a.HEATNO = t4.HEATNO and t4.xh = t4.cnt then t4.P end) over(partition by a.HEATNO) C_P,
- max(case when a.HEATNO = t4.HEATNO and t4.xh = t4.cnt then t4.S end) over(partition by a.HEATNO) C_S,
- max(case when a.HEATNO = t4.HEATNO and t4.xh = t4.cnt then t4.ALS end) over(partition by a.HEATNO) C_ALS,
- max(case when a.HEATNO = t4.HEATNO and t4.xh = t4.cnt then T4.NB end) over(partition by a.HEATNO) C_NB,
- max(case when a.HEATNO = t4.HEATNO and t4.xh = t4.cnt then T4.V end) over(partition by a.HEATNO) C_V,
-
- max(case when a.HEATNO = t4.HEATNO and t4.xh = t4.cnt then t4.NI end) over(partition by a.HEATNO) C_NI,
- max(case when a.HEATNO = t4.HEATNO and t4.xh = t4.cnt then t4.MO end) over(partition by a.HEATNO) C_MO,
- max(case when a.HEATNO = t4.HEATNO and t4.xh = t4.cnt then T4.CR end) over(partition by a.HEATNO) C_CR,
- max(case when a.HEATNO = t4.HEATNO and t4.xh = t4.cnt then T4.CU end) over(partition by a.HEATNO) C_CU,
-
- GetStandardVaule(a.HEATNO,t4.MN,t4.NI,t4.MO,t4.NB,t4.V,t4.ALS,t4.CR,t4.CU) CFFC,
- "1#RISER",
- "1#Dow",
- "2#RISER",
- "2#Dow",
- "3#RISER",
- "3#Dow",
- "1#TOPTIMES",
- "1#MIDDLETIMES",
- "1#BOTTOMTIMES",
- "2#TOPTIMES",
- "2#MIDDLETIMES",
- "2#BOTTOMTIMES",
- "3#TOPTIMES",
- "3#MIDDLETIMES",
- "3#BOTTOMTIMES",
- "1#OBS",
- "1#OBZ",
- "1#OBX",
- "2#OBS",
- "2#OBZ",
- "2#OBX",
- "3#OBS",
- "3#OBZ",
- "3#OBX",
- "1#AGE",
- "2#AGE",
- "3#AGE",
- "1#JIAOB",
- "1#JIEB",
- "2#JIAOB",
- "2#JIEB"
- from (select *
- from STL_RHS_OPTINFO
- where $
- union
- select * from J#stl_RHS_OPTINFO where $) a,
-
- (select *
- from STL_CCM_OPTINFO
- where $
- union
- select * from J#stl_CCM_OPTINFO where $ ) b,
-
- (select *
- from stl_BOF_OPTINFO
- union
- select * from J#stl_BOF_OPTINFO ) I,
-
- (select HEATNO, sum(JMWGT) over(partition by HEATNO) JMWGT
- from stl_ADDITIVES
- where upper(substr(STATIONCODE, 1, 1)) = 'F'
- and MATERIELTYPE = 'WS'
- and $ ) u,
-
- (select y.*
- from (select x.*,
- count(1) over(partition by x.HEATNO) cnt,
- row_number() over(partition by x.HEATNO order by x.ASSAYTYPECODE) xh
- from (select t.*
- from stl_CHEMELEMENT t
- where upper(SUBSTR(CHECKNO, 12, 1)) = 'F'
- and upper(SUBSTR(T.CHECKNO, -1)) = 'S'
- and $
- union
- select t.*
- from j#stl_CHEMELEMENT t
- where upper(SUBSTR(CHECKNO, 12, 1)) = 'F'
- and upper(SUBSTR(T.CHECKNO, -1)) = 'S'
- and $
- ) x) y
- where y.xh in (1, round(y.cnt / 2), y.cnt)) w,
-
- (select y.*
- from (select x.*,
- count(1) over(partition by x.HEATNO) cnt,
- row_number() over(partition by x.HEATNO order by x.ASSAYTYPECODE desc) xh
- from (select *
- from stl_CHEMELEMENT
- where upper(SUBSTR(CHECKNO, -1)) = 'S'
- and upper(SUBSTR(CHECKNO, 12, 2)) = 'GP'
- and $
- union
- select t.*
- from j#stl_CHEMELEMENT t
- where upper(SUBSTR(T.CHECKNO, -1)) = 'S'
- and upper(SUBSTR(CHECKNO, 12, 2)) = 'GP'
- and $ ) x) y
- where y.xh = y.cnt) t4,
- (select HEATNO, maxSPvalue, MinSPVALUE, avgSPVALUE
- from (select max(SAMPLINGVALUE) maxSPvalue,
- min(SAMPLINGVALUE) MinSPVALUE,
- round(avg(SAMPLINGVALUE), 2) avgSPVALUE,
- HEATNO
- from stl_tempsampling where substr(samplingdepict,1,4)='中包温度'
- group by HEATNO
- union
- select max(SAMPLINGVALUE) maxSPvalue,
- min(SAMPLINGVALUE) MinSPVALUE,
- round(avg(SAMPLINGVALUE), 2) avgSPVALUE,
- HEATNO
- from J#stl_tempsampling where substr(samplingdepict,1,4)='中包温度'
- group by HEATNO)) e,
- (select *
- from ppc_steel_heat
- union
- select * from J#ppc_steel_heat) v,
- (select '' "1#RISER",
- '' "1#Dow",
- '' "2#RISER",
- '' "2#Dow",
- '' "3#RISER",
- '' "3#Dow",
- s.heatno HEATNO,
- u.TOPTIMES "1#TOPTIMES",
- u.MIDDLETIMES "1#MIDDLETIMES",
- u.BOTTOMTIMES "1#BOTTOMTIMES",
- '' "2#TOPTIMES",
- '' "2#MIDDLETIMES",
- '' "2#BOTTOMTIMES",
- '' "3#TOPTIMES",
- '' "3#MIDDLETIMES",
- '' "3#BOTTOMTIMES",
- '' "1#OBS",
- '' "1#OBZ",
- '' "1#OBX",
- '' "2#OBS",
- '' "2#OBZ",
- '' "2#OBX",
- '' "3#OBS",
- '' "3#OBZ",
- '' "3#OBX",
- u.AGE "1#AGE",
- '' "2#AGE",
- '' "3#AGE",
- '' "1#JIAOB",
- '' "1#JIEB",
- '' "2#JIAOB",
- '' "2#JIEB"
- from dev_zkc_base_info t, STL_RHS_OPTINFO s, DEV_ZKC_USE_DETAIL u
- where t.tankcarid = s.vacgrooveid
- and u.tankcarid = t.id) C
- where a.HEATNO = u.HEATNO(+)
- and a.HEATNO = w.HEATNO(+)
- and a.HEATNO = t4.HEATNO(+)
- and a.HEATNO = v.heatno(+)
- and a.HEATNO = b.HEATNO(+)
- and a.HEATNO = C.HEATNO(+)
- and a.HEATNO = e.HEATNO(+)
- and a.heatno = I.HEATNO(+)
- order by OPTDATE,
- to_char(a.REPOSEBEGINTIME, 'hh24:mi')
- ]]>
- </query>
- <query id="LoadGetSteel_bindFLHJ.Query" desc="RH炉操作记录报表--合金加入量" fetchSize="10">
- <![CDATA[
- select a.HEATNO HEATNO,
- substr(a.STATIONCODE, 2, 2) STATIONCODE,
- a.DISPOSALTIME DISPOSALTIME,
- a.MATERIELTYPE TYPE,
- a.MATERIELCODE CODE,
- t.MATERIELNAME NAME,
- round(sum(nvl(a.JMWGT, 0)) over(partition by a.HEATNO,
- a.STATIONCODE,
- a.DISPOSALTIME,
- a.MATERIELTYPE,
- a.MATERIELCODE),
- 2) WEIGHT
- from stl_ADDITIVES a, scm_MATERIEL t
- where substr(a.STATIONCODE, 1, 1) = 'F' and $
- and a.MATERIELCODE = t.MATERIELCODE(+)
- and a.MATERIELTYPE = t.MATERIELTYPE(+)
- ]]>
- </query>
- <query id="reportLFData.Query" desc="LF炉操作记录报表" fetchSize="10">
- <![CDATA[
- select distinct to_char(a.OPTDATE, 'yyyy-MM-dd hh24:mi') OPTDATE,
- a.HEATNO,
- decode(a.DESLAGGFLAG,'0','否','1','是') SFDZ,
- a.LMLTEMPT,
- substr(a.STATIONCODE,2,1) ||'LF'||'-'||a.WSID STATIONCODE,
- b.MaxSPvalue,
- b.MinSPVALUE,
- b.AvgSPVALUE,
- a.LFSNO,
- v.aim_grade_code PLANSTEEL,
- I.POTNO,
- I.POTWRAPSTATE,
- I.POTAGE,
- decode(substr(a.shiftcode, 1, 1),
- '1',
- '白',
- '2',
- '中',
- '3',
- '晚') BC,
- decode(substr(a.shiftcode, 2, 1),
- '1',
- '甲',
- '2',
- '乙',
- '3',
- '丙',
- '4',
- '丁') BB,
- nvl(u.PFBALEWGT,0)-nvl(u.BALELEAVEWGT,0) MOLSTLWGT,
- a.RESIDUETHICKNESS,
- to_char(a.ARRIVETIME, 'hh24:mi') ARRIVETIME,
- to_char(a.LEAVETIME, 'hh24:mi') LEAVETIME,
- a.ARRIVEWGT,
- a.LEAVEWGT,
- a.ARRIVEO2,
- a.LEAVEO2,
- '' WAL,
- '' WCA,
- '' SDDW,
- '' GLMB,
- to_char(a.SELESTARTTIME, 'hh24:mi') SELESTARTTIME,
- to_char(a.SELEENDTIME, 'hh24:mi') SELEENDTIME,
- a.SELETIME,
- a.ARRIVETEMPT LEAVETEMPT,
- '' "PPM",
- h.BLOWARPRESS,
- h.ARFLUX,
- '' WATERP,
- '' WATERFLOW,
- to_char(a.REPOSEBEGINTIME, 'hh24:mi') REPOSEBEGINTIME,
- a.REPOSETIME,
- a.FLEXIBLEBLOWTIME,
- v.PLAN_LINES,
- v.CAST_ID || '-' || v.cast_seq CAST_ID,
- a.LEAVETEMPT, PFBALETEMPT,
- decode(a.DESLAGGFLAG,'0','否','1','是') IFSLAG,
- I.POTDISTINCTION POTDISTINCTION,
- round((a.SELEENDTIME - a.SELESTARTTIME) * 24 * 60) YLZQ,
- to_char(a.REPOSECLOSETIME,'hh24:mi') QDTIME,
- a.DISPOSALTIME,
-
- max(case when a.HEATNO = w.HEATNO and w.xh = 1 then w.C end) over(partition by a.HEATNO) C_1,
- max(case when a.HEATNO = w.HEATNO and w.xh = 1 then w.SI end) over(partition by a.HEATNO) SI_1,
- max(case when a.HEATNO = w.HEATNO and w.xh = 1 then w.MN end) over(partition by a.HEATNO) MN_1,
- max(case when a.HEATNO = w.HEATNO and w.xh = 1 then w.P end) over(partition by a.HEATNO) P_1,
- max(case when a.HEATNO = w.HEATNO and w.xh = 1 then w.S end) over(partition by a.HEATNO) S_1,
- max(case when a.HEATNO = w.HEATNO and w.xh = 1 then w.ALS end) over(partition by a.HEATNO) ALS_1,
- max(case when a.HEATNO = w.HEATNO and w.xh = 1 then w.Alt end) over(partition by a.HEATNO) ALT_1,
- max(case when a.HEATNO = w.HEATNO and w.xh = 1 then w.Ca end) over(partition by a.HEATNO) CA_1,
- 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,
- 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,
- 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,
- 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,
- 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,
- 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,
- 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,
- 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,
-
- max(case when a.HEATNO = w.HEATNO and w.xh = w.cnt then w.C end) over(partition by a.HEATNO) C_3,
- max(case when a.HEATNO = w.HEATNO and w.xh = w.cnt then w.SI end) over(partition by a.HEATNO) SI_3,
- max(case when a.HEATNO = w.HEATNO and w.xh = w.cnt then w.MN end) over(partition by a.HEATNO) MN_3,
- max(case when a.HEATNO = w.HEATNO and w.xh = w.cnt then w.P end) over(partition by a.HEATNO) P_3,
- max(case when a.HEATNO = w.HEATNO and w.xh = w.cnt then w.S end) over(partition by a.HEATNO) S_3,
- max(case when a.HEATNO = w.HEATNO and w.xh = w.cnt then w.ALS end) over(partition by a.HEATNO) ALS_3,
- max(case when a.HEATNO = w.HEATNO and w.xh = w.cnt then w.ALT end) over(partition by a.HEATNO) ALT_3,
- max(case when a.HEATNO = w.HEATNO and w.xh = w.cnt then w.Ca end) over(partition by a.HEATNO) CA_3,
-
- max(case when a.heatno = t4.heatno and t4.xh = 1 then t4.c end) over(partition by a.heatno) C_4,
- max(case when a.heatno = t4.heatno and t4.xh = 1 then t4.SI end) over(partition by a.heatno) SI_4,
- max(case when a.heatno = t4.heatno and t4.xh = 1 then t4.MN end) over(partition by a.heatno) MN_4,
- max(case when a.heatno = t4.heatno and t4.xh = 1 then t4.P end) over(partition by a.heatno) P_4,
- max(case when a.heatno = t4.heatno and t4.xh = 1 then t4.S end) over(partition by a.heatno) S_4,
- max(case when a.heatno = t4.heatno and t4.xh = 1 then t4.ALS end) over(partition by a.heatno) ALS_4,
-
- max(case when a.heatno = t4.heatno and t4.xh = 1 then t4.NI end) over(partition by a.heatno) Ni_4,
- max(case when a.heatno = t4.heatno and t4.xh = 1 then t4.MO end) over(partition by a.heatno) Mo_4,
- max(case when a.heatno = t4.heatno and t4.xh = 1 then t4.NB end) over(partition by a.heatno) Nb_4,
- max(case when a.heatno = t4.heatno and t4.xh = 1 then t4.V end) over(partition by a.heatno) V_4,
- max(case when a.heatno = t4.heatno and t4.xh = 1 then t4.CR end) over(partition by a.heatno) Cr_4,
- max(case when a.heatno = t4.heatno and t4.xh = 1 then t4.CU end) over(partition by a.heatno) Cu_4,
- max(case when a.heatno = t4.heatno and t4.xh = 1 then t4.ALT end) over(partition by a.heatno) ALT_4,
- max(case when a.heatno = t4.heatno and t4.xh = 1 then t4.CA end) over(partition by a.heatno) CA_4,
-
- GetStandardVaule(a.HEATNO,t4.MN,t4.NI,t4.MO,t4.NB,t4.V,t4.ALS,t4.CR,t4.CU) CFFC
-
-
- from (select *
- from stl_LFS_OPTINFO
- where $
- union
- select * from J#stl_LFS_OPTINFO where $) a,
-
- (select y.*
- from (select x.*,
- count(1) over(partition by x.HEATNO) cnt,
- row_number() over(partition by x.HEATNO order by x.ASSAYTYPECODE) xh
- from (select *
- from stl_CHEMELEMENT
- where upper(SUBSTR(CHECKNO, 12, 1)) = 'E'
- and upper(SUBSTR(CHECKNO, -1)) = 'S'
-
- and $
- union
- select *
- from J#stl_CHEMELEMENT
- where upper(SUBSTR(CHECKNO, 12, 1)) = 'E'
- and upper(SUBSTR(CHECKNO, -1)) = 'S'
-
- and $) x) y
- where y.xh in (1, round(y.cnt / 2), y.cnt)) w,
-
- (select y.*
- from (select x.*,
- row_number() over(partition by x.HEATNO, substr(assaytypecode, 1, 1) order by x.ASSAYTYPECODE desc) xh,
- substr(assaytypecode, 1, 1) typecode
- from (select *
- from stl_CHEMELEMENT
- where upper(SUBSTR(CHECKNO, -1)) = 'S'
- and upper(SUBSTR(CHECKNO, 12, 2)) = 'GP'
- and $
- union
- select *
- from J#stl_CHEMELEMENT
- where upper(SUBSTR(CHECKNO, -1)) = 'S'
- and upper(SUBSTR(CHECKNO, 12, 2)) = 'GP'
- and $) x) y
- where y.xh = 1) t4,
-
- (select *
- from stl_CCM_OPTINFO
- where $
- union
- select * from J#stl_CCM_OPTINFO where $) u,
-
- (select HEATNO, maxSPvalue, MinSPVALUE, avgSPVALUE
- from (select max(SAMPLINGVALUE) maxSPvalue,
- min(SAMPLINGVALUE) MinSPVALUE,
- round(avg(SAMPLINGVALUE), 2) avgSPVALUE,
- HEATNO
- from stl_tempsampling where substr(samplingdepict,1,4)='中包温度'
- group by HEATNO
- union
- select max(SAMPLINGVALUE) maxSPvalue,
- min(SAMPLINGVALUE) MinSPVALUE,
- round(avg(SAMPLINGVALUE), 2) avgSPVALUE,
- HEATNO
- from J#stl_tempsampling where substr(samplingdepict,1,4)='中包温度'
- group by HEATNO)) b,
-
- (select *
- from stl_CAS_OPTINFO
- where $
- union
- select * from J#stl_CAS_OPTINFO where $) h,
-
- (select *
- from stl_BOF_OPTINFO
- where $
- union
- select * from J#stl_BOF_OPTINFO where $) I,
-
- (select *
- from ppc_steel_heat
- union
- select * from J#ppc_steel_heat) v
- where a.HEATNO = u.HEATNO(+)
- and a.HEATNO = w.HEATNO(+)
- and a.HEATNO = v.HEATNo(+)
- and a.HEATNO = t4.HEATNO(+)
- and a.heatno = h.heatno(+)
- and a.heatno = b.HEATNO(+)
- and a.heatno = I.HEATNO(+)
- order by OPTDATE
- ]]>
- </query>
- <query id="queryLFData_FLHJ.Query" desc="LF炉操作记录报表--合金加入量" fetchSize="10">
- <![CDATA[
- Select t.heatno,
- t.STATIONCODE,
- t.DISPOSALTIME,
- t1.materielcode,
- decode(t1.materieltype, 'WS', t1.materieltype, 'WL') MATERIELTYPE,
- t2.materielname,
- round(sum(nvl(t1.JMWGT, 0)) over(partition by t1.HEATNO,
- t1.STATIONCODE,
- t1.DISPOSALTIME,
- t1.MATERIELTYPE,
- t1.MATERIELCODE)) materielWgt
- from (select *
- from stl_LFS_optinfo
- where 1 = 1 $
- union
- select * from J#stl_LFS_Optinfo where 1 = 1 $) t
- left join stl_additives t1 on t.heatno = t1.heatno
- and 'E' || t.stationcode = t1.stationcode
- and t.disposaltime = t1.disposaltime
- left join scm_materiel t2 on t1.materielcode = t2.materielcode
- order by t.STATIONCODE, t.HEATNO
- ]]>
- </query>
- <query id="reportLFS_DPR.Query" desc="LF炉日生产统计报表--加载钢种" fetchSize="10">
- <![CDATA[
- Select steel from scm_steel where LARGEFLAG='1' ORDER BY steel
- ]]>
- </query>
- <query id="reportLFS.Query" desc="LF炉日生产统计报表" fetchSize="10">
- <![CDATA[
- select t.OPTDATE,
- t.SUMLUCOUNT DT1,
- sum(t.SUMLUCOUNT) over(order by t.OPTDATE) CM1,
- t.SUMPLANSTEEL DT2,
- sum(t.SUMPLANSTEEL) over(order by t.OPTDATE) CM2,
- round(t.DC, 2) DC,
- t.JIABANLS DT3,
- sum(t.JIABANLS) over(order by t.OPTDATE) CM3,
- round(t.JIABANYIELD, 2) DT4,
- round(sum(t.JIABANYIELD) over(order by t.OPTDATE), 2) CM4,
- t.YIBANLS DT5,
- sum(t.YIBANLS) over(order by t.OPTDATE) CM5,
- round(t.YIBANYIELD, 2) DT6,
- round(sum(t.YIBANYIELD) over(order by t.OPTDATE), 2) CM6,
- t.BINGBANLS DT7,
- sum(t.BINGBANLS) over(order by t.OPTDATE) CM7,
- round(t.BINGBANYIELD, 2) DT8,
- round(sum(t.BINGBANYIELD) over(order by t.OPTDATE), 2) CM8,
- t.DINGBANLS DT9,
- sum(t.DINGBANLS) over(order by t.OPTDATE) CM9,
- round(t.DINGBANYIELD, 2) DT10,
- round(sum(t.DINGBANYIELD) over(order by t.OPTDATE), 2) CM10
- from (select distinct x.OPTDATE,
- count(distinct x.heatno) over(partition by x.optdate) SUMLUCOUNT,
- sum(y.WEIGHT) over(partition by x.optdate) SUMPLANSTEEL,
- sum(y.WEIGHT) over(partition by x.optdate) / count(distinct x.heatno) over(partition by x.optdate) DC,
- sum(case x.shiftcode
- when '1' then
- 1
- end) over(partition by x.optdate) JIABANLS,
- sum(case x.shiftcode
- when '1' then
- y.WEIGHT
- end) over(partition by x.optdate) JIABANYIELD,
- sum(case x.shiftcode
- when '2' then
- 1
- end) over(partition by x.optdate) YIBANLS,
- sum(case x.shiftcode
- when '2' then
- y.WEIGHT
- end) over(partition by x.optdate) YIBANYIELD,
- sum(case x.shiftcode
- when '3' then
- 1
- end) over(partition by x.optdate) BINGBANLS,
- sum(case x.shiftcode
- when '3' then
- y.WEIGHT
- end) over(partition by x.optdate) BINGBANYIELD,
- sum(case x.shiftcode
- when '4' then
- 1
- end) over(partition by x.optdate) DINGBANLS,
- sum(case x.shiftcode
- when '4' then
- y.WEIGHT
- end) over(partition by x.optdate) DINGBANYIELD
- from (select a.heatno,
- a.plansteel,
- substr(a.shiftcode, 2, 1) shiftcode,
- to_char(a.optdate, 'yyyy-MM-dd') optdate
- from (select *
- from STL_LFS_OPTINFO
- where $
- union
- select * from J#STL_LFS_OPTINFO where $) a
- group by a.heatno,
- a.plansteel,
- to_char(a.optdate, 'yyyy-MM-dd'),
- a.shiftcode) x,
-
- (select heatno,
- nvl(PFBALEWGT, 0) - nvl(BALELEAVEWGT, 0) WEIGHT
- from (select row_number() over(partition by b.heatno order by b.disposaltime) xh,
- count(1) over(partition by b.heatno) cnt,
- b.*
- from (select *
- from STL_CCM_OPTINFO
- where $
- union
- select * from J#STL_CCM_OPTINFO where $) b)
- where xh = cnt) y
-
- where x.heatno = y.heatno(+)
- order by x.optdate) t
- ]]>
- </query>
- <query id="proc_GetHeatNo_All.Query" desc="生产日报表--所有炉号查询" fetchSize="10">
- <![CDATA[
- select A.HEATNO,
- A.STATIONCODE,
- nvl(round(B.CPL, 3), 0) CPL,
- case
- when (nvl(A.PFBALEWGT, 0) - nvl(A.BALELEAVEWGT, 0)) > 0 then
- round((nvl(A.PFBALEWGT, 0) - nvl(A.BALELEAVEWGT, 0)), 3)
- else
- 0
- end GSL,
- (select substr(mes_lg_common.getlgshift1(A.RecFlag), 2, 1) from dual) SHIFTCODE,
- case
- when to_char(A.RecFlag, 'yyyy-MM-dd HH24:mi') between ? and ? then
- '1'
- else
- '0'
- end BECURR
- from (select *
- from (select t.*,
- row_number() over(partition by HEATNO order by RecFlag) XH
- from (select t.recflag, t2.*
- from (select t.heatno,
- case
- when B1STARTTIME is not null then
- B1STARTTIME
- else
- OPTDATE
- end RecFlag
- from STL_bof_optinfo t
- where to_char(case when
- B1STARTTIME is not null then
- B1STARTTIME else OPTDATE end,
- 'yyyy-MM-dd') between ? and ?
- union all
- select t.heatno,
- case
- when B1STARTTIME is not null then
- B1STARTTIME
- else
- OPTDATE
- end RecFlag
- from J#STL_bof_optinfo t
- where to_char(case when
- B1STARTTIME is not null then
- B1STARTTIME else OPTDATE end,
- 'yyyy-MM-dd') between ? and ?) t,
- (select *
- from STL_ccm_optinfo
- union
- select * from J#STL_Ccm_Optinfo) t2
- where t.heatno = t2.heatno) t)
- where XH = 1) A,
- (select distinct substr(CHARGE_NO, 1, 10) CHARGE_NO,
- sum(nvl(SLAB_WGT, 0)) over(partition by substr(CHARGE_NO, 1, 10)) CPL
- from (select CHARGE_NO, (sum(SLAB_WGT)/1000) SLAB_WGT
- from stl_incision_view
- where to_char(SLAB_CUT_DTIME) between ? and
- ? Group by CHARGE_NO) t) B
- where A.HEATNO = B.CHARGE_NO(+)
- ]]>
- </query>
- <query id="proc_GetBOFInfo_CEF.Query" desc="生产日报表--BOF炉信息查询" fetchSize="10">
- <![CDATA[
- select HEATNO,
- STATIONCODE,
- substr(SHIFTCODE, 2, 1) SHIFTCODE,
- nvl(IRONPOTWGT, 0) TSL,
- nvl(PIGIRONWGT, 0) STL,
- nvl(WSTEELWGT, 0) FGL,
- case
- when to_char(RecFlag, 'yyyy-MM-dd HH24:mi') between ? and ? then
- '1'
- else
- '0'
- end BECURR
- from (select *
- from (select t.*,
- row_number() over(partition by t.HEATNO order by t.RecFlag) XH
- from (select t.*,
- case
- when B1STARTTIME is not null then
- B1STARTTIME
- else
- OPTDATE
- end RecFlag
- from STL_BOF_OPTINFO t
- where to_char(case when B1STARTTIME is not null then
- B1STARTTIME else OPTDATE end,
- 'yyyy-MM-dd') between ? and ?
- union all
- select t.*,
- case
- when B1STARTTIME is not null then
- B1STARTTIME
- else
- OPTDATE
- end RecFlag
- from J#STL_BOF_OPTINFO t
- where to_char(case when B1STARTTIME is not null then
- B1STARTTIME else OPTDATE end,
- 'yyyy-MM-dd') between ? and ? ) t)
- where XH = 1)
- ]]>
- </query>
- <query id="proc_GetLFSInfo_CEF.Query" desc="生产日报表--LF炉信息查询" fetchSize="10">
- <![CDATA[
- select HEATNO,
- STATIONCODE,
- substr(SHIFTCODE, 2, 1) SHIFTCODE,
- case
- when to_char(RecFlag, 'yyyy-MM-dd HH24:mi') between ? and ? then
- '1'
- else
- '0'
- end BECURR
- from (select *
- from (select t.*,
- row_number() over(partition by HEATNO order by RecFlag) XH
- from (select t.recflag, t2.*
- from (select t.heatno,
- case
- when B1STARTTIME is not null then
- B1STARTTIME
- else
- OPTDATE
- end RecFlag
- from stl_bof_optinfo t
- where to_char(case when
- B1STARTTIME is not null then
- B1STARTTIME else OPTDATE end,
- 'yyyy-MM-dd') between ? and ?
- union all
- select t.heatno,
- case
- when B1STARTTIME is not null then
- B1STARTTIME
- else
- OPTDATE
- end RecFlag
- from J#stl_bof_optinfo t
- where to_char(case when
- B1STARTTIME is not null then
- B1STARTTIME else OPTDATE end,
- 'yyyy-MM-dd') between ? and ? ) t,
- (select *
- from stl_LFS_optinfo
- union
- select * from J#stl_LFS_Optinfo) t2
- where t.heatno = t2.heatno) t)
- where XH = 1)
- ]]>
- </query>
- <query id="proc_GetRHSInfo_CEF.Query" desc="生产日报表--RH炉信息查询" fetchSize="10">
- <![CDATA[
- select HEATNO,
- STATIONCODE,
- substr(SHIFTCODE, 2, 1) SHIFTCODE,
- ?
- case
- when to_char(OPTDATE, 'yyyy-MM-dd HH24:mi') between ? and ? then
- '1'
- else
- '0'
- end BECURR
- from (select *
- from (select t.*,
- row_number() over(partition by t.HEATNO order by t.OPTDATE) XH
- from (select *
- from ?
- where to_char(OPTDATE, 'yyyy-MM-dd') between ? and ?
- union all
- select *
- from J# ?
- where to_char(OPTDATE, 'yyyy-MM-dd') between ? and ? ) t)
- where XH = 1)
- ]]>
- </query>
- <query id="reportBOFToCCMData.Query" desc="炼钢生产报表--加载钢种" fetchSize="10">
- <![CDATA[
- Select steel from scm_steel where LARGEFLAG='1' ORDER BY steel
- ]]>
- </query>
- <query id="BOFToCCMData.Query" desc="炼钢生产报表--炼钢生产报表数据查询" fetchSize="10">
- <![CDATA[
- SELECT DISTINCT T.HEATNO,
- T.STATIONCODE STATIONCODE,
- TO_CHAR(T.OPTDATE, 'YYYY-MM-DD') OPTDATE,
- T.SHIFTCODE,
- SUBSTR(T.SHIFTCODE, 1, 1) BC,
- SUBSTR(T.SHIFTCODE, 2, 1) BB,
- T4.AIM_GRADE_CODE PLANSTEEL,
- CASE
- WHEN SUBSTR(T4.FACT_ROUTE, 9, 2) != 'E0' THEN
- '是'
- ELSE
- '否'
- END FACT_ROUTE,
- '' MNFC,
- NVL((SELECT D.STDMIN
- FROM SCM_STANDARD_CHEM_VIEW D,
- (SELECT *
- FROM SCM_BASE_INFO D
- WHERE D.SORTCODE = '1006'
- ORDER BY D.BASECODE) H
- WHERE D.ITEMCODE = H.BASENAME
- AND STEEL = T4.AIM_GRADE_CODE
- AND STDSTYLE = '1'
- AND D.ITEMCODE = 'MN'
- GROUP BY STEEL,
- STDSTYLE,
- ITEMCODE,
- STD,
- STDMIN,
- STDMAX,
- BASENAME,
- BASECODE),
- 0) NKMN,
-
- CASE
- WHEN SUBSTR(T4.FACT_ROUTE, 9, 2) != 'E0' THEN
-
- NVL(MAX(CASE
- WHEN T.HEATNO = T10.HEATNO AND T10.XH = T10.CNT THEN
- T10.MN
- END) OVER(PARTITION BY T.HEATNO),
- 0) --精炼
- ELSE
- NVL(MAX(CASE
- WHEN T.HEATNO = T11.HEATNO AND T11.XH = T11.CNT THEN
- T11.MN
- END) OVER(PARTITION BY T.HEATNO),
- 0) --连铸
-
- END LFORCCM,
-
- T.SAGE,
- T.GAGE,
- T.OGGNUMID,
- T.EMOLSTLTIME,
- NVL(T.IRONPOTWGT, '0') IRONPOTWGT,
- T.WSTEELWGT,
- T.PIGIRONWGT,
- T.JOINMARLWGT,
- T.RSTEELWGT,
- T.RSWGT,
- T.IRONPOTID,
- T.N2CONSUME,
- T.ARCONSUME,
- T.POTDISTINCTION,
- T.POTWRAPSTATE,
- NVL(T.N2CONSUME, 0) + NVL(T.TOPN2CONSUME, 0) N2SUM,
- DECODE(SUBSTR(T.MOLIRNTYPE, 1, 1),
- '1',
- '半钢',
- DECODE(SUBSTR(T.MOLIRNTYPE, 1, 1),
- '2',
- '脱硫',
- DECODE(SUBSTR(T.MOLIRNTYPE, 1, 1),
- '3',
- '混铁炉',
- DECODE(SUBSTR(T.MOLIRNTYPE, 1, 1),
- '4',
- '直兑',
- '')))) MOLIRNTYPE,
- T.IRONTEMPERATURE,
- (SELECT CAST_ID || '-' || CAST_SEQ
- FROM PPC_STEEL_HEAT
- WHERE HEATNO = T.HEATNO) MOULDUMID,
- TO_CHAR(T.CHANGESTARTTIME, 'HH24:MI') CHANGESTARTTIME,
- TO_CHAR(T.OPENOXYGENTIME, 'HH24:MI') OPENOXYGENTIME,
- FLOOR(NVL(T.SUPPLYOXYGENTIME / 60, 0)) SUPPLYOXYGENTIME,
- --TO_CHAR(ROUND((NVL(T.SUPPLYOXYGENTIME, 0) / 60 -
- -- FLOOR(NVL(T.SUPPLYOXYGENTIME, 0) / 60)) * 60))
- T.SUPPLYOXYGENTIME SUPPLYOXYGENTIME_S,
- FLOOR(NVL(T.B1TIME / 60, 0)) B1TIME_M,
- --TO_CHAR(ROUND((NVL(T.B1TIME, 0) / 60 -
- -- FLOOR(NVL(T.B1TIME, 0) / 60)) * 60))
- T.B1TIME B1TIME_S,
- T.O2CONSUME,
- T.TERMINUSTEPT TAPPINGTEMPERATURE,
- T.POTNO,
- T.TAPPINGTIME,
- TO_CHAR(T.TAPPINGENDTIME, 'HH24:MI') TAPPINGENDTIME,
- TO_CHAR(T.TAPPINGSTARTTIME, 'HH24:MI') TAPPINGSTARTTIME,
- T.MOLSTLTEMPERATURE,
- T.CCMPLANTEMPT,
- TO_CHAR(T.CCMPLANTEMPTTIME, 'HH24:MI') CCMPLANTEMPTTIME,
- ROUND((T.PSENDTIME - T.CHANGESTARTTIME) * 24 * 60) CYCLE,
- DECODE(SUBSTR(T4.PLAN_ROUTE,
- INSTR(T4.PLAN_ROUTE, 'E') + 1,
- 1),
- '0',
- '',
- SUBSTR(T4.PLAN_ROUTE,
- INSTR(T4.PLAN_ROUTE, 'E') + 1,
- 1)) LFSNO,
- (T4.WIDTH || '*' || T4.THICK) ROLLING,
- T4.CAST_ID CCMNO,
- T5.SI I_SI,
- T5.MN I_MN,
- T5.P I_P,
- T5.S I_S,
- T5.C I_AS,
- T.BLOWO2TIMES DOWNHEATTIME,
- T6.PFBALEWGT GROSSWGT,
- T6.BALELEAVEWGT KONGWGT,
- T6.PFBALEWGT - T6.BALELEAVEWGT TAPPINGWGT,
- T7.ARFTEMPT CASBEFORETEMPERATURE,
- T7.ARBTEMPT CASAFTERTEMPERATURE,
- T.OPTDATE OPTDISP,
- T.GASRECOVERYTIME,
- DECODE(T8.ISRS,
- '1',
- '精炼回炉',
- DECODE(T6.ISRS, '1', '连铸回炉', '')) ISRS,
- DECODE(T8.ISRS,
- '1',
- DECODE(T6.ISRS,
- '1',
- (SELECT SUM(WEIGHTOFCVT)
- FROM (SELECT WEIGHTOFCVT, SMELTINGIDOFCVT
- FROM STL_ES_TAPHOLE
- UNION
- SELECT WEIGHTOFCVT, SMELTINGIDOFCVT
- FROM STL_MIS_TAPHOLE)
- WHERE SMELTINGIDOFCVT = T.HEATNO),
- ''),
- '') ISRSWGT,
- NVL(T.IRONPOTWGT, '0') + NVL(T.WSTEELWGT, '0') +
- NVL(T.PIGIRONWGT, '0') + NVL(T.JOINMARLWGT, '0') +
- NVL(T.RSTEELWGT, '0') + NVL(T.RSWGT, '0') JOINSTOVEWGT,
- DECODE((NVL(T.IRONPOTWGT, '0') + NVL(T.WSTEELWGT, '0') +
- NVL(T.PIGIRONWGT, '0') + NVL(T.JOINMARLWGT, '0') +
- NVL(T.RSTEELWGT, '0') + NVL(T.RSWGT, '0')),
- 0,
- 0,
- ROUND((T6.PFBALEWGT - T6.BALELEAVEWGT) /
- (NVL(T.IRONPOTWGT, '0') + NVL(T.WSTEELWGT, '0') +
- NVL(T.PIGIRONWGT, '0') +
- NVL(T.JOINMARLWGT, '0') +
- NVL(T.RSTEELWGT, '0') + NVL(T.RSWGT, '0')) * 100,
- 2)) STEELOUT,
- T8.LADLECOVERAGE,
- T6.MWRAPNO,
- T8.ELETRICITYCONSUME,
- T7.ARFTEMPT,
- ROUND(((T8.REPOSEBEGINTIME - T8.ARRIVETIME) * 24 * 60), 0) AWAITTIME,
- T8.REFINETIME,
- T8.FLEXIBLEBLOWTIME,
- T8.ARRIVETEMPT,
- T8.LEAVETEMPT,
- T7.BLOWARTIME,
- T6.BILLETFIXSIZE,
- T9.BILLETNUM,
- T9.BILLETWGT
- FROM (SELECT *
- FROM STL_BOF_OPTINFO
- WHERE 1 = 1 $
- UNION
- SELECT * FROM J#STL_BOF_OPTINFO WHERE 1 = 1 $) T
- LEFT JOIN (SELECT *
- FROM PPC_STEEL_HEAT
- UNION
- SELECT * FROM J#PPC_STEEL_HEAT) T4
- ON T.HEATNO = T4.HEATNO
- LEFT JOIN (SELECT *
- FROM STL_CHEMELEMENT
- UNION
- SELECT * FROM J#STL_CHEMELEMENT) T5
- ON T5.HEATNO = T.MOLIRNSOURCE
- LEFT JOIN (SELECT HEATNO,
- PFBALEWGT,
- BALELEAVEWGT,
- ISRS,
- MWRAPNO,
- BILLETFIXSIZE
- FROM STL_CCM_OPTINFO
- UNION
- SELECT HEATNO,
- PFBALEWGT,
- BALELEAVEWGT,
- ISRS,
- MWRAPNO,
- BILLETFIXSIZE
- FROM J#STL_CCM_OPTINFO) T6
- ON T.HEATNO = T6.HEATNO
- LEFT JOIN (SELECT HEATNO, ARFTEMPT, ARBTEMPT, BLOWARTIME
- FROM STL_CAS_OPTINFO
- UNION
- SELECT HEATNO, ARFTEMPT, ARBTEMPT, BLOWARTIME
- FROM J#STL_CAS_OPTINFO) T7
- ON T.HEATNO = T7.HEATNO
- LEFT JOIN (SELECT HEATNO,
- MAX(ISRS) ISRS,
- MAX(ELETRICITYCONSUME) ELETRICITYCONSUME,
- MAX(LADLECOVERAGE) LADLECOVERAGE,
- MAX(REPOSEBEGINTIME) REPOSEBEGINTIME,
- MAX(ARRIVETIME) ARRIVETIME,
- MAX(REFINETIME) REFINETIME,
- MAX(FLEXIBLEBLOWTIME) FLEXIBLEBLOWTIME,
- MAX(ARRIVETEMPT) ARRIVETEMPT,
- MAX(LEAVETEMPT) LEAVETEMPT
- FROM (SELECT HEATNO,
- ISRS,
- ELETRICITYCONSUME,
- LADLECOVERAGE,
- REPOSEBEGINTIME,
- ARRIVETIME,
- REFINETIME,
- FLEXIBLEBLOWTIME,
- ARRIVETEMPT,
- LEAVETEMPT
- FROM STL_LFS_OPTINFO
- UNION ALL
- SELECT HEATNO,
- ISRS,
- ELETRICITYCONSUME,
- LADLECOVERAGE,
- REPOSEBEGINTIME,
- ARRIVETIME,
- REFINETIME,
- FLEXIBLEBLOWTIME,
- ARRIVETEMPT,
- LEAVETEMPT
- FROM J#STL_LFS_OPTINFO)
- GROUP BY HEATNO) T8
- ON T.HEATNO = T8.HEATNO
- LEFT JOIN (SELECT S.HEATNO, S.BILLETNUM, S.BILLETWGT
- FROM (SELECT T.HEATNO,
- COUNT(1) BILLETNUM,
- SUM(NVL(T.WEIGHT, 0)) BILLETWGT
- FROM STL_INCISION T
- GROUP BY HEATNO, WEIGHT
- UNION
- SELECT T.HEATNO,
- COUNT(1) BILLETNUM,
- SUM(NVL(T.WEIGHT, 0)) BILLETWGT
- FROM Y#STL_INCISION T
- GROUP BY HEATNO, WEIGHT) S) T9
- ON T.HEATNO = T9.HEATNO
- LEFT JOIN (SELECT Y.* --LFS
- FROM (SELECT X.*,
- COUNT(1) OVER(PARTITION BY X.HEATNO) CNT,
- ROW_NUMBER() OVER(PARTITION BY X.HEATNO ORDER BY X.ASSAYTYPECODE DESC, X.ASSAYDATE DESC) XH,
- SUBSTR(X.ASSAYTYPECODE, 1, 1) GW
- FROM (SELECT *
- FROM STL_CHEMELEMENT
- WHERE UPPER(SUBSTR(CHECKNO, 12, 1)) = 'E'
- AND UPPER(SUBSTR(CHECKNO, -1)) = 'S'
- UNION
- SELECT *
- FROM J#STL_CHEMELEMENT
- WHERE UPPER(SUBSTR(CHECKNO, 12, 1)) = 'E'
- AND UPPER(SUBSTR(CHECKNO, -1)) = 'S') X) Y) T10
- ON T.HEATNO = T10.HEATNO
- LEFT JOIN (SELECT Y.* --CCM
- FROM (SELECT X.*,
- COUNT(1) OVER(PARTITION BY X.HEATNO) CNT,
- ROW_NUMBER() OVER(PARTITION BY X.HEATNO ORDER BY X.ASSAYTYPECODE DESC, X.ASSAYDATE DESC) XH,
- SUBSTR(X.ASSAYTYPECODE, 1, 1) GW
- FROM (SELECT *
- FROM STL_CHEMELEMENT
- WHERE UPPER(SUBSTR(CHECKNO, -1)) = 'S'
- AND UPPER(SUBSTR(CHECKNO, 12, 2)) = 'GP'
- UNION
- SELECT *
- FROM J#STL_CHEMELEMENT
- WHERE UPPER(SUBSTR(CHECKNO, -1)) = 'S'
- AND UPPER(SUBSTR(CHECKNO, 12, 2)) = 'GP') X) Y) T11
- ON T.HEATNO = T11.HEATNO
- ORDER BY T.OPTDATE
- ]]>
- </query>
- <query id="queryBofData_FLHJ.Query" desc="炼钢生产报表--取转炉辅料合金数据" fetchSize="10">
- <![CDATA[
- Select t.heatno,
- t.STATIONCODE,
- t.DISPOSALTIME,
- t1.materielcode,
- t1.materieltype,
- t2.materielname,
- round(sum(nvl(t1.JMWGT, 0)) over(partition by t1.HEATNO,
- t1.STATIONCODE,
- t1.DISPOSALTIME,
- t1.MATERIELTYPE,
- t1.MATERIELCODE)) materielWgt
- from (select *
- from stl_bof_optinfo
- where 1 = 1 $
- union
- select * from J#stl_Bof_Optinfo where 1 = 1 $ ) t
- left join stl_additives t1 on t.heatno = t1.heatno
- and 'C' || t.stationcode = t1.stationcode
- and t.disposaltime = t1.disposaltime
- left join scm_materiel t2 on t1.materielcode = t2.materielcode
- order by t.STATIONCODE, t.HEATNO
- ]]>
- </query>
- <query id="queryBofLfsData_FLHJ.Query" desc="炼钢生产报表--取精炼辅料合金数据" fetchSize="10">
- <![CDATA[
- Select t.heatno,
- t.STATIONCODE,
- t.DISPOSALTIME,
- t1.materielcode,
- decode(t1.materieltype, 'WS', t1.materieltype, 'WL') MATERIELTYPE,
- t2.materielname,
- round(sum(nvl(t1.JMWGT, 0)) over(partition by t1.HEATNO,
- t1.STATIONCODE,
- t1.DISPOSALTIME,
- t1.MATERIELTYPE,
- t1.MATERIELCODE)) materielWgt
- from (select *
- from stl_bof_optinfo
- where 1 = 1 $
- union
- select * from J#stl_Bof_Optinfo where 1 = 1 $ ) t
- left join stl_additives t1 on t.heatno = t1.heatno
- and 'C' || t.stationcode = t1.stationcode
- and t.disposaltime = t1.disposaltime
- left join scm_materiel t2 on t1.materielcode = t2.materielcode
- order by t.STATIONCODE, t.HEATNO
- ]]>
- </query>
- <query id="VDSTEEL.Query" desc="VD炉操作记录报表--加载钢种" fetchSize="10">
- <![CDATA[
- Select steel from scm_steel where LARGEFLAG='1' ORDER BY steel
- ]]>
- </query>
- <query id="VDData.Query" desc="VD炉操作记录报表" fetchSize="10">
- <![CDATA[
- select distinct to_char(a.OPTDATE, 'yyyy-MM-dd hh24:mi') OPTDATE,
- a.HEATNO,
- decode(substr(a.shiftcode, 1, 1),
- '1',
- '白',
- '2',
- '中',
- '3',
- '晚') BC,
- decode(substr(a.shiftcode, 2, 1),
- '1',
- '甲',
- '2',
- '乙',
- '3',
- '丙',
- '4',
- '丁') BB,
- a.LMLTEMPT,
- b.MaxSPvalue,
- b.MinSPVALUE,
- b.AvgSPVALUE,
- a.PLANSTEEL,
- a.HEATPROCESSNO,
- to_char(a.ARRIVETIME,'hh24:mi:ss')ARRIVETIME,
- I.POTNO,
- I.POTDISTINCTION,
- a.WSID,
- a.RESIDUETHICKNESS,
- a.CLEARENCELHEIGHT,
- a.ARFTEMPT,
- to_char(a.VACBEGINTIME,'hh24:mi')VACBEGINTIME,
- a.ARRIVEH,
- a.VACUUMPRESS VAC_MIN,
- to_char(a.HYDGENSTARTTIME,'hh24:mi')HYDGENSTARTTIME,
- a.ARBTEMPT ARBTEMPT_A,
- to_char(a.VACLOSETIME,'hh24:mi')VACLOSETIME,
- a.LEAVEH,
- to_char(a.HYDGENENDTIME,'hh24:mi')HYDGENENDTIME,
- '' PROPHASE,
- '' INTERIM,
- '' LATE,
- a.FLEXIBLEBLOWTIME,
- --a.VACUUMPRESS,
- FLOOR(nvl(a.VAC_KEEP_TIME / 60, 0)) VAC_KEEP_TIME,
- a.VAC_TIME VACUUMTIME,
- a.STEAM_TEM,
- a.STEAM_PRES,
- a.STEAM_FLUX,
- to_char(a.LEAVETIME,'hh24:mi') LEAVETIME,
- p.PLAN_LINES,
- u.PFBALETEMPT,
- a.ARBTEMPT,
- p.HEAT_NUM,
- a.MEMO,
- max(case when a.HEATNO = w.HEATNO and w.xh = w.cnt then w.c end) over(partition by a.HEATNO) Y_C,
- max(case when a.HEATNO = w.HEATNO and w.xh = w.cnt then w.si end) over(partition by a.HEATNO) Y_SI,
- max(case when a.HEATNO = w.HEATNO and w.xh = w.cnt then w.MN end) over(partition by a.HEATNO) Y_MN,
- max(case when a.HEATNO = w.HEATNO and w.xh = w.cnt then w.P end) over(partition by a.HEATNO) Y_P,
- max(case when a.HEATNO = w.HEATNO and w.xh = w.cnt then w.S end) over(partition by a.HEATNO) Y_S,
- max(case when a.HEATNO = w.HEATNO and w.xh = w.cnt then w.ALS end) over(partition by a.HEATNO) Y_ALS,
- max(case when a.HEATNO = w.HEATNO and w.xh = w.cnt then w.NB end) over(partition by a.HEATNO) Y_NB,
- max(case when a.HEATNO = w.HEATNO and w.xh = w.cnt then w.V end) over(partition by a.HEATNO) Y_V,
- max(case when a.HEATNO = w.HEATNO and w.xh = w.cnt then w.TI end) over(partition by a.HEATNO) Y_TI,
- max(case when a.HEATNO = w.HEATNO and w.xh = w.cnt then w.CU end) over(partition by a.HEATNO) Y_CU,
- max(case when a.HEATNO = w.HEATNO and w.xh = w.cnt then w.N end) over(partition by a.HEATNO) Y_N,
- max(case when a.HEATNO = w.HEATNO and w.xh = w.cnt then w.B end) over(partition by a.HEATNO) Y_B,
-
- max(case when a.HEATNO = t4.HEATNO and t4.xh = t4.cnt then t4.c end) over(partition by a.HEATNO) C_C,
- max(case when a.HEATNO = t4.HEATNO and t4.xh = t4.cnt then t4.SI end) over(partition by a.HEATNO) C_SI,
- max(case when a.HEATNO = t4.HEATNO and t4.xh = t4.cnt then t4.MN end) over(partition by a.HEATNO) C_MN,
- max(case when a.HEATNO = t4.HEATNO and t4.xh = t4.cnt then t4.P end) over(partition by a.HEATNO) C_P,
- max(case when a.HEATNO = t4.HEATNO and t4.xh = t4.cnt then t4.S end) over(partition by a.HEATNO) C_S,
- max(case when a.HEATNO = t4.HEATNO and t4.xh = t4.cnt then t4.ALS end) over(partition by a.HEATNO) C_ALS,
- max(case when a.HEATNO = t4.HEATNO and t4.xh = t4.cnt then t4.NB end) over(partition by a.HEATNO) C_NB,
- max(case when a.HEATNO = t4.HEATNO and t4.xh = t4.cnt then t4.V end) over(partition by a.HEATNO) C_V,
- max(case when a.HEATNO = t4.HEATNO and t4.xh = t4.cnt then t4.TI end) over(partition by a.HEATNO) C_TI,
- max(case when a.HEATNO = t4.HEATNO and t4.xh = t4.cnt then t4.CU end) over(partition by a.HEATNO) C_CU,
- max(case when a.HEATNO = t4.HEATNO and t4.xh = t4.cnt then t4.N end) over(partition by a.HEATNO) C_N,
- max(case when a.HEATNO = t4.HEATNO and t4.xh = t4.cnt then t4.B end) over(partition by a.HEATNO) C_B,
-
- max(case when a.HEATNO = t4.HEATNO and t4.xh = t4.cnt then t4.N end) over(partition by a.HEATNO) C_NI,
- max(case when a.HEATNO = t4.HEATNO and t4.xh = t4.cnt then t4.B end) over(partition by a.HEATNO) C_MO,
- max(case when a.HEATNO = t4.HEATNO and t4.xh = t4.cnt then t4.N end) over(partition by a.HEATNO) C_CR,
- GetStandardVaule(a.HEATNO,t4.MN,t4.NI,t4.MO,t4.NB,t4.V,t4.ALS,t4.CR,t4.CU) CFFC,
- '' ETGYEXRECORD
- from (select *
- from stl_vds_optinfo $
- union
- select * from j#stl_vds_optinfo $ ) a,
- (select *
- from stl_BOF_OPTINFO
- union
- select * from J#stl_BOF_OPTINFO ) I,
- (select *
- from STL_CCM_OPTINFO
- $
- union
- select * from J#stl_CCM_OPTINFO $ ) u,
- (select HEATNO, maxSPvalue, MinSPVALUE, avgSPVALUE
- from (select max(SAMPLINGVALUE) maxSPvalue,
- min(SAMPLINGVALUE) MinSPVALUE,
- round(avg(SAMPLINGVALUE), 2) avgSPVALUE,
- HEATNO
- from stl_tempsampling where substr(samplingdepict,1,4)='中包温度'
- group by HEATNO
- union
- select max(SAMPLINGVALUE) maxSPvalue,
- min(SAMPLINGVALUE) MinSPVALUE,
- round(avg(SAMPLINGVALUE), 2) avgSPVALUE,
- HEATNO
- from J#stl_tempsampling where substr(samplingdepict,1,4)='中包温度'
- group by HEATNO)) b,
- (select *
- from ppc_steel_heat
- union
- select * from J#ppc_steel_heat) p,
- (select y.*
- from (select x.*,count(1) over(partition by x.HEATNO) cnt,
- row_number() over(partition by x.HEATNO order by x.ASSAYTYPECODE) xh
- from (select t.*
- from stl_CHEMELEMENT t where upper(SUBSTR(CHECKNO, 12, 1)) = 'I'
- and upper(SUBSTR(CHECKNO, -1)) = 'S'
- and $
- union
- select t.*
- from j#stl_CHEMELEMENT t where upper(SUBSTR(CHECKNO, 12, 1)) = 'I'
- and upper(SUBSTR(CHECKNO, -1)) = 'S'
- and $
- ) x) y
- where y.xh in (1, round(y.cnt / 2), y.cnt)) w,
- (select y.*
- from (select x.*,count(1) over(partition by x.HEATNO) cnt,
- row_number() over (partition by x.HEATNO order by x.ASSAYTYPECODE) xh
- from (select t.*
- from stl_CHEMELEMENT t
- where upper(SUBSTR(CHECKNO, -1)) = 'S'
- and upper(SUBSTR(CHECKNO, 12, 2)) = 'GP'
- and $
- union
- select t.*
- from J#stl_CHEMELEMENT t
- where upper(SUBSTR(CHECKNO, -1)) = 'S'
- and upper(SUBSTR(CHECKNO, 12, 2)) = 'GP'
- and $
- ) x) y
- ) t4
- where a.HEATNO = p.HEATNO(+)
- and a.HEATNO = w.HEATNO(+)
- and a.HEATNO = t4.HEATNO(+)
- and a.HEATNO = u.HEATNO(+)
- and a.heatno = b.HEATNO(+)
- and a.heatno = I.HEATNO(+)
- order by OPTDATE
- ]]>
- </query>
- <query id="LgHMPReport.Query" desc="脱硫操作记录报表" fetchSize="10">
- <![CDATA[
- select distinct t.misid,
- t.stoveid,
- t.stovetime,
- t.tapholeno,
- to_char(b.CHANGESTARTTIME,'HH24:mi') CHANGESTARTTIME,
- to_char(t.HSTAPHOLETIME,'HH24:mi') HSTAPHOLETIME,
- to_char(a.DR_BEF_ENDTIME,'HH24:mi') DR_BEF_ENDTIME,
- to_char(a.DR_AFT_ENDTIME,'HH24:mi') DR_AFT_ENDTIME,
- case substr(t.SHIFTCODE, 1, 1)
- when '1' then
- '白'
- when '2' then
- '中'
- when '3' then
- '晚'
- end BC,
- case substr(t.SHIFTCODE, 2, 1)
- when '1' then
- '甲'
- when '2' then
- '乙'
- when '3' then
- '丙'
- when '4' then
- '丁'
- end BB,
- decode(substr(t.molirnsource,1,1),'J','转炉','脱硫') molirnsource,
- a.HUDWID,
- round(t.TFPOTWGT,2) ARRIVEWGT,
- CASE
- when nvl(a.LEAVEWGT, 0) > 0 and nvl(a.ARRIVEWGT, 0) > 0 and
- nvl(a.LEAVEWGT, 0) < nvl(a.ARRIVEWGT, 0) THEN
- round(t.TFPOTWGT -
- (nvl(a.ARRIVEWGT, 0) - nvl(a.LEAVEWGT, 0)),
- 2)
- ELSE
- t.TFPOTWGT
- END LEAVEWGT,
- round(t.TFPOTWGT-(t.TFPOTWGT -
- (nvl(a.ARRIVEWGT, 0) - nvl(a.LEAVEWGT, 0))),
- 2) DRQUANTITY,
- CASE
- WHEN nvl(a.LEAVEWGT, 0) > 0 THEN
- (nvl(a.LEAVEWGT, 0) - nvl(t4.TAREWEIGHT,0))
- ELSE
- 0
- END LEAVEWGT_OUT,
- CASE
- WHEN nvl(a.ARRIVEWGT, 0) > 0 THEN
- (nvl(a.ARRIVEWGT, 0) - nvl(t4.TAREWEIGHT,0))
- ELSE
- 0
- END ARRIVEWGT_OUT,
-
- t4.TAREWEIGHT IRONPOTBOFWGT,
- t.TFPOTID || '-' || t4.age IRONPWRAPNO,
- CASE
- WHEN a.HUDWID IS NOT NULL THEN
- a.PLANSTEEL
- ELSE
- t.PLANSTEEL
- END PLANSTEEL,
- to_char(a.ARRIVETIME, 'HH24:mi') ARRIVETIME,
- to_char(a.LEAVETIME, 'HH24:mi') LEAVETIME,
- a.DR_BEF_TIME,
- a.DR_AFT_TIME,
- a.SWBTEMPERATURE,
- a.SWFTEMPERATURE,
- a.DREGSSOLVENT,
- a.CHURNUPDATE,
- a.MOSTROTATESPEED,
- a.SGGAGE,
- a.DFRWGT,
- CASE
- WHEN a.HEATNO IS NOT NULL THEN
- a.HEATNO
- WHEN substr(t.MOLIRNSOURCE, 1, 1) = 'J' then
- t.MOLIRNSOURCE
- END HEATNO,
- t.SI SI_BF,
- t.MN MN_BF,
- t.P P_BF,
- t.S S_BF,
- t2.SI,
- t2.MN,
- t2.P,
- t2.S,
- t3.SI SI2,
- t3.MN MN2,
- t3.P P2,
- t3.S S2,
- a.MEMO
-
- from (select *
- from stl_mis_importiron
- where to_char(operationdate, 'yyyy-MM-dd hh24:mi:ss') between ? AND
- ?) t,
- (select *
- from STL_HMP_OPTINFO
- where to_char(OPTDATE, 'yyyy-MM-dd') between ? AND
- ?
- union
- select *
- from J#STL_HMP_OPTINFO
- where to_char(OPTDATE, 'yyyy-MM-dd') between ? AND
- ?
- ) a,
-
- (select *
- from STL_bof_OPTINFO
- where to_char(OPTDATE, 'yyyy-MM-dd') between ? AND
- ?
- union
- select *
- from J#STL_bof_OPTINFO
- where to_char(OPTDATE, 'yyyy-MM-dd') between ? AND
- ?
- ) b,
-
- (select HEATNO, SI, MN, P, S, ASSAYTYPECODE
- from stl_CHEMELEMENT
- WHERE upper(SUBSTR(ASSAYTYPECODE, 1, 1)) = 'B'
- and to_char(assaydate, 'yyyy-MM-dd') between ? AND
- ?
- union
- select HEATNO, SI, MN, P, S, ASSAYTYPECODE
- from J#stl_CHEMELEMENT
- WHERE upper(SUBSTR(ASSAYTYPECODE, 1, 1)) = 'B'
- and to_char(assaydate, 'yyyy-MM-dd') between ? AND
- ?) t2,
- (select y.*
- from (select x.*,
- row_number() over(partition by x.HEATNO, substr(assaytypecode, 1, 1) order by x.ASSAYTYPECODE desc) xh,
- substr(assaytypecode, 1, 1) typecode
- from (select *
- from stl_CHEMELEMENT
- where upper(SUBSTR(ASSAYTYPECODE, 1, 1)) = 'B'
- and to_char(assaydate, 'yyyy-MM-dd') between
- ? AND ?
- union
- select *
- from J#stl_CHEMELEMENT
- where upper(SUBSTR(ASSAYTYPECODE, 1, 1)) = 'B'
- and to_char(assaydate, 'yyyy-MM-dd') between
- ? AND ?) x) y
- where y.xh = 1) t3,
- dev_ib_base_info t4
- where t.MOLIRNSOURCE = a.hudwid(+) and t.MOLIRNSOURCE = b.heatno(+)
- and t.misid = t2.heatno(+)
- and a.HUDWID = t3.heatno(+) and t.TFPOTID =t4.ladleid (+)
- AND substr(T.MOLIRNSOURCE,3, 1) =
- decode(?, null, substr(T.MOLIRNSOURCE, 3, 1), ?)
- and substr(T.MOLIRNSOURCE,1, 1) =
- decode(?, null, substr(T.MOLIRNSOURCE, 1, 1), ?)
- and substr(T.SHIFTCODE, 1, 1) =
- decode(?, null, substr(T.SHIFTCODE, 1, 1), ?)
- and substr(T.SHIFTCODE, 2, 1) =
- decode(?, null, substr(T.SHIFTCODE, 2, 1), ?)
- order by t.misid
-
- ]]>
- </query>
- <query id="reportRHS_DPR.Query" desc="RH炉日生产统计报表--加载钢种" fetchSize="10">
- <![CDATA[
- Select steel from scm_steel where LARGEFLAG='1' ORDER BY steel
- ]]>
- </query>
- <query id="reportRHS.Query" desc="RH炉日生产统计报表" fetchSize="10">
- <![CDATA[
- select t.OPTDATE,
- t.SUMLUCOUNT DT1,
- sum(t.SUMLUCOUNT) over(order by t.OPTDATE) CM1,
- t.SUMPLANSTEEL DT2,
- sum(t.SUMPLANSTEEL) over(order by t.OPTDATE) CM2,
- round(t.DC, 2) DC,
- t.JIABANLS DT3,
- sum(t.JIABANLS) over(order by t.OPTDATE) CM3,
- round(t.JIABANYIELD, 2) DT4,
- round(sum(t.JIABANYIELD) over(order by t.OPTDATE), 2) CM4,
- t.YIBANLS DT5,
- sum(t.YIBANLS) over(order by t.OPTDATE) CM5,
- round(t.YIBANYIELD, 2) DT6,
- round(sum(t.YIBANYIELD) over(order by t.OPTDATE), 2) CM6,
- t.BINGBANLS DT7,
- sum(t.BINGBANLS) over(order by t.OPTDATE) CM7,
- round(t.BINGBANYIELD, 2) DT8,
- round(sum(t.BINGBANYIELD) over(order by t.OPTDATE), 2) CM8,
- t.DINGBANLS DT9,
- sum(t.DINGBANLS) over(order by t.OPTDATE) CM9,
- round(t.DINGBANYIELD, 2) DT10,
- round(sum(t.DINGBANYIELD) over(order by t.OPTDATE), 2) CM10
- from (select distinct x.OPTDATE,
- count(distinct x.heatno) over(partition by x.optdate) SUMLUCOUNT,
- sum(y.WEIGHT) over(partition by x.optdate) SUMPLANSTEEL,
- sum(y.WEIGHT) over(partition by x.optdate) / count(distinct x.heatno) over(partition by x.optdate) DC,
- sum(case x.shiftcode
- when '1' then
- 1
- end) over(partition by x.optdate) JIABANLS,
- sum(case x.shiftcode
- when '1' then
- y.WEIGHT
- end) over(partition by x.optdate) JIABANYIELD,
- sum(case x.shiftcode
- when '2' then
- 1
- end) over(partition by x.optdate) YIBANLS,
- sum(case x.shiftcode
- when '2' then
- y.WEIGHT
- end) over(partition by x.optdate) YIBANYIELD,
- sum(case x.shiftcode
- when '3' then
- 1
- end) over(partition by x.optdate) BINGBANLS,
- sum(case x.shiftcode
- when '3' then
- y.WEIGHT
- end) over(partition by x.optdate) BINGBANYIELD,
- sum(case x.shiftcode
- when '4' then
- 1
- end) over(partition by x.optdate) DINGBANLS,
- sum(case x.shiftcode
- when '4' then
- y.WEIGHT
- end) over(partition by x.optdate) DINGBANYIELD
- from (select a.heatno,
- a.plansteel,
- substr(a.shiftcode, 2, 1) shiftcode,
- to_char(a.optdate, 'yyyy-MM-dd') optdate
- from (select *
- from STL_RHS_OPTINFO
- where $
- union
- select * from J#STL_RHS_OPTINFO where $ ) a
- group by a.heatno,
- a.plansteel,
- to_char(a.optdate, 'yyyy-MM-dd'),
- a.shiftcode) x,
-
- (select heatno,
- nvl(PFBALEWGT, 0) - nvl(BALELEAVEWGT, 0) WEIGHT
- from (select row_number() over(partition by b.heatno order by b.disposaltime) xh,
- count(1) over(partition by b.heatno) cnt,
- b.*
- from (select *
- from STL_CCM_OPTINFO
- where $
- union
- select * from J#STL_CCM_OPTINFO where $ ) b)
- where xh = cnt) y
-
- where x.heatno = y.heatno(+)
- order by x.optdate) t
- ]]>
- </query>
- <query id="LgCASReport.Query" desc="吹氩操作记录报表" fetchSize="10">
- <![CDATA[
-
- select distinct a.HEATNO,
- v.aim_grade_code PLANSTEEL,
- a.SHIFTCODE,
- v.CAST_ID || '-' || v.cast_seq CAST_ID,
- a.POTWRAPSTATE,
- a.POTNO,
- decode(substr(a.shiftcode, 1, 1),
- '1',
- '白',
- '2',
- '中',
- '3',
- '晚') BC,
- decode(substr(a.shiftcode, 2, 1),
- '1',
- '甲',
- '2',
- '乙',
- '3',
- '丙',
- '4',
- '丁') BB,
- to_char(a.LEAVETIME, 'hh24:mi') ZZTIME,
- to_char(a.ARRIVETIME, 'HH24:mi') ARRIVETIME,
- to_char(a.OPTDATE, 'yyyy-MM-dd hh24:mi') OPTDATE,
- to_char(a.BLOWARSTARTTIME, 'HH24:mi') BLOWARSTARTTIME,
- to_char(a.BLOWARENDTIME, 'HH24:mi') BLOWARENDTIME,
- to_char(a.CASSTARTTIME, 'HH24:mi') CASSTARTTIME,
- to_char(a.CASENDTIME, 'HH24:mi') CASENDTIME,
- a.ARITEMPT,
- a.ARFTEMPT,
- a.ARBTEMPT,
- a.ARRIVEO2,
- a.LEAVEO2,
- a.TWSTEELWGT,
- a.MANTLENUM,
- a.RESIDUETHICKNESS,
- a.BLOWARPRESS,
- a.ARFLUX,
- a.STATIONCODE,
- a.DISPOSALTIME,
- v.PLAN_LINES,
- nvl(t.PFBALEWGT,0)-nvl(t.BALELEAVEWGT,0) MOLSTLWGT,
- max(case when a.HEATNO = t4.HEATNO and t4.xh = t4.cnt then t4.C end) over(partition by a.HEATNO) C,
- max(case when a.HEATNO = t4.HEATNO and t4.xh = t4.cnt then t4.MN end) over(partition by a.HEATNO) Mn,
- max(case when a.HEATNO = t4.HEATNO and t4.xh = t4.cnt then t4.S end) over(partition by a.HEATNO) S,
- max(case when a.HEATNO = t4.HEATNO and t4.xh = t4.cnt then t4.P end) over(partition by a.HEATNO) P,
- max(case when a.HEATNO = t4.HEATNO and t4.xh = t4.cnt then t4.SI end) over(partition by a.HEATNO) Si,
- max(case when a.HEATNO = t4.HEATNO and t4.xh = t4.cnt then t4.ALS end) over(partition by a.HEATNO) AIS,
- max(case when a.HEATNO = t4.HEATNO and t4.xh = t4.cnt then t4.ALt end) over(partition by a.HEATNO) AIt,
- max(case when a.HEATNO = t4.HEATNO and t4.xh = t4.cnt then T4.CA end) over(partition by a.HEATNO) Ca
- from (select *
- from STL_CAS_OPTINFO
- where to_char(OPTDATE, 'yyyy-MM-dd hh24:mi:ss') between ? and ?
- and substr(STATIONCODE, 2, 1) =
- decode(?, null, substr(STATIONCODE, 2, 1), ?)
- and UPPER(nvl(PLANSTEEL, 'null')) in
- (decode(?, null, UPPER(nvl(PLANSTEEL, 'null')), ?))
- and substr(SHIFTCODE, 1, 1) =
- decode(?, null, substr(SHIFTCODE, 1, 1), ?)
- and substr(SHIFTCODE, 2, 1) =
- decode(?, null, substr(SHIFTCODE, 2, 1), ?)
- union
- select *
- from J#STL_CAS_OPTINFO
- where to_char(OPTDATE, 'yyyy-MM-dd hh24:mi:ss') between ? and ?
- and substr(STATIONCODE, 2, 1) =
- decode(?, null, substr(STATIONCODE, 2, 1), ?)
- and UPPER(nvl(PLANSTEEL, 'null')) in
- (decode(?, null, UPPER(nvl(PLANSTEEL, 'null')), ?))
- and substr(SHIFTCODE, 1, 1) =
- decode(?, null, substr(SHIFTCODE, 1, 1), ?)
- and substr(SHIFTCODE, 2, 1) =
- decode(?, null, substr(SHIFTCODE, 2, 1), ?)) a,
- (select *
- from ppc_steel_heat
- union
- select * from J#ppc_steel_heat) v,
-
- (select *
- from STL_CCM_OPTINFO
- where to_char(OPTDATE, 'yyyy-MM-dd') between ? and ?
- union
- select *
- from J#STL_CCM_OPTINFO
- where to_char(OPTDATE, 'yyyy-MM-dd') between ? and ?) t,
- (select *
- from STL_LFS_OPTINFO
- where to_char(OPTDATE, 'yyyy-MM-dd') between ? and ?
- union
- select *
- from J#STL_LFS_OPTINFO
- where to_char(OPTDATE, 'yyyy-MM-dd') between ? and ?) w,
-
- (select y.*
- from (select x.*,
- count(1) over(partition by x.HEATNO) cnt,
- row_number() over(partition by x.HEATNO order by x.ASSAYTYPECODE desc) xh
- from (select *
- from stl_CHEMELEMENT
- where upper(SUBSTR(CHECKNO, 12, 2)) = 'DQ'
- and upper(SUBSTR(CHECKNO, -1)) = 'S'
-
- union
- select t.*
- from j#stl_CHEMELEMENT t
- where upper(SUBSTR(CHECKNO, 12, 2)) = 'DQ'
- and upper(SUBSTR(CHECKNO, -1)) = 'S'
- ) x) y
- where y.xh = y.cnt) t4
- where a.HEATNO = v.heatNo(+)
- and a.HEATNO = t.HEATNO(+)
- and a.heatno = w.heatno(+)
- and a.heatno = t4.heatno(+)
- order by OPTDATE
- ]]>
- </query>
- <query id="CASData_FLHJ.Query" desc="获取吹氩物料" fetchSize="10">
- <![CDATA[
-
- select a.HEATNO,
- substr(a.STATIONCODE, 2, 2) STATIONCODE,
- a.DISPOSALTIME,
- a.MATERIELTYPE,
- a.MATERIELCODE,
- t.MATERIELNAME,
- round(sum(nvl(a.JMWGT, 0)) over(partition by a.HEATNO,
- a.STATIONCODE,
- a.DISPOSALTIME,
- a.MATERIELTYPE,
- a.MATERIELCODE),
- 2) MaterielWgt
- from stl_ADDITIVES a, scm_MATERIEL t
- where substr(a.STATIONCODE, 1, 1) = 'D'
- and to_char(a.JMDATE, 'yyyy-MM-dd') between ? and ?
- and substr(a.STATIONCODE, 3, 1) =
- decode(?, null, substr(a.STATIONCODE, 3, 1), ?)
- and a.MATERIELCODE = t.MATERIELCODE(+)
- and a.MATERIELTYPE = t.MATERIELTYPE(+)
- ]]>
- </query>
- <query id="JobTime.Query" desc="获取各工序时间信息" fetchSize="10">
- <![CDATA[
-
- select to_char(a.OPTDATE, 'yyyy-MM-dd') OPTDATE,
- a.HEATNO,
- a.PLANSTEEL,
- x.FACT_ROUTE,
- e.STATIONCODE,
- case substr(a.SHIFTCODE, 1, 1)
- when '1' then
- '早'
- when '2' then
- '中'
- when '3' then
- '晚'
- end BC,
- case substr(a.SHIFTCODE, 2, 1)
- when '1' then
- '甲'
- when '2' then
- '乙'
- when '3' then
- '丙'
- when '4' then
- '丁'
- end BB,
- to_char(a.CHANGESTARTTIME, 'HH24:mi') CHANGESTARTTIME,
- to_char(a.CHANGEENDTIME, 'HH24:mi') CHANGEENDTIME,
- to_char(a.B1STARTTIME, 'HH24:mi') B1STARTTIME,
- to_char(greatest(nvl(a.B1ENDTIME, a.OPTDATE - 7),
- nvl(a.B2ENDTIME, a.OPTDATE - 7),
- nvl(a.B3ENDTIME, a.OPTDATE - 7),
- nvl(a.B4ENDTIME, a.OPTDATE - 7),
- nvl(a.B5ENDTIME, a.OPTDATE - 7)),
- 'HH24:mi') B1ENDTIME,
- to_char(a.TAPPINGSTARTTIME, 'HH24:mi') TAPPINGSTARTTIME,
- to_char(a.TAPPINGENDTIME, 'HH24:mi') TAPPINGENDTIME,
- round((greatest(nvl(a.PSENDTIME, a.TAPPINGENDTIME), a.TAPPINGENDTIME) -
- a.CHANGESTARTTIME) * 24 * 60) SCZQ_BOF,
-
- to_char(b.ARRIVETIME, 'HH24:mi') ARRIVETIME_CAS,
- to_char(b.LEAVETIME, 'HH24:mi') LEAVETIME_CAS,
- round((b.LEAVETIME - b.ARRIVETIME) * 24 * 60) SCZQ_CAS,
-
- to_char(c.ARRIVETIME, 'HH24:mi') ARRIVETIME_LFS,
- to_char(c.LEAVETIME, 'HH24:mi') LEAVETIME_LFS,
- round((c.LEAVETIME - c.ARRIVETIME) * 24 * 60) SCZQ_LFS,
-
- to_char(g.ARRIVETIME, 'HH24:mi') ARRIVETIME_RHS,
- to_char(g.LEAVETIME, 'HH24:mi') LEAVETIME_RHS,
- round((g.LEAVETIME - g.ARRIVETIME) * 24 * 60) SCZQ_RHS,
-
- to_char(h.ARRIVETIME, 'HH24:mi') ARRIVETIME_VDS,
- to_char(h.LEAVETIME, 'HH24:mi') LEAVETIME_VDS,
- round((h.LEAVETIME - h.ARRIVETIME) * 24 * 60) SCZQ_VDS,
-
- to_char(e.BALEPFTIME, 'HH24:mi') BALEPFTIME,
- to_char(e.BALESTARTTIME, 'HH24:mi') BALESTARTTIME,
- to_char(e.BALEENDTIME, 'HH24:mi') BALEENDTIME,
- round((e.BALEENDTIME - e.BALESTARTTIME) * 24 * 60) SCZQ_CCM,
-
- to_char(f.CUTBEGIN, 'HH24:mi') CUTBEGIN,
- to_char(f.CUTEND, 'HH24:mi') CUTEND,
- round((f.CUTEND - f.CUTBEGIN) * 24 * 60) SCZQ_CUT,
- decode(c.isrs, '1', '精炼炉', decode(e.isrs, '1', '连铸机', '')) isrs,
- decode(c.isrs,
- '1',
- decode(e.isrs,
- '1',
- (select sum(WEIGHTOFCVT)
- from (select WEIGHTOFCVT, SMELTINGIDOFCVT
- from STL_es_taphole
- union
- select WEIGHTOFCVT, SMELTINGIDOFCVT
- from STL_mis_taphole)
- where SMELTINGIDOFCVT = a.heatno),
- ''),
- '') isrswgt
- from (select *
- from (select t.*,
- row_number() over(partition by t.HEATNO order by t.OPTDATE) XH
- from (select *
- from STL_BOF_OPTINFO
- where $
- to_char(OPTDATE, 'yyyy-MM-dd hh24:mi:ss') between ? and ?
- and substr(STATIONCODE, 2, 1) = decode(?,null,substr(STATIONCODE, 2, 1),?)
- and UPPER(PLANSTEEL) in (decode(?,null,UPPER(PLANSTEEL),?))
- and substr(SHIFTCODE, 1, 1) = decode(?,null,substr(SHIFTCODE, 1, 1),?)
- and substr(SHIFTCODE, 2, 1) = decode(?,null,substr(SHIFTCODE, 2, 1),?)
- union
- select *
- from J#STL_BOF_OPTINFO
- where $
- to_char(OPTDATE, 'yyyy-MM-dd hh24:mi:ss') between ? and ?
- and substr(STATIONCODE, 2, 1) = decode(?,null,substr(STATIONCODE, 2, 1),?)
- and UPPER(PLANSTEEL) in (decode(?,null,UPPER(PLANSTEEL),?))
- and substr(SHIFTCODE, 1, 1) = decode(?,null,substr(SHIFTCODE, 1, 1),?)
- and substr(SHIFTCODE, 2, 1) = decode(?,null,substr(SHIFTCODE, 2, 1),?)
- ) t)
- where XH = 1) a,
-
- (select *
- from PPC_STEEL_HEAT
- union
- select * from J#PPC_steel_heat) x,
-
- (select *
- from (select t.*,
- row_number() over(partition by t.HEATNO order by t.OPTDATE) XH
- from (select *
- from STL_CAS_OPTINFO
- where $
- to_char(OPTDATE, 'yyyy-MM-dd') between ? and ?
- union
- select *
- from J#STL_CAS_OPTINFO
- where $
- to_char(OPTDATE, 'yyyy-MM-dd') between ? and ?) t)
- where XH = 1) b,
-
- (select *
- from (select t.*,
- row_number() over(partition by t.HEATNO order by t.OPTDATE) XH
- from (select *
- from STL_LFS_OPTINFO
- where $
- to_char(OPTDATE, 'yyyy-MM-dd') between ? and ?
- union
- select *
- from J#STL_LFS_OPTINFO
- where $
- to_char(OPTDATE, 'yyyy-MM-dd') between ? and ?) t)
- where XH = 1) c,
-
- (select *
- from (select t.*,
- row_number() over(partition by t.HEATNO order by t.OPTDATE) XH
- from (select *
- from STL_RHS_OPTINFO
- where $
- to_char(OPTDATE, 'yyyy-MM-dd') between ? and ?
- union
- select *
- from J#STL_RHS_OPTINFO
- where $
- to_char(OPTDATE, 'yyyy-MM-dd') between ? and ?) t)
- where XH = 1) g,
-
- (select *
- from (select t.*,
- row_number() over(partition by t.HEATNO order by t.OPTDATE) XH
- from (select *
- from STL_VDS_OPTINFO
- where $
- to_char(OPTDATE, 'yyyy-MM-dd') between ? and ?
- union
- select *
- from J#STL_VDS_OPTINFO
- where $
- to_char(OPTDATE, 'yyyy-MM-dd') between ? and ?) t)
- where XH = 1) h,
-
- (select *
- from (select t.*,
- row_number() over(partition by t.HEATNO order by t.OPTDATE) XH
- from (select *
- from STL_CCM_OPTINFO
- where $
- to_char(OPTDATE, 'yyyy-MM-dd') between ? and ?
- union
- select *
- from J#STL_CCM_OPTINFO
- where $
- to_char(OPTDATE, 'yyyy-MM-dd') between ? and ?) t)
- where XH = 1) e,
-
- (select substr(t.HEATNO, 1, 10) HEATNO,
- min(t.CUTTIME) CUTBEGIN,
- max(t.CUTTIME) CUTEND
- from (select *
- from STL_INCISION
- where $
- to_char(CUTTIME, 'yyyy-MM-dd') between ? and ?
- union
- select *
- from J#STL_INCISION
- where $
- to_char(CUTTIME, 'yyyy-MM-dd') between ? and ?) t
- group by substr(t.HEATNO, 1, 10)) f
-
- where a.HEATNO = b.HEATNO(+)
- and a.HEATNO = c.HEATNO(+)
- and a.HEATNO = e.HEATNO(+)
- and a.HEATNO = f.HEATNO(+)
- and a.HEATNO = x.HEATNO(+)
- and a.HEATNO = g.HEATNO(+)
- and a.HEATNO = h.HEATNO(+)
-
- order by a.STATIONCODE, a.OPTDATE
-
-
- ]]>
- </query>
- <query id="GetreportBOFOggData.Query" desc="获取转炉原始记录数据" fetchSize="10">
- <![CDATA[
-
- select distinct t.HEATNO,
- t4.aim_grade_code PLANSTEEL,
- t.STATIONCODE,
- t.SAGE,
- t.GAGE,
- t.O2CONSUME,
- nvl(t.IRONPOTWGT, '0') IRONPOTWGT,
- t.WSTEELWGT,
- t.PIGIRONWGT,
- t.BRPSTIME,
- t.POTWRAPSTATE,
- t6.pfbalewgt - t6.baleleavewgt TAPPINGWGT,
- decode(substr(t.shiftcode, 1, 1),
- '1',
- '白',
- '2',
- '中',
- '3',
- '晚') BC,
- decode(substr(t.shiftcode, 2, 1),
- '1',
- '甲',
- '2',
- '乙',
- '3',
- '丙',
- '4',
- '丁') BB,
- decode(BLKREDEFFECTS,
- '0',
- '失败',
- '1',
- '成功',
- '3',
- '一般') BLKREDEFFECTS,
- t.SUBAGE,
- t.IRONPOTWGT,
- t.WSTEELWGT,
- t.PIGIRONWGT,
- t.CHANGESTARTTIME,
- t.OPENOXYGENTIME,
- t.IRONTEMPERATURE,
- t.TERMINUSC,
- t.TERMINUSO2,
- t.B1TEMPERATURE,
- t.B2TEMPERATURE,
- nvl(t.N2CONSUME, 0) + nvl(t.TOPN2CONSUME, 0) N2SUM,
- t.IRONTEMPERATURE,
- '0.9' O2PRESS,
- nvl(t.B2TIME,0)+nvl(t.B3TIME,0)+nvl(t.B4TIME,0)+nvl(t.B5TIME,0) DCTIME,
- to_char(t.CHANGESTARTTIME, 'HH24:mi') CHANGESTARTTIME,
- to_char(t.OPENOXYGENTIME, 'HH24:mi') OPENOXYGENTIME,
- round(nvl(t.supplyoxygentime / 60, 0),1) SUPPLYOXYGENTIME,
- round(t.supplyoxygentime,1) SUPPLYOXYGENTIME_S,
- t4.PLAN_LINES PLAN_LINES,
- t.TERMINUSTEPT TAPPINGTEMPERATURE,
- t.TAPPINGTIME,
- to_char(t.TAPPINGSTARTTIME, 'HH24:mi') TAPPINGSTARTTIME,
-
- max(case
- when t.HEATNO = t2.HEATNO and t2.xh = t2.cnt then
- t2.C
- end) over(partition by t.HEATNO) F_C,
- max(case
- when t.HEATNO = t2.HEATNO and t2.xh = t2.cnt then
- t2.Mn
- end) over(partition by t.HEATNO) F_MN,
- max(case
- when t.HEATNO = t2.HEATNO and t2.xh = t2.cnt then
- t2.Si
- end) over(partition by t.HEATNO) F_SI,
- max(case
- when t.HEATNO = t2.HEATNO and t2.xh = t2.cnt then
- t2.S
- end) over(partition by t.HEATNO) F_S,
- max(case
- when t.HEATNO = t2.HEATNO and t2.xh = t2.cnt then
- t2.P
- end) over(partition by t.HEATNO) F_P,
-
- max(case
- when t.HEATNO = t2.HEATNO and t2.xh = t2.cnt then
- t2.Als
- end) over(partition by t.HEATNO) F_ALS,
-
- max(case
- when t.MOLIRNSOURCE = t10.HEATNO then
- t10.Mn
- end) over(partition by t.MOLIRNSOURCE) R_MN,
- max(case
- when t.MOLIRNSOURCE = t10.HEATNO then
- t10.C
- end) over(partition by t.MOLIRNSOURCE) R_C,
- max(case
- when t.MOLIRNSOURCE = t10.HEATNO then
- t10.P
- end) over(partition by t.MOLIRNSOURCE) R_P,
- max(case
- when t.MOLIRNSOURCE = t10.HEATNO then
- t10.S
- end) over(partition by t.MOLIRNSOURCE) R_S,
- max(case
- when t.MOLIRNSOURCE = t10.HEATNO then
- t10.si
- end) over(partition by t.MOLIRNSOURCE) R_SI,
-
- max(case
- when t.HEATNO = t9.HEATNO and t9.xh = t9.cnt then
- t9.Mn
- end) over(partition by t.HEATNO) Z_MN,
- max(case
- when t.HEATNO = t9.HEATNO and t9.xh = t9.cnt then
- t9.C
- end) over(partition by t.HEATNO) Z_C,
- max(case
- when t.HEATNO = t9.HEATNO and t9.xh = t9.cnt then
- t9.P
- end) over(partition by t.HEATNO) Z_P,
- max(case
- when t.HEATNO = t9.HEATNO and t9.xh = t9.cnt then
- t9.S
- end) over(partition by t.HEATNO) Z_S,
-
- max(case
- when t.HEATNO = t9.HEATNO and t9.xh = t9.cnt then
- t9.SI
- end) over(partition by t.HEATNO) Z_SI,
- t4.cast_id CCMNO,
- (t4.cast_id) || '-' || (t4.cast_seq) CCMNO,
- t.MEMO,
- to_char(t.optdate, 'yyyy-MM-dd hh24:mi') optDisp
- from (select *
- from STL_bof_optinfo
- where 1 = 1
- and to_char(OPTDATE, 'yyyy-MM-dd hh24:mi:ss') between ? and ?
- and substr(STATIONCODE, 2, 1) =
- decode(?, null, substr(STATIONCODE, 2, 1), ?)
- and UPPER(nvl(PLANSTEEL, 'null')) in
- (decode(?, null, UPPER(nvl(PLANSTEEL, 'null')), ?))
- and substr(SHIFTCODE, 1, 1) =
- decode(?, null, substr(SHIFTCODE, 1, 1), ?)
- and substr(SHIFTCODE, 2, 1) =
- decode(?, null, substr(SHIFTCODE, 2, 1), ?)
- union
- select *
- from J#STL_bof_optinfo
- where 1 = 1
- and to_char(OPTDATE, 'yyyy-MM-dd hh24:mi:ss') between ? and ?
- and substr(STATIONCODE, 2, 1) =
- decode(?, null, substr(STATIONCODE, 2, 1), ?)
- and UPPER(nvl(PLANSTEEL, 'null')) in
- (decode(?, null, UPPER(nvl(PLANSTEEL, 'null')), ?))
- and substr(SHIFTCODE, 1, 1) =
- decode(?, null, substr(SHIFTCODE, 1, 1), ?)
- and substr(SHIFTCODE, 2, 1) =
- decode(?, null, substr(SHIFTCODE, 2, 1), ?)) t
- left join (select y.*
- from (select x.*,
-
- row_number() over(partition by x.HEATNO order by x.ASSAYTYPECODE) xh
- from (select *
- from STL_CHEMELEMENT
- where upper(substr(ASSAYTYPECODE, 1, 1)) = 'C'
- and to_char(ASSAYDATE, 'yyyy-MM-dd') between ? and ?
- union
- select *
- from J#STL_CHEMELEMENT
- where upper(substr(ASSAYTYPECODE, 1, 1)) = 'C'
- and to_char(ASSAYDATE, 'yyyy-MM-dd') between ? and ?) x) y) t1 on t.heatno =
- t1.heatno
- left join (select y.*
- from (select x.*,
- count(1) over(partition by x.HEATNO) cnt,
- row_number() over(partition by x.HEATNO order by x.ASSAYTYPECODE desc, x.assaydate desc) xh,
- substr(x.assaytypecode, 1, 1) gw
- from (select *
- from STL_CHEMELEMENT
- where to_char(ASSAYDATE, 'yyyy-MM-dd') between ? and ?
- and upper(SUBSTR(CHECKNO, -1)) = 'S'
- and upper(SUBSTR(CHECKNO, 12, 2)) = 'GP'
- union
- select *
- from J#STL_CHEMELEMENT
- where to_char(ASSAYDATE, 'yyyy-MM-dd') between ? and ?
- and upper(SUBSTR(CHECKNO, -1)) = 'S'
- and upper(SUBSTR(CHECKNO, 12, 2)) = 'GP') x) y) t2 on t2.heatno =
- t.heatno
- left join (select y.*
- from (select x.*,
- count(1) over(partition by x.HEATNO) cnt,
- row_number() over(partition by x.HEATNO order by x.ASSAYTYPECODE desc, x.assaydate desc) xh,
- substr(x.assaytypecode, 1, 1) gw
- from (select *
- from STL_CHEMELEMENT
- where to_char(ASSAYDATE, 'yyyy-MM-dd') between ? and ?
- and upper(SUBSTR(CHECKNO, 12, 1)) = 'C'
- and upper(SUBSTR(CHECKNO, -1)) = 'I'
- and upper(SUBSTR(CHECKNO, 13, 1)) <> 'P'
- union
- select *
- from J#STL_CHEMELEMENT
- where to_char(ASSAYDATE, 'yyyy-MM-dd') between ? and ?
- and upper(SUBSTR(CHECKNO, 12, 1)) = 'C'
- and upper(SUBSTR(CHECKNO, -1)) = 'I'
- and upper(SUBSTR(CHECKNO, 13, 1)) <> 'P') x) y) t3 on t3.heatno =
- t.heatno
- left join (select y.*
- from (select x.*,
- count(1) over(partition by x.HEATNO) cnt,
- row_number() over(partition by x.HEATNO order by x.ASSAYTYPECODE ) xh,
- substr(x.assaytypecode, 1, 1) gw
- from (select *
- from STL_CHEMELEMENT
- where to_char(ASSAYDATE, 'yyyy-MM-dd') between ? and ?
- and upper(SUBSTR(CHECKNO, 12, 1)) = 'C'
- and upper(SUBSTR(CHECKNO, -1)) = 'S'
- union
- select *
- from J#STL_CHEMELEMENT
- where to_char(ASSAYDATE, 'yyyy-MM-dd') between ? and ?
- and upper(SUBSTR(CHECKNO, 12, 1)) = 'C'
- and upper(SUBSTR(CHECKNO, -1)) = 'S') x) y) t9 on t9.heatno =
- t.heatno
- left join (select *
- from stl_chemelement
- union
- select * from J#stl_chemelement) t10 on t10.heatno =
- t.MOLIRNSOURCE
- left join (select *
- from ppc_steel_heat
- union
- select * from J#ppc_steel_heat) t4 on t.heatno = t4.heatno
-
- left join (select *
- from ppc_steel_heat
- union
- select * from J#ppc_steel_heat) t5 on t.heatno = t5.heatno
- left join (select heatno,
- PFBALEWGT,
- BALELEAVEWGT,
- isrs,
- MWRAPNO,
- BILLETFIXSIZE
- from stl_ccm_optinfo
- union
- select heatno,
- PFBALEWGT,
- BALELEAVEWGT,
- isrs,
- MWRAPNO,
- BILLETFIXSIZE
- from J#stl_ccm_optinfo) t6 on t.heatno = t6.heatno
-
- order by optDisp
-
- ]]>
- </query>
- <query id="BofData_FLHJ.Query" desc="获取转炉物料" fetchSize="10">
- <![CDATA[
-
- Select t.heatno,
- t.STATIONCODE,
- t.DISPOSALTIME,
- t1.materielcode,
- t1.materieltype,
- t2.materielname,
- round(sum(nvl(t1.JMWGT, 0)) over(partition by t1.HEATNO,
- t1.STATIONCODE,
- t1.DISPOSALTIME,
- t1.MATERIELTYPE,
- t1.MATERIELCODE)) materielWgt
- from (select *
- from stl_bof_optinfo
- where 1 = 1
- and to_char(OPTDATE, 'yyyy-MM-dd') between ? and ?
- and substr(STATIONCODE, 2, 1) =
- decode(?, null, substr(STATIONCODE, 2, 1), ?)
- and UPPER(nvl(PLANSTEEL, 'null')) in
- (decode(?, null, UPPER(nvl(PLANSTEEL, 'null')), ?))
- and substr(SHIFTCODE, 1, 1) =
- decode(?, null, substr(SHIFTCODE, 1, 1), ?)
- and substr(SHIFTCODE, 2, 1) =
- decode(?, null, substr(SHIFTCODE, 2, 1), ?)
- union
- select *
- from J#stl_Bof_Optinfo
- where 1 = 1
- and to_char(OPTDATE, 'yyyy-MM-dd') between ? and ?
- and substr(STATIONCODE, 2, 1) =
- decode(?, null, substr(STATIONCODE, 2, 1), ?)
- and UPPER(nvl(PLANSTEEL, 'null')) in
- (decode(?, null, UPPER(nvl(PLANSTEEL, 'null')), ?))
- and substr(SHIFTCODE, 1, 1) =
- decode(?, null, substr(SHIFTCODE, 1, 1), ?)
- and substr(SHIFTCODE, 2, 1) =
- decode(?, null, substr(SHIFTCODE, 2, 1), ?)) t
- left join stl_ADDITIVES t1 on t.heatno = t1.heatno
- and 'C' || t.stationcode = t1.stationcode
- and t.disposaltime = t1.disposaltime
- left join scm_MATERIEL t2 on t1.materielcode = t2.materielcode
- order by t.STATIONCODE, t.HEATNO
- ]]>
- </query>
- <query id="CCMData_HEAT.Query" desc="获取连铸机炉次信息" fetchSize="10">
- <![CDATA[
-
-
- select a.HEATNO,
- a.MOULDNO,
- v.aim_grade_code PLANSTEEL,
- v.PLAN_LINES,
- a.BILLETSECTION,
- case a.BALEFLOWFLAG
- when 0 then
- '否'
- when 1 then
- '是'
- end BALEFLOWFLAG,
- a.MOULDSTOVENUM,
- a.PFBALETEMPT,
- to_char(a.BALEPFTIME, 'HH24:mi') BALEPFTIME,
- to_char(a.BALESTARTTIME, 'HH24:mi') BALESTARTTIME,
- to_char(a.BALEENDTIME, 'HH24:mi') BALEENDTIME,
- round((a.BALEENDTIME - a.BALESTARTTIME) * 24 * 60) 周期,
- a.PFBALEWGT,
- a.BALELEAVEWGT,
- nvl(a.PFBALEWGT,0)-nvl(a.BALELEAVEWGT,0) JGWGT,
- to_char(a.BALELEAVETIME,'HH24:mi') BALELEAVETIME,
- v.CAST_ID || '-' || v.cast_seq CAST_ID,
- a.S1BILLETLENGTH LEN_1,
- a.S2BILLETLENGTH LEN_2,
- a.CRYSTALLIZERTIMES CRYSTALLIZERTIMES1,
- a.CRYSTALLIZERTIMES2,
- to_char(a.OPTDATE, 'yyyy-MM-dd hh24:mi') Optdisp
- from (select *
- from STL_CCM_OPTINFO
- where 1 = 1
- and to_char(OPTDATE, 'yyyy-MM-dd hh24:mi:ss') between ? and ?
- and substr(STATIONCODE, 2, 1) =
- decode(?, null, substr(STATIONCODE, 2, 1), ?)
- and UPPER(nvl(PLANSTEEL, 'null')) in
- (decode(?, null, UPPER(nvl(PLANSTEEL, 'null')), ?))
- and substr(SHIFTCODE, 1, 1) =
- decode(?, null, substr(SHIFTCODE, 1, 1), ?)
- and substr(SHIFTCODE, 2, 1) =
- decode(?, null, substr(SHIFTCODE, 2, 1), ?)
- union
- select *
- from J#STL_CCM_OPTINFO
- where 1 = 1
- and to_char(OPTDATE, 'yyyy-MM-dd hh24:mi:ss') between ? and ?
- and substr(STATIONCODE, 2, 1) =
- decode(?, null, substr(STATIONCODE, 2, 1), ?)
- and UPPER(nvl(PLANSTEEL, 'null')) in
- (decode(?, null, UPPER(nvl(PLANSTEEL, 'null')), ?))
- and substr(SHIFTCODE, 1, 1) =
- decode(?, null, substr(SHIFTCODE, 1, 1), ?)
- and substr(SHIFTCODE, 2, 1) =
- decode(?, null, substr(SHIFTCODE, 2, 1), ?)) a,
-
- STL_CCM_MOULDINFO u,
- (select *
- from PPC_steel_heat
- union
- select * from J#PPC_steel_heat) v
-
- where a.MOULDNO = u.MOULDNO(+)
- and a.HEATNO = v.heatno(+)
-
- order by a.optdate
-
- ]]>
- </query>
- <query id="CCMDataHEAT_Speed.Query" desc="获取连铸中包温度对应的拉速" fetchSize="10">
- <![CDATA[
-
- select z.*
- from (select Distinct x.Heatno,
- x.STATIONCODE,
- x.DISPOSALTIME,
- x.MIDLADLETEMP,
- to_char(x.LASTFRESHTIME,'HH24:mi') LASTFRESHTIME,
- y.s1castspeed,
- y.s2castspeed,
- y.s3castspeed,
- y.s4castspeed,
- y.s5castspeed,
- row_number() over(partition by x.HEATNO order by x.LASTFRESHTIME) xh,
- count(*) over(partition by x.HEATNO order by x.HEATNO) intcount
- from (SELECT Heatno,
- STATIONCODE,
- DISPOSALTIME,
- MIDLADLETEMP,
- min(LASTFRESHTIME) LASTFRESHTIME
- FROM (select HEATNO,
- STATIONCODE,
- DISPOSALTIME,
- ROUND(greatest(midladletemp1, midladletemp2)) MIDLADLETEMP,
- LASTFRESHTIME from $ b
- where 1 = 1
- and to_char(OPTDATE, 'yyyy-MM-dd') between ? and ?
- and substr(STATIONCODE, 2, 1) =
- decode(?, null, substr(STATIONCODE, 2, 1), ?)
- union
- select HEATNO,
- STATIONCODE,
- DISPOSALTIME,
- ROUND(greatest(midladletemp1, midladletemp2)) MIDLADLETEMP,
- LASTFRESHTIME
- from J#$
- where 1 = 1
- and to_char(OPTDATE, 'yyyy-MM-dd') between ? and ?
- and substr(STATIONCODE, 2, 1) =
- decode(?, null, substr(STATIONCODE, 2, 1), ?)) a
- group by heatno,
- stationcode,
- disposaltime,
- MIDLADLETEMP
- order by heatno) x
- left join (select HEATNO,
- STATIONCODE,
- DISPOSALTIME,
- s1castspeed,
- s2castspeed,
- s3castspeed,
- s4castspeed,
- s5castspeed,
- LASTFRESHTIME,
- ROUND(greatest(midladletemp1, midladletemp2)) MIDLADLETEMP
- from $ b
- where 1 = 1
- and to_char(OPTDATE, 'yyyy-MM-dd') between ? and ?
- and substr(STATIONCODE, 2, 1) =
- decode(?, null, substr(STATIONCODE, 2, 1), ?)
- union
- select HEATNO,
- STATIONCODE,
- DISPOSALTIME,
- s1castspeed,
- s2castspeed,
- s3castspeed,
- s4castspeed,
- s5castspeed,
- LASTFRESHTIME,
- ROUND(greatest(midladletemp1, midladletemp2)) MIDLADLETEMP
- from J#$
- where 1 = 1
- and to_char(OPTDATE, 'yyyy-MM-dd') between ? and ?
- and substr(STATIONCODE, 2, 1) =
- decode(?, null, substr(STATIONCODE, 2, 1), ?)) y on x.heatno =
- y.heatno
- and x.stationcode =
- y.stationcode
- and x.disposaltime =
- y.disposaltime
- where x.LASTFRESHTIME = y.LASTFRESHTIME
- and x.MIDLADLETEMP = y.MIDLADLETEMP
- and x.MIDLADLETEMP > 1410
- order by heatno, LASTFRESHTIME) z
- where z.xh in (1, round(z.intcount / 4), round((z.intcount - 2) / 4) * 2,
- round((z.intcount - 2) / 4) * 3,
- round((z.intcount - 2) / 4) * 4, z.intcount)
-
- ]]>
- </query>
- <query id="CCMData_CAST.Query" desc="获取连铸机浇次信息" fetchSize="10">
- <![CDATA[
-
-
- select u.MOULDNO,
- u.S1CRYSTALCODE,
- u.S2CRYSTALCODE,
- u.S1PLANENDTIME,
- u.S2PLANENDTIME,
- u.MWRAPNO,
- u.STUFFSTICK,
- u.UPGAP,
- u.DIPGAP,
- u.PROTECTDTEGNAME,
- u.MWRAPBESTROWNAME,
- to_char(u.MINFIREBEGINTIME, 'HH24:mi') MINFIREBEGINTIME,
- to_char(u.MIDDLEFIREBEGINTIME, 'HH24:mi') MIDDLEFIREBEGINTIME,
- to_char(u.MAXBEGINTIME, 'HH24:mi') MAXBEGINTIME,
- u.MWRAPFIRINGENDTIME1,
- a.SWRAPENDCAUSE ,
- u.MWRAPREMAIN,
- a.PLANSTEEL,
- u.MEMO,
- to_char(a.OPTDATE, 'yyyy-MM-dd') Optdisp
- from (select *
- from STL_CCM_OPTINFO
- where 1 = 1
- and to_char(OPTDATE, 'yyyy-MM-dd') between ? and ?
- and substr(STATIONCODE, 2, 1) =
- decode(?, null, substr(STATIONCODE, 2, 1), ?)
- and UPPER(nvl(PLANSTEEL, 'null')) in
- (decode(?, null, UPPER(nvl(PLANSTEEL, 'null')), ?))
- and substr(SHIFTCODE, 1, 1) =
- decode(?, null, substr(SHIFTCODE, 1, 1), ?)
- and substr(SHIFTCODE, 2, 1) =
- decode(?, null, substr(SHIFTCODE, 2, 1), ?)
- union
- select *
- from J#STL_CCM_OPTINFO
- where 1 = 1
- and to_char(OPTDATE, 'yyyy-MM-dd') between ? and ?
- and substr(STATIONCODE, 2, 1) =
- decode(?, null, substr(STATIONCODE, 2, 1), ?)
- and UPPER(nvl(PLANSTEEL, 'null')) in
- (decode(?, null, UPPER(nvl(PLANSTEEL, 'null')), ?))
- and substr(SHIFTCODE, 1, 1) =
- decode(?, null, substr(SHIFTCODE, 1, 1), ?)
- and substr(SHIFTCODE, 2, 1) =
- decode(?, null, substr(SHIFTCODE, 2, 1), ?)) a,
-
- STL_CCM_MOULDINFO u,
- (select *
- from PPC_steel_heat
- union
- select * from J#PPC_steel_heat) v
-
- where a.MOULDNO = u.MOULDNO(+)
- and a.MOULDNO = v.cast_no(+)
-
- order by a.optdate
-
- ]]>
- </query>
- <query id="BOFLG.Query" desc="转炉生产调度——炼钢部分" fetchSize="10">
- <![CDATA[
-
- select distinct substr(t.STATIONCODE, 2, 1) || '#转炉' STATIONCODE,
- t.HEATNO,
- substr(B.FACT_ROUTE,9,2) LFSGX,
- t.PLANSTEEL,
- to_char(t.CHANGESTARTTIME, 'hh24:mi') CHANGESTARTTIME,
- to_char(t.TAPPINGENDTIME, 'hh24:mi') TAPPINGENDTIME,
- t.IRONPOTWGT,
- t.WSTEELWGT,
- t.PIGIRONWGT,
- t.POTNO,
- (B.cast_id) || '-' || (B.cast_seq) MOULDNO,
- t.POTAGE POAGE,
- t.POTDISTINCTION POLVL,
- t.MEMO,
- to_char(t.optdate, 'yyyy-MM-dd HH24:mi:ss') optDisp
- from (select *
- from STL_bof_optinfo
- where 1 = 1
- and to_char(OPTDATE, 'yyyy-MM-dd') between ? and ?
-
- union
- select *
- from J#STL_bof_optinfo
- where 1 = 1
- and to_char(OPTDATE, 'yyyy-MM-dd') between ? and
- ? ) t
- left join (select *
- from STL_ccm_optinfo
- union
- select * from J#STL_ccm_optinfo) C on t.heatno = c.heatno
- left join (select *
- from ppc_steel_heat
- union
- select * from J#ppc_steel_heat) B on t.heatno = B.heatno
- order by STATIONCODE, optDisp
- ]]>
- </query>
- <query id="CCMSLG.Query" desc="转炉生产调度——连铸部分" fetchSize="10">
- <![CDATA[
-
- select distinct substr(t.STATIONCODE, 2, 1) || '#连铸' STATIONCODE,
- t.HEATNO,
- t.PLANSTEEL,
- t.BILLETSECTION,
- to_char(t.BALESTARTTIME,'hh24:mi') BALESTARTTIME,
- to_char(t.BALEENDTIME,'hh24:mi') BALEENDTIME,
- (t.PFBALEWGT-t.BALELEAVEWGT) PFBALEWGT,
- round(nvl(D.SLAB_WGT / 1000, 0), 1) BILLETWGT,
- t.MEMO,
- to_char(t.optdate, 'yyyy-MM-dd HH24:mi:ss') optDisp
- from (select *
- from STL_ccm_optinfo
- where 1 = 1
- and to_char(OPTDATE, 'yyyy-MM-dd') between ? and ?
-
- union
- select *
- from J#STL_ccm_optinfo
- where 1 = 1
- and to_char(OPTDATE, 'yyyy-MM-dd') between ? and
- ? ) t
- left join (select *
- from ppc_steel_heat
- union
- select * from J#ppc_steel_heat) B on t.heatno = B.heatno
- left join (select t.CHARGE_NO, sum(t.SLAB_WGT) SLAB_WGT from stl_incision_view t Group by t.CHARGE_NO ) D
- on t.heatno =D.CHARGE_NO
- order by STATIONCODE, optDisp
- ]]>
- </query>
- <query id="BOFCCM.Query" desc="转炉生产调度——连铸" fetchSize="10">
- <![CDATA[
-
- select distinct a.HEATNO,
- substr(a.STATIONCODE, 2, 1) || '#炉' STATIONCODE,
- a.BILLETSECTION,
- v.aim_grade_code PLANSTEEL,
- a.BALESTARTTIME,
- a.BALEENDTIME,
- a.BILLETWGT,
- a.PFBALEWGT,
- a.MEMO,
- to_char(a.OPTDATE, 'yyyy-MM-dd') Optdisp
- from (select *
- from STL_CCM_OPTINFO
- where 1 = 1
- and to_char(OPTDATE, 'yyyy-MM-dd') between ? and
- ?
- and substr(STATIONCODE, 2, 1) = '1'
- or substr(STATIONCODE, 2, 2) = '2'
- union
- select *
- from J#STL_CCM_OPTINFO
- where 1 = 1
- and to_char(OPTDATE, 'yyyy-MM-dd') between ? and
- ?
- and substr(STATIONCODE, 2, 1) = '1'
- or substr(STATIONCODE, 2, 2) = '2') a,
-
- STL_CCM_MOULDINFO u,
- (select *
- from PPC_steel_heat
- union
- select * from J#PPC_steel_heat) v
-
- where a.MOULDNO = u.MOULDNO(+)
- and a.HEATNO = v.heatno(+)
-
- order by STATIONCODE, optDisp
- ]]>
- </query>
- <query id="frmRTDCons.Query" desc="RTD" fetchSize="10">
- <![CDATA[
- SELECT row_number() over(order by USER_TAB_COLS.COLUMN_ID) ID, USER_TAB_COLS.COLUMN_NAME as FIELDS
- FROM USER_TAB_COLS
- where USER_TAB_COLS.TABLE_NAME = ?
- ]]>
- </query>
- <query id="RtdDataQuery.Query" desc="RTD" fetchSize="10">
- <![CDATA[
- select t.* from $ t
- ]]>
- </query>
- <query id="proc_RTDTable.Query" desc="加载RTD表" fetchSize="10">
- <![CDATA[
- select table_name from user_tables where table_name like 'RTD_POIN%'
- ]]>
- </query>
- <query id="reportRHElement.Query" desc="RH炉CP化学成分报表查询" fetchSize="10">
- <![CDATA[
- select distinct to_char(a.OPTDATE, 'yyyy-MM-dd') OPTDATE,--日期
- decode(a.SHIFTCODE,'11','甲白','12','乙白','13','丙白','14','丁白','21','甲中','22','乙中','23','丙中','24','丁中','31','甲夜','32','乙夜','33','丙夜','34','丁夜')SHIFTCODE ,--班组
- a.HEATNO HEATNO, --炉号
- a.PLANSTEEL PLANSTEEL,--钢种
- p.FLAG FLAG, --是否改判
- --CP化学成分
- max(case when a.HEATNO = w.HEATNO and w.xh = w.cnt then w.C end) over(partition by a.HEATNO) Y_C,
- max(case when a.HEATNO = w.HEATNO and w.xh = w.cnt then w.MN end) over(partition by a.HEATNO) Y_MN,
- max(case when a.HEATNO = w.HEATNO and w.xh = w.cnt then w.S end) over(partition by a.HEATNO) Y_S,
- max(case when a.HEATNO = w.HEATNO and w.xh = w.cnt then w.P end) over(partition by a.HEATNO) Y_P,
- max(case when a.HEATNO = w.HEATNO and w.xh = w.cnt then w.SI end) over(partition by a.HEATNO) Y_SI,
- max(case when a.HEATNO = w.HEATNO and w.xh = w.cnt then w.V end) over(partition by a.HEATNO) Y_V,
- max(case when a.HEATNO = w.HEATNO and w.xh = w.cnt then w.TI end) over(partition by a.HEATNO) Y_TI,
- max(case when a.HEATNO = w.HEATNO and w.xh = w.cnt then w.NB end) over(partition by a.HEATNO) Y_NB,
- max(case when a.HEATNO = w.HEATNO and w.xh = w.cnt then w.CR end) over(partition by a.HEATNO) Y_CR,
- max(case when a.HEATNO = w.HEATNO and w.xh = w.cnt then w.NI end) over(partition by a.HEATNO) Y_NI,
- max(case when a.HEATNO = w.HEATNO and w.xh = w.cnt then w.MO end) over(partition by a.HEATNO) Y_MO,
- max(case when a.HEATNO = w.HEATNO and w.xh = w.cnt then w.CU end) over(partition by a.HEATNO) Y_CU,
- max(case when a.HEATNO = w.HEATNO and w.xh = w.cnt then w.ALS end) over(partition by a.HEATNO) Y_ALS,
- max(case when a.HEATNO = w.HEATNO and w.xh = w.cnt then w.ALT end) over(partition by a.HEATNO) Y_ALT,
- --内控下限化学成分
- max(case when a.HEATNO = u.GYCODE then decode(u.itemcode,'C',u.stdmin,'') end) over(partition by a.HEATNO) C_C,
- max(case when a.HEATNO = u.GYCODE then decode(u.itemcode,'Mn',u.stdmin,'') end) over(partition by a.HEATNO) C_MN,
- max(case when a.HEATNO = u.GYCODE then decode(u.itemcode,'S',u.stdmin,'') end) over(partition by a.HEATNO) C_S,
- max(case when a.HEATNO = u.GYCODE then decode(u.itemcode,'P',u.stdmin,'') end) over(partition by a.HEATNO) C_P,
- max(case when a.HEATNO = u.GYCODE then decode(u.itemcode,'Si',u.stdmin,'') end) over(partition by a.HEATNO) C_SI,
- max(case when a.HEATNO = u.GYCODE then decode(u.itemcode,'V',u.stdmin,'') end) over(partition by a.HEATNO) C_V,
- max(case when a.HEATNO = u.GYCODE then decode(u.itemcode,'Ti',u.stdmin,'') end) over(partition by a.HEATNO) C_TI,
- max(case when a.HEATNO = u.GYCODE then decode(u.itemcode,'Nb',u.stdmin,'') end) over(partition by a.HEATNO) C_NB,
- max(case when a.HEATNO = u.GYCODE then decode(u.itemcode,'Cr',u.stdmin,'') end) over(partition by a.HEATNO) C_CR,
- max(case when a.HEATNO = u.GYCODE then decode(u.itemcode,'Ni',u.stdmin,'') end) over(partition by a.HEATNO) C_NI,
- max(case when a.HEATNO = u.GYCODE then decode(u.itemcode,'Mo',u.stdmin,'') end) over(partition by a.HEATNO) C_MO,
- max(case when a.HEATNO = u.GYCODE then decode(u.itemcode,'Cu',u.stdmin,'') end) over(partition by a.HEATNO) C_CU,
- max(case when a.HEATNO = u.GYCODE then decode(u.itemcode,'Als',u.stdmin,'') end) over(partition by a.HEATNO) C_ALS,
- max(case when a.HEATNO = u.GYCODE then decode(u.itemcode,'Alt',u.stdmin,'') end) over(partition by a.HEATNO) C_ALT,
- --内控上限化学成分
- max(case when a.HEATNO = u.GYCODE then decode(u.itemcode,'C',u.stdmax,'') end) over(partition by a.HEATNO) S_C,
- max(case when a.HEATNO = u.GYCODE then decode(u.itemcode,'Mn',u.stdmax,'') end) over(partition by a.HEATNO) S_MN,
- max(case when a.HEATNO = u.GYCODE then decode(u.itemcode,'S',u.stdmax,'') end) over(partition by a.HEATNO) S_S,
- max(case when a.HEATNO = u.GYCODE then decode(u.itemcode,'P',u.stdmax,'') end) over(partition by a.HEATNO) S_P,
- max(case when a.HEATNO = u.GYCODE then decode(u.itemcode,'Si',u.stdmax,'') end) over(partition by a.HEATNO) S_SI,
- max(case when a.HEATNO = u.GYCODE then decode(u.itemcode,'V',u.stdmax,'') end) over(partition by a.HEATNO) S_V,
- max(case when a.HEATNO = u.GYCODE then decode(u.itemcode,'Ti',u.stdmax,'') end) over(partition by a.HEATNO) S_TI,
- max(case when a.HEATNO = u.GYCODE then decode(u.itemcode,'Nb',u.stdmax,'') end) over(partition by a.HEATNO) S_NB,
- max(case when a.HEATNO = u.GYCODE then decode(u.itemcode,'Cr',u.stdmax,'') end) over(partition by a.HEATNO) S_CR,
- max(case when a.HEATNO = u.GYCODE then decode(u.itemcode,'Ni',u.stdmax,'') end) over(partition by a.HEATNO) S_NI,
- max(case when a.HEATNO = u.GYCODE then decode(u.itemcode,'Mo',u.stdmax,'') end) over(partition by a.HEATNO) S_MO,
- max(case when a.HEATNO = u.GYCODE then decode(u.itemcode,'Cu',u.stdmax,'') end) over(partition by a.HEATNO) S_CU,
- max(case when a.HEATNO = u.GYCODE then decode(u.itemcode,'Als',u.stdmax,'') end) over(partition by a.HEATNO) S_ALS,
- max(case when a.HEATNO = u.GYCODE then decode(u.itemcode,'Alt',u.stdmax,'') end) over(partition by a.HEATNO) S_ALT
- from (select *
- from STL_RHS_OPTINFO
- where $
- union
- select * from J#stl_RHS_OPTINFO where $) a,
- (select t.charge_no,t.judge_stl_grd,decode(t.judge_stl_grd,'','否','是') FLAG from stl_judge_result t) p,
-
- (select y.*
- from (select x.*,
- count(1) over(partition by x.HEATNO) cnt,
- row_number() over(partition by x.HEATNO order by x.ASSAYTYPECODE desc) xh
- from (select *
- from stl_CHEMELEMENT
- where (upper(SUBSTR(CHECKNO, 12, 1)) = 'F'
- or upper(SUBSTR(CHECKNO, 12, 2)) = 'GP')
- and upper(SUBSTR(CHECKNO, -1)) = 'S'
- and $
- union
- select t.*
- from j#stl_CHEMELEMENT t
- where (upper(SUBSTR(CHECKNO, 12, 1)) = 'F'
- or upper(SUBSTR(CHECKNO, 12, 2)) = 'GP')
- and upper(SUBSTR(CHECKNO, -1)) = 'S'
- and $ ) x) y
- where y.xh = y.cnt) w,
-
- (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
- where a.HEATNO = w.HEATNO(+)
- and a.HEATNO = p.charge_no(+)
- and a.HEATNO = u.GYCODE(+)
- order by to_char(a.OPTDATE, 'yyyy-MM-dd')
- ]]>
- </query>
- <query id="reportLFElement.Query" desc="LF炉成分报表查询" fetchSize="10">
- <![CDATA[
- select distinct to_char(a.OPTDATE, 'yyyy-MM-dd') OPTDATE,--日期
- decode(a.SHIFTCODE,'11','甲白','12','乙白','13','丙白','14','丁白','21','甲中','22','乙中','23','丙中','24','丁中','31','甲夜','32','乙夜','33','丙夜','34','丁夜')SHIFTCODE ,--班组
- a.HEATNO HEATNO, --炉号
- a.PLANSTEEL PLANSTEEL,--钢种
- w.CEQ, --碳当量
- p.FLAG FLAG, --是否改判
- --CP化学成分
- max(case when a.HEATNO = w.HEATNO and w.xh = w.cnt then w.C end) over(partition by a.HEATNO) Y_C,
- max(case when a.HEATNO = w.HEATNO and w.xh = w.cnt then w.MN end) over(partition by a.HEATNO) Y_MN,
- max(case when a.HEATNO = w.HEATNO and w.xh = w.cnt then w.S end) over(partition by a.HEATNO) Y_S,
- max(case when a.HEATNO = w.HEATNO and w.xh = w.cnt then w.P end) over(partition by a.HEATNO) Y_P,
- max(case when a.HEATNO = w.HEATNO and w.xh = w.cnt then w.SI end) over(partition by a.HEATNO) Y_SI,
- max(case when a.HEATNO = w.HEATNO and w.xh = w.cnt then w.V end) over(partition by a.HEATNO) Y_V,
- max(case when a.HEATNO = w.HEATNO and w.xh = w.cnt then w.TI end) over(partition by a.HEATNO) Y_TI,
- max(case when a.HEATNO = w.HEATNO and w.xh = w.cnt then w.NB end) over(partition by a.HEATNO) Y_NB,
- max(case when a.HEATNO = w.HEATNO and w.xh = w.cnt then w.CR end) over(partition by a.HEATNO) Y_CR,
- max(case when a.HEATNO = w.HEATNO and w.xh = w.cnt then w.NI end) over(partition by a.HEATNO) Y_NI,
- max(case when a.HEATNO = w.HEATNO and w.xh = w.cnt then w.MO end) over(partition by a.HEATNO) Y_MO,
- max(case when a.HEATNO = w.HEATNO and w.xh = w.cnt then w.CU end) over(partition by a.HEATNO) Y_CU,
- max(case when a.HEATNO = w.HEATNO and w.xh = w.cnt then w.ALS end) over(partition by a.HEATNO) Y_ALS,
- max(case when a.HEATNO = w.HEATNO and w.xh = w.cnt then w.ALT end) over(partition by a.HEATNO) Y_ALT,
- --内控下限化学成分
- max(case when a.HEATNO = u.GYCODE then decode(u.itemcode,'C',u.stdmin,'') end) over(partition by a.HEATNO) C_C,
- max(case when a.HEATNO = u.GYCODE then decode(u.itemcode,'Mn',u.stdmin,'') end) over(partition by a.HEATNO) C_MN,
- max(case when a.HEATNO = u.GYCODE then decode(u.itemcode,'S',u.stdmin,'') end) over(partition by a.HEATNO) C_S,
- max(case when a.HEATNO = u.GYCODE then decode(u.itemcode,'P',u.stdmin,'') end) over(partition by a.HEATNO) C_P,
- max(case when a.HEATNO = u.GYCODE then decode(u.itemcode,'Si',u.stdmin,'') end) over(partition by a.HEATNO) C_SI,
- max(case when a.HEATNO = u.GYCODE then decode(u.itemcode,'V',u.stdmin,'') end) over(partition by a.HEATNO) C_V,
- max(case when a.HEATNO = u.GYCODE then decode(u.itemcode,'Ti',u.stdmin,'') end) over(partition by a.HEATNO) C_TI,
- max(case when a.HEATNO = u.GYCODE then decode(u.itemcode,'Nb',u.stdmin,'') end) over(partition by a.HEATNO) C_NB,
- max(case when a.HEATNO = u.GYCODE then decode(u.itemcode,'Cr',u.stdmin,'') end) over(partition by a.HEATNO) C_CR,
- max(case when a.HEATNO = u.GYCODE then decode(u.itemcode,'Ni',u.stdmin,'') end) over(partition by a.HEATNO) C_NI,
- max(case when a.HEATNO = u.GYCODE then decode(u.itemcode,'Mo',u.stdmin,'') end) over(partition by a.HEATNO) C_MO,
- max(case when a.HEATNO = u.GYCODE then decode(u.itemcode,'Cu',u.stdmin,'') end) over(partition by a.HEATNO) C_CU,
- max(case when a.HEATNO = u.GYCODE then decode(u.itemcode,'Als',u.stdmin,'') end) over(partition by a.HEATNO) C_ALS,
- max(case when a.HEATNO = u.GYCODE then decode(u.itemcode,'Alt',u.stdmin,'') end) over(partition by a.HEATNO) C_ALT,
- --内控上限化学成分
- max(case when a.HEATNO = u.GYCODE then decode(u.itemcode,'C',u.stdmax,'') end) over(partition by a.HEATNO) S_C,
- max(case when a.HEATNO = u.GYCODE then decode(u.itemcode,'Mn',u.stdmax,'') end) over(partition by a.HEATNO) S_MN,
- max(case when a.HEATNO = u.GYCODE then decode(u.itemcode,'S',u.stdmax,'') end) over(partition by a.HEATNO) S_S,
- max(case when a.HEATNO = u.GYCODE then decode(u.itemcode,'P',u.stdmax,'') end) over(partition by a.HEATNO) S_P,
- max(case when a.HEATNO = u.GYCODE then decode(u.itemcode,'Si',u.stdmax,'') end) over(partition by a.HEATNO) S_SI,
- max(case when a.HEATNO = u.GYCODE then decode(u.itemcode,'V',u.stdmax,'') end) over(partition by a.HEATNO) S_V,
- max(case when a.HEATNO = u.GYCODE then decode(u.itemcode,'Ti',u.stdmax,'') end) over(partition by a.HEATNO) S_TI,
- max(case when a.HEATNO = u.GYCODE then decode(u.itemcode,'Nb',u.stdmax,'') end) over(partition by a.HEATNO) S_NB,
- max(case when a.HEATNO = u.GYCODE then decode(u.itemcode,'Cr',u.stdmax,'') end) over(partition by a.HEATNO) S_CR,
- max(case when a.HEATNO = u.GYCODE then decode(u.itemcode,'Ni',u.stdmax,'') end) over(partition by a.HEATNO) S_NI,
- max(case when a.HEATNO = u.GYCODE then decode(u.itemcode,'Mo',u.stdmax,'') end) over(partition by a.HEATNO) S_MO,
- max(case when a.HEATNO = u.GYCODE then decode(u.itemcode,'Cu',u.stdmax,'') end) over(partition by a.HEATNO) S_CU,
- max(case when a.HEATNO = u.GYCODE then decode(u.itemcode,'Als',u.stdmax,'') end) over(partition by a.HEATNO) S_ALS,
- max(case when a.HEATNO = u.GYCODE then decode(u.itemcode,'Alt',u.stdmax,'') end) over(partition by a.HEATNO) S_ALT
- from (select *
- from stl_LFS_OPTINFO
- where $
- union
- select * from J#stl_LFS_OPTINFO where $) a,
-
- (select t.charge_no,t.judge_stl_grd,decode(t.judge_stl_grd,'','否','是') FLAG from stl_judge_result t) p,
-
- (select y.*
- from (select x.*,
- count(1) over(partition by x.HEATNO) cnt,
- row_number() over(partition by x.HEATNO order by x.ASSAYTYPECODE desc) xh
- from (select *
- from stl_CHEMELEMENT
- where (upper(SUBSTR(CHECKNO, 12, 1)) = 'E'
- or upper(SUBSTR(CHECKNO, 12, 2)) = 'GP')
- and upper(SUBSTR(CHECKNO, -1)) = 'S'
- and $
- union
- select t.*
- from j#stl_CHEMELEMENT t
- where (upper(SUBSTR(CHECKNO, 12, 1)) = 'E'
- or upper(SUBSTR(CHECKNO, 12, 2)) = 'GP')
- and upper(SUBSTR(CHECKNO, -1)) = 'S'
- and $ ) x) y
- where y.xh = y.cnt) w,
-
- (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
-
- where a.HEATNO = w.HEATNO(+)
- and a.HEATNO = u.GYCODE(+)
- and a.HEATNO = p.charge_no(+)
- order by to_char(a.OPTDATE, 'yyyy-MM-dd')
- ]]>
- </query>
- <query id="reportVDElement.Query" desc="VD炉成分报表查询" fetchSize="10">
- <![CDATA[
- select distinct to_char(a.OPTDATE, 'yyyy-MM-dd') OPTDATE,--日期
- decode(a.SHIFTCODE,'11','甲白','12','乙白','13','丙白','14','丁白','21','甲中','22','乙中','23','丙中','24','丁中','31','甲夜','32','乙夜','33','丙夜','34','丁夜')SHIFTCODE ,--班组
- a.HEATNO HEATNO, --炉号
- a.PLANSTEEL PLANSTEEL,--钢种
- w.CEQ, --碳当量
- p.FLAG FLAG, --是否改判
- --CP化学成分
- max(case when a.HEATNO = w.HEATNO and w.xh = w.cnt then w.C end) over(partition by a.HEATNO) Y_C,
- max(case when a.HEATNO = w.HEATNO and w.xh = w.cnt then w.MN end) over(partition by a.HEATNO) Y_MN,
- max(case when a.HEATNO = w.HEATNO and w.xh = w.cnt then w.S end) over(partition by a.HEATNO) Y_S,
- max(case when a.HEATNO = w.HEATNO and w.xh = w.cnt then w.P end) over(partition by a.HEATNO) Y_P,
- max(case when a.HEATNO = w.HEATNO and w.xh = w.cnt then w.SI end) over(partition by a.HEATNO) Y_SI,
- max(case when a.HEATNO = w.HEATNO and w.xh = w.cnt then w.V end) over(partition by a.HEATNO) Y_V,
- max(case when a.HEATNO = w.HEATNO and w.xh = w.cnt then w.TI end) over(partition by a.HEATNO) Y_TI,
- max(case when a.HEATNO = w.HEATNO and w.xh = w.cnt then w.NB end) over(partition by a.HEATNO) Y_NB,
- max(case when a.HEATNO = w.HEATNO and w.xh = w.cnt then w.CR end) over(partition by a.HEATNO) Y_CR,
- max(case when a.HEATNO = w.HEATNO and w.xh = w.cnt then w.NI end) over(partition by a.HEATNO) Y_NI,
- max(case when a.HEATNO = w.HEATNO and w.xh = w.cnt then w.MO end) over(partition by a.HEATNO) Y_MO,
- max(case when a.HEATNO = w.HEATNO and w.xh = w.cnt then w.CU end) over(partition by a.HEATNO) Y_CU,
- max(case when a.HEATNO = w.HEATNO and w.xh = w.cnt then w.ALS end) over(partition by a.HEATNO) Y_ALS,
- max(case when a.HEATNO = w.HEATNO and w.xh = w.cnt then w.ALT end) over(partition by a.HEATNO) Y_ALT,
- --内控下限化学成分
- max(case when a.HEATNO = u.GYCODE then decode(u.itemcode,'C',u.stdmin,'') end) over(partition by a.HEATNO) C_C,
- max(case when a.HEATNO = u.GYCODE then decode(u.itemcode,'Mn',u.stdmin,'') end) over(partition by a.HEATNO) C_MN,
- max(case when a.HEATNO = u.GYCODE then decode(u.itemcode,'S',u.stdmin,'') end) over(partition by a.HEATNO) C_S,
- max(case when a.HEATNO = u.GYCODE then decode(u.itemcode,'P',u.stdmin,'') end) over(partition by a.HEATNO) C_P,
- max(case when a.HEATNO = u.GYCODE then decode(u.itemcode,'Si',u.stdmin,'') end) over(partition by a.HEATNO) C_SI,
- max(case when a.HEATNO = u.GYCODE then decode(u.itemcode,'V',u.stdmin,'') end) over(partition by a.HEATNO) C_V,
- max(case when a.HEATNO = u.GYCODE then decode(u.itemcode,'Ti',u.stdmin,'') end) over(partition by a.HEATNO) C_TI,
- max(case when a.HEATNO = u.GYCODE then decode(u.itemcode,'Nb',u.stdmin,'') end) over(partition by a.HEATNO) C_NB,
- max(case when a.HEATNO = u.GYCODE then decode(u.itemcode,'Cr',u.stdmin,'') end) over(partition by a.HEATNO) C_CR,
- max(case when a.HEATNO = u.GYCODE then decode(u.itemcode,'Ni',u.stdmin,'') end) over(partition by a.HEATNO) C_NI,
- max(case when a.HEATNO = u.GYCODE then decode(u.itemcode,'Mo',u.stdmin,'') end) over(partition by a.HEATNO) C_MO,
- max(case when a.HEATNO = u.GYCODE then decode(u.itemcode,'Cu',u.stdmin,'') end) over(partition by a.HEATNO) C_CU,
- max(case when a.HEATNO = u.GYCODE then decode(u.itemcode,'Als',u.stdmin,'') end) over(partition by a.HEATNO) C_ALS,
- max(case when a.HEATNO = u.GYCODE then decode(u.itemcode,'Alt',u.stdmin,'') end) over(partition by a.HEATNO) C_ALT,
- --内控上限化学成分
- max(case when a.HEATNO = u.GYCODE then decode(u.itemcode,'C',u.stdmax,'') end) over(partition by a.HEATNO) S_C,
- max(case when a.HEATNO = u.GYCODE then decode(u.itemcode,'Mn',u.stdmax,'') end) over(partition by a.HEATNO) S_MN,
- max(case when a.HEATNO = u.GYCODE then decode(u.itemcode,'S',u.stdmax,'') end) over(partition by a.HEATNO) S_S,
- max(case when a.HEATNO = u.GYCODE then decode(u.itemcode,'P',u.stdmax,'') end) over(partition by a.HEATNO) S_P,
- max(case when a.HEATNO = u.GYCODE then decode(u.itemcode,'Si',u.stdmax,'') end) over(partition by a.HEATNO) S_SI,
- max(case when a.HEATNO = u.GYCODE then decode(u.itemcode,'V',u.stdmax,'') end) over(partition by a.HEATNO) S_V,
- max(case when a.HEATNO = u.GYCODE then decode(u.itemcode,'Ti',u.stdmax,'') end) over(partition by a.HEATNO) S_TI,
- max(case when a.HEATNO = u.GYCODE then decode(u.itemcode,'Nb',u.stdmax,'') end) over(partition by a.HEATNO) S_NB,
- max(case when a.HEATNO = u.GYCODE then decode(u.itemcode,'Cr',u.stdmax,'') end) over(partition by a.HEATNO) S_CR,
- max(case when a.HEATNO = u.GYCODE then decode(u.itemcode,'Ni',u.stdmax,'') end) over(partition by a.HEATNO) S_NI,
- max(case when a.HEATNO = u.GYCODE then decode(u.itemcode,'Mo',u.stdmax,'') end) over(partition by a.HEATNO) S_MO,
- max(case when a.HEATNO = u.GYCODE then decode(u.itemcode,'Cu',u.stdmax,'') end) over(partition by a.HEATNO) S_CU,
- max(case when a.HEATNO = u.GYCODE then decode(u.itemcode,'Als',u.stdmax,'') end) over(partition by a.HEATNO) S_ALS,
- max(case when a.HEATNO = u.GYCODE then decode(u.itemcode,'Alt',u.stdmax,'') end) over(partition by a.HEATNO) S_ALT
- from (select *
- from stl_vds_optinfo
- where $
- union
- select * from J#stl_vds_optinfo where $) a,
-
- (select t.charge_no,t.judge_stl_grd,decode(t.judge_stl_grd,'','否','是') FLAG from stl_judge_result t) p,
-
- (select y.*
- from (select x.*,
- count(1) over(partition by x.HEATNO) cnt,
- row_number() over(partition by x.HEATNO order by x.ASSAYTYPECODE desc) xh
- from (select *
- from stl_CHEMELEMENT
- where (upper(SUBSTR(CHECKNO, 12, 1)) = 'I'
- or upper(SUBSTR(CHECKNO, 12, 2)) = 'GP')
- and upper(SUBSTR(CHECKNO, -1)) = 'S'
- and $
- union
- select t.*
- from j#stl_CHEMELEMENT t
- where (upper(SUBSTR(CHECKNO, 12, 1)) = 'I'
- or upper(SUBSTR(CHECKNO, 12, 2)) = 'GP')
- and upper(SUBSTR(CHECKNO, -1)) = 'S'
- and $ ) x) y
- where y.xh = y.cnt) w,
-
- (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
-
- where a.HEATNO = w.HEATNO(+)
- and a.HEATNO = u.GYCODE(+)
- and a.HEATNO = p.charge_no(+)
- order by to_char(a.OPTDATE, 'yyyy-MM-dd')
- ]]>
- </query>
- <query id="reportLFSMetal.Query" desc="LF炉合金加入报表查询" fetchSize="10">
- <![CDATA[
- select distinct v.heatprocessno, --加热处理号
- v.OPTDATE, --日期
- decode(v.SHIFTCODE,'11','甲白','12','乙白','13','丙白','14','丁白','21','甲中','22','乙中','23','丙中','24','丁中','31','甲夜','32','乙夜','33','丙夜','34','丁夜')SHIFTCODE ,--班组
- v.HEATNO, --炉号
- v.PLANSTEEL STEEL,--钢种
- v.STATIONCODE, --设备号
- substr(v.stationcode,3,1) ||'#'||
- decode(substr(v.STATIONCODE, 1, 1), 'C','转炉',
- decode(substr(v.STATIONCODE, 1, 1), 'D','吹氩站',
- decode(substr(v.STATIONCODE, 1, 1), 'E','精炼炉',
- decode(substr(v.STATIONCODE, 1, 1), 'F','RH炉',
- decode(substr(v.STATIONCODE, 1, 1), 'B','脱硫',''))))) wsid,
- d.materielname, --物料名
- v.MATERIELCODE vCODE, --LF物料编码
- v.MATERIELTYPE vTYPE, --LF物料类型
- round(v.JMWGT,2) vJMWGT,--LF加料重量(Kg)
- w.MATERIELCODE wCODE, --BF物料编码
- w.MATERIELTYPE wTYPE, --BF物料类型
- round(w.JMWGT,2) wJMWGT --BF加料重量(Kg)
- from
- (select * from scm_materiel) d,
- (select distinct a.heatprocessno,
- a.heatno,
- a.optdate,
- a.PLANSTEEL,
- b.STATIONCODE,
- a.wsid,
- a.SHIFTCODE,
- b.MATERIELCODE,
- b.MATERIELTYPE,
- round(sum(nvl(b.JMWGT,0)) over (partition by b.HEATNO, b.STATIONCODE, b.DISPOSALTIME, b.MATERIELTYPE, b.MATERIELCODE),2) JMWGT
- 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'
- )v ,
- (select distinct a.heatprocessno,
- a.heatno,
- a.optdate,
- a.PLANSTEEL,
- b.STATIONCODE,
- a.wsid,
- a.SHIFTCODE,
- b.MATERIELCODE,
- b.MATERIELTYPE,
- round(sum(nvl(b.JMWGT,0)) over (partition by b.HEATNO, b.STATIONCODE, b.DISPOSALTIME, b.MATERIELTYPE, b.MATERIELCODE),2) JMWGT
- 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
-
- where d.materielcode (+)= v.materielcode
- --and d.materielcode = w.materielcode (+)
- and v.heatno = w.heatno
- order by v.heatprocessno desc
- ]]>
- </query>
- <query id="reportLFS_Metal_Load.select" desc="获取LF炉合金 初始化物料信息列名" fetchSize="10">
- <![CDATA[
- select distinct (a.materielcode) materielcode,
- a.MATERIELTYPE,
- b.materielforshort
- from stl_additives a, scm_materiel b
- where a.materielcode = b.materielcode
- and b.MATERIELTYPE= ? and to_char(a.updatetime, 'yyyy-MM-dd')
- between ? and ?
- ]]>
- </query>
- <query id="reportVDSMetal.Query" desc="VD炉合金加入报表查询" fetchSize="10">
- <![CDATA[
- select v.heatprocessno, --加热处理号
- v.OPTDATE, --日期
- decode(v.SHIFTCODE,'11','甲白','12','乙白','13','丙白','14','丁白','21','甲中','22','乙中','23','丙中','24','丁中','31','甲夜','32','乙夜','33','丙夜','34','丁夜')SHIFTCODE ,--班组
- v.HEATNO, --炉号
- v.PLANSTEEL STEEL,--钢种
- v.STATIONCODE, --设备号
- substr(v.stationcode,3,1) ||'#'||
- decode(substr(v.STATIONCODE, 1, 1), 'C','转炉',
- decode(substr(v.STATIONCODE, 1, 1), 'D','吹氩站',
- decode(substr(v.STATIONCODE, 1, 1), 'E','精炼炉',
- decode(substr(v.STATIONCODE, 1, 1), 'F','RH炉',
- decode(substr(v.STATIONCODE, 1, 1), 'B','脱硫',''))))) wsid,
- v.MATERIELCODE, --物料编码
- d.materielname, --物料名
- v.MATERIELTYPE, --物料类型
- round(v.JMWGT,2) JMWGT --加料重量(Kg)
- from
- (select * from scm_materiel) d,
- (select distinct a.heatprocessno,
- a.heatno,
- a.optdate,
- a.PLANSTEEL,
- b.STATIONCODE,
- a.wsid,
- a.SHIFTCODE,
- b.MATERIELCODE,
- b.MATERIELTYPE,
- round(sum(nvl(b.JMWGT,0)) over (partition by b.HEATNO, b.STATIONCODE, b.DISPOSALTIME, b.MATERIELTYPE, b.MATERIELCODE),2) JMWGT
- from (select * from STL_VDS_Optinfo union select * from J#STL_VDS_Optinfo ) a, stl_additives b
- where a.heatno =b.heatno and 'I'|| a.stationcode = b.stationcode and a.disposaltime = b.disposaltime $ and b.MATERIELTYPE='HJ') v
- where d.materielcode (+)= v.materielcode order by v.heatprocessno desc
- ]]>
- </query>
- <query id="reportVDS_Metal_Load.select" desc="获取VD炉合金初始化物料信息列名" fetchSize="10">
- <![CDATA[
- select distinct (a.materielcode) materielcode,
- a.MATERIELTYPE,
- b.materielforshort
- from stl_additives a, scm_materiel b
- where a.materielcode = b.materielcode
- and b.MATERIELTYPE= ? and to_char(a.updatetime, 'yyyy-MM-dd')
- between ? and ?
- ]]>
- </query>
- <query id="reportBOF.Query" desc="转炉生产日报统计表--所有炉号查询" fetchSize="10">
- <![CDATA[
- select A.HEATNO, --炉号
- A.station STATIONCODE, --岗位编码
- nvl(round(B.CPL, 3), 0) CPL, --合格铸坯量(T)
- case
- when (nvl(A.PFBALEWGT, 0) - nvl(A.BALELEAVEWGT, 0)) > 0 then
- round((nvl(A.PFBALEWGT, 0) - nvl(A.BALELEAVEWGT, 0)), 3)
- else
- 0
- end GSL, --GSL(合格钢水量) = (上台大包重量-下台大包重量)
- (select substr(mes_lg_common.getlgshift1(A.RecFlag), 2, 1) from dual) SHIFTCODE,--班组
- case
- when to_char(A.RecFlag, 'yyyy-MM-dd HH24:mi') between ? and ? then
- '1'
- else
- '0'
- end BECURR --1#吹开始时刻(操作时间)
- from (select *
- from (select t.*,
- row_number() over(partition by HEATNO order by RecFlag) XH
- from (select t.recflag,station, t2.*
- from (select t.heatno,
- case
- when B1STARTTIME is not null then
- B1STARTTIME
- else
- OPTDATE
- end RecFlag,t.stationcode station
- from STL_bof_optinfo t
- where to_char(case when
- B1STARTTIME is not null then
- B1STARTTIME else OPTDATE end,
- 'yyyy-MM-dd') between ? and ?
- union all
- select t.heatno,
- case
- when B1STARTTIME is not null then
- B1STARTTIME
- else
- OPTDATE
- end RecFlag,t.stationcode station
- from J#STL_bof_optinfo t
- where to_char(case when
- B1STARTTIME is not null then
- B1STARTTIME else OPTDATE end,
- 'yyyy-MM-dd') between ? and ?) t,
- (select *
- from STL_ccm_optinfo
- union
- select * from J#STL_Ccm_Optinfo) t2
- where t.heatno = t2.heatno) t)
- where XH = 1) A,
- (select distinct substr(CHARGE_NO, 1, 10) HEATNO,
- sum(nvl(SLAB_WGT, 0)) over(partition by substr(CHARGE_NO, 1, 10)) CPL
- from (select CHARGE_NO, (SLAB_WGT/1000) SLAB_WGT --合格铸坯量(T)
- from stl_incision_view
- where to_char(to_date(substr(SLAB_CUT_DTIME,1,8),'yyyy-MM-dd hh24:mi:ss'),'yyyy-MM-dd') between ? and ?
- ) t) B
- where A.HEATNO = B.HEATNO(+)
- ]]>
- </query>
- <query id="proc_GetBOFInfo.Query" desc="转炉生产日报统计表--转炉信息查询" fetchSize="10">
- <![CDATA[
- select distinct b.HEATNO, --炉号
- b.STATIONCODE, --岗位编号
- substr(b.SHIFTCODE, 2, 1) SHIFTCODE,--班组(甲、乙、丙、丁)
- nvl(b.IRONPOTWGT, 0) TSL, --装入铁水量
- nvl(b.PIGIRONWGT, 0) STL, --装入生铁量(T)
- nvl(b.WSTEELWGT, 0) FGL, --装入废钢量(T)
- nvl(b.RSWGT, 0) HLL, --回炉重量(T)
- nvl(h.jmwgt,0) HJL, --加入合金量(Kg)
- to_char(b.CHANGESTARTTIME,'yyyy-mm-dd hh24:mi:ss') starttime, --兑铁开始时刻
- to_char(b.TAPPINGENDTIME,'yyyy-mm-dd hh24:mi:ss') endtime, --出钢结束时刻
- nvl((b.TAPPINGENDTIME-b.CHANGESTARTTIME )*24*60,0) time, --作业时间(min)
- case
- when to_char(RecFlag, 'yyyy-MM-dd HH24:mi') between ? and ? then
- '1'
- else
- '0'
- end BECURR --1#吹开始时刻(操作时间)
- from (select *
- from (select t.*,
- row_number() over(partition by t.HEATNO order by t.RecFlag) XH
- from (select t.*,
- case
- when B1STARTTIME is not null then
- B1STARTTIME
- else
- OPTDATE
- end RecFlag
- from STL_BOF_OPTINFO t
- where to_char(case when B1STARTTIME is not null then
- B1STARTTIME else OPTDATE end,
- 'yyyy-MM-dd') between ? and ?
- union all
- select t.*,
- case
- when B1STARTTIME is not null then
- B1STARTTIME
- else
- OPTDATE
- end RecFlag
- from J#STL_BOF_OPTINFO t
- where to_char(case when B1STARTTIME is not null then
- B1STARTTIME else OPTDATE end,
- 'yyyy-MM-dd') between ? and ?) t) v where XH = 1) b,
- (select distinct s.heatno,
- sum(s.jmwgt) over(partition by s.heatno order by s.heatno) jmwgt,
- s.materieltype,
- substr(s.stationcode, 2, 2) code
- from stl_additives s
- where s.materieltype = 'HJ'
- and substr(s.stationcode, 1, 1) = 'C'
- union
- select distinct s.heatno,
- sum(s.jmwgt) over(partition by s.heatno order by s.heatno) jmwgt,
- s.materieltype,
- substr(s.stationcode, 2, 2) code
- from j#stl_additives s
- where s.materieltype = 'HJ'
- and substr(s.stationcode, 1, 1) = 'C') h
- where b.heatno = h.heatno(+) order by b.heatno
- ]]>
- </query>
- <query id="proc_GetBOFInfo_RHS.Query" desc="转炉生产日报统计表--经过RH炉的转炉信息查询" fetchSize="10">
- <![CDATA[
- select distinct p.heatno, --炉号
- s.stationcode, --岗位编号
- substr(s.SHIFTCODE, 2, 1) SHIFTCODE, --班组(甲、乙、丙、丁)
- p.FACT_ROUTE, --实绩工艺路线
- case
- when to_char(RecFlag, 'yyyy-MM-dd HH24:mi') between ? and ? then
- '1'
- else
- '0'
- end BECURR --1#吹开始时刻(操作时间)
- from (select p.FACT_ROUTE,p.heatno
- from PPC_STEEL_HEAT p
- union
- select p.FACT_ROUTE,p.heatno
- from j#PPC_STEEL_HEAT p
- ) p,
- (select *
- from (select t.*,
- row_number() over(partition by t.HEATNO order by t.RecFlag) XH
- from (select t.*,
- case
- when B1STARTTIME is not null then
- B1STARTTIME
- else
- OPTDATE
- end RecFlag
- from STL_BOF_OPTINFO t
- where to_char(case when B1STARTTIME is not null then
- B1STARTTIME else OPTDATE end,
- 'yyyy-MM-dd') between ? and ?
- union all
- select t.*,
- case
- when B1STARTTIME is not null then
- B1STARTTIME
- else
- OPTDATE
- end RecFlag
- from J#STL_BOF_OPTINFO t
- where to_char(case when B1STARTTIME is not null then
- B1STARTTIME else OPTDATE end,
- 'yyyy-MM-dd') between ? and ?) t) v where XH = 1) s
- where substr(p.FACT_ROUTE, 11, 2) = 'F1'
- and s.HEATNO = p.HEATNO(+)
- order by heatno
- ]]>
- </query>
- <query id="GetreportEAFOggData.Query" desc="获取电炉原始记录数据" fetchSize="10">
- <![CDATA[
- select distinct t.HEATNO, --炉号
- t4.aim_grade_code PLANSTEEL, --目标钢号
- t.STATIONCODE, --岗位编号
- t.SAGE, --炉龄
- t.GAGE, --枪龄
- t.O2CONSUME, --供氧耗量
- t.PIGIRONWGT, --装入生铁量
- t.POTWRAPSTATE, --大包包况
- t.SCRAPWGT, --装入废钢量
- t.CHANGESTARTTIME,--兑铁兑钢开始时刻
- t.OPENOXYGENTIME, --开氧时刻
- t.MOLSTLTEMPERATURE,--钢水温度
- t.TERMINUSC, --终点定碳
- t.TERMINUSO2, --终点定氧
- t.MOLSTLTEMPERATURE,--钢水温度
- t.O2PRESS, --氧气压力
- to_char(t.CHANGESTARTTIME, 'HH24:mi') CHANGESTARTTIME, --兑铁兑钢开始时刻
- to_char(t.OPENOXYGENTIME, 'HH24:mi') OPENOXYGENTIME, --开氧时刻
- FLOOR(nvl(t.SUPPLYOXYGENTIME / 60, 0)) SUPPLYOXYGENTIME,--供氧时间
- t.supplyoxygentime SUPPLYOXYGENTIME_S,
- t.TERMINUSTEPT TAPPINGTEMPERATURE, --终点温度
- t.TAPPINGTIME, --出钢时间
- to_char(t.TAPPINGSTARTTIME, 'HH24:mi') TAPPINGSTARTTIME,--出钢开始时刻
- max(case
- when t.HEATNO = t2.HEATNO and t2.xh = t2.cnt then
- t2.C
- end) over(partition by t.HEATNO) F_C,
- max(case
- when t.HEATNO = t2.HEATNO and t2.xh = t2.cnt then
- t2.Mn
- end) over(partition by t.HEATNO) F_MN,
- max(case
- when t.HEATNO = t2.HEATNO and t2.xh = t2.cnt then
- t2.Si
- end) over(partition by t.HEATNO) F_SI,
- max(case
- when t.HEATNO = t2.HEATNO and t2.xh = t2.cnt then
- t2.S
- end) over(partition by t.HEATNO) F_S,
- max(case
- when t.HEATNO = t2.HEATNO and t2.xh = t2.cnt then
- t2.P
- end) over(partition by t.HEATNO) F_P,
-
- max(case
- when t.HEATNO = t2.HEATNO and t2.xh = t2.cnt then
- t2.Als
- end) over(partition by t.HEATNO) F_ALS,
-
- max(case
- when t.HEATNO = t3.HEATNO and t3.xh = t3.cnt then
- t3.Mn
- end) over(partition by t.HEATNO) R_MN,
- max(case
- when t.HEATNO = t3.HEATNO and t3.xh = t3.cnt then
- t3.C
- end) over(partition by t.HEATNO) R_C,
- max(case
- when t.HEATNO = t3.HEATNO and t3.xh = t3.cnt then
- t3.P
- end) over(partition by t.HEATNO) R_P,
- max(case
- when t.HEATNO = t3.HEATNO and t3.xh = t3.cnt then
- t3.S
- end) over(partition by t.HEATNO) R_S,
-
- max(case
- when t.HEATNO = t3.HEATNO and t3.xh = t3.cnt then
- t3.SI
- end) over(partition by t.HEATNO) R_SI,
-
- max(case
- when t.HEATNO = t9.HEATNO and t9.xh = t9.cnt then
- t9.Mn
- end) over(partition by t.HEATNO) Z_MN,
- max(case
- when t.HEATNO = t9.HEATNO and t9.xh = t9.cnt then
- t9.C
- end) over(partition by t.HEATNO) Z_C,
- max(case
- when t.HEATNO = t9.HEATNO and t9.xh = t9.cnt then
- t9.P
- end) over(partition by t.HEATNO) Z_P,
- max(case
- when t.HEATNO = t9.HEATNO and t9.xh = t9.cnt then
- t9.S
- end) over(partition by t.HEATNO) Z_S,
-
- max(case
- when t.HEATNO = t9.HEATNO and t9.xh = t9.cnt then
- t9.SI
- end) over(partition by t.HEATNO) Z_SI,
- t4.cast_id CCMNO, --连铸机号
- t.REMARK, --备注
- to_char(t.optdate, 'yyyy-MM-dd') optDisp --操作时间
- from (select * from stl_eaf_optinfo
- where 1 = 1
- and to_char(OPTDATE, 'yyyy-MM-dd') between ? and ?
- and substr(STATIONCODE, 2, 1) =
- decode(?, null, substr(STATIONCODE, 2, 1), ?)
- and UPPER(nvl(PLANSTEEL, 'null')) in
- (decode(?, null, UPPER(nvl(PLANSTEEL, 'null')), ?))
- and substr(SHIFTCODE, 1, 1) =
- decode(?, null, substr(SHIFTCODE, 1, 1), ?)
- and substr(SHIFTCODE, 2, 1) =
- decode(?, null, substr(SHIFTCODE, 2, 1), ?)
- union
- select * from J#stl_eaf_optinfo
- where 1 = 1
- and to_char(OPTDATE, 'yyyy-MM-dd') between ? and ?
- and substr(STATIONCODE, 2, 1) =
- decode(?, null, substr(STATIONCODE, 2, 1), ?)
- and UPPER(nvl(PLANSTEEL, 'null')) in
- (decode(?, null, UPPER(nvl(PLANSTEEL, 'null')), ?))
- and substr(SHIFTCODE, 1, 1) =
- decode(?, null, substr(SHIFTCODE, 1, 1), ?)
- and substr(SHIFTCODE, 2, 1) =
- decode(?, null, substr(SHIFTCODE, 2, 1), ?)
- ) t
- left join (select y.*
- from (select x.*,
- row_number() over(partition by x.HEATNO order by x.ASSAYTYPECODE) xh
- from (select *
- from STL_CHEMELEMENT
- where upper(substr(ASSAYTYPECODE, 1, 1)) = 'A'
- and to_char(ASSAYDATE, 'yyyy-MM-dd') between ? and ?
- union
- select *
- from J#STL_CHEMELEMENT
- where upper(substr(ASSAYTYPECODE, 1, 1)) = 'A'
- and to_char(ASSAYDATE, 'yyyy-MM-dd') between ? and ?
- ) x) y) t1 on t.heatno = t1.heatno
- left join (select y.*
- from (select x.*,
- count(1) over(partition by x.HEATNO) cnt,
- row_number() over(partition by x.HEATNO order by x.ASSAYTYPECODE desc, x.assaydate desc) xh,
- substr(x.assaytypecode, 1, 1) gw
- from (select *
- from STL_CHEMELEMENT
- where to_char(ASSAYDATE, 'yyyy-MM-dd') between ? and ?
- and upper(SUBSTR(CHECKNO, 12, 1)) = 'C'
- and upper(SUBSTR(CHECKNO, -1)) = 'S'
- and upper(SUBSTR(CHECKNO, 13, 1)) = 'P'
- union
- select *
- from J#STL_CHEMELEMENT
- where to_char(ASSAYDATE, 'yyyy-MM-dd') between ? and ?
- and upper(SUBSTR(CHECKNO, 12, 1)) = 'C'
- and upper(SUBSTR(CHECKNO, -1)) = 'S'
- and upper(SUBSTR(CHECKNO, 13, 1)) = 'P') x) y) t2 on t2.heatno = t.heatno
- left join (select y.*
- from (select x.*,
- count(1) over(partition by x.HEATNO) cnt,
- row_number() over(partition by x.HEATNO order by x.ASSAYTYPECODE desc, x.assaydate desc) xh,
- substr(x.assaytypecode, 1, 1) gw
- from (select *
- from STL_CHEMELEMENT
- where to_char(ASSAYDATE, 'yyyy-MM-dd') between ? and ?
- and upper(SUBSTR(CHECKNO, 12, 1)) = 'C'
- and upper(SUBSTR(CHECKNO, -1)) = 'I'
- and upper(SUBSTR(CHECKNO, 13, 1)) <> 'P'
- union
- select *
- from J#STL_CHEMELEMENT
- where to_char(ASSAYDATE, 'yyyy-MM-dd') between ? and ?
- and upper(SUBSTR(CHECKNO, 12, 1)) = 'C'
- and upper(SUBSTR(CHECKNO, -1)) = 'I'
- and upper(SUBSTR(CHECKNO, 13, 1)) <> 'P') x) y) t3 on t3.heatno = t.heatno
- left join (select y.*
- from (select x.*,
- count(1) over(partition by x.HEATNO) cnt,
- row_number() over(partition by x.HEATNO order by x.ASSAYTYPECODE desc, x.assaydate desc) xh,
- substr(x.assaytypecode, 1, 1) gw
- from (select *
- from STL_CHEMELEMENT
- where to_char(ASSAYDATE, 'yyyy-MM-dd') between ? and ?
- and upper(SUBSTR(CHECKNO, 12, 1)) = 'C'
- and upper(SUBSTR(CHECKNO, -1)) = 'S'
- and upper(SUBSTR(CHECKNO, 13, 1)) = 'P'
- union
- select *
- from J#STL_CHEMELEMENT
- where to_char(ASSAYDATE, 'yyyy-MM-dd') between ? and ?
- and upper(SUBSTR(CHECKNO, 12, 1)) = 'C'
- and upper(SUBSTR(CHECKNO, -1)) = 'S'
- and upper(SUBSTR(CHECKNO, 13, 1)) = 'P') x) y) t9 on t9.heatno = t.heatno
- left join (select * from ppc_steel_heat
- union
- select * from J#ppc_steel_heat) t4 on t.heatno = t4.heatno
- /**left join (select *
- from (select misid, C, Si, Mn, P, S, Asn, Cu, Sn, Sb
- from stl_es_taphole
- union
- select misid, C, Si, Mn, P, S, Asn, Cu, Sn, Sb
- from stl_mis_taphole)) t5 on t.MOLIRNSOURCE = t5.misid**/
- left join (select heatno, PFBALEWGT, BALELEAVEWGT, isrs from STL_ccm_optinfo
- union --PFBALEWGT上台大包重量 BALELEAVEWGT下台大包重量 isrs是否回炉
- select heatno, PFBALEWGT, BALELEAVEWGT, isrs from J#STL_ccm_optinfo) t6 on t.heatno = t6.heatno
- left join (select heatno, ARFTEMPT, ARBTEMPT from STL_cas_optinfo
- union --ARFTEMPT氩前温度 ARFTEMPT氩后温度
- select heatno, ARFTEMPT, ARBTEMPT from J#STL_cas_optinfo) t7 on t.heatno = t7.heatno
- left join (select heatno, isrs from STL_lfs_optinfo
- union --isrs是否回炉
- select heatno, isrs from J#STL_lfs_optinfo) t8 on t.heatno = t8.heatno
- order by optDisp
- ]]>
- </query>
- <query id="EafData_FLHJ.Query" desc="炼钢生产报表--取电炉辅料合金数据" fetchSize="10">
- <![CDATA[
- Select t.heatno,
- t.STATIONCODE,
- t.DISPOSALTIME,
- t1.materielcode,
- t1.materieltype,
- t2.materielname,
- round(sum(nvl(t1.JMWGT, 0)) over(partition by t1.HEATNO,
- t1.STATIONCODE,
- t1.DISPOSALTIME,
- t1.MATERIELTYPE,
- t1.MATERIELCODE)) materielWgt
- from (select *
- from stl_eaf_optinfo
- where 1 = 1 $
- union
- select * from J#stl_eaf_optinfo where 1 = 1 $ ) t
- left join stl_additives t1 on t.heatno = t1.heatno
- and 'A' || t.stationcode = t1.stationcode
- and t.disposaltime = t1.disposaltime
- left join scm_materiel t2 on t1.materielcode = t2.materielcode
- order by t.STATIONCODE, t.HEATNO
- ]]>
- </query>
- <query id="reportAll.Select" desc="各工序炉号、岗位、班次、钢种、日期记录查询" fetchSize="10">
- <![CDATA[
- select A.HEATNO,
- A.STATIONCODE,
- B.FACT_ROUTE,
- substr(A.SHIFTCODE, 2, 1) SHIFTCODE,
- case
- when B.AIM_GRADE_CODE is null then
- B.AIM_GRADE_CODE
- else
- B.AIM_GRADE_CODE
- end PLANSTEEL,
- case
- when $ then
- '1'
- else
- '0'
- end BECURR
-
- from (select *
- from (select t.*,
- row_number() over(partition by t.HEATNO order by t.OPTDATE) XH
- from (select *
- from $ t
- where $
- union all
- select * from J#$ t where $) t
- )
- where XH = 1) A,
-
- (select HEATNO, AIM_GRADE_CODE,FACT_ROUTE
- from (select t.*,
- row_number() over(partition by t.HEATNO order by V_HEAT_ID desc) XH
- from ppc_steel_heat t
- where t.HEATNO is not null
- and $)
- where XH = 1) B
- where A.HEATNO = B.HEATNO(+)
- ]]>
- </query>
- <query id="reportStl_Chemelement.Select" desc="查询对应炉号化学检验表值记录" fetchSize="10">
- <![CDATA[
- select *
- from (select t.*,
- row_number() over(partition by t.heatno order by t.assaydate desc) XH
- from (select *
- from stl_chemelement
- where 1=1 and $
- and (substr(stationcode, 1, 1) = 'G' or
- upper(substr(assaytypecode, 1, 2)) = 'GP')
- union
- select *
- from j#stl_chemelement
- where 1=1 and $
- and (substr(stationcode, 1, 1) = 'G' or
- upper(substr(assaytypecode, 1, 2)) = 'GP')
- ) t
- )
- where XH = 1
- ]]>
- </query>
- <query id="reportScm_Standard_Chem.Select" desc="查询对应炉号化学成份标准记录" fetchSize="10">
- <![CDATA[
- select distinct t1.steel STEELNAME, --牌号
- t.itemcode ELENAME, --描述
- trim(t.stdsign) STDSIGN, --范围符号
- trim(t.stdmin) STDMIN, --最小值
- trim(t.stdmax) STDMAX --最大值
-
- from scm_standard_chem t, scm_sortcode_chem t1
-
- where t.cic = t1.cic
- and t1.stdstyle = '1' --标准內型(1内控 2放行)
- and $ --and t1.STEEL in('','')
-
-
- ]]>
- </query>
- <query id="reportFXMZL_Standard_Chem.Select" desc="放行命中率查询对应炉号化学成份标准记录" fetchSize="10">
- <![CDATA[
- select t1.steel STEELNAME, --牌号
- t.itemcode ELENAME, --描述
- trim(t.stdsign) STDSIGN, --范围符号
- trim(t.stdmin) STDMIN, --最小值
- trim(t.stdmax) STDMAX --最大值
-
- from scm_standard_chem t, scm_sortcode_chem t1
-
- where t.cic = t1.cic
- and t1.stdstyle = '2' --标准內型(1内控 2放行)
- and $
-
- order by t.cic
- ]]>
- </query>
- <query id="reportBOF_Forward.Query" desc="查询转炉炉前铁水信息" fetchSize="10">
- <![CDATA[
- select distinct t.HEATNO, --炉次号
- t.IRONPOTID, --铁水编号
- t4.aim_grade_code PLANSTEEL, --钢种计划
- nvl(t.IRONPOTWGT, '0') IRONPOTWGT,--铁水重量
- t.IRONTEMPERATURE, --铁水温度
- case substr(t.SHIFTCODE, 2, 1) --班组
- when '1' then
- '甲'
- when '2' then
- '乙'
- when '3' then
- '丙'
- when '4' then
- '丁'
- end BB,
- case substr(t.SHIFTCODE, 1, 1) --班次
- when '1' then
- '白'
- when '2' then
- '中'
- when '3' then
- '夜'
- end BC,
- --入炉铁水信息
- max(case
- when t.MOLIRNSOURCE = t10.HEATNO then
- t10.Mn
- end) over(partition by t.MOLIRNSOURCE) R_MN,
- max(case
- when t.MOLIRNSOURCE = t10.HEATNO then
- t10.C
- end) over(partition by t.MOLIRNSOURCE) R_C,
- max(case
- when t.MOLIRNSOURCE = t10.HEATNO then
- t10.P
- end) over(partition by t.MOLIRNSOURCE) R_P,
- max(case
- when t.MOLIRNSOURCE = t10.HEATNO then
- t10.S
- end) over(partition by t.MOLIRNSOURCE) R_S,
- max(case
- when t.MOLIRNSOURCE = t10.HEATNO then
- t10.si
- end) over(partition by t.MOLIRNSOURCE) R_SI,
- --TSO试样
- max(case
- when t.HEATNO = t9.HEATNO and t9.xh = t9.cnt then
- t9.Mn
- end) over(partition by t.HEATNO) Z_MN,
- max(case
- when t.HEATNO = t9.HEATNO and t9.xh = t9.cnt then
- t9.C
- end) over(partition by t.HEATNO) Z_C,
- max(case
- when t.HEATNO = t9.HEATNO and t9.xh = t9.cnt then
- t9.P
- end) over(partition by t.HEATNO) Z_P,
-
- to_char(t.optdate, 'yyyy-MM-dd hh24:mi') OPTDISP --操作时间
- from (select *
- from STL_bof_optinfo
- where 1 = 1
- and to_char(OPTDATE, 'yyyy-MM-dd hh24:mi:ss') between ? and ?
- and substr(STATIONCODE, 2, 1) =
- decode(?, null, substr(STATIONCODE, 2, 1), ?)
- and UPPER(nvl(PLANSTEEL, 'null')) in
- (decode(?, null, UPPER(nvl(PLANSTEEL, 'null')), ?))
- and substr(SHIFTCODE, 1, 1) =
- decode(?, null, substr(SHIFTCODE, 1, 1), ?)
- and substr(SHIFTCODE, 2, 1) =
- decode(?, null, substr(SHIFTCODE, 2, 1), ?)
- union
- select *
- from J#STL_bof_optinfo
- where 1 = 1
- and to_char(OPTDATE, 'yyyy-MM-dd hh24:mi:ss') between ? and ?
- and substr(STATIONCODE, 2, 1) =
- decode(?, null, substr(STATIONCODE, 2, 1), ?)
- and UPPER(nvl(PLANSTEEL, 'null')) in
- (decode(?, null, UPPER(nvl(PLANSTEEL, 'null')), ?))
- and substr(SHIFTCODE, 1, 1) =
- decode(?, null, substr(SHIFTCODE, 1, 1), ?)
- and substr(SHIFTCODE, 2, 1) =
- decode(?, null, substr(SHIFTCODE, 2, 1), ?)
- ) t
- left join (select y.*
- from (select x.*,
- row_number() over(partition by x.HEATNO order by x.ASSAYTYPECODE) xh
- from (select *
- from STL_CHEMELEMENT
- where upper(substr(ASSAYTYPECODE, 1, 1)) = 'C'
- and to_char(ASSAYDATE, 'yyyy-MM-dd') between ? and ?
- union
- select *
- from J#STL_CHEMELEMENT
- where upper(substr(ASSAYTYPECODE, 1, 1)) = 'C'
- and to_char(ASSAYDATE, 'yyyy-MM-dd') between ? and ?
- ) x) y) t1 on t.heatno = t1.heatno
- left join (select y.*
- from (select x.*,
- count(1) over(partition by x.HEATNO) cnt,
- row_number() over(partition by x.HEATNO order by x.ASSAYTYPECODE asc, x.assaydate asc) xh,
- substr(x.assaytypecode, 1, 1) gw
- from (select *
- from STL_CHEMELEMENT
- where to_char(ASSAYDATE, 'yyyy-MM-dd') between ? and ? and
- upper(SUBSTR(CHECKNO, 12, 1)) = 'C'
- and upper(SUBSTR(CHECKNO, -1)) = 'S'
- union
- select *
- from J#STL_CHEMELEMENT
- where to_char(ASSAYDATE, 'yyyy-MM-dd') between ? and ? and
- upper(SUBSTR(CHECKNO, 12, 1)) = 'C'
- and upper(SUBSTR(CHECKNO, -1)) = 'S') x) y) t9 on t9.heatno = t.heatno
- left join (select *
- from stl_chemelement
- union
- select * from J#stl_chemelement) t10 on t10.heatno = t.MOLIRNSOURCE
- left join (select *
- from ppc_steel_heat
- union
- select * from J#ppc_steel_heat) t4 on t.heatno = t4.heatno
-
- order by OPTDISP
- ]]>
- </query>
- <query id="reportBOF_Tapp.Query" desc="查询转炉二次取样信息" fetchSize="10">
- <![CDATA[
- select distinct t.HEATNO, --炉号
- t4.aim_grade_code PLANSTEEL, --钢种
- case substr(t.SHIFTCODE, 2, 1)--班组
- when '1' then
- '甲'
- when '2' then
- '乙'
- when '3' then
- '丙'
- when '4' then
- '丁'
- end BB,
- case substr(t.SHIFTCODE, 1, 1)--班次
- when '1' then
- '白'
- when '2' then
- '中'
- when '3' then
- '夜'
- end BC,
- nvl(t.B2TIME,0) B2TIME, --2#吹时间(s)
- nvl(t.B3TIME,0) B3TIME, --3#吹时间(s)
- nvl(t.B4TIME,0) B4TIME, --4#吹时间(s)
- nvl(t.B5TIME,0) B5TIME, --5#吹时间(s)
- --LD2(第二次取样)
- max(case
- when t.HEATNO = t3.HEATNO and t3.xh = t3.cnt then
- t3.Mn
- end) over(partition by t.HEATNO) Z_MN,
- max(case
- when t.HEATNO = t3.HEATNO and t3.xh = t3.cnt then
- t3.C
- end) over(partition by t.HEATNO) Z_C,
- max(case
- when t.HEATNO = t3.HEATNO and t3.xh = t3.cnt then
- t3.P
- end) over(partition by t.HEATNO) Z_P,
- max(case
- when t.HEATNO = t3.HEATNO and t3.xh = t3.cnt then
- t3.S
- end) over(partition by t.HEATNO) Z_S,
-
- to_char(t.optdate, 'yyyy-MM-dd hh24:mi') OPTDISP --操作时间
- from (select *
- from STL_bof_optinfo
- where 1 = 1
- and to_char(OPTDATE, 'yyyy-MM-dd') between ? and ?
- and substr(STATIONCODE, 2, 1) =
- decode(?, null, substr(STATIONCODE, 2, 1), ?)
- and UPPER(nvl(PLANSTEEL, 'null')) in
- (decode(?, null, UPPER(nvl(PLANSTEEL, 'null')), ?))
- and substr(SHIFTCODE, 1, 1) =
- decode(?, null, substr(SHIFTCODE, 1, 1), ?)
- and substr(SHIFTCODE, 2, 1) =
- decode(?, null, substr(SHIFTCODE, 2, 1), ?)
- union
- select *
- from J#STL_bof_optinfo
- where 1 = 1
- and to_char(OPTDATE, 'yyyy-MM-dd') between ? and ?
- and substr(STATIONCODE, 2, 1) =
- decode(?, null, substr(STATIONCODE, 2, 1), ?)
- and UPPER(nvl(PLANSTEEL, 'null')) in
- (decode(?, null, UPPER(nvl(PLANSTEEL, 'null')), ?))
- and substr(SHIFTCODE, 1, 1) =
- decode(?, null, substr(SHIFTCODE, 1, 1), ?)
- and substr(SHIFTCODE, 2, 1) =
- decode(?, null, substr(SHIFTCODE, 2, 1), ?)
- ) t
- left join (select y.*
- from (select x.*,
- count(1) over(partition by x.HEATNO) cnt,
- row_number() over(partition by x.HEATNO order by x.ASSAYTYPECODE asc, x.assaydate asc) xh,
- substr(x.assaytypecode, 1, 1) gw
- from (select *
- from STL_CHEMELEMENT
- where to_char(ASSAYDATE, 'yyyy-MM-dd') between ? and ? and
- upper(SUBSTR(CHECKNO, 12, 1)) = 'C'
- and upper(SUBSTR(CHECKNO, -1)) = 'S'
- union
- select *
- from J#STL_CHEMELEMENT
- where to_char(ASSAYDATE, 'yyyy-MM-dd') between ? and ? and
- upper(SUBSTR(CHECKNO, 12, 1)) = 'C'
- and upper(SUBSTR(CHECKNO, -1)) = 'S') x) y ) t3 on t.heatno = t3.heatno
- left join (select *
- from ppc_steel_heat
- union
- select * from J#ppc_steel_heat) t4 on t.heatno = t4.heatno
- order by OPTDISP
- ]]>
- </query>
- <query id="reportBOF_CheckEndMn.Query" desc="获取当月各岗位所有班次的终点MN考核记录" fetchSize="10">
- <![CDATA[
- select distinct t.HEATNO,--炉号
- t.STATIONCODE, --岗位编号
- substr(t.SHIFTCODE, 2, 1) SHIFTCODE, --班组(甲、乙、丙、丁)
- max(case
- when t.HEATNO = t1.HEATNO and t1.xh = t1.cnt then
- t1.Mn
- end) over(partition by t.HEATNO) Z_MN,
- t2.stdmin, --最小值(内控)
- t2.stdmax, --最大值(内控)
- to_char(t.optdate, 'yyyy-MM-dd') OPTDISP --日期
-
- from (select * from stl_bof_optinfo where 1 = 1
- and to_char(OPTDATE, 'yyyy-MM') = ?
- union select * from j#stl_bof_optinfo where 1 = 1
- and to_char(OPTDATE, 'yyyy-MM') = ?
- ) t
-
- left join (select y.*
- from (select x.*,
- count(1) over(partition by x.HEATNO) cnt,
- row_number() over(partition by x.HEATNO order by x.ASSAYTYPECODE asc, x.assaydate asc) xh,
- substr(x.assaytypecode, 1, 1) gw
- from (select *
- from STL_CHEMELEMENT
- where to_char(ASSAYDATE, 'yyyy-MM') = ?
- and upper(SUBSTR(CHECKNO, 12, 1)) = 'C'
- and upper(SUBSTR(CHECKNO, -1)) = 'S'
- union
- select *
- from J#STL_CHEMELEMENT
- where to_char(ASSAYDATE, 'yyyy-MM') = ?
- and upper(SUBSTR(CHECKNO, 12, 1)) = 'C'
- and upper(SUBSTR(CHECKNO, -1)) = 'S') x) y) t1 on t1.heatno = t.heatno
-
- 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
- from scm_sortcode_chem t3, scm_standard_chem t4
- where t3.cic = t4.cic
- and t3.stdstyle = '1'
- and t4.itemcode= 'Mn' ) t2 on t2.gycode = t.heatno
- order by substr(OPTDISP,9,2)
- ]]>
- </query>
- <query id="GetMonthDate.Select" desc="获取当月的生产日期_转炉" fetchSize="10">
- <![CDATA[
- select distinct to_char(OPTDATE, 'yyyy-MM-dd') ddate
- from j#stl_bof_optinfo
- where to_char(OPTDATE, 'yyyy-MM') = ?
- order by ddate
- ]]>
- </query>
- <query id="GetMnStandardElement.Select" desc="获取Mn元素内控标准信息" fetchSize="10">
- <![CDATA[
- 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
- from scm_sortcode_chem t, scm_standard_chem t1
- where t.cic = t1.cic
- and t.stdstyle = '1'
- and t1.itemcode= 'Mn'
- order by gycode
- ]]>
- </query>
- <query id="reportBOF_AdditStat.Select" desc="查询转炉消耗统计信息-按班统计物料消耗重量" fetchSize="10">
- <![CDATA[
- select distinct t.MATERIELCODE,
- t.materielname,
- t.MATERIELTYPE,
- case substr(t.SHIFTCODE, 1, 1)
- when '1' then
- '白'
- when '2' then
- '中'
- when '3' then
- '夜'
- end BC,
- case substr(t.SHIFTCODE, 2, 1)
- when '1' then
- '甲'
- when '2' then
- '乙'
- when '3' then
- '丙'
- when '4' then
- '丁'
- end BB,
- t.SHIFTCODE,
- sum(nvl(t.JMWGT, 0)) over(partition by t.ddate, substr(t.SHIFTCODE, 2, 1), t.MATERIELCODE, t.MATERIELTYPE) JMWGT, --加料重量
- t.DDATE --日期
- from (select v.heatprocessno,
- v.heatno,
- v.PLANSTEEL STEEL,
- v.STATIONCODE,
- v.SHIFTCODE,
- v.MATERIELCODE,
- d.materielname,
- v.MATERIELTYPE,
- round(v.JMWGT, 2) JMWGT,
- to_char(v.optdate, 'yyyy-MM-dd') DDATE --日期
- from (select distinct a.heatprocessno,
- a.heatno,
- a.optdate,
- a.PLANSTEEL,
- b.STATIONCODE,
- a.SHIFTCODE,
- b.MATERIELCODE,
- b.MATERIELTYPE,
- round(sum(nvl(b.JMWGT, 0))
- over(partition by b.HEATNO,
- b.STATIONCODE,
- b.DISPOSALTIME,
- b.MATERIELTYPE,
- b.MATERIELCODE),
- 2) JMWGT
- from (select *
- from STL_bof_optinfo
- where 1 = 1
- and to_char(OPTDATE, 'yyyy-MM-dd') between
- ? and ?
- and substr(STATIONCODE, 2, 1) =
- decode(?, null, substr(STATIONCODE, 2, 1), ?)
- and UPPER(nvl(PLANSTEEL, 'null')) in
- (decode(?,
- null,
- UPPER(nvl(PLANSTEEL, 'null')),
- ?))
- and substr(SHIFTCODE, 1, 1) =
- decode(?, null, substr(SHIFTCODE, 1, 1), ?)
- and substr(SHIFTCODE, 2, 1) =
- decode(?, null, substr(SHIFTCODE, 2, 1), ?)
- union
- select *
- from J#STL_bof_optinfo
- where 1 = 1
- and to_char(OPTDATE, 'yyyy-MM-dd') between
- ? and ?
- and substr(STATIONCODE, 2, 1) =
- decode(?, null, substr(STATIONCODE, 2, 1), ?)
- and UPPER(nvl(PLANSTEEL, 'null')) in
- (decode(?,
- null,
- UPPER(nvl(PLANSTEEL, 'null')),
- ?))
- and substr(SHIFTCODE, 1, 1) =
- decode(?, null, substr(SHIFTCODE, 1, 1), ?)
- and substr(SHIFTCODE, 2, 1) =
- decode(?, null, substr(SHIFTCODE, 2, 1), ?)) a,
- stl_additives b
- where a.heatno = b.heatno
- and 'C' || a.stationcode = b.stationcode
- and a.disposaltime = b.disposaltime
- and b.MATERIELTYPE in ('FL', 'HJ')) v
- left join (select * from scm_materiel) d on v.materielcode =
- d.materielcode
- order by to_char(v.optdate, 'yyyy-MM-dd HH24:ss') desc) t
- order by DDATE, MATERIELTYPE, substr(SHIFTCODE, 2, 1)
- ]]>
- </query>
- <query id="getProduction.Select" desc="统计每个班的产量" fetchSize="10">
- <![CDATA[
- select distinct to_char(a.optdate, 'yyyy-MM-dd') optdate,
- substr(a.shiftcode, 2, 1) shiftcode,
- sum(nvl(WEIGHT,0)) WEIGHT,
- count(a.heatno) intCount
- from (select *
- from stl_bof_optinfo
- where to_char(optdate, 'yyyy-MM-dd') between ? and
- ?
- and substr(STATIONCODE, 2, 1) =
- decode(?, null, substr(STATIONCODE, 2, 1), ?)
- and UPPER(nvl(PLANSTEEL, 'null')) in
- (decode(?, null, UPPER(nvl(PLANSTEEL, 'null')), ?))
- and substr(SHIFTCODE, 1, 1) =
- decode(?, null, substr(SHIFTCODE, 1, 1), ?)
- and substr(SHIFTCODE, 2, 1) =
- decode(?, null, substr(SHIFTCODE, 2, 1), ?)
- union
- select *
- from J#STL_bof_optinfo
- where to_char(optdate, 'yyyy-MM-dd') between ? and
- ?
- and substr(STATIONCODE, 2, 1) =
- decode(?, null, substr(STATIONCODE, 2, 1), ?)
- and UPPER(nvl(PLANSTEEL, 'null')) in
- (decode(?, null, UPPER(nvl(PLANSTEEL, 'null')), ?))
- and substr(SHIFTCODE, 1, 1) =
- decode(?, null, substr(SHIFTCODE, 1, 1), ?)
- and substr(SHIFTCODE, 2, 1) =
- decode(?, null, substr(SHIFTCODE, 2, 1), ?)) a,
- (select heatno,
- case
- when (nvl(PFBALEWGT, 0) - nvl(BALELEAVEWGT, 0)) > 0 then
- round((nvl(PFBALEWGT, 0) - nvl(BALELEAVEWGT, 0)), 1)
- else
- 0
- end WEIGHT
- from STL_CCM_OPTINFO
- union
- select heatno,
- case
- when (nvl(PFBALEWGT, 0) - nvl(BALELEAVEWGT, 0)) > 0 then
- round((nvl(PFBALEWGT, 0) - nvl(BALELEAVEWGT, 0)), 1)
- else
- 0
- end WEIGHT
- from J#STL_CCM_OPTINFO) b
- where a.heatno = b.heatno(+)
- group by to_char(a.optdate, 'yyyy-MM-dd'), substr(a.shiftcode, 2, 1)
- order by to_char(a.optdate, 'yyyy-MM-dd'), substr(a.shiftcode, 2, 1)
- ]]>
- </query>
- <query id="reportBOF_AdditStat_Load.Select" desc="获取转炉合金 、辅料初始化物料信息列名" fetchSize="10">
- <![CDATA[
- select distinct (a.materielcode) materielcode,
- a.MATERIELTYPE,
- b.materielforshort
- from (Select HEATNO, stationcode
- from stl_bof_optinfo t
- where to_char(t.optdate, 'yyyy-MM-dd') between ? and
- ?
- union
- Select HEATNO, stationcode
- from J#stl_bof_optinfo t
- where to_char(t.optdate, 'yyyy-MM-dd') between ? and
- ?) t,
- stl_additives a,
- scm_materiel b
- where t.heatno = a.heatno
- and 'C' || t.stationcode = a.stationcode
- and a.materielcode = b.materielcode
- and b.MATERIELTYPE IN ('HJ', 'FL') order by materieltype
- ]]>
- </query>
- <query id="getMaterieltype.Select" desc="判断物料信息是合金 还是辅料" fetchSize="10">
- <![CDATA[
- select a.materieltype from scm_materiel a where a.materielcode = ?
- ]]>
- </query>
- <query id="proc_GetBOFInfo.Select" desc="钢铁料消耗报表(设计)--转炉信息查询" fetchSize="10">
- <![CDATA[
- select distinct b.HEATNO, --炉号
- b.STATIONCODE, --岗位编号
- substr(b.SHIFTCODE, 2, 1) SHIFTCODE,--班组(甲、乙、丙、丁)
- nvl(b.IRONPOTWGT, 0) TSL, --装入铁水量
- nvl(b.PIGIRONWGT, 0) STL, --装入生铁量(T)
- nvl(b.WSTEELWGT, 0) FGL, --装入废钢量(T)
- round(nvl(h.jmwgt/1000,0),2) HJL, --加入合金量(Kg)
- round(nvl(d.jmwgt/1000,0),2) KSL, --加入矿石量(Kg)
- to_char(b.CHANGESTARTTIME,'yyyy-mm-dd hh24:mi:ss') starttime, --兑铁开始时刻
- to_char(b.TAPPINGENDTIME,'yyyy-mm-dd hh24:mi:ss') endtime, --出钢结束时刻
- case
- when to_char(RecFlag, 'yyyy-MM-dd HH24:mi') between ? and ? then
- '1'
- else
- '0'
- end BECURR --1#吹开始时刻(操作时间)
- from (select *
- from (select t.*,
- row_number() over(partition by t.HEATNO order by t.RecFlag) XH
- from (select t.*,
- case
- when B1STARTTIME is not null then
- B1STARTTIME
- else
- OPTDATE
- end RecFlag
- from STL_BOF_OPTINFO t
- where to_char(case when B1STARTTIME is not null then
- B1STARTTIME else OPTDATE end,
- 'yyyy-MM-dd') between ? and ?
- union all
- select t.*,
- case
- when B1STARTTIME is not null then
- B1STARTTIME
- else
- OPTDATE
- end RecFlag
- from J#STL_BOF_OPTINFO t
- where to_char(case when B1STARTTIME is not null then
- B1STARTTIME else OPTDATE end,
- 'yyyy-MM-dd') between ? and ?) t) v where XH = 1) b,
- (select distinct s.heatno,
- sum(s.jmwgt) over(partition by s.heatno order by s.heatno) jmwgt,
- s.materieltype,
- substr(s.stationcode, 2, 2) code
- from stl_additives s
- where s.materieltype = 'HJ'
- --and substr(s.stationcode, 1, 1) = 'C'
- union
- select distinct s.heatno,
- sum(s.jmwgt) over(partition by s.heatno order by s.heatno) jmwgt,
- s.materieltype,
- substr(s.stationcode, 2, 2) code
- from j#stl_additives s
- where s.materieltype = 'HJ'
- --and substr(s.stationcode, 1, 1) = 'C'
- ) h,
- (select distinct s.heatno,
- sum(s.jmwgt) over(partition by s.heatno order by s.heatno) jmwgt,
- s.materieltype,
- substr(s.stationcode, 2, 2) code
- from stl_additives s
- where s.materieltype = 'FL'
- and substr(s.stationcode, 1, 1) = 'C'
- and s.materielcode in ('10301010078','10301010084')--高磷矿石 + 球团
- union
- select distinct s.heatno,
- sum(s.jmwgt) over(partition by s.heatno order by s.heatno) jmwgt,
- s.materieltype,
- substr(s.stationcode, 2, 2) code
- from j#stl_additives s
- where s.materieltype = 'FL'
- and substr(s.stationcode, 1, 1) = 'C'
- and s.materielcode in ('10301010078','10301010084')--高磷矿石 + 球团
- ) d
- where b.heatno = h.heatno(+)
- and b.heatno = d.heatno(+)
- order by b.heatno
- ]]>
- </query>
- <query id="reportAll_Flow.Query" desc="自开率统计报表 --各工序炉号查询" fetchSize="10">
- <![CDATA[
- select HEATNO, --炉号
- STATIONCODE, --岗位
- substr(SHIFTCODE, 2, 1) SHIFTCODE,--班次
- $ DEALTIME, --出钢结束时刻
- case
- when $ --to_char(OPTDATE, 'yyyy-MM-dd') between '2011-08-26' and '2011-08-29'
- then '1' else '0'
- end BECURR
- from (select t.*,
- row_number() over(partition by t.HEATNO order by t.OPTDATE) XH
- from (select *
- from $
- where $ --to_char(OPTDATE, 'yyyy-MM') = '2011-08'
- union all
- select *
- from J#$
- where $ --to_char(OPTDATE, 'yyyy-MM') = '2011-08'
- ) t)
- where XH = 1
- ]]>
- </query>
- <query id="reportCCM_Flag.Query" desc="自开率统计报表 --连铸大包是否引流炉号查询" fetchSize="10">
- <![CDATA[
- select HEATNO,
- SHIFTCODE,
- substr(STATIONCODE, 2, 1) STATIONCODE,
- to_char(BALESTARTTIME, 'yyyy-MM-dd HH24:mi:ss') BALESTARTTIME,--大包开浇时刻
- BALEFLOWTIEMS,--引流次数
- case nvl(BALEFLOWFLAG, 0)
- when 1 then
- '0'
- else
- '1'
- end FLOWFLAG --大包是否自动引流
- from (select t.*,
- row_number() over(partition by t.HEATNO order by t.OPTDATE) XH
- from (select *
- from STL_CCM_OPTINFO
- where $ --HEATNO in ()
- union
- select * from J#STL_CCM_OPTINFO
- where $ --HEATNO in ()
- ) t)
- where XH = 1
- order by STATIONCODE, OPTDATE
- ]]>
- </query>
- <query id="reportCCM_DianLaBP_Query" desc="铸机典拉表" fetchSize="10">
- <![CDATA[
-
- select RQ "日期",
- BC "班次",
- BB "班别",
- HEATNO "炉号",
- PLANSTEEL "钢种",
- BJZCX "班浇注次序",
- ZBCX "中包次序",
- SUBSTR(STATIONCODE,2,1) CCM_ID,
- trim(to_char(JZDW, '990.0')) "浇注吨位",
- SFYL "是否引流",
- to_char(BALESTARTTIME, 'HH24:mi') "大包开浇时间",
- to_char(BALEENDTIME, 'HH24:mi') "大包关闭时间",
- trim(to_char(round((case
- when CAST_NO = CAST_NO_NEXT then
- BALESTARTTIME_NEXT
- else
- BALEENDTIME
- end - BALESTARTTIME) * 24 * 60,
- 1),
- '990.0')) "浇注周期",
- TEMP_MIN "最低_1",
- TEMP_MAX "最高_1",
- WC "温差",
- round(SPD_MIN, 2) "最低_2",
- round(SPD_MAX, 2) "最高_2",
- round(BD, 2) "波动",
- S "S",
- Als "Als",
- N "N",
- MEMO "备注"
- from (select to_char(case
- when a.BALESTARTTIME is not null then
- a.BALESTARTTIME
- else
- a.OPTDATE
- end,
- 'yyyy-MM-dd') RQ,
- case substr(a.SHIFTCODE, 1, 1)
- when '1' then
- '白'
- when '2' then
- '中'
- when '3' then
- '夜'
- end BC,
- case substr(a.SHIFTCODE, 2, 1)
- when '1' then
- '甲'
- when '2' then
- '乙'
- when '3' then
- '丙'
- when '4' then
- '丁'
- end BB,
- a.HEATNO,
- a.STATIONCODE,
- a.PLANSTEEL,
- row_number() over(partition by to_char(case
- when a.BALESTARTTIME is not null then
- a.BALESTARTTIME
- else
- a.OPTDATE
- end, 'yyyy-MM-dd'), a.SHIFTCODE order by a.BALESTARTTIME) BJZCX,
- row_number() over(partition by b.CAST_NO order by a.BALESTARTTIME) ZBCX,
- round(nvl(a.PFBALEWGT, 0) - nvl(a.BALELEAVEWGT, 0), 1) JZDW,
- case nvl(a.BALEFLOWFLAG, 0)
- when 1 then
- '×'
- end SFYL,
- a.BALESTARTTIME,
- a.BALEENDTIME,
- nvl(b.CAST_NO, a.MOULDNO) CAST_NO,
- lead(a.BALESTARTTIME, 1, a.BALEENDTIME) over(order by a.BALESTARTTIME) BALESTARTTIME_NEXT,
- lead(b.CAST_NO, 1, a.MOULDNO) over(order by a.BALESTARTTIME) CAST_NO_NEXT,
- round(c.TEMP_MIN) TEMP_MIN,
- round(c.TEMP_MAX) TEMP_MAX,
- round((c.TEMP_MAX - c.TEMP_MIN)) WC,
- c.SPD_MIN,
- c.SPD_MAX,
- (c.SPD_MAX - c.SPD_MIN) BD,
- trim(to_char(d.S, '0.000')) S,
- trim(to_char(d.Als, '0.000')) Als,
- trim(to_char(d.N, '0.0000')) N,
- a.MEMO
- from (select *
- from STL_CCM_OPTINFO
- where $
- union
- select *
- from J#STL_CCM_OPTINFO
- where $) a,
- (select *
- from ppc_STEEL_HEAT
- where $) b,
- (select distinct x.HEATNO,
- min(case
- when nvl(x.MIDLADLETEMP, 0) between ? and ? then
- nvl(x.MIDLADLETEMP, 0)
- end) over(partition by x.HEATNO) TEMP_MIN,
- max(case
- when nvl(x.MIDLADLETEMP, 0) between ? and ? then
- nvl(x.MIDLADLETEMP, 0)
- end) over(partition by x.HEATNO) TEMP_MAX,
- min(LEAST(x.S1CASTSPEED,X.S2CASTSPEED)) over(partition by x.HEATNO) SPD_MIN,
- max(GREATEST(x.S1CASTSPEED,x.S2CASTSPEED)) over(partition by x.HEATNO) SPD_MAX
- from (select *
- from $
- where $
- union
- select *
- from J#$
- where $) x) c,
- (select y.*
- from (select x.*,
- row_number() over(partition by x.HEATNO order by x.ASSAYDATE) xh
- from (select *
- from STL_CHEMELEMENT
- where (upper(substr(ASSAYTYPECODE, 1, 2)) = 'CP' or
- upper(substr(STATIONCODE, 1, 1)) = 'G')
- and $
- union
- select *
- from J#STL_CHEMELEMENT
- where (upper(substr(ASSAYTYPECODE, 1, 2)) = 'CP' or
- upper(substr(STATIONCODE, 1, 1)) = 'G')
- and $) x) y
- where y.xh = 1) d
- where a.HEATNO = b.HEATNO(+)
- and a.HEATNO = c.HEATNO(+)
- and a.HEATNO = d.HEATNO(+)
- order by a.BALESTARTTIME)
- where RQ between ? and ?
-
- ]]>
- </query>
-
- <query id="LFSDataHEAT_Speed.Query" desc="" fetchSize="10">
- <![CDATA[
- select z.*
- from (select Distinct x.Heatno,
- x.STATIONCODE,
- x.DISPOSALTIME,
- x.MIDLADLETEMP,
- to_char(x.LASTFRESHTIME, 'HH24:mi') LASTFRESHTIME,
- row_number() over(partition by x.HEATNO order by x.LASTFRESHTIME) xh,
- count(*) over(partition by x.HEATNO order by x.HEATNO) intcount
- from (SELECT Heatno,
- STATIONCODE,
- DISPOSALTIME,
- MIDLADLETEMP,
- min(LASTFRESHTIME) LASTFRESHTIME
- FROM (select HEATNO,
- STATIONCODE,
- DISPOSALTIME,
- ROUND(greatest(midladletemp1, midladletemp2)) MIDLADLETEMP,
- LASTFRESHTIME from stl_ccm_f1sampling b
- where 1 = 1
- and to_char(OPTDATE, 'yyyy-MM-dd') between
- ? and ?
- union
- select HEATNO,
- STATIONCODE,
- DISPOSALTIME,
- ROUND(greatest(midladletemp1, midladletemp2)) MIDLADLETEMP,
- LASTFRESHTIME from j#stl_ccm_f1sampling b
- where 1 = 1
- and to_char(OPTDATE, 'yyyy-MM-dd') between
- ? and ?
- union
- select HEATNO,
- STATIONCODE,
- DISPOSALTIME,
- ROUND(greatest(midladletemp1, midladletemp2)) MIDLADLETEMP,
- LASTFRESHTIME from stl_ccm_f2sampling b
- where 1 = 1
- and to_char(OPTDATE, 'yyyy-MM-dd') between
- ? and ?
- union
- select HEATNO,
- STATIONCODE,
- DISPOSALTIME,
- ROUND(greatest(midladletemp1, midladletemp2)) MIDLADLETEMP,
- LASTFRESHTIME from j#stl_ccm_f2sampling b
- where 1 = 1
- and to_char(OPTDATE, 'yyyy-MM-dd') between
- ? and ?
- union
- select HEATNO,
- STATIONCODE,
- DISPOSALTIME,
- ROUND(greatest(midladletemp1, midladletemp2)) MIDLADLETEMP,
- LASTFRESHTIME from stl_ccm_f3sampling b
- where 1 = 1
- and to_char(OPTDATE, 'yyyy-MM-dd') between
- ? and ?
- union
- select HEATNO,
- STATIONCODE,
- DISPOSALTIME,
- ROUND(greatest(midladletemp1, midladletemp2)) MIDLADLETEMP,
- LASTFRESHTIME
- from J#stl_ccm_f3sampling
- where 1 = 1
- and to_char(OPTDATE, 'yyyy-MM-dd') between
- ? and ?) a
- group by heatno, stationcode, disposaltime, MIDLADLETEMP
- order by heatno) x
-
- where x.MIDLADLETEMP > 1410
- order by heatno, LASTFRESHTIME) z
- where z.xh in (1, round(z.intcount / 4), round((z.intcount - 2) / 4) * 2,
- round((z.intcount - 2) / 4) * 3,
- round((z.intcount - 2) / 4) * 4, z.intcount)
- ]]>
- </query>
- <query id="reportCAS_All.Select" desc="吹氩炉号、岗位、班次、钢种、日期记录查询" fetchSize="10">
- <![CDATA[
- select A.HEATNO,
- A.STATIONCODE,
- V.FACT_ROUTE,
- substr(A.SHIFTCODE, 2, 1) SHIFTCODE,
- case
- when B.AIM_GRADE_CODE is null then
- B.AIM_GRADE_CODE
- else
- B.AIM_GRADE_CODE
- end PLANSTEEL,
- max(case when a.HEATNO = C.HEATNO and C.xh = C.cnt then C.MN end) over(partition by a.HEATNO) MN,
- max(case when a.HEATNO = C.HEATNO and C.xh = C.cnt then C.SI end) over(partition by a.HEATNO) SI,
- max(case
- when a.HEATNO = C.HEATNO and C.xh = C.cnt then
- C.ALS
- end) over(partition by a.HEATNO) ALS,
-
- NVL((select d.stdmin
- from scm_standard_chem_view d,
- ( select *
- from scm_base_info d
- where d.sortcode = '1006'
- order by d.basecode) h
- where d.ITEMCODE = h.basename
- and steel = B.AIM_GRADE_CODE
- and stdstyle = '2'
- and d.ITEMCODE = 'Als'
- group by steel, stdstyle, itemcode, std, stdmin, stdmax, basename,basecode
- ),0) FXALSBZ,
- case
- when $ then
- '1'
- else
- '0'
- end BECURR
-
- from (select *
- from (select t.*,
- row_number() over(partition by t.HEATNO order by t.OPTDATE) XH
- from (select *
- from $ t
- where $
- union all
- select * from J#$ t where $) t
- )
- where XH = 1) A,
-
- (select HEATNO, AIM_GRADE_CODE
- from (select t.*,
- row_number() over(partition by t.HEATNO order by V_HEAT_ID desc) XH
- from ppc_steel_heat t
- where t.HEATNO is not null
- and $)
- where XH = 1) B,
- (select y.*
- from (select x.*,
- count(1) over(partition by x.HEATNO) cnt,
- row_number() over(partition by x.HEATNO order by x.ASSAYTYPECODE desc) xh
- from (select *
- from stl_CHEMELEMENT
- where upper(SUBSTR(CHECKNO, 12, 2)) = 'DQ'
- and upper(SUBSTR(CHECKNO, -1)) = 'S'
-
- union
- select t.*
- from j#stl_CHEMELEMENT t
- where upper(SUBSTR(CHECKNO, 12, 2)) = 'DQ'
- and upper(SUBSTR(CHECKNO, -1)) = 'S'
- ) x) y
- where y.xh = y.cnt) C,
- (select *
- from ppc_steel_heat
- union
- select * from J#ppc_steel_heat) V
- where A.HEATNO = B.HEATNO(+)
- and A.HEATNO = C.HEATNO(+)
- and A.HEATNO = V.HEATNO(+)
- ]]>
- </query>
- <query id="reportCCM_AddN.Select" desc="连铸增N报表" fetchSize="10">
- <![CDATA[
- select distinct t.HEATNO,
- t.STATIONCODE,
- substr(t.SHIFTCODE, 2, 1) SHIFTCODE,
- t4.PLAN_ROUTE,
- max(case when t.HEATNO = t2.HEATNO and t2.xh = t2.cnt then t2.N end) over(partition by t.HEATNO) F_N,
- case
- when substr(t4.PLAN_ROUTE, 9, 2) = 'E0' and
- substr(t4.PLAN_ROUTE, 11, 2) = 'F0' and
- substr(t4.PLAN_ROUTE, 13, 2) = 'I0' then
- max(case when t.HEATNO = t3.HEATNO and t3.xh = t3.cnt then t3.N end) over(partition by t.HEATNO) --氩站
-
- when substr(t4.PLAN_ROUTE, 9, 2) != 'E0' and
- substr(t4.PLAN_ROUTE, 11, 2) = 'F0' and
- substr(t4.PLAN_ROUTE, 13, 2) = 'I0' then
- max(case when t.HEATNO = t7.HEATNO and t7.xh = t7.cnt then t7.N end) over(partition by t.HEATNO) --精炼
-
- when substr(t4.PLAN_ROUTE, 9, 2) = 'E0' and
- substr(t4.PLAN_ROUTE, 11, 2) != 'F0' and
- substr(t4.PLAN_ROUTE, 13, 2) = 'I0' then
- max(case when t.HEATNO = t6.HEATNO and t6.xh = t6.cnt then t6.N end) over(partition by t.HEATNO) --RH
-
- when substr(t4.PLAN_ROUTE, 9, 2) != 'E0' and
- substr(t4.PLAN_ROUTE, 11, 2) != 'F0' and
- substr(t4.PLAN_ROUTE, 13, 2) = 'I0' then
- max(case when t.HEATNO = t6.HEATNO and t6.xh = t6.cnt then t6.N end) over(partition by t.HEATNO) --RH
-
-
- when substr(t4.PLAN_ROUTE, 9, 2) != 'E0' and
- substr(t4.PLAN_ROUTE, 11, 2) = 'F0' and
- substr(t4.PLAN_ROUTE, 13, 2) != 'I0' then
- max(case when t.HEATNO = t5.HEATNO and t5.xh = t5.cnt then t5.N end) over(partition by t.HEATNO) --vd
-
- when substr(t4.PLAN_ROUTE, 9, 2) != 'E0' and
- substr(t4.PLAN_ROUTE, 11, 2) != 'F0' and
- substr(t4.PLAN_ROUTE, 13, 2) != 'I0' then
- max(case when t.HEATNO = t5.HEATNO and t5.xh = t5.cnt then t5.N end) over(partition by t.HEATNO) --vd
- else
- '0'
- end N,
- to_char(t.OPTDATE, 'yyyy-MM-dd hh24:mi') Optdisp
- from (select *
- from $
- where $
-
- union all
- select *
- from J#$
- where $ ) t
- left join (select y.*
- from (select x.*,
- count(1) over(partition by x.HEATNO) cnt,
- row_number() over(partition by x.HEATNO order by x.ASSAYTYPECODE desc, x.assaydate desc) xh,
- substr(x.assaytypecode, 1, 1) gw
- from (select *
- from STL_CHEMELEMENT
- where upper(SUBSTR(CHECKNO, -1)) = 'S'
- and upper(SUBSTR(CHECKNO, 12, 2)) = 'GP'
- union
- select *
- from J#STL_CHEMELEMENT
- where upper(SUBSTR(CHECKNO, -1)) = 'S'
- and upper(SUBSTR(CHECKNO, 12, 2)) = 'GP') x) y) t2 on t.heatno =
- t2.heatno
- left join (select y.*--氩站
- from (select x.*,
- count(1) over(partition by x.HEATNO) cnt,
- row_number() over(partition by x.HEATNO order by x.ASSAYTYPECODE desc, x.assaydate desc) xh,
- substr(x.assaytypecode, 1, 1) gw
- from (select *
- from STL_CHEMELEMENT
- where upper(SUBSTR(CHECKNO, -1)) = 'S'
- and upper(SUBSTR(CHECKNO, 12, 2)) = 'DH'
- union
- select *
- from J#STL_CHEMELEMENT
- where upper(SUBSTR(CHECKNO, -1)) = 'S'
- and upper(SUBSTR(CHECKNO, 12, 2)) = 'DH') x) y) t3 on t.heatno =
- t3.heatno
-
- left join (select y.*--vd
- from (select x.*,
- count(1) over(partition by x.HEATNO) cnt,
- row_number() over(partition by x.HEATNO order by x.ASSAYTYPECODE desc, x.assaydate desc) xh,
- substr(x.assaytypecode, 1, 1) gw
- from (select *
- from STL_CHEMELEMENT
- where upper(SUBSTR(CHECKNO, 12, 1)) = 'I'
- and upper(SUBSTR(CHECKNO, -1)) = 'S'
- union
- select *
- from J#STL_CHEMELEMENT
- where upper(SUBSTR(CHECKNO, 12, 1)) = 'I'
- and upper(SUBSTR(CHECKNO, -1)) = 'S') x) y) t5 on t.heatno =
- t5.heatno
- left join (select y.*--RH
- from (select x.*,
- count(1) over(partition by x.HEATNO) cnt,
- row_number() over(partition by x.HEATNO order by x.ASSAYTYPECODE desc, x.assaydate desc) xh,
- substr(x.assaytypecode, 1, 1) gw
- from (select *
- from STL_CHEMELEMENT
- where upper(SUBSTR(CHECKNO, 12, 1)) = 'F'
- and upper(SUBSTR(CHECKNO, -1)) = 'S'
- union
- select *
- from J#STL_CHEMELEMENT
- where upper(SUBSTR(CHECKNO, 12, 1)) = 'F'
- and upper(SUBSTR(CHECKNO, -1)) = 'S') x) y) t6 on t.heatno =
- t6.heatno
-
- left join (select y.*--LFS
- from (select x.*,
- count(1) over(partition by x.HEATNO) cnt,
- row_number() over(partition by x.HEATNO order by x.ASSAYTYPECODE desc, x.assaydate desc) xh,
- substr(x.assaytypecode, 1, 1) gw
- from (select *
- from STL_CHEMELEMENT
- where upper(SUBSTR(CHECKNO, 12, 1)) = 'E'
- and upper(SUBSTR(CHECKNO, -1)) = 'S'
- union
- select *
- from J#STL_CHEMELEMENT
- where upper(SUBSTR(CHECKNO, 12, 1)) = 'E'
- and upper(SUBSTR(CHECKNO, -1)) = 'S') x) y) t7 on t.heatno =
- t7.heatno
- left join (select *
- from ppc_steel_heat
- union
- select * from J#ppc_steel_heat) t4 on t.heatno = t4.heatno
-
- order by Optdisp
- ]]>
- </query>
- <query id="reportBof_LZZB.Select" desc="连铸增N报表" fetchSize="10">
- <![CDATA[
-
- select * from ( select distinct to_char(a.OPTDATE, 'yyyy-MM-dd') ,
- a.HEATNO ,
- a.PLANSTEEL ,
- a.SUPPLYOXYGENTIME ,
-
- --f.SAMPLINGDEPICT,
- --f.SAMPLINGVALUE,
- substr(a.SHIFTCODE,2,1) SHIFTCODE,
- a.STATIONCODE,
- case a.BLKREDEFFECTS when '0' then '失败' when '1' then '成功' when '3' then '一般' end BLKREDEFFECTS,
- trim(to_char(c.C, '0.00')) 倒炉C,
- '' 终点出钢合格, '' 双渣, case when a.B2TIME is null then '1' end YDHG,
- '' 到站温度合格,
- case when count(case when f.HeatNo = a.HeatNo
- and f.SAMPLINGNAME = 'GUN' || a.OGGNUMID || 'HIGH' and f.SAMPLINGVALUE < 1350
- and f.SAMPLINGDATE <= a.B1ENDTIME + (1/24/60/60)*60 then 1 end) over(partition by f.HeatNo) >= 2 then '1' end ZDYY,
- case when count(case when f.HeatNo = a.HeatNo and f.SAMPLINGNAME = 'BOFANGLE'
- and f.SAMPLINGVALUE <= -2 and f.SAMPLINGDATE >=
- case when a.PSSTARTTIME is null then a.TAPPINGENDTIME + 1.5/24/60
- else a.PSSTARTTIME - 3/24/60 end then 1 end) over(partition by f.HeatNo) >= 1 then '1' end JZJD,
- case when count(case when f.HeatNo = a.HeatNo and f.SAMPLINGNAME = 'BOFANGLE' and f.SAMPLINGVALUE >= 115
- and f.SAMPLINGDATE >= a.PSENDTIME then 1 end) over(partition by f.HeatNo) >= 1 then '1' end ZZJD,
- case when sum(case when g.HeatNo = a.HeatNo and g.MATERIELCODE = '10301010039'
- and g.JMDATE >= a.B1STARTTIME + (750/24/60/60)
- then nvl(g.JMWGT, 0) end) over(partition by g.HeatNo) > 0 then '1' end JKS,
- case when count(case when f.HeatNo = a.HeatNo and f.SAMPLINGNAME = 'GUN' || a.OGGNUMID || 'HIGH'
- and f.SAMPLINGVALUE > 1500 and f.SAMPLINGDATE <= a.B1ENDTIME - (10/24/60/60)
- and f.SAMPLINGDATE > a.B1STARTTIME + (750/24/60/60) then 1 end) over(partition by f.HeatNo) <= 0 then '1' end QWS,
- '' 溅渣未加料, '' 到站化学成分未命中
- from
- (select *
- from STL_BOF_OPTINFO
- where to_char(OPTDATE,'yyyy-mm-dd') between ? and
- ?
- union
- select *
- from J#STL_BOF_OPTINFO
- where to_char(OPTDATE,'yyyy-mm-dd') between ? and
- ?) a,
- (select y.* from (select x.*,
- row_number() over(partition by x.HEATNO order by x.ASSAYDATE) xh
- from (select *
- from STL_CHEMELEMENT
- where (upper(substr(ASSAYTYPECODE, 1, 2)) = 'LD' or
- upper(substr(STATIONCODE, 1, 1)) = 'C')
- and to_char(ASSAYDATE,'yyyy-mm-dd') between ? and
- ?
- union
- select *
- from J#STL_CHEMELEMENT
- where (upper(substr(ASSAYTYPECODE, 1, 2)) = 'LD' or
- upper(substr(STATIONCODE, 1, 1)) = 'C')
- and to_char(ASSAYDATE,'yyyy-mm-dd') between ? and
- ? ) x) y
- where y.xh = 1) c,
- (select HeatNo,SAMPLINGNAME,SAMPLINGVALUE,max(SAMPLINGDATE) SAMPLINGDATE
- from STL_BOF_SAMPLING
- where (SAMPLINGNAME = 'GUNAHIGH' or SAMPLINGNAME = 'GUNBHIGH' or
- SAMPLINGNAME = 'BOFANGLE')
- and to_char(SAMPLINGDATE,'yyyy-mm-dd') between ? and
- ? group by HEATNO,SAMPLINGNAME,SAMPLINGVALUE
- union
- select HeatNo,SAMPLINGNAME,SAMPLINGVALUE,max(SAMPLINGDATE) SAMPLINGDATE
- from J#STL_BOF_SAMPLING
- where (SAMPLINGNAME = 'GUNAHIGH' or SAMPLINGNAME = 'GUNBHIGH' or
- SAMPLINGNAME = 'BOFANGLE')
- and to_char(SAMPLINGDATE,'yyyy-mm-dd') between ? and
- ? group by HEATNO,SAMPLINGNAME,SAMPLINGVALUE ) f,
-
- (select HeatNo,MATERIELCODE,JMDATE,JMWGT
- from STL_BOF_ADDITIVES
- where to_char(JMDATE,'yyyy-mm-dd') between ? and
- ?
- union
- select HeatNo,MATERIELCODE,JMDATE,JMWGT
- from J#STL_BOF_ADDITIVES
- where to_char(JMDATE,'yyyy-mm-dd') between ? and
- ? ) g
- where a.HEATNO = c.HEATNO(+)
- and a.HEATNO = f.HEATNO(+)
- and a.HEATNO = g.HEATNO) order by STATIONCODE, HEATNO desc
-
-
- ]]>
- </query>
- <query id="reportBOF_TSCTSO.Query" desc="转炉小指标 TSC/TSO" fetchSize="10">
- <![CDATA[
- select a.HEATNO,
- a.STATIONCODE,
- substr(a.SHIFTCODE,2,1) SHIFTCODE,
- b.SAMPLINGTYPE,
- b.TEMPERATURE,
- b.TERMINUSC_O2C,
- b.TERMINUSO2
- from (select HEATNO,STATIONCODE, SHIFTCODE,OPTDATE
- from STL_BOF_OPTINFO
- where to_char(OPTDATE, 'yyyy-mm-dd') between ? and
- ?
- union
- select HEATNO,STATIONCODE, SHIFTCODE,OPTDATE
- from J#STL_BOF_OPTINFO
- where to_char(OPTDATE, 'yyyy-mm-dd') between ? and
- ?) a,
- (select SAMPLINGTYPE,
- TEMPERATURE,
- HEATNO,
- TERMINUSC_O2C,
- TERMINUSO2,
- SAMPLINGDATE
- from STL_BOF_SUBSAMPLING t
- where to_char(t.samplingdate, 'yyyy-mm-dd') between ? and
- ?
- union
- select SAMPLINGTYPE,
- TEMPERATURE,
- HEATNO,
- TERMINUSC_O2C,
- TERMINUSO2,
- SAMPLINGDATE
- from j#STL_BOF_SUBSAMPLING g
- where to_char(g.samplingdate, 'yyyy-mm-dd') between ? and
- ?) b
- where a.HEATNO = b.HEATNO(+) order by a.HEATNO
-
- ]]>
- </query>
-
- <query id="reportBOF_CountHeaTNO.Query" desc="统计转炉生产总炉数" fetchSize="10">
- <![CDATA[
- select DISTINCT a.HEATNO,
- a.STATIONCODE,
- substr(a.SHIFTCODE,2,1) SHIFTCODE
- from (select HEATNO,STATIONCODE, SHIFTCODE,OPTDATE
- from STL_BOF_OPTINFO
- where to_char(OPTDATE, 'yyyy-mm-dd') between ? and
- ?
- union
- select HEATNO,STATIONCODE, SHIFTCODE,OPTDATE
- from J#STL_BOF_OPTINFO
- where to_char(OPTDATE, 'yyyy-mm-dd') between ? and
- ?) a
- ]]>
- </query>
- <query id="LoadGetYQ.Query" desc="氧枪喷头厂家信息加载" fetchSize="10">
- <![CDATA[
- select basename,basecode
- from scm_base_info
- where sortcode = '40030401'
- order by basecode
- ]]>
- </query>
- <query id="LoadGetYQBy_ID.Query" desc="根据ID获取基础信息" fetchSize="10">
- <![CDATA[
- select basename,basecode,MEMO
- from scm_base_info
- where basecode = ?
- order by basecode
- ]]>
- </query>
- <query id="report_BoF_Target.Select" desc="转炉炉长指示统计" fetchSize="10">
- <![CDATA[
-
- select * from ( select distinct to_char(a.OPTDATE, 'yyyy-MM-dd') 日期,
- a.HEATNO 炉号,
- a.PLANSTEEL 钢种,
- case substr(a.SHIFTCODE,1,1) when '1' then '白' when '2' then '中' when '3' then '夜' end 班次,
- case substr(a.SHIFTCODE,2,1) when '1' then '甲' when '2' then '乙' when '3' then '丙' when '4' then '丁' end 班别,
- substr(a.STATIONCODE, 2, 1) 炉座, case a.BLKREDEFFECTS when '0' then '失败' when '1' then '成功' when '3' then '一般' end 挡渣成功,
- trim(to_char(c.C, '0.00')) 倒炉C,
- nvl(a.B2TIME, 0) + nvl(a.B3TIME, 0) + nvl(a.B4TIME, 0) + nvl(a.B5TIME, 0) 补吹时间 ,
- '' 终点出钢合格, '' 双渣, case when a.B2TIME is null then '1' else '0' end 一倒合格,
- '' 到站温度合格,
- case when count(case when f.HeatNo = a.HeatNo
- and (substr((h.FACT_ROUTE),9,2) ='E1' OR substr((h.FACT_ROUTE),9,2) = 'E2')
- and f.SAMPLINGNAME = 'GUN' || a.OGGNUMID || 'HIGH' and f.SAMPLINGVALUE <= 1400
- and f.SAMPLINGDATE <= a.STOPOXYGENTIME + (1/24/60/60)*50 then 1 end) over(partition by f.HeatNo) >= 2 then '1' end YQLF,
- case when count(case when f.HeatNo = a.HeatNo
- and substr((h.FACT_ROUTE),9,2) = 'E0'
- and f.SAMPLINGNAME = 'GUN' || a.OGGNUMID || 'HIGH' and f.SAMPLINGVALUE <= 1460
- and f.SAMPLINGDATE <= a.STOPOXYGENTIME + (1/24/60/60)*50 then 1 end) over(partition by f.HeatNo) >= 2 then '1' end YQFLF,
-
- case when count(case when f.HeatNo = a.HeatNo and f.SAMPLINGNAME = 'BOFANGLE'
- and f.SAMPLINGVALUE <= -3 and f.SAMPLINGDATE >=
- case when a.PSSTARTTIME is null then a.TAPPINGENDTIME + 1.5/24/60
- else a.PSSTARTTIME - 1/24/60 end then 1 end) over(partition by f.HeatNo) >= 1 then '1' else '0' end 溅渣角度合格,
-
- case when count(case when f.HeatNo = a.HeatNo and f.SAMPLINGNAME = 'BOFANGLE' and f.SAMPLINGVALUE >= 105
- and f.SAMPLINGDATE >= a.PSENDTIME then 1 end) over(partition by f.HeatNo) >= 1 then '1' else '0' end 粘渣角度合格,
-
- case when sum(case when g.HeatNo = a.HeatNo and g.MATERIELCODE = '10301010078'
- and g.JMDATE >= a.OPENOXYGENTIME + (700/24/60/60)
- then nvl(g.JMWGT, 0) end) over(partition by g.HeatNo) > 0 then '1' else '0' end 加矿石,
- case when substr((select FACT_ROUTE from ppc_steel_heat t where t.heatno=a.HEATNO),9,2) ='E0' then
- '是'
- else
- '否'
- end FACT_ROUTE,
- case when count(case when f.HeatNo = a.HeatNo and f.SAMPLINGNAME = 'GUN' || a.OGGNUMID || 'HIGH'
- and (substr((h.FACT_ROUTE),9,2) ='E1' OR substr((h.FACT_ROUTE),9,2) = 'E2')
- and f.SAMPLINGVALUE <= 1460 and f.SAMPLINGDATE <= a.STOPOXYGENTIME - (10/24/60/60)
- and f.SAMPLINGDATE > a.OPENOXYGENTIME + (700/24/60/60) then 1 end) over(partition by f.HeatNo) <= 0 then '1' end QWLF,
- case when count(case when f.HeatNo = a.HeatNo and f.SAMPLINGNAME = 'GUN' || a.OGGNUMID || 'HIGH'
- and substr((h.FACT_ROUTE),9,2) = 'E0'
- and f.SAMPLINGVALUE <= 1500 and f.SAMPLINGDATE <= a.STOPOXYGENTIME - (10/24/60/60)
- and f.SAMPLINGDATE > a.OPENOXYGENTIME + (700/24/60/60) then 1 end) over(partition by f.HeatNo) <= 0 then '1' end QWFLF,
- '' 溅渣未加料, '' 到站化学成分未命中
- from
- (select *
- from STL_BOF_OPTINFO
- where $
- union
- select *
- from J#STL_BOF_OPTINFO
- where $ ) a,
- (select y.* from (select x.*,
- row_number() over(partition by x.HEATNO order by x.ASSAYDATE desc) xh
- from (select *
- from STL_CHEMELEMENT
- where (upper(substr(ASSAYTYPECODE, 1, 2)) = 'LD' or
- upper(substr(STATIONCODE, 1, 1)) = 'C')
- and to_char(ASSAYDATE,'yyyy-mm-dd') between ? and
- ?
- union
- select *
- from J#STL_CHEMELEMENT
- where (upper(substr(ASSAYTYPECODE, 1, 2)) = 'LD' or
- upper(substr(STATIONCODE, 1, 1)) = 'C')
- and to_char(ASSAYDATE,'yyyy-mm-dd') between ? and
- ? ) x) y
- where y.xh = 1) c,
- (select HeatNo,SAMPLINGNAME,SAMPLINGVALUE,max(SAMPLINGDATE) SAMPLINGDATE
- from STL_BOF_SAMPLING
- where (SAMPLINGNAME = 'GUNAHIGH' or SAMPLINGNAME = 'GUNBHIGH' or
- SAMPLINGNAME = 'BOFANGLE')
- and to_char(SAMPLINGDATE,'yyyy-mm-dd') between ? and
- ? group by HEATNO,SAMPLINGNAME,SAMPLINGVALUE
- union
- select HeatNo,SAMPLINGNAME,SAMPLINGVALUE,max(SAMPLINGDATE) SAMPLINGDATE
- from J#STL_BOF_SAMPLING
- where (SAMPLINGNAME = 'GUNAHIGH' or SAMPLINGNAME = 'GUNBHIGH' or
- SAMPLINGNAME = 'BOFANGLE')
- and to_char(SAMPLINGDATE,'yyyy-mm-dd') between ? and
- ? group by HEATNO,SAMPLINGNAME,SAMPLINGVALUE ) f,
-
- (select HeatNo,MATERIELCODE,JMDATE,JMWGT
- from STL_BOF_ADDITIVES
- where to_char(JMDATE,'yyyy-mm-dd') between ? and
- ?
- union
- select HeatNo,MATERIELCODE,JMDATE,JMWGT
- from J#STL_BOF_ADDITIVES
- where to_char(JMDATE,'yyyy-mm-dd') between ? and
- ? ) g ,
- (select HEATNO,FACT_ROUTE,PLAN_MAKING_TIME
- from ppc_steel_heat a
- where to_char(PLAN_MAKING_TIME,'yyyy-mm-dd') between ? and
- ?
- union
- select HEATNO,FACT_ROUTE,PLAN_MAKING_TIME
- from J#ppc_steel_heat b
- where to_char(PLAN_MAKING_TIME,'yyyy-mm-dd') between ? and
- ? ) h
- where a.HEATNO = c.HEATNO(+)
- and a.HEATNO = f.HEATNO(+)
- and a.HEATNO = g.HEATNO(+)
- and a.HEATNO = h.HEATNO(+) ) order by 炉座, 炉号 desc
-
-
- ]]>
- </query>
- <query id="GetSlagSplashInfo_EG.select" desc="获取在二炼钢服务器的二炼渣样信息" fetchSize="10">
- <![CDATA[
- select A.HEATNO,
- case substr(a.SHIFTCODE, 1, 1)
- when '1' then
- '白'
- when '2' then
- '中'
- when '3' then
- '夜'
- end BC,
- case substr(a.SHIFTCODE, 2, 1)
- when '1' then
- '甲'
- when '2' then
- '乙'
- when '3' then
- '丙'
- when '4' then
- '丁'
- end BB,
- A.CaO,
- A.SiO2,
- A.Al2O3,
- A.TFe,
- A.MnO,
- A.S,
- A.MgO,
- A.P2O5,
- A.JIANDU,
- to_char(A.ASSAYDATE, 'yyyy-MM-dd HH24:mi:ss') ASSAYDATE
- from (select t.*,
- case
- when nvl(SiO2, 0) <> 0 then
- trim(to_char(round(CaO / (SiO2), 3), '9990.000'))
- else
- ''
- end JIANDU
- from STL_CHEMELEMENT t
- where substr(t.checkno, length(t.checkno) - 1, 2) = '-4'
- and to_char(ASSAYDATE, 'yyyy-MM-dd') between ? and
- ?
- union
- select t.*,
- case
- when nvl(SiO2, 0) <> 0 then
- trim(to_char(round(CaO / (SiO2), 3), '9990.000'))
- else
- ''
- end JIANDU
- from J#STL_CHEMELEMENT t
- where substr(t.checkno, length(t.checkno) - 1, 2) = '-4'
- and to_char(ASSAYDATE, 'yyyy-MM-dd') between ? and
- ? ) A
- order by A.ASSAYDATE
- ]]>
- </query>
- </queryMap>
|