0
order by processcode, dept_code,pline_code
]]>
0
order by processcode, dept,pline_name
]]>
0
order by processcode, dept,pline_name
]]>
0
order by processcode, dept,pline_name
]]>
0
order by processcode, dept,pline_name
]]>
0
order by processcode, dept,pline_name
]]>
0
order by processcode, dept,pline_name
]]>
='#fromday#' and to_char(CREATETIME,'yyyy-MM-dd')<='#today#'
and kf>0
order by processcode, dept_code,pline_code
]]>
='#fromday#' and to_char(CREATETIME,'yyyy-MM-dd')<='#today#'
and kf>0
order by processcode, dept,pline_name
]]>
='#fromday#' and to_char(CREATETIME,'yyyy-MM-dd')<='#today#'
and kf>0
order by processcode, dept,pline_name
]]>
='#fromday#' and to_char(CREATETIME,'yyyy-MM-dd')<='#today#'
and kf>0
order by processcode, dept,pline_name
]]>
='#fromday#' and to_char(CREATETIME,'yyyy-MM-dd')<='#today#'
and kf>0
order by processcode, dept,pline_name
]]>
='#fromday#' and to_char(CREATETIME,'yyyy-MM-dd')<='#today#'
and kf>0
order by processcode, dept,pline_name
]]>
='#fromday#' and to_char(CREATETIME,'yyyy-MM-dd')<='#today#'
and kf>0
order by processcode, dept,pline_name
]]>
0
and to_char(CREATETIME,'yyyy-MM-dd')>='#fromday#' and to_char(CREATETIME,'yyyy-MM-dd')<='#today#'
group by pline_name,pline_code,to_char(CREATETIME,'yyyy-MM-dd')
]]>
0
and to_char(CREATETIME,'yyyy-MM-dd')>='#fromday#' and to_char(CREATETIME,'yyyy-MM-dd')<='#today#'
group by pline_name,pline_code,to_char(CREATETIME,'yyyy-MM-dd')
]]>
0
and to_char(CREATETIME,'yyyy-MM-dd')>='#fromday#' and to_char(CREATETIME,'yyyy-MM-dd')<='#today#'
group by pline_name,pline_code,to_char(CREATETIME,'yyyy-MM-dd')
]]>
0
and to_char(CREATETIME,'yyyy-MM-dd')>='#fromday#' and to_char(CREATETIME,'yyyy-MM-dd')<='#today#'
group by pline_name,pline_code,to_char(CREATETIME,'yyyy-MM-dd')
]]>
0
and to_char(CREATETIME,'yyyy-MM-dd')>='#fromday#' and to_char(CREATETIME,'yyyy-MM-dd')<='#today#'
group by pline_name,pline_code,to_char(CREATETIME,'yyyy-MM-dd')
]]>
0
and to_char(CREATETIME,'yyyy-MM-dd')>='#fromday#' and to_char(CREATETIME,'yyyy-MM-dd')<='#today#'
group by pline_name,pline_code,to_char(CREATETIME,'yyyy-MM-dd')
]]>
0
and to_char(CREATETIME,'yyyy-MM-dd')>='#fromday#' and to_char(CREATETIME,'yyyy-MM-dd')<='#today#'
group by pline_name,pline_code,to_char(CREATETIME,'yyyy-MM-dd')
]]>
'B' and area_code<>'002001002'then '轧管' else '管加工' end area
,case when t.area_code='002001001' then '4' when processcode='B' then '1' when processcode<>'B' and area_code<>'002001002' then '2' else '3' end area_code
,'1' as signxh,'DC'as sign,t.processcode,t.dept_code,max(t.dept) as dept,t.area_code as area_code1,max(t.area) as area1,
t.pline_code,max(t.pline_name) as pline_name,to_char(createtime,'yyyy-MM-dd') as createdate,sum(kf) as kf,max(qz) as qz,to_number(sum(kf*qz)) as kfqz
from tab_rpt_ls_dc t
where kf>0
and to_char(CREATETIME,'yyyy-MM-dd')>='#fromday#' and to_char(CREATETIME,'yyyy-MM-dd')<='#today#'
group by t.processcode,t.area_code,t.dept_code,t.pline_code,to_char(createtime,'yyyy-MM-dd')
union
select case when t.area_code='002001001' then '外委' when processcode='B' then '炼钢' when processcode<>'B' and area_code<>'002001002'then '轧管' else '管加工' end area
,case when t.area_code='002001001' then '4' when processcode='B' then '1' when processcode<>'B' and area_code<>'002001002' then '2' else '3' end area_code
,'2' as signxh,'QX'as sign,t.processcode,t.dept_code,max(t.dept) as dept,t.area_code as area_code1,max(t.area) as area1,
t.pline_code,max(t.pline_name) as pline_name,to_char(createtime,'yyyy-MM-dd'),sum(kf),max(qz) as qz,to_number(sum(kf*qz)) as kfqz
from tab_rpt_ls_qx t
where kf>0
and to_char(CREATETIME,'yyyy-MM-dd')>='#fromday#' and to_char(CREATETIME,'yyyy-MM-dd')<='#today#'
group by t.processcode,t.area_code,t.dept_code,t.pline_code,to_char(createtime,'yyyy-MM-dd')
union
select case when t.area_code='002001001' then '外委' when processcode='B' then '炼钢' when processcode<>'B' and area_code<>'002001002'then '轧管' else '管加工' end area
,case when t.area_code='002001001' then '4' when processcode='B' then '1' when processcode<>'B' and area_code<>'002001002' then '2' else '3' end area_code
,case when t.sign='DSP' then '3' else '4' end as signxh,t.sign,t.processcode,t.dept_code,max(t.dept) as dept,t.area_code as area_code1,max(t.area) as area1,
t.pline_code,max(t.pline_name) as pline_name,to_char(createtime,'yyyy-MM-dd'),sum(kf),max(qz) as qz,to_number(sum(kf*qz)) as kfqz
from tab_rpt_ls_dp t
where kf>0
and to_char(CREATETIME,'yyyy-MM-dd')>='#fromday#' and to_char(CREATETIME,'yyyy-MM-dd')<='#today#'
group by t.sign,t.processcode,t.area_code,t.dept_code,t.pline_code,to_char(createtime,'yyyy-MM-dd')
union
select case when t.area_code='002001001' then '外委' when processcode='B' then '炼钢' when processcode<>'B' and area_code<>'002001002'then '轧管' else '管加工' end area
,case when t.area_code='002001001' then '4' when processcode='B' then '1' when processcode<>'B' and area_code<>'002001002' then '2' else '3' end area_code
,case when t.sign='LXWT' then '5' else '6' end as signxh,t.sign,t.processcode,t.dept_code,max(t.dept) as dept,t.area_code as area_code1,max(t.area) as area1,
t.pline_code,max(t.pline_name) as pline_name,to_char(createtime,'yyyy-MM-dd'),sum(kf),max(qz) as qz,to_number(sum(kf*qz)) as kfqz
from tab_rpt_ls_lx t
where kf>0
and to_char(CREATETIME,'yyyy-MM-dd')>='#fromday#' and to_char(CREATETIME,'yyyy-MM-dd')<='#today#'
group by t.sign,t.processcode,t.area_code,t.dept_code,t.pline_code,to_char(createtime,'yyyy-MM-dd')
union
select case when t.area_code='002001001' then '外委' when processcode='B' then '炼钢' when processcode<>'B' and area_code<>'002001002'then '轧管' else '管加工' end area
,case when t.area_code='002001001' then '4' when processcode='B' then '1' when processcode<>'B' and area_code<>'002001002' then '2' else '3' end area_code
,'7' as signxh,'FP' as sign,t.processcode,t.dept_code,max(t.dept) as dept,t.area_code as area_code1,max(t.area) as area1,
t.pline_code,max(t.pline_name) as pline_name,to_char(createtime,'yyyy-MM-dd'),sum(kf),max(qz) as qz,to_number(sum(kf*qz)) as kfqz
from tab_rpt_ls_fp t
where kf>0
and to_char(CREATETIME,'yyyy-MM-dd')>='#fromday#' and to_char(CREATETIME,'yyyy-MM-dd')<='#today#'
group by t.processcode,t.area_code,t.dept_code,t.pline_code,to_char(createtime,'yyyy-MM-dd') )a
order by area_code,dept,processcode,pline_name,createdate
]]>
='#fromday#' and to_char(JUDGE_TOLRESULT_TIME,'yyyy-MM-dd')<='#today#')
select a.produccode,a.producname
,(select min(x.whole_backlog) from v_sczq x
where x.produccode=a.produccode
and length(x.whole_backlog)=(select MIN(length(y.whole_backlog)) whole_backlog_len from v_sczq y
where y.produccode=a.produccode)) as min_whole_backlog
,(select min(workhours) from v_sczq z
where z.produccode=a.produccode
and z.whole_backlog=(select min(x.whole_backlog) from v_sczq x
where x.produccode=a.produccode
and length(x.whole_backlog)=(select MIN(length(y.whole_backlog)) whole_backlog_len from v_sczq y
where y.produccode=a.produccode))) as minwhole_backlog_minworkhours
,(select max(workhours) from v_sczq z
where z.produccode=a.produccode
and z.whole_backlog=(select min(x.whole_backlog) from v_sczq x
where x.produccode=a.produccode
and length(x.whole_backlog)=(select MIN(length(y.whole_backlog)) whole_backlog_len from v_sczq y
where y.produccode=a.produccode))) as minwhole_backlog_maxworkhours
,(select round(avg(workhours),1) from v_sczq z
where z.produccode=a.produccode and z.material_no=a.material_no
and z.whole_backlog=(select min(x.whole_backlog) from v_sczq x
where x.produccode=a.produccode and x.material_no=a.material_no
and length(x.whole_backlog)=(select MIN(length(y.whole_backlog)) whole_backlog_len from v_sczq y
where y.produccode=a.produccode and y.material_no=a.material_no))) as minwhole_backlog_avgworkhours
,(select round(sum(workhours*act_count)/sum(act_count),1) from v_sczq z
where z.produccode=a.produccode and z.material_no=a.material_no
and z.whole_backlog=(select min(x.whole_backlog) from v_sczq x
where x.produccode=a.produccode and x.material_no=a.material_no
and length(x.whole_backlog)=(select MIN(length(y.whole_backlog)) whole_backlog_len from v_sczq y
where y.produccode=a.produccode and y.material_no=a.material_no))) as minwhole_backlog_ajqworkhours
,(select round(STDDEV (workhours),1) from v_sczq z
where z.produccode=a.produccode
and z.whole_backlog=(select min(x.whole_backlog) from v_sczq x
where x.produccode=a.produccode
and length(x.whole_backlog)=(select MIN(length(y.whole_backlog)) whole_backlog_len from v_sczq y
where y.produccode=a.produccode))) as minwholelog_STDDEVwhours --标准差
,(select sum(act_count) from v_sczq z
where z.produccode=a.produccode
and z.whole_backlog=(select min(x.whole_backlog) from v_sczq x
where x.produccode=a.produccode
and length(x.whole_backlog)=(select MIN(length(y.whole_backlog)) whole_backlog_len from v_sczq y
where y.produccode=a.produccode))) as minwholelog_act_count
,(select count(judge_stove_no) from v_sczq z
where z.produccode=a.produccode
and z.whole_backlog=(select min(x.whole_backlog) from v_sczq x
where x.produccode=a.produccode
and length(x.whole_backlog)=(select MIN(length(y.whole_backlog)) whole_backlog_len from v_sczq y
where y.produccode=a.produccode))) as minwholelog_lcount
,(select max(x.whole_backlog) from v_sczq x
where x.produccode=a.produccode
and length(x.whole_backlog)=(select max(length(y.whole_backlog)) whole_backlog_len from v_sczq y
where y.produccode=a.produccode)) as max_whole_backlog
,(select min(workhours) from v_sczq z
where z.produccode=a.produccode
and z.whole_backlog=(select max(x.whole_backlog) from v_sczq x
where x.produccode=a.produccode
and length(x.whole_backlog)=(select max(length(y.whole_backlog)) whole_backlog_len from v_sczq y
where y.produccode=a.produccode))) as maxwhole_backlog_minworkhours
,(select max(workhours) from v_sczq z
where z.produccode=a.produccode
and z.whole_backlog=(select max(x.whole_backlog) from v_sczq x
where x.produccode=a.produccode
and length(x.whole_backlog)=(select max(length(y.whole_backlog)) whole_backlog_len from v_sczq y
where y.produccode=a.produccode))) as maxwhole_backlog_maxworkhours
,(select round(avg(workhours),1) from v_sczq z
where z.produccode=a.produccode
and z.whole_backlog=(select max(x.whole_backlog) from v_sczq x
where x.produccode=a.produccode
and length(x.whole_backlog)=(select max(length(y.whole_backlog)) whole_backlog_len from v_sczq y
where y.produccode=a.produccode))) as maxwhole_backlog_avgworkhours
,(select round(sum(workhours*act_count)/sum(act_count),1) from v_sczq z
where z.produccode=a.produccode
and z.whole_backlog=(select max(x.whole_backlog) from v_sczq x
where x.produccode=a.produccode
and length(x.whole_backlog)=(select max(length(y.whole_backlog)) whole_backlog_len from v_sczq y
where y.produccode=a.produccode))) as maxwhole_backlog_ajqworkhours
,(select round(STDDEV(workhours),1) from v_sczq z
where z.produccode=a.produccode
and z.whole_backlog=(select max(x.whole_backlog) from v_sczq x
where x.produccode=a.produccode
and length(x.whole_backlog)=(select max(length(y.whole_backlog)) whole_backlog_len from v_sczq y
where y.produccode=a.produccode))) as maxwholelog_STDDEVwhours --标准差
,(select sum(z.act_count) from v_sczq z
where z.produccode=a.produccode
and z.whole_backlog=(select max(x.whole_backlog) from v_sczq x
where x.produccode=a.produccode
and length(x.whole_backlog)=(select max(length(y.whole_backlog)) whole_backlog_len from v_sczq y
where y.produccode=a.produccode))) as maxwholelog_act_count
,(select count(judge_stove_no) from v_sczq z
where z.produccode=a.produccode
and z.whole_backlog=(select max(x.whole_backlog) from v_sczq x
where x.produccode=a.produccode
and length(x.whole_backlog)=(select max(length(y.whole_backlog)) whole_backlog_len from v_sczq y
where y.produccode=a.produccode))) as maxwholelog_lcount
/*,(select MIN(length(y.whole_backlog)) from v_sczq y
where y.produccode=a.produccode) as minlen
,(select max(length(y.whole_backlog)) from v_sczq y
where y.produccode=a.produccode) as maxlen*/
,(select min(workhours) from v_sczq y
where y.produccode=a.produccode) as minworkhours
,(select max(workhours) from v_sczq y
where y.produccode=a.produccode) as maxworkhours
,(select round(avg(workhours),1) from v_sczq y
where y.produccode=a.produccode) as avgworkhours
,(select round(sum(workhours*act_count)/sum(act_count),1) from v_sczq y
where y.produccode=a.produccode) as avgjqworkhours
,(select round(STDDEV(workhours),1) from v_sczq y
where y.produccode=a.produccode) as STDDEVwhours --标准差
,(select sum(act_count) from v_sczq y
where y.produccode=a.produccode) as act_count
,(select count(judge_stove_no) from v_sczq y
where y.produccode=a.produccode) as lcount
from (SELECT * FROM v_sczq WHERE ROWID IN (
SELECT MIN(ROWID) FROM v_sczq t GROUP BY t.produccode)) a
order by (select min(workhours) whole_backlog_len from v_sczq y
where y.produccode=a.produccode),a.produccode
]]>
='#fromday#' and to_char(JUDGE_TOLRESULT_TIME,'yyyy-MM-dd')<='#today#')
select a.produccode,a.producname,a.material_no,a.material_name
,(select min(x.whole_backlog) from v_sczq x
where x.produccode=a.produccode and x.material_no=a.material_no
and length(x.whole_backlog)=(select MIN(length(y.whole_backlog)) whole_backlog_len from v_sczq y
where y.produccode=a.produccode and y.material_no=a.material_no)) as min_whole_backlog
,(select min(workhours) from v_sczq z
where z.produccode=a.produccode and z.material_no=a.material_no
and z.whole_backlog=(select min(x.whole_backlog) from v_sczq x
where x.produccode=a.produccode and x.material_no=a.material_no
and length(x.whole_backlog)=(select MIN(length(y.whole_backlog)) whole_backlog_len from v_sczq y
where y.produccode=a.produccode and y.material_no=a.material_no))) as minwhole_backlog_minworkhours
,(select max(workhours) from v_sczq z
where z.produccode=a.produccode and z.material_no=a.material_no
and z.whole_backlog=(select min(x.whole_backlog) from v_sczq x
where x.produccode=a.produccode and x.material_no=a.material_no
and length(x.whole_backlog)=(select MIN(length(y.whole_backlog)) whole_backlog_len from v_sczq y
where y.produccode=a.produccode and y.material_no=a.material_no))) as minwhole_backlog_maxworkhours
,(select round(avg(workhours),1) from v_sczq z
where z.produccode=a.produccode and z.material_no=a.material_no
and z.whole_backlog=(select min(x.whole_backlog) from v_sczq x
where x.produccode=a.produccode and x.material_no=a.material_no
and length(x.whole_backlog)=(select MIN(length(y.whole_backlog)) whole_backlog_len from v_sczq y
where y.produccode=a.produccode and y.material_no=a.material_no))) as minwhole_backlog_avgworkhours
,(select round(sum(workhours*act_count)/sum(act_count),1) from v_sczq z
where z.produccode=a.produccode and z.material_no=a.material_no
and z.whole_backlog=(select min(x.whole_backlog) from v_sczq x
where x.produccode=a.produccode and x.material_no=a.material_no
and length(x.whole_backlog)=(select MIN(length(y.whole_backlog)) whole_backlog_len from v_sczq y
where y.produccode=a.produccode and y.material_no=a.material_no))) as minwhole_backlog_ajqworkhours
,(select round(STDDEV (workhours),1) from v_sczq z
where z.produccode=a.produccode and z.material_no=a.material_no
and z.whole_backlog=(select min(x.whole_backlog) from v_sczq x
where x.produccode=a.produccode and x.material_no=a.material_no
and length(x.whole_backlog)=(select MIN(length(y.whole_backlog)) whole_backlog_len from v_sczq y
where y.produccode=a.produccode and y.material_no=a.material_no))) as minwholelog_STDDEVwhours --标准差
,(select sum(act_count) from v_sczq z
where z.produccode=a.produccode and z.material_no=a.material_no
and z.whole_backlog=(select min(x.whole_backlog) from v_sczq x
where x.produccode=a.produccode and x.material_no=a.material_no
and length(x.whole_backlog)=(select MIN(length(y.whole_backlog)) whole_backlog_len from v_sczq y
where y.produccode=a.produccode and y.material_no=a.material_no))) as minwholelog_act_count
,(select count(judge_stove_no) from v_sczq z
where z.produccode=a.produccode and z.material_no=a.material_no
and z.whole_backlog=(select min(x.whole_backlog) from v_sczq x
where x.produccode=a.produccode and x.material_no=a.material_no
and length(x.whole_backlog)=(select MIN(length(y.whole_backlog)) whole_backlog_len from v_sczq y
where y.produccode=a.produccode and y.material_no=a.material_no))) as minwholelog_lcount
,(select max(x.whole_backlog) from v_sczq x
where x.produccode=a.produccode and x.material_no=a.material_no
and length(x.whole_backlog)=(select max(length(y.whole_backlog)) whole_backlog_len from v_sczq y
where y.produccode=a.produccode and y.material_no=a.material_no)) as max_whole_backlog
,(select min(workhours) from v_sczq z
where z.produccode=a.produccode and z.material_no=a.material_no
and z.whole_backlog=(select max(x.whole_backlog) from v_sczq x
where x.produccode=a.produccode and x.material_no=a.material_no
and length(x.whole_backlog)=(select max(length(y.whole_backlog)) whole_backlog_len from v_sczq y
where y.produccode=a.produccode and y.material_no=a.material_no))) as maxwhole_backlog_minworkhours
,(select max(workhours) from v_sczq z
where z.produccode=a.produccode and z.material_no=a.material_no
and z.whole_backlog=(select max(x.whole_backlog) from v_sczq x
where x.produccode=a.produccode and x.material_no=a.material_no
and length(x.whole_backlog)=(select max(length(y.whole_backlog)) whole_backlog_len from v_sczq y
where y.produccode=a.produccode and y.material_no=a.material_no))) as maxwhole_backlog_maxworkhours
,(select round(avg(workhours),1) from v_sczq z
where z.produccode=a.produccode and z.material_no=a.material_no
and z.whole_backlog=(select max(x.whole_backlog) from v_sczq x
where x.produccode=a.produccode and x.material_no=a.material_no
and length(x.whole_backlog)=(select max(length(y.whole_backlog)) whole_backlog_len from v_sczq y
where y.produccode=a.produccode and y.material_no=a.material_no))) as maxwhole_backlog_avgworkhours
,(select round(sum(workhours*act_count)/sum(act_count),1) from v_sczq z
where z.produccode=a.produccode and z.material_no=a.material_no
and z.whole_backlog=(select max(x.whole_backlog) from v_sczq x
where x.produccode=a.produccode and x.material_no=a.material_no
and length(x.whole_backlog)=(select max(length(y.whole_backlog)) whole_backlog_len from v_sczq y
where y.produccode=a.produccode and y.material_no=a.material_no))) as maxwhole_backlog_ajqworkhours
,(select round(STDDEV(workhours),1) from v_sczq z
where z.produccode=a.produccode and z.material_no=a.material_no
and z.whole_backlog=(select max(x.whole_backlog) from v_sczq x
where x.produccode=a.produccode and x.material_no=a.material_no
and length(x.whole_backlog)=(select max(length(y.whole_backlog)) whole_backlog_len from v_sczq y
where y.produccode=a.produccode and y.material_no=a.material_no))) as maxwholelog_STDDEVwhours --标准差
,(select sum(act_count) from v_sczq z
where z.produccode=a.produccode and z.material_no=a.material_no
and z.whole_backlog=(select max(x.whole_backlog) from v_sczq x
where x.produccode=a.produccode and x.material_no=a.material_no
and length(x.whole_backlog)=(select max(length(y.whole_backlog)) whole_backlog_len from v_sczq y
where y.produccode=a.produccode and y.material_no=a.material_no))) as maxwholelog_act_count
,(select count(judge_stove_no) from v_sczq z
where z.produccode=a.produccode and z.material_no=a.material_no
and z.whole_backlog=(select max(x.whole_backlog) from v_sczq x
where x.produccode=a.produccode and x.material_no=a.material_no
and length(x.whole_backlog)=(select max(length(y.whole_backlog)) whole_backlog_len from v_sczq y
where y.produccode=a.produccode and y.material_no=a.material_no))) as maxwholelog_lcount
/*,(select MIN(length(y.whole_backlog)) whole_backlog_len from v_sczq y
where y.produccode=a.produccode and y.material_no=a.material_no) as minlenwhole_backlog
,(select max(length(y.whole_backlog)) from v_sczq y
where y.produccode=a.produccode and y.material_no=a.material_no) as maxlenwhole_backlog*/
,(select min(workhours) whole_backlog_len from v_sczq y
where y.produccode=a.produccode and y.material_no=a.material_no) as minworkhours
,(select max(workhours) whole_backlog_len from v_sczq y
where y.produccode=a.produccode and y.material_no=a.material_no) as maxworkhours
,(select round(avg(workhours),1) from v_sczq y
where y.produccode=a.produccode and y.material_no=a.material_no) as avgworkhours
,(select round(sum(workhours*act_count)/sum(act_count),2) from v_sczq y
where y.produccode=a.produccode and y.material_no=a.material_no) as avgjqworkhours
,(select round(STDDEV(workhours),1) from v_sczq y
where y.produccode=a.produccode and y.material_no=a.material_no) as STDDEVwhours --标准差
,(select sum(y.act_count) from v_sczq y
where y.produccode=a.produccode and y.material_no=a.material_no) as act_count
,(select count(judge_stove_no) from v_sczq y
where y.produccode=a.produccode and y.material_no=a.material_no) as lcount
from (SELECT * FROM v_sczq WHERE ROWID IN (
SELECT MIN(ROWID) FROM v_sczq t GROUP BY t.produccode,t.producname,t.material_no,t.material_name )) a
order by (select min(workhours) whole_backlog_len from v_sczq y
where y.produccode=a.produccode and y.material_no=a.material_no),a.produccode,a.material_no
]]>
='#fromday#' and to_char(JUDGE_TOLRESULT_TIME,'yyyy-MM-dd')<='#today#')
select pline_name as 产线, judge_stove_no as 判定炉号,batch_no as 批号, whole_backlog as 流程码,workhours as "生产周期(天)",
to_char(judge_tolresult_time,'yyyy-MM-dd hh24:mi:ss') as 综合判定时间,
to_char(zg_feedtime,'yyyy-MM-dd hh24:mi:ss') as 轧管上料时间, zg_feed_judge_stove_no as 轧管上料炉号,
produccode as 品种代码,producname as 品名,material_no as 物料码, material_name as 物料名称
,act_count as 支,nvl(act_weight,act_theory_weight) as 吨, steelname as 钢级,
gradename as 钢种,spec_name as 规格,model_desc as 扣型,std_name as 标准,std_style_desc as 标准类别,
act_len_min||'-'||act_len_max as 长度范围,act_len as 实际长度, pro_order_no as 合同号,process_status as 热处理状态
/* steelcode, gradecode, spec_code, model_code, std_code, std_style,target, ct_dimater,act_height,
pline_code, load_judge_stove_no,load_batch_no,zp_m_lh,zp_coll, process_code, jugde_apply_code,
jugde_apply_sequeno,quality_group,batch_groud_no, belong_name_jugde, ord_ln_dly_pk,
input_weight,input_count,output_weight,output_count,bal_year_month,is_all_scrap,is_carry_voer,
stove_no,steel_standrad,heat_plan_no,zbs_flag,createtime */
from v_sczq
order by workhours,produccode,material_no
]]>
0 and to_char(a.createtime,'yyyy-MM-dd')=to_char(sysdate,'yyyy-MM-dd')
and not exists (select 1 from TAB_RPT_temp_LS_DC b
where to_char(a.createtime,'yyyy-MM-dd')=to_char(b.createtime,'yyyy-MM-dd')
and a.processcode=b.processcode and a.pline_code=b.pline_code
and a.heat_plan_no=b.heat_plan_no and a.judge_stove_no=b.judge_stove_no);
commit;
delete
from TAB_RPT_LS_DC a
where a.kf=0 and to_char(a.createtime,'yyyy-MM-dd')=to_char(sysdate,'yyyy-MM-dd')
and not exists (select 1 from TAB_RPT_temp_LS_DC b
where b.kf>0 and to_char(a.createtime,'yyyy-MM-dd')=to_char(b.createtime,'yyyy-MM-dd')
and a.processcode=b.processcode and a.pline_code=b.pline_code
and a.heat_plan_no=b.heat_plan_no and a.judge_stove_no=b.judge_stove_no);
commit;
insert into TAB_RPT_LS_DC(processcode, area, area_code, dept, dept_code, pline_name, pline_code,heat_plan_no,judge_stove_no,
create_time, bj_time, dc_hours, dc_days, kf, kfsm, planstatus ,orderno,createtime,SPEC_NAME ,STEELNAME,PRODUCNAME,MODEL_DESC
,PLN_OUTSINGLE_NUM,PLN_OUTSINGLE_W,qz)
select processcode, area, area_code, dept, dept_code, pline_name, pline_code,heat_plan_no,judge_stove_no,
create_time, bj_time, dc_hours, dc_days, 0 as kf, kfsm, planstatus ,orderno,createtime,SPEC_NAME ,STEELNAME,PRODUCNAME,MODEL_DESC
,PLN_OUTSINGLE_NUM,PLN_OUTSINGLE_W,qz
from TAB_RPT_temp_LS_DC a
where not exists (select 1 from TAB_RPT_LS_DC b
where to_char(a.createtime,'yyyy-MM-dd')=to_char(b.createtime,'yyyy-MM-dd')
and a.processcode=b.processcode and a.pline_code=b.pline_code
and a.heat_plan_no=b.heat_plan_no and a.judge_stove_no=b.judge_stove_no);
commit;
end;
]]>
0 and to_char(a.createtime,'yyyy-MM-dd')=to_char(sysdate,'yyyy-MM-dd')
and not exists (select 1 from TAB_RPT_temp_LS_QX b
where to_char(a.createtime,'yyyy-MM-dd')=to_char(b.createtime,'yyyy-MM-dd')
and a.processcode=b.processcode and a.pline_code=b.pline_code
and (a.heat_plan_no is null and b.heat_plan_no is null or a.heat_plan_no=b.heat_plan_no) and a.judge_stove_no=b.judge_stove_no);
commit;
delete from TAB_RPT_LS_QX a
where a.kf=0 and to_char(a.createtime,'yyyy-MM-dd')=to_char(sysdate,'yyyy-MM-dd')
and not exists (select 1 from TAB_RPT_temp_LS_QX b
where b.kf>0 and to_char(a.createtime,'yyyy-MM-dd')=to_char(b.createtime,'yyyy-MM-dd')
and a.processcode=b.processcode and a.pline_code=b.pline_code
and (a.heat_plan_no is null and b.heat_plan_no is null or a.heat_plan_no=b.heat_plan_no) and a.judge_stove_no=b.judge_stove_no);
commit;
insert into TAB_RPT_LS_QX (processcode, area, area_code, dept, dept_code, pline_name, pline_code, heat_plan_no, judge_stove_no, batch_no,
minfeed_time, maxfeed_time, minfx_time, maxfx_time, bj_time, dc_hours, dc_days, dc_hours_xz, dc_days_xz,
kf, kfsm, zxz, orderno, nowork_times_days, nowork_times, nowork_days,
nowork_days_all, nowork_times_days_desc, nowork_times_desc, nowork_days_desc,createtime,qz,feed_heat_no)
select processcode, area, area_code, dept, dept_code, pline_name, pline_code, heat_plan_no, judge_stove_no, batch_no,
minfeed_time, maxfeed_time, minfx_time, maxfx_time, bj_time, dc_hours, dc_days, dc_hours_xz, dc_days_xz,
0 as kf, kfsm, zxz, orderno, nowork_times_days, nowork_times, nowork_days,
nowork_days_all, nowork_times_days_desc, nowork_times_desc, nowork_days_desc,createtime,qz,feed_heat_no
from TAB_RPT_temp_LS_QX a
where not exists (select 1 from TAB_RPT_LS_QX b
where to_char(a.createtime,'yyyy-MM-dd')=to_char(b.createtime,'yyyy-MM-dd')
and a.processcode=b.processcode and a.pline_code=b.pline_code
and (a.heat_plan_no is null and b.heat_plan_no is null or a.heat_plan_no=b.heat_plan_no) and a.judge_stove_no=b.judge_stove_no);
commit;
end;
]]>
0 and to_char(a.createtime,'yyyy-MM-dd')=to_char(sysdate,'yyyy-MM-dd')
and not exists (select 1 from TAB_RPT_temp_LS_DP b
where b.sign='DSP' and to_char(a.createtime,'yyyy-MM-dd')=to_char(b.createtime,'yyyy-MM-dd')
and a.processcode=b.processcode and a.pline_code=b.pline_code
and (a.heat_plan_no is null and b.heat_plan_no is null or a.heat_plan_no=b.heat_plan_no) and a.judge_stove_no=b.judge_stove_no);
commit;
delete from TAB_RPT_LS_DP a
where sign='DSP' and a.kf=0 and to_char(a.createtime,'yyyy-MM-dd')=to_char(sysdate,'yyyy-MM-dd')
and not exists (select 1 from TAB_RPT_temp_LS_DP b
where b.sign='DSP' and b.kf>0 and to_char(a.createtime,'yyyy-MM-dd')=to_char(b.createtime,'yyyy-MM-dd')
and a.processcode=b.processcode and a.pline_code=b.pline_code
and (a.heat_plan_no is null and b.heat_plan_no is null or a.heat_plan_no=b.heat_plan_no) and a.judge_stove_no=b.judge_stove_no);
commit;
insert into TAB_RPT_LS_DP (sign,processcode, area, area_code, dept, dept_code, pline_name, pline_code, heat_plan_no, judge_stove_no, batch_no,
minin_time, maxin_time, minsp_time, maxsp_time,minpd_time,maxpd_time, bj_time, dc_hours, dc_days, kf, kfsm, dspz, orderno,createtime,qz)
select sign,processcode, area, area_code, dept, dept_code, pline_name, pline_code, heat_plan_no, judge_stove_no, batch_no,
minin_time, maxin_time, minsp_time, maxsp_time,minpd_time,maxpd_time, bj_time, dc_hours, dc_days, 0 as kf, kfsm, dspz, orderno,createtime,qz
from TAB_RPT_temp_LS_DP a
where a.sign='DSP' and not exists (select 1 from TAB_RPT_LS_DP b
where b.sign='DSP' and to_char(a.createtime,'yyyy-MM-dd')=to_char(b.createtime,'yyyy-MM-dd')
and a.processcode=b.processcode and a.pline_code=b.pline_code
and (a.heat_plan_no is null and b.heat_plan_no is null or a.heat_plan_no=b.heat_plan_no) and a.judge_stove_no=b.judge_stove_no);
commit;
end;
]]>
0 and to_char(a.createtime,'yyyy-MM-dd')=to_char(sysdate,'yyyy-MM-dd')
and not exists (select 1 from TAB_RPT_temp_LS_DP b
where b.sign='DPD' and to_char(a.createtime,'yyyy-MM-dd')=to_char(b.createtime,'yyyy-MM-dd')
and a.processcode=b.processcode and a.pline_code=b.pline_code
and (a.heat_plan_no is null and b.heat_plan_no is null or a.heat_plan_no=b.heat_plan_no) and a.judge_stove_no=b.judge_stove_no);
commit;
delete from TAB_RPT_LS_DP a
where sign='DPD' and a.kf=0 and to_char(a.createtime,'yyyy-MM-dd')=to_char(sysdate,'yyyy-MM-dd')
and not exists (select 1 from TAB_RPT_temp_LS_DP b
where b.sign='DPD' and b.kf>0 and to_char(a.createtime,'yyyy-MM-dd')=to_char(b.createtime,'yyyy-MM-dd')
and a.processcode=b.processcode and a.pline_code=b.pline_code
and (a.heat_plan_no is null and b.heat_plan_no is null or a.heat_plan_no=b.heat_plan_no) and a.judge_stove_no=b.judge_stove_no);
commit;
insert into TAB_RPT_LS_DP (sign,processcode, area, area_code, dept, dept_code, pline_name, pline_code, heat_plan_no, judge_stove_no, batch_no,
minin_time, maxin_time, minsp_time, maxsp_time,minpd_time,maxpd_time, bj_time, dc_hours, dc_days, kf, kfsm, dspz, orderno,createtime,qz)
select sign,processcode, area, area_code, dept, dept_code, pline_name, pline_code, heat_plan_no, judge_stove_no, batch_no,
minin_time, maxin_time, minsp_time, maxsp_time,minpd_time,maxpd_time, bj_time, dc_hours, dc_days, 0 as kf, kfsm, dspz, orderno,createtime,qz
from TAB_RPT_temp_LS_DP a
where a.sign='DPD' and not exists (select 1 from TAB_RPT_LS_DP b
where b.sign='DPD' and to_char(a.createtime,'yyyy-MM-dd')=to_char(b.createtime,'yyyy-MM-dd')
and a.processcode=b.processcode and a.pline_code=b.pline_code
and (a.heat_plan_no is null and b.heat_plan_no is null or a.heat_plan_no=b.heat_plan_no) and a.judge_stove_no=b.judge_stove_no);
commit;
end;
]]>
0 and to_char(a.createtime,'yyyy-MM-dd')=to_char(sysdate,'yyyy-MM-dd')
and not exists (select 1 from TAB_RPT_temp_LS_LX b
where b.sign='LXWT' and to_char(a.createtime,'yyyy-MM-dd')=to_char(b.createtime,'yyyy-MM-dd')
and a.processcode=b.processcode and a.pline_code=b.pline_code
and (a.heat_plan_no is null and b.heat_plan_no is null or a.heat_plan_no=b.heat_plan_no) and a.judge_stove_no=b.judge_stove_no);
commit;
delete from TAB_RPT_LS_LX a
where sign='LXWT' and a.kf=0 and to_char(a.createtime,'yyyy-MM-dd')=to_char(sysdate,'yyyy-MM-dd')
and not exists (select 1 from TAB_RPT_temp_LS_LX b
where b.sign='LXWT' and b.kf>0 and to_char(a.createtime,'yyyy-MM-dd')=to_char(b.createtime,'yyyy-MM-dd')
and a.processcode=b.processcode and a.pline_code=b.pline_code
and (a.heat_plan_no is null and b.heat_plan_no is null or a.heat_plan_no=b.heat_plan_no) and a.judge_stove_no=b.judge_stove_no);
commit;
insert into TAB_RPT_LS_LX (sign,processcode, area, area_code, dept, dept_code, pline_name, pline_code, heat_plan_no, judge_stove_no,batch_no,
minoffline_time, maxoffline_time, minwg_time,maxwg_time,bj_time, dc_hours, dc_days, kf, kfsm, lxz, wgz, orderno,jcx,createtime,qz)
select sign,processcode, area, area_code, dept, dept_code, pline_name, pline_code, heat_plan_no, judge_stove_no,batch_no,
minoffline_time, maxoffline_time, minwg_time,maxwg_time,bj_time, dc_hours, dc_days,0 as kf, kfsm, lxz, wgz, orderno,jcx,createtime,qz
from TAB_RPT_temp_LS_LX a
where a.sign='LXWT' and not exists (select 1 from TAB_RPT_LS_LX b
where b.sign='LXWT' and to_char(a.createtime,'yyyy-MM-dd')=to_char(b.createtime,'yyyy-MM-dd')
and a.processcode=b.processcode and a.pline_code=b.pline_code
and (a.heat_plan_no is null and b.heat_plan_no is null or a.heat_plan_no=b.heat_plan_no) and a.judge_stove_no=b.judge_stove_no);
commit;
end;
]]>
0 and to_char(a.createtime,'yyyy-MM-dd')=to_char(sysdate,'yyyy-MM-dd')
and not exists (select 1 from TAB_RPT_temp_LS_LX b
where b.sign='LXFX' and to_char(a.createtime,'yyyy-MM-dd')=to_char(b.createtime,'yyyy-MM-dd')
and a.processcode=b.processcode and a.pline_code=b.pline_code
and (a.heat_plan_no is null and b.heat_plan_no is null or a.heat_plan_no=b.heat_plan_no) and a.judge_stove_no=b.judge_stove_no);
commit;
delete from TAB_RPT_LS_LX a
where sign='LXFX' and a.kf=0 and to_char(a.createtime,'yyyy-MM-dd')=to_char(sysdate,'yyyy-MM-dd')
and not exists (select 1 from TAB_RPT_temp_LS_LX b
where b.sign='LXFX' and b.kf>0 and to_char(a.createtime,'yyyy-MM-dd')=to_char(b.createtime,'yyyy-MM-dd')
and a.processcode=b.processcode and a.pline_code=b.pline_code
and (a.heat_plan_no is null and b.heat_plan_no is null or a.heat_plan_no=b.heat_plan_no) and a.judge_stove_no=b.judge_stove_no);
commit;
insert into TAB_RPT_LS_LX(sign,processcode, area, area_code, dept, dept_code, pline_name, pline_code, heat_plan_no, judge_stove_no,batch_no,
minoffline_time, maxoffline_time, minwg_time,maxwg_time,bj_time, dc_hours, dc_days, kf, kfsm, lxz, wgz, orderno,jcx,createtime,qz)
select sign,processcode, area, area_code, dept, dept_code, pline_name, pline_code, heat_plan_no, judge_stove_no,batch_no,
minoffline_time, maxoffline_time, minwg_time,maxwg_time,bj_time, dc_hours, dc_days,0 as kf,kfsm, lxz, wgz, orderno,jcx,createtime,qz
from TAB_RPT_temp_LS_LX a
where a.sign='LXFX' and not exists (select 1 from TAB_RPT_LS_LX b
where b.sign='LXFX' and to_char(a.createtime,'yyyy-MM-dd')=to_char(b.createtime,'yyyy-MM-dd')
and a.processcode=b.processcode and a.pline_code=b.pline_code
and (a.heat_plan_no is null and b.heat_plan_no is null or a.heat_plan_no=b.heat_plan_no) and a.judge_stove_no=b.judge_stove_no);
commit;
end;
]]>
0 and to_char(a.createtime,'yyyy-MM-dd')=to_char(sysdate,'yyyy-MM-dd')
and not exists (select 1 from TAB_RPT_temp_LS_FP b
where to_char(a.createtime,'yyyy-MM-dd')=to_char(b.createtime,'yyyy-MM-dd')
and a.processcode=b.processcode and a.pline_code=b.pline_code
and (a.heat_plan_no is null and b.heat_plan_no is null or a.heat_plan_no=b.heat_plan_no) and a.judge_stove_no=b.judge_stove_no);
commit;
delete from TAB_RPT_LS_FP a
where a.kf=0 and to_char(a.createtime,'yyyy-MM-dd')=to_char(sysdate,'yyyy-MM-dd')
and not exists (select 1 from TAB_RPT_temp_LS_FP b
where b.kf>0 and to_char(a.createtime,'yyyy-MM-dd')=to_char(b.createtime,'yyyy-MM-dd')
and a.processcode=b.processcode and a.pline_code=b.pline_code
and (a.heat_plan_no is null and b.heat_plan_no is null or a.heat_plan_no=b.heat_plan_no) and a.judge_stove_no=b.judge_stove_no);
commit;
insert into TAB_RPT_LS_FP(processcode,area, area_code, dept, dept_code, pline_name, pline_code, heat_plan_no, judge_stove_no, batch_no,
minin_time, maxin_time, bj_time, dc_hours, dc_days, kf, kfsm, wsqz, orderno,createtime,qz)
select processcode,area, area_code, dept, dept_code, pline_name, pline_code, heat_plan_no, judge_stove_no, batch_no,
minin_time, maxin_time, bj_time, dc_hours, dc_days,0 as kf, kfsm, wsqz, orderno,createtime,qz
from TAB_RPT_temp_LS_FP a
where not exists (select 1 from TAB_RPT_LS_FP b
where to_char(a.createtime,'yyyy-MM-dd')=to_char(b.createtime,'yyyy-MM-dd')
and a.processcode=b.processcode and a.pline_code=b.pline_code
and (a.heat_plan_no is null and b.heat_plan_no is null or a.heat_plan_no=b.heat_plan_no) and a.judge_stove_no=b.judge_stove_no);
commit;
end;
]]>
2 then 'N+n'
END as 排产年月
from PLN_ORDER_ZG_S d
inner join (select ORD_LN_DLY_PK,PLN_DIVIDE_ID,GROUP_JGX,GROUP_RCL,PLAN_TOT_LEN_D,PLANSTATUS,PRIORITY,PRIORITY_MEMO,PROC_DESC_C_RCL
,BJ_TYPE,ABC,VERSION_NO,GRADECODE_ALL,ISSUED_TIME,ISSUED_MAN
from PLN_SALEORD_PROC where to_date(substr(VERSION_NO,0,8),'yyyyMMdd')'备料需求' and d.EXE_STATUS<'3'
]]>