| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281 |
- <?xml version="1.0" encoding='UTF-8'?>
- <queryMap desc="班产">
- <query id="UIC020220_01.SELECT" desc="热轧班产">
- <![CDATA[
- select to_char(to_date(t3.TIME_SLOT,'yyyymmdd:hh24'),'yyyymmdd-hh24') TIME_SLOT,
- t3.BLOCKS,
- t3.WEIGHT,
- t3.BREAKDOWN_TIME,
- case
- when 3600 - t3.BREAKDOWN_TIME = 0 then
- 0
- else
- round(t3.WEIGHT / ((3600 - t3.BREAKDOWN_TIME) / 3600), 2)
- end HOUR_YIELD,
- case
- when 3600 - t3.BREAKDOWN_TIME = 0 then
- 0
- else
- round(((3600 - t3.BREAKDOWN_TIME)/t3.BLOCKS ), 2)
- end AVERAGE_RHYTHM
- from (select substr(t2.MILL_DTIME, 0, 10) TIME_SLOT,
- count(*) BLOCKS,
- sum(t2.ACT_WGT) / 1000 WEIGHT,
- round(to_char((sum(t2.k) * 86400) + sum(t2.sjc))) BREAKDOWN_TIME
- from (select t1.MILL_DTIME,
- t1.MILL_DTIME2,
- t1.leadd,
- t1.lagg,
- case
- when to_date(t1.leadd, 'YYYYMMDDHH24MISS') -
- to_date(t1.MILL_DTIME2, 'YYYYMMDDHH24MISS') > 0 and
- ((to_date(t1.MILL_DTIME2, 'YYYYMMDDHH24MISS') -
- to_date(t1.MILL_DTIME, 'YYYYMMDDHH24MISS')) +
- (to_date(t1.Leadd, 'YYYYMMDDHH24MISS') -
- to_date(t1.MILL_DTIME2, 'YYYYMMDDHH24MISS'))) *
- 86400 > 180 and t1.leadd is not null then
- to_date(t1.MILL_DTIME2, 'YYYYMMDDHH24MISS') -
- to_date(t1.MILL_DTIME, 'YYYYMMDDHH24MISS')
- when (to_date(t1.MILL_DTIME2, 'YYYYMMDDHH24MISS') -
- to_date(t1.Lagg, 'YYYYMMDDHH24MISS')) * 86400 >
- 3600.1 and
- (to_date(t1.MILL_DTIME, 'YYYYMMDDHH24MISS') -
- to_date(t1.Lagg, 'YYYYMMDDHH24MISS')) * 86400 > 180 then
- to_date(t1.MILL_DTIME, 'YYYYMMDDHH24MISS') -
- (to_date(t1.MILL_DTIME2, 'YYYYMMDDHH24MISS') -
- numtodsinterval(1, 'hour'))
- when t1.leadd is null and
- (to_date(t1.MILL_DTIME2, 'YYYYMMDDHH24MISS') -
- to_date(t1.MILL_DTIME, 'YYYYMMDDHH24MISS')) *
- 86400 > 180 then
- to_date(t1.MILL_DTIME2, 'YYYYMMDDHH24MISS') -
- to_date(t1.MILL_DTIME, 'YYYYMMDDHH24MISS')
- when t1.lagg is null and
- (to_date(t1.MILL_DTIME, 'YYYYMMDDHH24MISS') -
- (to_date(t1.MILL_DTIME2, 'YYYYMMDDHH24MISS') -
- numtodsinterval(1, 'hour'))) * 86400 > 180 then
- to_date(t1.MILL_DTIME, 'YYYYMMDDHH24MISS') -
- (to_date(t1.MILL_DTIME2, 'YYYYMMDDHH24MISS') -
- numtodsinterval(1, 'hour'))
- else
- 0
- end k,
- case
- when substr(t1.Leadd, 0, 10) =
- substr(t1.MILL_DTIME, 0, 10) and
- (to_date(t1.Leadd, 'YYYYMMDDHH24MISS') -
- to_date(t1.MILL_DTIME, 'YYYYMMDDHH24MISS')) *
- 86400 > 180 then
- (to_date(t1.Leadd, 'YYYYMMDDHH24MISS') -
- to_date(t1.MILL_DTIME, 'YYYYMMDDHH24MISS')) * 86400
- else
- 0
- end sjc,
- t1.ACT_WGT
- from (select t.MILL_DTIME,
- substr(to_char(to_date(t.MILL_DTIME,
- 'YYYYMMDDHH24MISS') +
- numtodsinterval(1, 'hour'),
- 'YYYYMMDDHH24MISS'),
- 0,
- 10) || '0000' MILL_DTIME2,
- Lead(t.MILL_DTIME) OVER(ORDER BY t.MILL_DTIME) leadd,
- lag(t.MILL_DTIME) OVER(ORDER BY t.MILL_DTIME) lagg,
- t.ACT_WGT
- from tbh02_coil_comm t
- where substr(t.MILL_DTIME,0,8) between ? and ?
- ORDER BY t.MILL_DTIME) t1) t2
- group by substr(t2.MILL_DTIME, 0, 10)
- order by substr(t2.MILL_DTIME, 0, 10)) t3
- ]]>
- </query>
- <query id="UIC020220_02.SELECT" desc="连退班产">
- <![CDATA[
- select to_char(to_date(t3.TIME_SLOT,'yyyymmdd:hh24'),'yyyymmdd-hh24') TIME_SLOT,
- t3.BLOCKS,
- t3.WEIGHT,
- t3.BREAKDOWN_TIME,
- case
- when 3600 - t3.BREAKDOWN_TIME = 0 then
- 0
- else
- round(t3.WEIGHT / ((3600 - t3.BREAKDOWN_TIME) / 3600), 2)
- end HOUR_YIELD,
- case
- when 3600 - t3.BREAKDOWN_TIME = 0 then
- 0
- else
- round(((3600 - t3.BREAKDOWN_TIME)/t3.BLOCKS ), 2)
- end AVERAGE_RHYTHM
- from (select substr(t2.MILL_DTIME, 0, 10) TIME_SLOT,
- count(*) BLOCKS,
- sum(t2.ACT_WGT) / 1000 WEIGHT,
- round(to_char((sum(t2.k) * 86400) + sum(t2.sjc))) BREAKDOWN_TIME
- from (select t1.MILL_DTIME,
- t1.MILL_DTIME2,
- t1.leadd,
- t1.lagg,
- case
- when to_date(t1.leadd, 'YYYYMMDDHH24MISS') -
- to_date(t1.MILL_DTIME2, 'YYYYMMDDHH24MISS') > 0 and
- ((to_date(t1.MILL_DTIME2, 'YYYYMMDDHH24MISS') -
- to_date(t1.MILL_DTIME, 'YYYYMMDDHH24MISS')) +
- (to_date(t1.Leadd, 'YYYYMMDDHH24MISS') -
- to_date(t1.MILL_DTIME2, 'YYYYMMDDHH24MISS'))) *
- 86400 > 180 and t1.leadd is not null then
- to_date(t1.MILL_DTIME2, 'YYYYMMDDHH24MISS') -
- to_date(t1.MILL_DTIME, 'YYYYMMDDHH24MISS')
- when (to_date(t1.MILL_DTIME2, 'YYYYMMDDHH24MISS') -
- to_date(t1.Lagg, 'YYYYMMDDHH24MISS')) * 86400 >
- 3600.1 and
- (to_date(t1.MILL_DTIME, 'YYYYMMDDHH24MISS') -
- to_date(t1.Lagg, 'YYYYMMDDHH24MISS')) * 86400 > 180 then
- to_date(t1.MILL_DTIME, 'YYYYMMDDHH24MISS') -
- (to_date(t1.MILL_DTIME2, 'YYYYMMDDHH24MISS') -
- numtodsinterval(1, 'hour'))
- when t1.leadd is null and
- (to_date(t1.MILL_DTIME2, 'YYYYMMDDHH24MISS') -
- to_date(t1.MILL_DTIME, 'YYYYMMDDHH24MISS')) *
- 86400 > 180 then
- to_date(t1.MILL_DTIME2, 'YYYYMMDDHH24MISS') -
- to_date(t1.MILL_DTIME, 'YYYYMMDDHH24MISS')
- when t1.lagg is null and
- (to_date(t1.MILL_DTIME, 'YYYYMMDDHH24MISS') -
- (to_date(t1.MILL_DTIME2, 'YYYYMMDDHH24MISS') -
- numtodsinterval(1, 'hour'))) * 86400 > 180 then
- to_date(t1.MILL_DTIME, 'YYYYMMDDHH24MISS') -
- (to_date(t1.MILL_DTIME2, 'YYYYMMDDHH24MISS') -
- numtodsinterval(1, 'hour'))
- else
- 0
- end k,
- case
- when substr(t1.Leadd, 0, 10) =
- substr(t1.MILL_DTIME, 0, 10) and
- (to_date(t1.Leadd, 'YYYYMMDDHH24MISS') -
- to_date(t1.MILL_DTIME, 'YYYYMMDDHH24MISS')) *
- 86400 > 180 then
- (to_date(t1.Leadd, 'YYYYMMDDHH24MISS') -
- to_date(t1.MILL_DTIME, 'YYYYMMDDHH24MISS')) * 86400
- else
- 0
- end sjc,
- t1.ACT_WGT
- from (select t.MILL_DTIME,
- substr(to_char(to_date(t.MILL_DTIME,
- 'YYYYMMDDHH24MISS') +
- numtodsinterval(1, 'hour'),
- 'YYYYMMDDHH24MISS'),
- 0,
- 10) || '0000' MILL_DTIME2,
- Lead(t.MILL_DTIME) OVER(ORDER BY t.MILL_DTIME) leadd,
- lag(t.MILL_DTIME) OVER(ORDER BY t.MILL_DTIME) lagg,
- t.ACT_WGT
- from C_TBC02_COIL_COMM t
- where t.LINE_TP = 'L'
- and t.COIL_STAT in ('2', '3')
- and t.DIVIDE_YN not in ('X', 'Y')
- and substr(t.MILL_DTIME,0,8) between ? and ?
- ORDER BY t.MILL_DTIME) t1) t2
- group by substr(t2.MILL_DTIME, 0, 10)
- order by substr(t2.MILL_DTIME, 0, 10)) t3
-
- ]]>
- </query>
- <query id="UIC020220_03.SELECT" desc="酸扎班产">
- <![CDATA[
- select to_char(to_date(t3.TIME_SLOT,'yyyymmdd:hh24'),'yyyymmdd-hh24') TIME_SLOT,
- t3.BLOCKS,
- t3.WEIGHT,
- t3.BREAKDOWN_TIME,
- case
- when 3600 - t3.BREAKDOWN_TIME = 0 then
- 0
- else
- round(t3.WEIGHT / ((3600 - t3.BREAKDOWN_TIME) / 3600), 2)
- end HOUR_YIELD,
- case
- when 3600 - t3.BREAKDOWN_TIME = 0 then
- 0
- else
- round(((3600 - t3.BREAKDOWN_TIME)/t3.BLOCKS ), 2)
- end AVERAGE_RHYTHM
- from (select substr(t2.MILL_DTIME, 0, 10) TIME_SLOT,
- count(*) BLOCKS,
- sum(t2.ACT_WGT) / 1000 WEIGHT,
- round(to_char((sum(t2.k) * 86400) + sum(t2.sjc))) BREAKDOWN_TIME
- from (select t1.MILL_DTIME,
- t1.MILL_DTIME2,
- t1.leadd,
- t1.lagg,
- case
- when to_date(t1.leadd, 'YYYYMMDDHH24MISS') -
- to_date(t1.MILL_DTIME2, 'YYYYMMDDHH24MISS') > 0 and
- ((to_date(t1.MILL_DTIME2, 'YYYYMMDDHH24MISS') -
- to_date(t1.MILL_DTIME, 'YYYYMMDDHH24MISS')) +
- (to_date(t1.Leadd, 'YYYYMMDDHH24MISS') -
- to_date(t1.MILL_DTIME2, 'YYYYMMDDHH24MISS'))) *
- 86400 > 180 and t1.leadd is not null then
- to_date(t1.MILL_DTIME2, 'YYYYMMDDHH24MISS') -
- to_date(t1.MILL_DTIME, 'YYYYMMDDHH24MISS')
- when (to_date(t1.MILL_DTIME2, 'YYYYMMDDHH24MISS') -
- to_date(t1.Lagg, 'YYYYMMDDHH24MISS')) * 86400 >
- 3600.1 and
- (to_date(t1.MILL_DTIME, 'YYYYMMDDHH24MISS') -
- to_date(t1.Lagg, 'YYYYMMDDHH24MISS')) * 86400 > 180 then
- to_date(t1.MILL_DTIME, 'YYYYMMDDHH24MISS') -
- (to_date(t1.MILL_DTIME2, 'YYYYMMDDHH24MISS') -
- numtodsinterval(1, 'hour'))
- when t1.leadd is null and
- (to_date(t1.MILL_DTIME2, 'YYYYMMDDHH24MISS') -
- to_date(t1.MILL_DTIME, 'YYYYMMDDHH24MISS')) *
- 86400 > 180 then
- to_date(t1.MILL_DTIME2, 'YYYYMMDDHH24MISS') -
- to_date(t1.MILL_DTIME, 'YYYYMMDDHH24MISS')
- when t1.lagg is null and
- (to_date(t1.MILL_DTIME, 'YYYYMMDDHH24MISS') -
- (to_date(t1.MILL_DTIME2, 'YYYYMMDDHH24MISS') -
- numtodsinterval(1, 'hour'))) * 86400 > 180 then
- to_date(t1.MILL_DTIME, 'YYYYMMDDHH24MISS') -
- (to_date(t1.MILL_DTIME2, 'YYYYMMDDHH24MISS') -
- numtodsinterval(1, 'hour'))
- else
- 0
- end k,
- case
- when substr(t1.Leadd, 0, 10) =
- substr(t1.MILL_DTIME, 0, 10) and
- (to_date(t1.Leadd, 'YYYYMMDDHH24MISS') -
- to_date(t1.MILL_DTIME, 'YYYYMMDDHH24MISS')) *
- 86400 > 180 then
- (to_date(t1.Leadd, 'YYYYMMDDHH24MISS') -
- to_date(t1.MILL_DTIME, 'YYYYMMDDHH24MISS')) * 86400
- else
- 0
- end sjc,
- t1.ACT_WGT
- from (select t.MILL_DTIME,
- substr(to_char(to_date(t.MILL_DTIME,
- 'YYYYMMDDHH24MISS') +
- numtodsinterval(1, 'hour'),
- 'YYYYMMDDHH24MISS'),
- 0,
- 10) || '0000' MILL_DTIME2,
- Lead(t.MILL_DTIME) OVER(ORDER BY t.MILL_DTIME) leadd,
- lag(t.MILL_DTIME) OVER(ORDER BY t.MILL_DTIME) lagg,
- t.ACT_WGT
- from C_TBL02_COIL_COMM t
- where substr(t.MILL_DTIME,0,8) between ? and ?
- ORDER BY t.MILL_DTIME) t1) t2
- group by substr(t2.MILL_DTIME, 0, 10)
- order by substr(t2.MILL_DTIME, 0, 10)) t3
-
- ]]>
- </query>
- </queryMap>
|