ReportLgJobMgt.xml 225 KB

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