257a237d4da71c55147a9c9d1f3da0996935743b.svn-base 14 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281
  1. <?xml version="1.0" encoding='UTF-8'?>
  2. <queryMap desc="班产">
  3. <query id="UIC020220_01.SELECT" desc="热轧班产">
  4. <![CDATA[
  5. select to_char(to_date(t3.TIME_SLOT,'yyyymmdd:hh24'),'yyyymmdd-hh24') TIME_SLOT,
  6. t3.BLOCKS,
  7. t3.WEIGHT,
  8. t3.BREAKDOWN_TIME,
  9. case
  10. when 3600 - t3.BREAKDOWN_TIME = 0 then
  11. 0
  12. else
  13. round(t3.WEIGHT / ((3600 - t3.BREAKDOWN_TIME) / 3600), 2)
  14. end HOUR_YIELD,
  15. case
  16. when 3600 - t3.BREAKDOWN_TIME = 0 then
  17. 0
  18. else
  19. round(((3600 - t3.BREAKDOWN_TIME)/t3.BLOCKS ), 2)
  20. end AVERAGE_RHYTHM
  21. from (select substr(t2.MILL_DTIME, 0, 10) TIME_SLOT,
  22. count(*) BLOCKS,
  23. sum(t2.ACT_WGT) / 1000 WEIGHT,
  24. round(to_char((sum(t2.k) * 86400) + sum(t2.sjc))) BREAKDOWN_TIME
  25. from (select t1.MILL_DTIME,
  26. t1.MILL_DTIME2,
  27. t1.leadd,
  28. t1.lagg,
  29. case
  30. when to_date(t1.leadd, 'YYYYMMDDHH24MISS') -
  31. to_date(t1.MILL_DTIME2, 'YYYYMMDDHH24MISS') > 0 and
  32. ((to_date(t1.MILL_DTIME2, 'YYYYMMDDHH24MISS') -
  33. to_date(t1.MILL_DTIME, 'YYYYMMDDHH24MISS')) +
  34. (to_date(t1.Leadd, 'YYYYMMDDHH24MISS') -
  35. to_date(t1.MILL_DTIME2, 'YYYYMMDDHH24MISS'))) *
  36. 86400 > 180 and t1.leadd is not null then
  37. to_date(t1.MILL_DTIME2, 'YYYYMMDDHH24MISS') -
  38. to_date(t1.MILL_DTIME, 'YYYYMMDDHH24MISS')
  39. when (to_date(t1.MILL_DTIME2, 'YYYYMMDDHH24MISS') -
  40. to_date(t1.Lagg, 'YYYYMMDDHH24MISS')) * 86400 >
  41. 3600.1 and
  42. (to_date(t1.MILL_DTIME, 'YYYYMMDDHH24MISS') -
  43. to_date(t1.Lagg, 'YYYYMMDDHH24MISS')) * 86400 > 180 then
  44. to_date(t1.MILL_DTIME, 'YYYYMMDDHH24MISS') -
  45. (to_date(t1.MILL_DTIME2, 'YYYYMMDDHH24MISS') -
  46. numtodsinterval(1, 'hour'))
  47. when t1.leadd is null and
  48. (to_date(t1.MILL_DTIME2, 'YYYYMMDDHH24MISS') -
  49. to_date(t1.MILL_DTIME, 'YYYYMMDDHH24MISS')) *
  50. 86400 > 180 then
  51. to_date(t1.MILL_DTIME2, 'YYYYMMDDHH24MISS') -
  52. to_date(t1.MILL_DTIME, 'YYYYMMDDHH24MISS')
  53. when t1.lagg is null and
  54. (to_date(t1.MILL_DTIME, 'YYYYMMDDHH24MISS') -
  55. (to_date(t1.MILL_DTIME2, 'YYYYMMDDHH24MISS') -
  56. numtodsinterval(1, 'hour'))) * 86400 > 180 then
  57. to_date(t1.MILL_DTIME, 'YYYYMMDDHH24MISS') -
  58. (to_date(t1.MILL_DTIME2, 'YYYYMMDDHH24MISS') -
  59. numtodsinterval(1, 'hour'))
  60. else
  61. 0
  62. end k,
  63. case
  64. when substr(t1.Leadd, 0, 10) =
  65. substr(t1.MILL_DTIME, 0, 10) and
  66. (to_date(t1.Leadd, 'YYYYMMDDHH24MISS') -
  67. to_date(t1.MILL_DTIME, 'YYYYMMDDHH24MISS')) *
  68. 86400 > 180 then
  69. (to_date(t1.Leadd, 'YYYYMMDDHH24MISS') -
  70. to_date(t1.MILL_DTIME, 'YYYYMMDDHH24MISS')) * 86400
  71. else
  72. 0
  73. end sjc,
  74. t1.ACT_WGT
  75. from (select t.MILL_DTIME,
  76. substr(to_char(to_date(t.MILL_DTIME,
  77. 'YYYYMMDDHH24MISS') +
  78. numtodsinterval(1, 'hour'),
  79. 'YYYYMMDDHH24MISS'),
  80. 0,
  81. 10) || '0000' MILL_DTIME2,
  82. Lead(t.MILL_DTIME) OVER(ORDER BY t.MILL_DTIME) leadd,
  83. lag(t.MILL_DTIME) OVER(ORDER BY t.MILL_DTIME) lagg,
  84. t.ACT_WGT
  85. from tbh02_coil_comm t
  86. where substr(t.MILL_DTIME,0,8) between ? and ?
  87. ORDER BY t.MILL_DTIME) t1) t2
  88. group by substr(t2.MILL_DTIME, 0, 10)
  89. order by substr(t2.MILL_DTIME, 0, 10)) t3
  90. ]]>
  91. </query>
  92. <query id="UIC020220_02.SELECT" desc="连退班产">
  93. <![CDATA[
  94. select to_char(to_date(t3.TIME_SLOT,'yyyymmdd:hh24'),'yyyymmdd-hh24') TIME_SLOT,
  95. t3.BLOCKS,
  96. t3.WEIGHT,
  97. t3.BREAKDOWN_TIME,
  98. case
  99. when 3600 - t3.BREAKDOWN_TIME = 0 then
  100. 0
  101. else
  102. round(t3.WEIGHT / ((3600 - t3.BREAKDOWN_TIME) / 3600), 2)
  103. end HOUR_YIELD,
  104. case
  105. when 3600 - t3.BREAKDOWN_TIME = 0 then
  106. 0
  107. else
  108. round(((3600 - t3.BREAKDOWN_TIME)/t3.BLOCKS ), 2)
  109. end AVERAGE_RHYTHM
  110. from (select substr(t2.MILL_DTIME, 0, 10) TIME_SLOT,
  111. count(*) BLOCKS,
  112. sum(t2.ACT_WGT) / 1000 WEIGHT,
  113. round(to_char((sum(t2.k) * 86400) + sum(t2.sjc))) BREAKDOWN_TIME
  114. from (select t1.MILL_DTIME,
  115. t1.MILL_DTIME2,
  116. t1.leadd,
  117. t1.lagg,
  118. case
  119. when to_date(t1.leadd, 'YYYYMMDDHH24MISS') -
  120. to_date(t1.MILL_DTIME2, 'YYYYMMDDHH24MISS') > 0 and
  121. ((to_date(t1.MILL_DTIME2, 'YYYYMMDDHH24MISS') -
  122. to_date(t1.MILL_DTIME, 'YYYYMMDDHH24MISS')) +
  123. (to_date(t1.Leadd, 'YYYYMMDDHH24MISS') -
  124. to_date(t1.MILL_DTIME2, 'YYYYMMDDHH24MISS'))) *
  125. 86400 > 180 and t1.leadd is not null then
  126. to_date(t1.MILL_DTIME2, 'YYYYMMDDHH24MISS') -
  127. to_date(t1.MILL_DTIME, 'YYYYMMDDHH24MISS')
  128. when (to_date(t1.MILL_DTIME2, 'YYYYMMDDHH24MISS') -
  129. to_date(t1.Lagg, 'YYYYMMDDHH24MISS')) * 86400 >
  130. 3600.1 and
  131. (to_date(t1.MILL_DTIME, 'YYYYMMDDHH24MISS') -
  132. to_date(t1.Lagg, 'YYYYMMDDHH24MISS')) * 86400 > 180 then
  133. to_date(t1.MILL_DTIME, 'YYYYMMDDHH24MISS') -
  134. (to_date(t1.MILL_DTIME2, 'YYYYMMDDHH24MISS') -
  135. numtodsinterval(1, 'hour'))
  136. when t1.leadd is null and
  137. (to_date(t1.MILL_DTIME2, 'YYYYMMDDHH24MISS') -
  138. to_date(t1.MILL_DTIME, 'YYYYMMDDHH24MISS')) *
  139. 86400 > 180 then
  140. to_date(t1.MILL_DTIME2, 'YYYYMMDDHH24MISS') -
  141. to_date(t1.MILL_DTIME, 'YYYYMMDDHH24MISS')
  142. when t1.lagg is null and
  143. (to_date(t1.MILL_DTIME, 'YYYYMMDDHH24MISS') -
  144. (to_date(t1.MILL_DTIME2, 'YYYYMMDDHH24MISS') -
  145. numtodsinterval(1, 'hour'))) * 86400 > 180 then
  146. to_date(t1.MILL_DTIME, 'YYYYMMDDHH24MISS') -
  147. (to_date(t1.MILL_DTIME2, 'YYYYMMDDHH24MISS') -
  148. numtodsinterval(1, 'hour'))
  149. else
  150. 0
  151. end k,
  152. case
  153. when substr(t1.Leadd, 0, 10) =
  154. substr(t1.MILL_DTIME, 0, 10) and
  155. (to_date(t1.Leadd, 'YYYYMMDDHH24MISS') -
  156. to_date(t1.MILL_DTIME, 'YYYYMMDDHH24MISS')) *
  157. 86400 > 180 then
  158. (to_date(t1.Leadd, 'YYYYMMDDHH24MISS') -
  159. to_date(t1.MILL_DTIME, 'YYYYMMDDHH24MISS')) * 86400
  160. else
  161. 0
  162. end sjc,
  163. t1.ACT_WGT
  164. from (select t.MILL_DTIME,
  165. substr(to_char(to_date(t.MILL_DTIME,
  166. 'YYYYMMDDHH24MISS') +
  167. numtodsinterval(1, 'hour'),
  168. 'YYYYMMDDHH24MISS'),
  169. 0,
  170. 10) || '0000' MILL_DTIME2,
  171. Lead(t.MILL_DTIME) OVER(ORDER BY t.MILL_DTIME) leadd,
  172. lag(t.MILL_DTIME) OVER(ORDER BY t.MILL_DTIME) lagg,
  173. t.ACT_WGT
  174. from C_TBC02_COIL_COMM t
  175. where t.LINE_TP = 'L'
  176. and t.COIL_STAT in ('2', '3')
  177. and t.DIVIDE_YN not in ('X', 'Y')
  178. and substr(t.MILL_DTIME,0,8) between ? and ?
  179. ORDER BY t.MILL_DTIME) t1) t2
  180. group by substr(t2.MILL_DTIME, 0, 10)
  181. order by substr(t2.MILL_DTIME, 0, 10)) t3
  182. ]]>
  183. </query>
  184. <query id="UIC020220_03.SELECT" desc="酸扎班产">
  185. <![CDATA[
  186. select to_char(to_date(t3.TIME_SLOT,'yyyymmdd:hh24'),'yyyymmdd-hh24') TIME_SLOT,
  187. t3.BLOCKS,
  188. t3.WEIGHT,
  189. t3.BREAKDOWN_TIME,
  190. case
  191. when 3600 - t3.BREAKDOWN_TIME = 0 then
  192. 0
  193. else
  194. round(t3.WEIGHT / ((3600 - t3.BREAKDOWN_TIME) / 3600), 2)
  195. end HOUR_YIELD,
  196. case
  197. when 3600 - t3.BREAKDOWN_TIME = 0 then
  198. 0
  199. else
  200. round(((3600 - t3.BREAKDOWN_TIME)/t3.BLOCKS ), 2)
  201. end AVERAGE_RHYTHM
  202. from (select substr(t2.MILL_DTIME, 0, 10) TIME_SLOT,
  203. count(*) BLOCKS,
  204. sum(t2.ACT_WGT) / 1000 WEIGHT,
  205. round(to_char((sum(t2.k) * 86400) + sum(t2.sjc))) BREAKDOWN_TIME
  206. from (select t1.MILL_DTIME,
  207. t1.MILL_DTIME2,
  208. t1.leadd,
  209. t1.lagg,
  210. case
  211. when to_date(t1.leadd, 'YYYYMMDDHH24MISS') -
  212. to_date(t1.MILL_DTIME2, 'YYYYMMDDHH24MISS') > 0 and
  213. ((to_date(t1.MILL_DTIME2, 'YYYYMMDDHH24MISS') -
  214. to_date(t1.MILL_DTIME, 'YYYYMMDDHH24MISS')) +
  215. (to_date(t1.Leadd, 'YYYYMMDDHH24MISS') -
  216. to_date(t1.MILL_DTIME2, 'YYYYMMDDHH24MISS'))) *
  217. 86400 > 180 and t1.leadd is not null then
  218. to_date(t1.MILL_DTIME2, 'YYYYMMDDHH24MISS') -
  219. to_date(t1.MILL_DTIME, 'YYYYMMDDHH24MISS')
  220. when (to_date(t1.MILL_DTIME2, 'YYYYMMDDHH24MISS') -
  221. to_date(t1.Lagg, 'YYYYMMDDHH24MISS')) * 86400 >
  222. 3600.1 and
  223. (to_date(t1.MILL_DTIME, 'YYYYMMDDHH24MISS') -
  224. to_date(t1.Lagg, 'YYYYMMDDHH24MISS')) * 86400 > 180 then
  225. to_date(t1.MILL_DTIME, 'YYYYMMDDHH24MISS') -
  226. (to_date(t1.MILL_DTIME2, 'YYYYMMDDHH24MISS') -
  227. numtodsinterval(1, 'hour'))
  228. when t1.leadd is null and
  229. (to_date(t1.MILL_DTIME2, 'YYYYMMDDHH24MISS') -
  230. to_date(t1.MILL_DTIME, 'YYYYMMDDHH24MISS')) *
  231. 86400 > 180 then
  232. to_date(t1.MILL_DTIME2, 'YYYYMMDDHH24MISS') -
  233. to_date(t1.MILL_DTIME, 'YYYYMMDDHH24MISS')
  234. when t1.lagg is null and
  235. (to_date(t1.MILL_DTIME, 'YYYYMMDDHH24MISS') -
  236. (to_date(t1.MILL_DTIME2, 'YYYYMMDDHH24MISS') -
  237. numtodsinterval(1, 'hour'))) * 86400 > 180 then
  238. to_date(t1.MILL_DTIME, 'YYYYMMDDHH24MISS') -
  239. (to_date(t1.MILL_DTIME2, 'YYYYMMDDHH24MISS') -
  240. numtodsinterval(1, 'hour'))
  241. else
  242. 0
  243. end k,
  244. case
  245. when substr(t1.Leadd, 0, 10) =
  246. substr(t1.MILL_DTIME, 0, 10) and
  247. (to_date(t1.Leadd, 'YYYYMMDDHH24MISS') -
  248. to_date(t1.MILL_DTIME, 'YYYYMMDDHH24MISS')) *
  249. 86400 > 180 then
  250. (to_date(t1.Leadd, 'YYYYMMDDHH24MISS') -
  251. to_date(t1.MILL_DTIME, 'YYYYMMDDHH24MISS')) * 86400
  252. else
  253. 0
  254. end sjc,
  255. t1.ACT_WGT
  256. from (select t.MILL_DTIME,
  257. substr(to_char(to_date(t.MILL_DTIME,
  258. 'YYYYMMDDHH24MISS') +
  259. numtodsinterval(1, 'hour'),
  260. 'YYYYMMDDHH24MISS'),
  261. 0,
  262. 10) || '0000' MILL_DTIME2,
  263. Lead(t.MILL_DTIME) OVER(ORDER BY t.MILL_DTIME) leadd,
  264. lag(t.MILL_DTIME) OVER(ORDER BY t.MILL_DTIME) lagg,
  265. t.ACT_WGT
  266. from C_TBL02_COIL_COMM t
  267. where substr(t.MILL_DTIME,0,8) between ? and ?
  268. ORDER BY t.MILL_DTIME) t1) t2
  269. group by substr(t2.MILL_DTIME, 0, 10)
  270. order by substr(t2.MILL_DTIME, 0, 10)) t3
  271. ]]>
  272. </query>
  273. </queryMap>