0 then round((nvl(A.PFBALEWGT, 0) - nvl(A.BALELEAVEWGT, 0)), 3) else 0 end GSL, (select substr(mes_lg_common.getlgshift1(A.RecFlag), 2, 1) from dual) SHIFTCODE, case when to_char(A.RecFlag, 'yyyy-MM-dd HH24:mi') between ? and ? then '1' else '0' end BECURR from (select * from (select t.*, row_number() over(partition by HEATNO order by RecFlag) XH from (select t.recflag, t2.* from (select t.heatno, case when B1STARTTIME is not null then B1STARTTIME else OPTDATE end RecFlag from STL_bof_optinfo t where to_char(case when B1STARTTIME is not null then B1STARTTIME else OPTDATE end, 'yyyy-MM-dd') between ? and ? union all select t.heatno, case when B1STARTTIME is not null then B1STARTTIME else OPTDATE end RecFlag from J#STL_bof_optinfo t where to_char(case when B1STARTTIME is not null then B1STARTTIME else OPTDATE end, 'yyyy-MM-dd') between ? and ?) t, (select * from STL_ccm_optinfo union select * from J#STL_Ccm_Optinfo) t2 where t.heatno = t2.heatno) t) where XH = 1) A, (select distinct substr(CHARGE_NO, 1, 10) CHARGE_NO, sum(nvl(SLAB_WGT, 0)) over(partition by substr(CHARGE_NO, 1, 10)) CPL from (select CHARGE_NO, (sum(SLAB_WGT)/1000) SLAB_WGT from stl_incision_view where to_char(SLAB_CUT_DTIME) between ? and ? Group by CHARGE_NO) t) B where A.HEATNO = B.CHARGE_NO(+) ]]> 0 and nvl(a.ARRIVEWGT, 0) > 0 and nvl(a.LEAVEWGT, 0) < nvl(a.ARRIVEWGT, 0) THEN round(t.TFPOTWGT - (nvl(a.ARRIVEWGT, 0) - nvl(a.LEAVEWGT, 0)), 2) ELSE t.TFPOTWGT END LEAVEWGT, round(t.TFPOTWGT-(t.TFPOTWGT - (nvl(a.ARRIVEWGT, 0) - nvl(a.LEAVEWGT, 0))), 2) DRQUANTITY, CASE WHEN nvl(a.LEAVEWGT, 0) > 0 THEN (nvl(a.LEAVEWGT, 0) - nvl(t4.TAREWEIGHT,0)) ELSE 0 END LEAVEWGT_OUT, CASE WHEN nvl(a.ARRIVEWGT, 0) > 0 THEN (nvl(a.ARRIVEWGT, 0) - nvl(t4.TAREWEIGHT,0)) ELSE 0 END ARRIVEWGT_OUT, t4.TAREWEIGHT IRONPOTBOFWGT, t.TFPOTID || '-' || t4.age IRONPWRAPNO, CASE WHEN a.HUDWID IS NOT NULL THEN a.PLANSTEEL ELSE t.PLANSTEEL END PLANSTEEL, to_char(a.ARRIVETIME, 'HH24:mi') ARRIVETIME, to_char(a.LEAVETIME, 'HH24:mi') LEAVETIME, a.DR_BEF_TIME, a.DR_AFT_TIME, a.SWBTEMPERATURE, a.SWFTEMPERATURE, a.DREGSSOLVENT, a.CHURNUPDATE, a.MOSTROTATESPEED, a.SGGAGE, a.DFRWGT, CASE WHEN a.HEATNO IS NOT NULL THEN a.HEATNO WHEN substr(t.MOLIRNSOURCE, 1, 1) = 'J' then t.MOLIRNSOURCE END HEATNO, t.SI SI_BF, t.MN MN_BF, t.P P_BF, t.S S_BF, t2.SI, t2.MN, t2.P, t2.S, t3.SI SI2, t3.MN MN2, t3.P P2, t3.S S2, a.MEMO from (select * from stl_mis_importiron where to_char(operationdate, 'yyyy-MM-dd hh24:mi:ss') between ? AND ?) t, (select * from STL_HMP_OPTINFO where to_char(OPTDATE, 'yyyy-MM-dd') between ? AND ? union select * from J#STL_HMP_OPTINFO where to_char(OPTDATE, 'yyyy-MM-dd') between ? AND ? ) a, (select * from STL_bof_OPTINFO where to_char(OPTDATE, 'yyyy-MM-dd') between ? AND ? union select * from J#STL_bof_OPTINFO where to_char(OPTDATE, 'yyyy-MM-dd') between ? AND ? ) b, (select HEATNO, SI, MN, P, S, ASSAYTYPECODE from stl_CHEMELEMENT WHERE upper(SUBSTR(ASSAYTYPECODE, 1, 1)) = 'B' and to_char(assaydate, 'yyyy-MM-dd') between ? AND ? union select HEATNO, SI, MN, P, S, ASSAYTYPECODE from J#stl_CHEMELEMENT WHERE upper(SUBSTR(ASSAYTYPECODE, 1, 1)) = 'B' and to_char(assaydate, 'yyyy-MM-dd') between ? AND ?) t2, (select y.* from (select x.*, row_number() over(partition by x.HEATNO, substr(assaytypecode, 1, 1) order by x.ASSAYTYPECODE desc) xh, substr(assaytypecode, 1, 1) typecode from (select * from stl_CHEMELEMENT where upper(SUBSTR(ASSAYTYPECODE, 1, 1)) = 'B' and to_char(assaydate, 'yyyy-MM-dd') between ? AND ? union select * from J#stl_CHEMELEMENT where upper(SUBSTR(ASSAYTYPECODE, 1, 1)) = 'B' and to_char(assaydate, 'yyyy-MM-dd') between ? AND ?) x) y where y.xh = 1) t3, dev_ib_base_info t4 where t.MOLIRNSOURCE = a.hudwid(+) and t.MOLIRNSOURCE = b.heatno(+) and t.misid = t2.heatno(+) and a.HUDWID = t3.heatno(+) and t.TFPOTID =t4.ladleid (+) AND substr(T.MOLIRNSOURCE,3, 1) = decode(?, null, substr(T.MOLIRNSOURCE, 3, 1), ?) and substr(T.MOLIRNSOURCE,1, 1) = decode(?, null, substr(T.MOLIRNSOURCE, 1, 1), ?) and substr(T.SHIFTCODE, 1, 1) = decode(?, null, substr(T.SHIFTCODE, 1, 1), ?) and substr(T.SHIFTCODE, 2, 1) = decode(?, null, substr(T.SHIFTCODE, 2, 1), ?) order by t.misid ]]> 'P' union select * from J#STL_CHEMELEMENT where to_char(ASSAYDATE, 'yyyy-MM-dd') between ? and ? and upper(SUBSTR(CHECKNO, 12, 1)) = 'C' and upper(SUBSTR(CHECKNO, -1)) = 'I' and upper(SUBSTR(CHECKNO, 13, 1)) <> 'P') x) y) t3 on t3.heatno = t.heatno left join (select y.* from (select x.*, count(1) over(partition by x.HEATNO) cnt, row_number() over(partition by x.HEATNO order by x.ASSAYTYPECODE ) xh, substr(x.assaytypecode, 1, 1) gw from (select * from STL_CHEMELEMENT where to_char(ASSAYDATE, 'yyyy-MM-dd') between ? and ? and upper(SUBSTR(CHECKNO, 12, 1)) = 'C' and upper(SUBSTR(CHECKNO, -1)) = 'S' union select * from J#STL_CHEMELEMENT where to_char(ASSAYDATE, 'yyyy-MM-dd') between ? and ? and upper(SUBSTR(CHECKNO, 12, 1)) = 'C' and upper(SUBSTR(CHECKNO, -1)) = 'S') x) y) t9 on t9.heatno = t.heatno left join (select * from stl_chemelement union select * from J#stl_chemelement) t10 on t10.heatno = t.MOLIRNSOURCE left join (select * from ppc_steel_heat union select * from J#ppc_steel_heat) t4 on t.heatno = t4.heatno left join (select * from ppc_steel_heat union select * from J#ppc_steel_heat) t5 on t.heatno = t5.heatno left join (select heatno, PFBALEWGT, BALELEAVEWGT, isrs, MWRAPNO, BILLETFIXSIZE from stl_ccm_optinfo union select heatno, PFBALEWGT, BALELEAVEWGT, isrs, MWRAPNO, BILLETFIXSIZE from J#stl_ccm_optinfo) t6 on t.heatno = t6.heatno order by optDisp ]]> 1410 order by heatno, LASTFRESHTIME) z where z.xh in (1, round(z.intcount / 4), round((z.intcount - 2) / 4) * 2, round((z.intcount - 2) / 4) * 3, round((z.intcount - 2) / 4) * 4, z.intcount) ]]> 0 then round((nvl(A.PFBALEWGT, 0) - nvl(A.BALELEAVEWGT, 0)), 3) else 0 end GSL, --GSL(合格钢水量) = (上台大包重量-下台大包重量) (select substr(mes_lg_common.getlgshift1(A.RecFlag), 2, 1) from dual) SHIFTCODE,--班组 case when to_char(A.RecFlag, 'yyyy-MM-dd HH24:mi') between ? and ? then '1' else '0' end BECURR --1#吹开始时刻(操作时间) from (select * from (select t.*, row_number() over(partition by HEATNO order by RecFlag) XH from (select t.recflag,station, t2.* from (select t.heatno, case when B1STARTTIME is not null then B1STARTTIME else OPTDATE end RecFlag,t.stationcode station from STL_bof_optinfo t where to_char(case when B1STARTTIME is not null then B1STARTTIME else OPTDATE end, 'yyyy-MM-dd') between ? and ? union all select t.heatno, case when B1STARTTIME is not null then B1STARTTIME else OPTDATE end RecFlag,t.stationcode station from J#STL_bof_optinfo t where to_char(case when B1STARTTIME is not null then B1STARTTIME else OPTDATE end, 'yyyy-MM-dd') between ? and ?) t, (select * from STL_ccm_optinfo union select * from J#STL_Ccm_Optinfo) t2 where t.heatno = t2.heatno) t) where XH = 1) A, (select distinct substr(CHARGE_NO, 1, 10) HEATNO, sum(nvl(SLAB_WGT, 0)) over(partition by substr(CHARGE_NO, 1, 10)) CPL from (select CHARGE_NO, (SLAB_WGT/1000) SLAB_WGT --合格铸坯量(T) from stl_incision_view where to_char(to_date(substr(SLAB_CUT_DTIME,1,8),'yyyy-MM-dd hh24:mi:ss'),'yyyy-MM-dd') between ? and ? ) t) B where A.HEATNO = B.HEATNO(+) ]]> 'P' union select * from J#STL_CHEMELEMENT where to_char(ASSAYDATE, 'yyyy-MM-dd') between ? and ? and upper(SUBSTR(CHECKNO, 12, 1)) = 'C' and upper(SUBSTR(CHECKNO, -1)) = 'I' and upper(SUBSTR(CHECKNO, 13, 1)) <> 'P') x) y) t3 on t3.heatno = t.heatno left join (select y.* from (select x.*, count(1) over(partition by x.HEATNO) cnt, row_number() over(partition by x.HEATNO order by x.ASSAYTYPECODE desc, x.assaydate desc) xh, substr(x.assaytypecode, 1, 1) gw from (select * from STL_CHEMELEMENT where to_char(ASSAYDATE, 'yyyy-MM-dd') between ? and ? and upper(SUBSTR(CHECKNO, 12, 1)) = 'C' and upper(SUBSTR(CHECKNO, -1)) = 'S' and upper(SUBSTR(CHECKNO, 13, 1)) = 'P' union select * from J#STL_CHEMELEMENT where to_char(ASSAYDATE, 'yyyy-MM-dd') between ? and ? and upper(SUBSTR(CHECKNO, 12, 1)) = 'C' and upper(SUBSTR(CHECKNO, -1)) = 'S' and upper(SUBSTR(CHECKNO, 13, 1)) = 'P') x) y) t9 on t9.heatno = t.heatno left join (select * from ppc_steel_heat union select * from J#ppc_steel_heat) t4 on t.heatno = t4.heatno /**left join (select * from (select misid, C, Si, Mn, P, S, Asn, Cu, Sn, Sb from stl_es_taphole union select misid, C, Si, Mn, P, S, Asn, Cu, Sn, Sb from stl_mis_taphole)) t5 on t.MOLIRNSOURCE = t5.misid**/ left join (select heatno, PFBALEWGT, BALELEAVEWGT, isrs from STL_ccm_optinfo union --PFBALEWGT上台大包重量 BALELEAVEWGT下台大包重量 isrs是否回炉 select heatno, PFBALEWGT, BALELEAVEWGT, isrs from J#STL_ccm_optinfo) t6 on t.heatno = t6.heatno left join (select heatno, ARFTEMPT, ARBTEMPT from STL_cas_optinfo union --ARFTEMPT氩前温度 ARFTEMPT氩后温度 select heatno, ARFTEMPT, ARBTEMPT from J#STL_cas_optinfo) t7 on t.heatno = t7.heatno left join (select heatno, isrs from STL_lfs_optinfo union --isrs是否回炉 select heatno, isrs from J#STL_lfs_optinfo) t8 on t.heatno = t8.heatno order by optDisp ]]> 0 then round((nvl(PFBALEWGT, 0) - nvl(BALELEAVEWGT, 0)), 1) else 0 end WEIGHT from STL_CCM_OPTINFO union select heatno, case when (nvl(PFBALEWGT, 0) - nvl(BALELEAVEWGT, 0)) > 0 then round((nvl(PFBALEWGT, 0) - nvl(BALELEAVEWGT, 0)), 1) else 0 end WEIGHT from J#STL_CCM_OPTINFO) b where a.heatno = b.heatno(+) group by to_char(a.optdate, 'yyyy-MM-dd'), substr(a.shiftcode, 2, 1) order by to_char(a.optdate, 'yyyy-MM-dd'), substr(a.shiftcode, 2, 1) ]]> 1410 order by heatno, LASTFRESHTIME) z where z.xh in (1, round(z.intcount / 4), round((z.intcount - 2) / 4) * 2, round((z.intcount - 2) / 4) * 3, round((z.intcount - 2) / 4) * 4, z.intcount) ]]> = 2 then '1' end ZDYY, case when count(case when f.HeatNo = a.HeatNo and f.SAMPLINGNAME = 'BOFANGLE' and f.SAMPLINGVALUE <= -2 and f.SAMPLINGDATE >= case when a.PSSTARTTIME is null then a.TAPPINGENDTIME + 1.5/24/60 else a.PSSTARTTIME - 3/24/60 end then 1 end) over(partition by f.HeatNo) >= 1 then '1' end JZJD, case when count(case when f.HeatNo = a.HeatNo and f.SAMPLINGNAME = 'BOFANGLE' and f.SAMPLINGVALUE >= 115 and f.SAMPLINGDATE >= a.PSENDTIME then 1 end) over(partition by f.HeatNo) >= 1 then '1' end ZZJD, case when sum(case when g.HeatNo = a.HeatNo and g.MATERIELCODE = '10301010039' and g.JMDATE >= a.B1STARTTIME + (750/24/60/60) then nvl(g.JMWGT, 0) end) over(partition by g.HeatNo) > 0 then '1' end JKS, case when count(case when f.HeatNo = a.HeatNo and f.SAMPLINGNAME = 'GUN' || a.OGGNUMID || 'HIGH' and f.SAMPLINGVALUE > 1500 and f.SAMPLINGDATE <= a.B1ENDTIME - (10/24/60/60) and f.SAMPLINGDATE > a.B1STARTTIME + (750/24/60/60) then 1 end) over(partition by f.HeatNo) <= 0 then '1' end QWS, '' 溅渣未加料, '' 到站化学成分未命中 from (select * from STL_BOF_OPTINFO where to_char(OPTDATE,'yyyy-mm-dd') between ? and ? union select * from J#STL_BOF_OPTINFO where to_char(OPTDATE,'yyyy-mm-dd') between ? and ?) a, (select y.* from (select x.*, row_number() over(partition by x.HEATNO order by x.ASSAYDATE) xh from (select * from STL_CHEMELEMENT where (upper(substr(ASSAYTYPECODE, 1, 2)) = 'LD' or upper(substr(STATIONCODE, 1, 1)) = 'C') and to_char(ASSAYDATE,'yyyy-mm-dd') between ? and ? union select * from J#STL_CHEMELEMENT where (upper(substr(ASSAYTYPECODE, 1, 2)) = 'LD' or upper(substr(STATIONCODE, 1, 1)) = 'C') and to_char(ASSAYDATE,'yyyy-mm-dd') between ? and ? ) x) y where y.xh = 1) c, (select HeatNo,SAMPLINGNAME,SAMPLINGVALUE,max(SAMPLINGDATE) SAMPLINGDATE from STL_BOF_SAMPLING where (SAMPLINGNAME = 'GUNAHIGH' or SAMPLINGNAME = 'GUNBHIGH' or SAMPLINGNAME = 'BOFANGLE') and to_char(SAMPLINGDATE,'yyyy-mm-dd') between ? and ? group by HEATNO,SAMPLINGNAME,SAMPLINGVALUE union select HeatNo,SAMPLINGNAME,SAMPLINGVALUE,max(SAMPLINGDATE) SAMPLINGDATE from J#STL_BOF_SAMPLING where (SAMPLINGNAME = 'GUNAHIGH' or SAMPLINGNAME = 'GUNBHIGH' or SAMPLINGNAME = 'BOFANGLE') and to_char(SAMPLINGDATE,'yyyy-mm-dd') between ? and ? group by HEATNO,SAMPLINGNAME,SAMPLINGVALUE ) f, (select HeatNo,MATERIELCODE,JMDATE,JMWGT from STL_BOF_ADDITIVES where to_char(JMDATE,'yyyy-mm-dd') between ? and ? union select HeatNo,MATERIELCODE,JMDATE,JMWGT from J#STL_BOF_ADDITIVES where to_char(JMDATE,'yyyy-mm-dd') between ? and ? ) g where a.HEATNO = c.HEATNO(+) and a.HEATNO = f.HEATNO(+) and a.HEATNO = g.HEATNO) order by STATIONCODE, HEATNO desc ]]> = 2 then '1' end YQLF, case when count(case when f.HeatNo = a.HeatNo and substr((h.FACT_ROUTE),9,2) = 'E0' and f.SAMPLINGNAME = 'GUN' || a.OGGNUMID || 'HIGH' and f.SAMPLINGVALUE <= 1460 and f.SAMPLINGDATE <= a.STOPOXYGENTIME + (1/24/60/60)*50 then 1 end) over(partition by f.HeatNo) >= 2 then '1' end YQFLF, case when count(case when f.HeatNo = a.HeatNo and f.SAMPLINGNAME = 'BOFANGLE' and f.SAMPLINGVALUE <= -3 and f.SAMPLINGDATE >= case when a.PSSTARTTIME is null then a.TAPPINGENDTIME + 1.5/24/60 else a.PSSTARTTIME - 1/24/60 end then 1 end) over(partition by f.HeatNo) >= 1 then '1' else '0' end 溅渣角度合格, case when count(case when f.HeatNo = a.HeatNo and f.SAMPLINGNAME = 'BOFANGLE' and f.SAMPLINGVALUE >= 105 and f.SAMPLINGDATE >= a.PSENDTIME then 1 end) over(partition by f.HeatNo) >= 1 then '1' else '0' end 粘渣角度合格, case when sum(case when g.HeatNo = a.HeatNo and g.MATERIELCODE = '10301010078' and g.JMDATE >= a.OPENOXYGENTIME + (700/24/60/60) then nvl(g.JMWGT, 0) end) over(partition by g.HeatNo) > 0 then '1' else '0' end 加矿石, case when substr((select FACT_ROUTE from ppc_steel_heat t where t.heatno=a.HEATNO),9,2) ='E0' then '是' else '否' end FACT_ROUTE, case when count(case when f.HeatNo = a.HeatNo and f.SAMPLINGNAME = 'GUN' || a.OGGNUMID || 'HIGH' and (substr((h.FACT_ROUTE),9,2) ='E1' OR substr((h.FACT_ROUTE),9,2) = 'E2') and f.SAMPLINGVALUE <= 1460 and f.SAMPLINGDATE <= a.STOPOXYGENTIME - (10/24/60/60) and f.SAMPLINGDATE > a.OPENOXYGENTIME + (700/24/60/60) then 1 end) over(partition by f.HeatNo) <= 0 then '1' end QWLF, case when count(case when f.HeatNo = a.HeatNo and f.SAMPLINGNAME = 'GUN' || a.OGGNUMID || 'HIGH' and substr((h.FACT_ROUTE),9,2) = 'E0' and f.SAMPLINGVALUE <= 1500 and f.SAMPLINGDATE <= a.STOPOXYGENTIME - (10/24/60/60) and f.SAMPLINGDATE > a.OPENOXYGENTIME + (700/24/60/60) then 1 end) over(partition by f.HeatNo) <= 0 then '1' end QWFLF, '' 溅渣未加料, '' 到站化学成分未命中 from (select * from STL_BOF_OPTINFO where $ union select * from J#STL_BOF_OPTINFO where $ ) a, (select y.* from (select x.*, row_number() over(partition by x.HEATNO order by x.ASSAYDATE desc) xh from (select * from STL_CHEMELEMENT where (upper(substr(ASSAYTYPECODE, 1, 2)) = 'LD' or upper(substr(STATIONCODE, 1, 1)) = 'C') and to_char(ASSAYDATE,'yyyy-mm-dd') between ? and ? union select * from J#STL_CHEMELEMENT where (upper(substr(ASSAYTYPECODE, 1, 2)) = 'LD' or upper(substr(STATIONCODE, 1, 1)) = 'C') and to_char(ASSAYDATE,'yyyy-mm-dd') between ? and ? ) x) y where y.xh = 1) c, (select HeatNo,SAMPLINGNAME,SAMPLINGVALUE,max(SAMPLINGDATE) SAMPLINGDATE from STL_BOF_SAMPLING where (SAMPLINGNAME = 'GUNAHIGH' or SAMPLINGNAME = 'GUNBHIGH' or SAMPLINGNAME = 'BOFANGLE') and to_char(SAMPLINGDATE,'yyyy-mm-dd') between ? and ? group by HEATNO,SAMPLINGNAME,SAMPLINGVALUE union select HeatNo,SAMPLINGNAME,SAMPLINGVALUE,max(SAMPLINGDATE) SAMPLINGDATE from J#STL_BOF_SAMPLING where (SAMPLINGNAME = 'GUNAHIGH' or SAMPLINGNAME = 'GUNBHIGH' or SAMPLINGNAME = 'BOFANGLE') and to_char(SAMPLINGDATE,'yyyy-mm-dd') between ? and ? group by HEATNO,SAMPLINGNAME,SAMPLINGVALUE ) f, (select HeatNo,MATERIELCODE,JMDATE,JMWGT from STL_BOF_ADDITIVES where to_char(JMDATE,'yyyy-mm-dd') between ? and ? union select HeatNo,MATERIELCODE,JMDATE,JMWGT from J#STL_BOF_ADDITIVES where to_char(JMDATE,'yyyy-mm-dd') between ? and ? ) g , (select HEATNO,FACT_ROUTE,PLAN_MAKING_TIME from ppc_steel_heat a where to_char(PLAN_MAKING_TIME,'yyyy-mm-dd') between ? and ? union select HEATNO,FACT_ROUTE,PLAN_MAKING_TIME from J#ppc_steel_heat b where to_char(PLAN_MAKING_TIME,'yyyy-mm-dd') between ? and ? ) h where a.HEATNO = c.HEATNO(+) and a.HEATNO = f.HEATNO(+) and a.HEATNO = g.HEATNO(+) and a.HEATNO = h.HEATNO(+) ) order by 炉座, 炉号 desc ]]> 0 then trim(to_char(round(CaO / (SiO2), 3), '9990.000')) else '' end JIANDU from STL_CHEMELEMENT t where substr(t.checkno, length(t.checkno) - 1, 2) = '-4' and to_char(ASSAYDATE, 'yyyy-MM-dd') between ? and ? union select t.*, case when nvl(SiO2, 0) <> 0 then trim(to_char(round(CaO / (SiO2), 3), '9990.000')) else '' end JIANDU from J#STL_CHEMELEMENT t where substr(t.checkno, length(t.checkno) - 1, 2) = '-4' and to_char(ASSAYDATE, 'yyyy-MM-dd') between ? and ? ) A order by A.ASSAYDATE ]]>