QueryZGReport.xml 42 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920
  1. <?xml version="1.0" encoding="UTF-8"?>
  2. <queryMap desc="中钢炼钢报表">
  3. <query id="FrmTerminusTept.Query" desc="炼钢厂终点温度按月统计" fetchSize="10">
  4. <![CDATA[
  5. select decode(substr(t.o, 5, 1), '0', '', '1', '1') || substr(t.o, 6, 1) || '月' ||
  6. decode(substr(t.o, 7, 1), '0', '', '1', '1', '2', '2', '3', '3') ||
  7. substr(t.o, 8, 1) || '日' opdate,
  8. t1.sumcount "11",
  9. t2.sumcount "12",
  10. t3.sumcount "13",
  11. t4.sumcount "14",
  12. t5.sumcount "15",
  13. t6.sumcount "21",
  14. t7.sumcount "22",
  15. t8.sumcount "23",
  16. t9.sumcount "24",
  17. t10.sumcount "25",
  18. t11.sumcount "31",
  19. t12.sumcount "32",
  20. t13.sumcount "33",
  21. t14.sumcount "34",
  22. t15.sumcount "35",
  23. t16.sumcount "41",
  24. t17.sumcount "42",
  25. t18.sumcount "43",
  26. t19.sumcount "44",
  27. t20.sumcount "45",
  28. '冶炼炉数' YLLS,
  29. '高温炉数' GWLS
  30. from ((select to_char(optdate, 'yyyymmdd') o, count(1) sumcount
  31. from (select * from stl_bof_optinfo union select * from j#stl_bof_optinfo)
  32. where TERMINUSTEPT > ?
  33. group by to_char(optdate, 'yyyymmdd')) t
  34. --甲班
  35. left join (select to_char(optdate, 'yyyymmdd') o, count(1) sumcount
  36. from (select * from stl_bof_optinfo union select * from j#stl_bof_optinfo)
  37. where substr(shiftcode, 2, 1) = '1'
  38. and stationcode = '01'
  39. and TERMINUSTEPT > ?
  40. group by to_char(optdate, 'yyyymmdd')) t1
  41. on t.o = t1.o
  42. left join (select to_char(optdate, 'yyyymmdd') o, count(1) sumcount
  43. from (select * from stl_bof_optinfo union select * from j#stl_bof_optinfo)
  44. where substr(shiftcode, 2, 1) = '1'
  45. and stationcode = '02'
  46. and TERMINUSTEPT > ?
  47. group by to_char(optdate, 'yyyymmdd')) t2
  48. on t.o = t2.o
  49. left join (select to_char(optdate, 'yyyymmdd') o, count(1) sumcount
  50. from (select * from stl_bof_optinfo union select * from j#stl_bof_optinfo)
  51. where substr(shiftcode, 2, 1) = '1'
  52. and stationcode = '03'
  53. and TERMINUSTEPT > ?
  54. group by to_char(optdate, 'yyyymmdd')) t3
  55. on t.o = t3.o
  56. left join (select to_char(optdate, 'yyyymmdd') o, count(1) sumcount
  57. from (select * from stl_bof_optinfo union select * from j#stl_bof_optinfo)
  58. where substr(shiftcode, 2, 1) = '1'
  59. and stationcode = '04'
  60. and TERMINUSTEPT > ?
  61. group by to_char(optdate, 'yyyymmdd')) t4
  62. on t.o = t4.o
  63. left join (select to_char(optdate, 'yyyymmdd') o, count(1) sumcount
  64. from (select * from stl_bof_optinfo union select * from j#stl_bof_optinfo)
  65. where substr(shiftcode, 2, 1) = '1'
  66. and stationcode = '05'
  67. and TERMINUSTEPT > ?
  68. group by to_char(optdate, 'yyyymmdd')) t5
  69. on t.o = t5.o
  70. --乙班
  71. left join (select to_char(optdate, 'yyyymmdd') o, count(1) sumcount
  72. from (select * from stl_bof_optinfo union select * from j#stl_bof_optinfo)
  73. where substr(shiftcode, 2, 1) = '2'
  74. and stationcode = '01'
  75. and TERMINUSTEPT > ?
  76. group by to_char(optdate, 'yyyymmdd')) t6
  77. on t.o = t6.o
  78. left join (select to_char(optdate, 'yyyymmdd') o, count(1) sumcount
  79. from (select * from stl_bof_optinfo union select * from j#stl_bof_optinfo)
  80. where substr(shiftcode, 2, 1) = '2'
  81. and stationcode = '02'
  82. and TERMINUSTEPT > ?
  83. group by to_char(optdate, 'yyyymmdd')) t7
  84. on t.o = t7.o
  85. left join (select to_char(optdate, 'yyyymmdd') o, count(1) sumcount
  86. from (select * from stl_bof_optinfo union select * from j#stl_bof_optinfo)
  87. where substr(shiftcode, 2, 1) = '2'
  88. and stationcode = '03'
  89. and TERMINUSTEPT > ?
  90. group by to_char(optdate, 'yyyymmdd')) t8
  91. on t.o = t8.o
  92. left join (select to_char(optdate, 'yyyymmdd') o, count(1) sumcount
  93. from (select * from stl_bof_optinfo union select * from j#stl_bof_optinfo)
  94. where substr(shiftcode, 2, 1) = '2'
  95. and stationcode = '04'
  96. and TERMINUSTEPT > ?
  97. group by to_char(optdate, 'yyyymmdd')) t9
  98. on t.o = t9.o
  99. left join (select to_char(optdate, 'yyyymmdd') o, count(1) sumcount
  100. from (select * from stl_bof_optinfo union select * from j#stl_bof_optinfo)
  101. where substr(shiftcode, 2, 1) = '2'
  102. and stationcode = '05'
  103. and TERMINUSTEPT > ?
  104. group by to_char(optdate, 'yyyymmdd')) t10
  105. on t.o = t10.o
  106. --丙班
  107. left join (select to_char(optdate, 'yyyymmdd') o, count(1) sumcount
  108. from (select * from stl_bof_optinfo union select * from j#stl_bof_optinfo)
  109. where substr(shiftcode, 2, 1) = '3'
  110. and stationcode = '01'
  111. and TERMINUSTEPT > ?
  112. group by to_char(optdate, 'yyyymmdd')) t11
  113. on t.o = t11.o
  114. left join (select to_char(optdate, 'yyyymmdd') o, count(1) sumcount
  115. from (select * from stl_bof_optinfo union select * from j#stl_bof_optinfo)
  116. where substr(shiftcode, 2, 1) = '3'
  117. and stationcode = '02'
  118. and TERMINUSTEPT > ?
  119. group by to_char(optdate, 'yyyymmdd')) t12
  120. on t.o = t12.o
  121. left join (select to_char(optdate, 'yyyymmdd') o, count(1) sumcount
  122. from (select * from stl_bof_optinfo union select * from j#stl_bof_optinfo)
  123. where substr(shiftcode, 2, 1) = '3'
  124. and stationcode = '03'
  125. and TERMINUSTEPT > ?
  126. group by to_char(optdate, 'yyyymmdd')) t13
  127. on t.o = t13.o
  128. left join (select to_char(optdate, 'yyyymmdd') o, count(1) sumcount
  129. from (select * from stl_bof_optinfo union select * from j#stl_bof_optinfo)
  130. where substr(shiftcode, 2, 1) = '3'
  131. and stationcode = '04'
  132. and TERMINUSTEPT > ?
  133. group by to_char(optdate, 'yyyymmdd')) t14
  134. on t.o = t14.o
  135. left join (select to_char(optdate, 'yyyymmdd') o, count(1) sumcount
  136. from (select * from stl_bof_optinfo union select * from j#stl_bof_optinfo)
  137. where substr(shiftcode, 2, 1) = '3'
  138. and stationcode = '05'
  139. and TERMINUSTEPT > ?
  140. group by to_char(optdate, 'yyyymmdd')) t15
  141. on t.o = t15.o
  142. --丁班
  143. left join (select to_char(optdate, 'yyyymmdd') o, count(1) sumcount
  144. from (select * from stl_bof_optinfo union select * from j#stl_bof_optinfo)
  145. where substr(shiftcode, 2, 1) = '4'
  146. and stationcode = '01'
  147. and TERMINUSTEPT > ?
  148. group by to_char(optdate, 'yyyymmdd')) t16
  149. on t.o = t16.o
  150. left join (select to_char(optdate, 'yyyymmdd') o, count(1) sumcount
  151. from (select * from stl_bof_optinfo union select * from j#stl_bof_optinfo)
  152. where substr(shiftcode, 2, 1) = '4'
  153. and stationcode = '02'
  154. and TERMINUSTEPT > ?
  155. group by to_char(optdate, 'yyyymmdd')) t17
  156. on t.o = t17.o
  157. left join (select to_char(optdate, 'yyyymmdd') o, count(1) sumcount
  158. from (select * from stl_bof_optinfo union select * from j#stl_bof_optinfo)
  159. where substr(shiftcode, 2, 1) = '4'
  160. and stationcode = '03'
  161. and TERMINUSTEPT > ?
  162. group by to_char(optdate, 'yyyymmdd')) t18
  163. on t.o = t18.o
  164. left join (select to_char(optdate, 'yyyymmdd') o, count(1) sumcount
  165. from (select * from stl_bof_optinfo union select * from j#stl_bof_optinfo)
  166. where substr(shiftcode, 2, 1) = '4'
  167. and stationcode = '04'
  168. and TERMINUSTEPT > ?
  169. group by to_char(optdate, 'yyyymmdd')) t19
  170. on t.o = t19.o
  171. left join (select to_char(optdate, 'yyyymmdd') o, count(1) sumcount
  172. from (select * from stl_bof_optinfo union select * from j#stl_bof_optinfo)
  173. where substr(shiftcode, 2, 1) = '4'
  174. and stationcode = '05'
  175. and TERMINUSTEPT > ?
  176. group by to_char(optdate, 'yyyymmdd')) t20
  177. on t.o = t20.o )
  178. where substr(t.o,1,6)=?
  179. order by t.o
  180. ]]>
  181. </query>
  182. <query id="FrmTerminusTeptCount.Query" desc="炼钢厂终点温度按月统计冶炼总数" fetchSize="10">
  183. <![CDATA[
  184. select decode(substr(t.o, 5, 1), '0', '', '1', '1') || substr(t.o, 6, 1) || '月' ||
  185. decode(substr(t.o, 7, 1), '0', '', '1', '1', '2', '2', '3', '3') ||
  186. substr(t.o, 8, 1) || '日' opdate,
  187. t1.sumcount "T11",
  188. t2.sumcount "T12",
  189. t3.sumcount "T13",
  190. t4.sumcount "T14",
  191. t5.sumcount "T15",
  192. t6.sumcount "T21",
  193. t7.sumcount "T22",
  194. t8.sumcount "T23",
  195. t9.sumcount "T24",
  196. t10.sumcount "T25",
  197. t11.sumcount "T31",
  198. t12.sumcount "T32",
  199. t13.sumcount "T33",
  200. t14.sumcount "T34",
  201. t15.sumcount "T35",
  202. t16.sumcount "T41",
  203. t17.sumcount "T42",
  204. t18.sumcount "T43",
  205. t19.sumcount "T44",
  206. t20.sumcount "T45"
  207. from ((select to_char(optdate, 'yyyymmdd') o, count(1) sumcount
  208. from (select *
  209. from stl_bof_optinfo
  210. union
  211. select * from j#stl_bof_optinfo)
  212. group by to_char(optdate, 'yyyymmdd')) t
  213. --甲班
  214. left join (select to_char(optdate, 'yyyymmdd') o, count(1) sumcount
  215. from (select *
  216. from stl_bof_optinfo
  217. union
  218. select * from j#stl_bof_optinfo)
  219. where substr(shiftcode, 2, 1) = '1'
  220. and stationcode = '01'
  221. group by to_char(optdate, 'yyyymmdd')) t1 on t.o = t1.o left join
  222. (select to_char(optdate, 'yyyymmdd') o, count(1) sumcount
  223. from (select *
  224. from stl_bof_optinfo
  225. union
  226. select * from j#stl_bof_optinfo)
  227. where substr(shiftcode, 2, 1) = '1'
  228. and stationcode = '02'
  229. group by to_char(optdate, 'yyyymmdd')) t2 on t.o = t2.o left join
  230. (select to_char(optdate, 'yyyymmdd') o, count(1) sumcount
  231. from (select *
  232. from stl_bof_optinfo
  233. union
  234. select * from j#stl_bof_optinfo)
  235. where substr(shiftcode, 2, 1) = '1'
  236. and stationcode = '03'
  237. group by to_char(optdate, 'yyyymmdd')) t3 on t.o = t3.o left join
  238. (select to_char(optdate, 'yyyymmdd') o, count(1) sumcount
  239. from (select *
  240. from stl_bof_optinfo
  241. union
  242. select * from j#stl_bof_optinfo)
  243. where substr(shiftcode, 2, 1) = '1'
  244. and stationcode = '04'
  245. group by to_char(optdate, 'yyyymmdd')) t4 on t.o = t4.o left join
  246. (select to_char(optdate, 'yyyymmdd') o, count(1) sumcount
  247. from (select *
  248. from stl_bof_optinfo
  249. union
  250. select * from j#stl_bof_optinfo)
  251. where substr(shiftcode, 2, 1) = '1'
  252. and stationcode = '05'
  253. group by to_char(optdate, 'yyyymmdd')) t5 on t.o = t5.o
  254. --乙班
  255. left join (select to_char(optdate, 'yyyymmdd') o, count(1) sumcount
  256. from (select *
  257. from stl_bof_optinfo
  258. union
  259. select * from j#stl_bof_optinfo)
  260. where substr(shiftcode, 2, 1) = '2'
  261. and stationcode = '01'
  262. group by to_char(optdate, 'yyyymmdd')) t6 on t.o = t6.o left join
  263. (select to_char(optdate, 'yyyymmdd') o, count(1) sumcount
  264. from (select *
  265. from stl_bof_optinfo
  266. union
  267. select * from j#stl_bof_optinfo)
  268. where substr(shiftcode, 2, 1) = '2'
  269. and stationcode = '02'
  270. group by to_char(optdate, 'yyyymmdd')) t7 on t.o = t7.o left join
  271. (select to_char(optdate, 'yyyymmdd') o, count(1) sumcount
  272. from (select *
  273. from stl_bof_optinfo
  274. union
  275. select * from j#stl_bof_optinfo)
  276. where substr(shiftcode, 2, 1) = '2'
  277. and stationcode = '03'
  278. group by to_char(optdate, 'yyyymmdd')) t8 on t.o = t8.o left join
  279. (select to_char(optdate, 'yyyymmdd') o, count(1) sumcount
  280. from (select *
  281. from stl_bof_optinfo
  282. union
  283. select * from j#stl_bof_optinfo)
  284. where substr(shiftcode, 2, 1) = '2'
  285. and stationcode = '04'
  286. group by to_char(optdate, 'yyyymmdd')) t9 on t.o = t9.o left join
  287. (select to_char(optdate, 'yyyymmdd') o, count(1) sumcount
  288. from (select *
  289. from stl_bof_optinfo
  290. union
  291. select * from j#stl_bof_optinfo)
  292. where substr(shiftcode, 2, 1) = '2'
  293. and stationcode = '05'
  294. group by to_char(optdate, 'yyyymmdd')) t10 on t.o = t10.o
  295. --丙班
  296. left join (select to_char(optdate, 'yyyymmdd') o, count(1) sumcount
  297. from (select *
  298. from stl_bof_optinfo
  299. union
  300. select * from j#stl_bof_optinfo)
  301. where substr(shiftcode, 2, 1) = '3'
  302. and stationcode = '01'
  303. group by to_char(optdate, 'yyyymmdd')) t11 on
  304. t.o = t11.o left join
  305. (select to_char(optdate, 'yyyymmdd') o, count(1) sumcount
  306. from (select *
  307. from stl_bof_optinfo
  308. union
  309. select * from j#stl_bof_optinfo)
  310. where substr(shiftcode, 2, 1) = '3'
  311. and stationcode = '02'
  312. group by to_char(optdate, 'yyyymmdd')) t12 on t.o = t12.o left join
  313. (select to_char(optdate, 'yyyymmdd') o, count(1) sumcount
  314. from (select *
  315. from stl_bof_optinfo
  316. union
  317. select * from j#stl_bof_optinfo)
  318. where substr(shiftcode, 2, 1) = '3'
  319. and stationcode = '03'
  320. group by to_char(optdate, 'yyyymmdd')) t13 on t.o = t13.o left join
  321. (select to_char(optdate, 'yyyymmdd') o, count(1) sumcount
  322. from (select *
  323. from stl_bof_optinfo
  324. union
  325. select * from j#stl_bof_optinfo)
  326. where substr(shiftcode, 2, 1) = '3'
  327. and stationcode = '04'
  328. group by to_char(optdate, 'yyyymmdd')) t14 on t.o = t14.o left join
  329. (select to_char(optdate, 'yyyymmdd') o, count(1) sumcount
  330. from (select *
  331. from stl_bof_optinfo
  332. union
  333. select * from j#stl_bof_optinfo)
  334. where substr(shiftcode, 2, 1) = '3'
  335. and stationcode = '05'
  336. group by to_char(optdate, 'yyyymmdd')) t15 on t.o = t15.o
  337. --丁班
  338. left join (select to_char(optdate, 'yyyymmdd') o, count(1) sumcount
  339. from (select *
  340. from stl_bof_optinfo
  341. union
  342. select * from j#stl_bof_optinfo)
  343. where substr(shiftcode, 2, 1) = '4'
  344. and stationcode = '01'
  345. group by to_char(optdate, 'yyyymmdd')) t16 on
  346. t.o = t16.o left join
  347. (select to_char(optdate, 'yyyymmdd') o, count(1) sumcount
  348. from (select *
  349. from stl_bof_optinfo
  350. union
  351. select * from j#stl_bof_optinfo)
  352. where substr(shiftcode, 2, 1) = '4'
  353. and stationcode = '02'
  354. group by to_char(optdate, 'yyyymmdd')) t17 on t.o = t17.o left join
  355. (select to_char(optdate, 'yyyymmdd') o, count(1) sumcount
  356. from (select *
  357. from stl_bof_optinfo
  358. union
  359. select * from j#stl_bof_optinfo)
  360. where substr(shiftcode, 2, 1) = '4'
  361. and stationcode = '03'
  362. group by to_char(optdate, 'yyyymmdd')) t18 on t.o = t18.o left join
  363. (select to_char(optdate, 'yyyymmdd') o, count(1) sumcount
  364. from (select *
  365. from stl_bof_optinfo
  366. union
  367. select * from j#stl_bof_optinfo)
  368. where substr(shiftcode, 2, 1) = '4'
  369. and stationcode = '04'
  370. group by to_char(optdate, 'yyyymmdd')) t19 on t.o = t19.o left join
  371. (select to_char(optdate, 'yyyymmdd') o, count(1) sumcount
  372. from (select *
  373. from stl_bof_optinfo
  374. union
  375. select * from j#stl_bof_optinfo)
  376. where substr(shiftcode, 2, 1) = '4'
  377. and stationcode = '05'
  378. group by to_char(optdate, 'yyyymmdd')) t20 on t.o = t20.o)
  379. where substr(t.o, 1, 6) = ?
  380. order by t.o
  381. ]]>
  382. </query>
  383. <query id="FrmTerminusTept.YearQuery" desc="炼钢厂终点温度按年统计" fetchSize="10">
  384. <![CDATA[
  385. select decode(substr(t.o, 5, 1), '0', '', '1', '1') || substr(t.o, 6, 1) || '月' opdate,
  386. t1.sumcount "11",
  387. t2.sumcount "12",
  388. t3.sumcount "13",
  389. t4.sumcount "14",
  390. t5.sumcount "15",
  391. t6.sumcount "21",
  392. t7.sumcount "22",
  393. t8.sumcount "23",
  394. t9.sumcount "24",
  395. t10.sumcount "25",
  396. t11.sumcount "31",
  397. t12.sumcount "32",
  398. t13.sumcount "33",
  399. t14.sumcount "34",
  400. t15.sumcount "35",
  401. t16.sumcount "41",
  402. t17.sumcount "42",
  403. t18.sumcount "43",
  404. t19.sumcount "44",
  405. t20.sumcount "45",
  406. '冶炼炉数' YLLS,
  407. '高温炉数' GWLS
  408. from ((select to_char(optdate, 'yyyymm') o, count(1) sumcount
  409. from (select * from stl_bof_optinfo union select * from j#stl_bof_optinfo)
  410. where TERMINUSTEPT > ?
  411. group by to_char(optdate, 'yyyymm')) t
  412. --甲班
  413. left join (select to_char(optdate, 'yyyymm') o, count(1) sumcount
  414. from (select * from stl_bof_optinfo union select * from j#stl_bof_optinfo)
  415. where substr(shiftcode, 2, 1) = '1'
  416. and stationcode = '01'
  417. and TERMINUSTEPT > ?
  418. group by to_char(optdate, 'yyyymm')) t1
  419. on t.o = t1.o
  420. left join (select to_char(optdate, 'yyyymm') o, count(1) sumcount
  421. from (select * from stl_bof_optinfo union select * from j#stl_bof_optinfo)
  422. where substr(shiftcode, 2, 1) = '1'
  423. and stationcode = '02'
  424. and TERMINUSTEPT > ?
  425. group by to_char(optdate, 'yyyymm')) t2
  426. on t.o = t2.o
  427. left join (select to_char(optdate, 'yyyymm') o, count(1) sumcount
  428. from (select * from stl_bof_optinfo union select * from j#stl_bof_optinfo)
  429. where substr(shiftcode, 2, 1) = '1'
  430. and stationcode = '03'
  431. and TERMINUSTEPT > ?
  432. group by to_char(optdate, 'yyyymm')) t3
  433. on t.o = t3.o
  434. left join (select to_char(optdate, 'yyyymm') o, count(1) sumcount
  435. from (select * from stl_bof_optinfo union select * from j#stl_bof_optinfo)
  436. where substr(shiftcode, 2, 1) = '1'
  437. and stationcode = '04'
  438. and TERMINUSTEPT > ?
  439. group by to_char(optdate, 'yyyymm')) t4
  440. on t.o = t4.o
  441. left join (select to_char(optdate, 'yyyymm') o, count(1) sumcount
  442. from (select * from stl_bof_optinfo union select * from j#stl_bof_optinfo)
  443. where substr(shiftcode, 2, 1) = '1'
  444. and stationcode = '05'
  445. and TERMINUSTEPT > ?
  446. group by to_char(optdate, 'yyyymm')) t5
  447. on t.o = t5.o
  448. --乙班
  449. left join (select to_char(optdate, 'yyyymm') o, count(1) sumcount
  450. from (select * from stl_bof_optinfo union select * from j#stl_bof_optinfo)
  451. where substr(shiftcode, 2, 1) = '2'
  452. and stationcode = '01'
  453. and TERMINUSTEPT > ?
  454. group by to_char(optdate, 'yyyymm')) t6
  455. on t.o = t6.o
  456. left join (select to_char(optdate, 'yyyymm') o, count(1) sumcount
  457. from (select * from stl_bof_optinfo union select * from j#stl_bof_optinfo)
  458. where substr(shiftcode, 2, 1) = '2'
  459. and stationcode = '02'
  460. and TERMINUSTEPT > ?
  461. group by to_char(optdate, 'yyyymm')) t7
  462. on t.o = t7.o
  463. left join (select to_char(optdate, 'yyyymm') o, count(1) sumcount
  464. from (select * from stl_bof_optinfo union select * from j#stl_bof_optinfo)
  465. where substr(shiftcode, 2, 1) = '2'
  466. and stationcode = '03'
  467. and TERMINUSTEPT > ?
  468. group by to_char(optdate, 'yyyymm')) t8
  469. on t.o = t8.o
  470. left join (select to_char(optdate, 'yyyymm') o, count(1) sumcount
  471. from (select * from stl_bof_optinfo union select * from j#stl_bof_optinfo)
  472. where substr(shiftcode, 2, 1) = '2'
  473. and stationcode = '04'
  474. and TERMINUSTEPT > ?
  475. group by to_char(optdate, 'yyyymm')) t9
  476. on t.o = t9.o
  477. left join (select to_char(optdate, 'yyyymm') o, count(1) sumcount
  478. from (select * from stl_bof_optinfo union select * from j#stl_bof_optinfo)
  479. where substr(shiftcode, 2, 1) = '2'
  480. and stationcode = '05'
  481. and TERMINUSTEPT > ?
  482. group by to_char(optdate, 'yyyymm')) t10
  483. on t.o = t10.o
  484. --丙班
  485. left join (select to_char(optdate, 'yyyymm') o, count(1) sumcount
  486. from (select * from stl_bof_optinfo union select * from j#stl_bof_optinfo)
  487. where substr(shiftcode, 2, 1) = '3'
  488. and stationcode = '01'
  489. and TERMINUSTEPT > ?
  490. group by to_char(optdate, 'yyyymm')) t11
  491. on t.o = t11.o
  492. left join (select to_char(optdate, 'yyyymm') o, count(1) sumcount
  493. from (select * from stl_bof_optinfo union select * from j#stl_bof_optinfo)
  494. where substr(shiftcode, 2, 1) = '3'
  495. and stationcode = '02'
  496. and TERMINUSTEPT > ?
  497. group by to_char(optdate, 'yyyymm')) t12
  498. on t.o = t12.o
  499. left join (select to_char(optdate, 'yyyymm') o, count(1) sumcount
  500. from (select * from stl_bof_optinfo union select * from j#stl_bof_optinfo)
  501. where substr(shiftcode, 2, 1) = '3'
  502. and stationcode = '03'
  503. and TERMINUSTEPT > ?
  504. group by to_char(optdate, 'yyyymm')) t13
  505. on t.o = t13.o
  506. left join (select to_char(optdate, 'yyyymm') o, count(1) sumcount
  507. from (select * from stl_bof_optinfo union select * from j#stl_bof_optinfo)
  508. where substr(shiftcode, 2, 1) = '3'
  509. and stationcode = '04'
  510. and TERMINUSTEPT > ?
  511. group by to_char(optdate, 'yyyymm')) t14
  512. on t.o = t14.o
  513. left join (select to_char(optdate, 'yyyymm') o, count(1) sumcount
  514. from (select * from stl_bof_optinfo union select * from j#stl_bof_optinfo)
  515. where substr(shiftcode, 2, 1) = '3'
  516. and stationcode = '05'
  517. and TERMINUSTEPT > ?
  518. group by to_char(optdate, 'yyyymm')) t15
  519. on t.o = t15.o
  520. --丁班
  521. left join (select to_char(optdate, 'yyyymm') o, count(1) sumcount
  522. from (select * from stl_bof_optinfo union select * from j#stl_bof_optinfo)
  523. where substr(shiftcode, 2, 1) = '4'
  524. and stationcode = '01'
  525. and TERMINUSTEPT > ?
  526. group by to_char(optdate, 'yyyymm')) t16
  527. on t.o = t16.o
  528. left join (select to_char(optdate, 'yyyymm') o, count(1) sumcount
  529. from (select * from stl_bof_optinfo union select * from j#stl_bof_optinfo)
  530. where substr(shiftcode, 2, 1) = '4'
  531. and stationcode = '02'
  532. and TERMINUSTEPT > ?
  533. group by to_char(optdate, 'yyyymm')) t17
  534. on t.o = t17.o
  535. left join (select to_char(optdate, 'yyyymm') o, count(1) sumcount
  536. from (select * from stl_bof_optinfo union select * from j#stl_bof_optinfo)
  537. where substr(shiftcode, 2, 1) = '4'
  538. and stationcode = '03'
  539. and TERMINUSTEPT > ?
  540. group by to_char(optdate, 'yyyymm')) t18
  541. on t.o = t18.o
  542. left join (select to_char(optdate, 'yyyymm') o, count(1) sumcount
  543. from (select * from stl_bof_optinfo union select * from j#stl_bof_optinfo)
  544. where substr(shiftcode, 2, 1) = '4'
  545. and stationcode = '04'
  546. and TERMINUSTEPT > ?
  547. group by to_char(optdate, 'yyyymm')) t19
  548. on t.o = t19.o
  549. left join (select to_char(optdate, 'yyyymm') o, count(1) sumcount
  550. from (select * from stl_bof_optinfo union select * from j#stl_bof_optinfo)
  551. where substr(shiftcode, 2, 1) = '4'
  552. and stationcode = '05'
  553. and TERMINUSTEPT > ?
  554. group by to_char(optdate, 'yyyymm')) t20
  555. on t.o = t20.o )
  556. where t.o between ? and ?
  557. order by t.o
  558. ]]>
  559. </query>
  560. <query id="FrmTerminusTeptCount.YearQuery" desc="炼钢厂终点温度按年统计冶炼总数" fetchSize="10">
  561. <![CDATA[
  562. select decode(substr(t.o, 5, 1), '0', '', '1', '1') || substr(t.o, 6, 1) || '月' opdate,
  563. t1.sumcount "T11",
  564. t2.sumcount "T12",
  565. t3.sumcount "T13",
  566. t4.sumcount "T14",
  567. t5.sumcount "T15",
  568. t6.sumcount "T21",
  569. t7.sumcount "T22",
  570. t8.sumcount "T23",
  571. t9.sumcount "T24",
  572. t10.sumcount "T25",
  573. t11.sumcount "T31",
  574. t12.sumcount "T32",
  575. t13.sumcount "T33",
  576. t14.sumcount "T34",
  577. t15.sumcount "T35",
  578. t16.sumcount "T41",
  579. t17.sumcount "T42",
  580. t18.sumcount "T43",
  581. t19.sumcount "T44",
  582. t20.sumcount "T45"
  583. from ((select to_char(optdate, 'yyyymm') o, count(1) sumcount
  584. from (select *
  585. from stl_bof_optinfo
  586. union
  587. select * from j#stl_bof_optinfo)
  588. group by to_char(optdate, 'yyyymm')) t
  589. --甲班
  590. left join (select to_char(optdate, 'yyyymm') o, count(1) sumcount
  591. from (select *
  592. from stl_bof_optinfo
  593. union
  594. select * from j#stl_bof_optinfo)
  595. where substr(shiftcode, 2, 1) = '1'
  596. and stationcode = '01'
  597. group by to_char(optdate, 'yyyymm')) t1 on t.o = t1.o left join
  598. (select to_char(optdate, 'yyyymm') o, count(1) sumcount
  599. from (select *
  600. from stl_bof_optinfo
  601. union
  602. select * from j#stl_bof_optinfo)
  603. where substr(shiftcode, 2, 1) = '1'
  604. and stationcode = '02'
  605. group by to_char(optdate, 'yyyymm')) t2 on t.o = t2.o left join
  606. (select to_char(optdate, 'yyyymm') o, count(1) sumcount
  607. from (select *
  608. from stl_bof_optinfo
  609. union
  610. select * from j#stl_bof_optinfo)
  611. where substr(shiftcode, 2, 1) = '1'
  612. and stationcode = '03'
  613. group by to_char(optdate, 'yyyymm')) t3 on t.o = t3.o left join
  614. (select to_char(optdate, 'yyyymm') o, count(1) sumcount
  615. from (select *
  616. from stl_bof_optinfo
  617. union
  618. select * from j#stl_bof_optinfo)
  619. where substr(shiftcode, 2, 1) = '1'
  620. and stationcode = '04'
  621. group by to_char(optdate, 'yyyymm')) t4 on t.o = t4.o left join
  622. (select to_char(optdate, 'yyyymm') o, count(1) sumcount
  623. from (select *
  624. from stl_bof_optinfo
  625. union
  626. select * from j#stl_bof_optinfo)
  627. where substr(shiftcode, 2, 1) = '1'
  628. and stationcode = '05'
  629. group by to_char(optdate, 'yyyymm')) t5 on t.o = t5.o
  630. --乙班
  631. left join (select to_char(optdate, 'yyyymm') o, count(1) sumcount
  632. from (select *
  633. from stl_bof_optinfo
  634. union
  635. select * from j#stl_bof_optinfo)
  636. where substr(shiftcode, 2, 1) = '2'
  637. and stationcode = '01'
  638. group by to_char(optdate, 'yyyymm')) t6 on t.o = t6.o left join
  639. (select to_char(optdate, 'yyyymm') o, count(1) sumcount
  640. from (select *
  641. from stl_bof_optinfo
  642. union
  643. select * from j#stl_bof_optinfo)
  644. where substr(shiftcode, 2, 1) = '2'
  645. and stationcode = '02'
  646. group by to_char(optdate, 'yyyymm')) t7 on t.o = t7.o left join
  647. (select to_char(optdate, 'yyyymm') o, count(1) sumcount
  648. from (select *
  649. from stl_bof_optinfo
  650. union
  651. select * from j#stl_bof_optinfo)
  652. where substr(shiftcode, 2, 1) = '2'
  653. and stationcode = '03'
  654. group by to_char(optdate, 'yyyymm')) t8 on t.o = t8.o left join
  655. (select to_char(optdate, 'yyyymm') o, count(1) sumcount
  656. from (select *
  657. from stl_bof_optinfo
  658. union
  659. select * from j#stl_bof_optinfo)
  660. where substr(shiftcode, 2, 1) = '2'
  661. and stationcode = '04'
  662. group by to_char(optdate, 'yyyymm')) t9 on t.o = t9.o left join
  663. (select to_char(optdate, 'yyyymm') o, count(1) sumcount
  664. from (select *
  665. from stl_bof_optinfo
  666. union
  667. select * from j#stl_bof_optinfo)
  668. where substr(shiftcode, 2, 1) = '2'
  669. and stationcode = '05'
  670. group by to_char(optdate, 'yyyymm')) t10 on t.o = t10.o
  671. --丙班
  672. left join (select to_char(optdate, 'yyyymm') o, count(1) sumcount
  673. from (select *
  674. from stl_bof_optinfo
  675. union
  676. select * from j#stl_bof_optinfo)
  677. where substr(shiftcode, 2, 1) = '3'
  678. and stationcode = '01'
  679. group by to_char(optdate, 'yyyymm')) t11 on
  680. t.o = t11.o left join
  681. (select to_char(optdate, 'yyyymm') o, count(1) sumcount
  682. from (select *
  683. from stl_bof_optinfo
  684. union
  685. select * from j#stl_bof_optinfo)
  686. where substr(shiftcode, 2, 1) = '3'
  687. and stationcode = '02'
  688. group by to_char(optdate, 'yyyymm')) t12 on t.o = t12.o left join
  689. (select to_char(optdate, 'yyyymm') o, count(1) sumcount
  690. from (select *
  691. from stl_bof_optinfo
  692. union
  693. select * from j#stl_bof_optinfo)
  694. where substr(shiftcode, 2, 1) = '3'
  695. and stationcode = '03'
  696. group by to_char(optdate, 'yyyymm')) t13 on t.o = t13.o left join
  697. (select to_char(optdate, 'yyyymm') o, count(1) sumcount
  698. from (select *
  699. from stl_bof_optinfo
  700. union
  701. select * from j#stl_bof_optinfo)
  702. where substr(shiftcode, 2, 1) = '3'
  703. and stationcode = '04'
  704. group by to_char(optdate, 'yyyymm')) t14 on t.o = t14.o left join
  705. (select to_char(optdate, 'yyyymm') o, count(1) sumcount
  706. from (select *
  707. from stl_bof_optinfo
  708. union
  709. select * from j#stl_bof_optinfo)
  710. where substr(shiftcode, 2, 1) = '3'
  711. and stationcode = '05'
  712. group by to_char(optdate, 'yyyymm')) t15 on t.o = t15.o
  713. --丁班
  714. left join (select to_char(optdate, 'yyyymm') o, count(1) sumcount
  715. from (select *
  716. from stl_bof_optinfo
  717. union
  718. select * from j#stl_bof_optinfo)
  719. where substr(shiftcode, 2, 1) = '4'
  720. and stationcode = '01'
  721. group by to_char(optdate, 'yyyymm')) t16 on
  722. t.o = t16.o left join
  723. (select to_char(optdate, 'yyyymm') o, count(1) sumcount
  724. from (select *
  725. from stl_bof_optinfo
  726. union
  727. select * from j#stl_bof_optinfo)
  728. where substr(shiftcode, 2, 1) = '4'
  729. and stationcode = '02'
  730. group by to_char(optdate, 'yyyymm')) t17 on t.o = t17.o left join
  731. (select to_char(optdate, 'yyyymm') o, count(1) sumcount
  732. from (select *
  733. from stl_bof_optinfo
  734. union
  735. select * from j#stl_bof_optinfo)
  736. where substr(shiftcode, 2, 1) = '4'
  737. and stationcode = '03'
  738. group by to_char(optdate, 'yyyymm')) t18 on t.o = t18.o left join
  739. (select to_char(optdate, 'yyyymm') o, count(1) sumcount
  740. from (select *
  741. from stl_bof_optinfo
  742. union
  743. select * from j#stl_bof_optinfo)
  744. where substr(shiftcode, 2, 1) = '4'
  745. and stationcode = '04'
  746. group by to_char(optdate, 'yyyymm')) t19 on t.o = t19.o left join
  747. (select to_char(optdate, 'yyyymm') o, count(1) sumcount
  748. from (select *
  749. from stl_bof_optinfo
  750. union
  751. select * from j#stl_bof_optinfo)
  752. where substr(shiftcode, 2, 1) = '4'
  753. and stationcode = '05'
  754. group by to_char(optdate, 'yyyymm')) t20 on t.o = t20.o)
  755. where t.o between ? and ?
  756. order by t.o
  757. ]]>
  758. </query>
  759. <query id="reportProMonitor.Query" desc="炼钢厂工艺监督原始记录查询" fetchSize="10">
  760. <![CDATA[
  761. select t1.heatno,
  762. t2.steel plansteel,
  763. to_char(t1.optdate,'yyyy-MM-dd hh24:mi') optdate,
  764. decode(substr(t1.shiftcode, 1, 1),
  765. '1',
  766. '白班',
  767. '2',
  768. '小夜',
  769. '3',
  770. '大夜') shiftcode1,
  771. decode(substr(t1.shiftcode, 2, 1),
  772. '1',
  773. '甲班',
  774. '2',
  775. '乙班',
  776. '3',
  777. '丙班',
  778. '4',
  779. '丁班') shiftcode2,
  780. t1.sage,
  781. t1.gage,
  782. t1.ironpotwgt,
  783. t1.wsteelwgt,
  784. t1.emolstltime,
  785. t1.terminustept,
  786. t1.pottemp,
  787. t3.c B_C,
  788. t3.si B_SI,
  789. t3.mn B_MN,
  790. t3.p B_P,
  791. t3.s B_S,
  792. t4.c GP_C,
  793. t4.si GP_SI,
  794. t4.mn GP_MN,
  795. t4.p GP_P,
  796. t4.s GP_S,
  797. t4.v GP_V,
  798. t5.staytime,
  799. t6.balestaytime,
  800. t6.stlwgt
  801. from (select *
  802. from stl_bof_optinfo
  803. union
  804. select * from j#stl_bof_optinfo) t1
  805. left join (select m1.steelcode, m1.steel from com_steel m1) t2
  806. on t1.plansteel = t2.steelcode
  807. left join (select m3.heatno, m3.c, m3.si, m3.mn, m3.p, m3.s
  808. from (select row_number() over(partition by m2.heatno order by m2.assaytypecode desc) xh,
  809. count(1) over(partition by m2.heatno) cnt,
  810. m2.heatno,
  811. m2.stationcode,
  812. m2.assaytypecode,
  813. m2.c,
  814. m2.si,
  815. m2.mn,
  816. m2.p,
  817. m2.s
  818. from (select *
  819. from stl_chemelement
  820. union
  821. select * from j#stl_chemelement) m2
  822. where substr(m2.stationcode, 1, 1) = 'C') m3
  823. where m3.xh = m3.cnt) t3
  824. on t1.heatno = t3.heatno
  825. left join (select m5.heatno, m5.c, m5.si, m5.mn, m5.p, m5.s,m5.v
  826. from (select row_number() over(partition by m4.heatno order by m4.assaytypecode desc) xh,
  827. count(1) over(partition by m4.heatno) cnt,
  828. m4.heatno,
  829. m4.stationcode,
  830. m4.assaytypecode,
  831. m4.c,
  832. m4.si,
  833. m4.mn,
  834. m4.p,
  835. m4.s,
  836. m4.v
  837. from (select *
  838. from stl_chemelement
  839. union
  840. select * from j#stl_chemelement) m4
  841. where substr(m4.stationcode, 1, 1) = 'G') m5
  842. where m5.xh = m5.cnt) t4
  843. on t1.heatno = t4.heatno
  844. left join (select *
  845. from stl_cas_optinfo
  846. union
  847. select * from j#stl_cas_optinfo) t5
  848. on t1.heatno = t5.heatno
  849. left join (select m6.heatno,
  850. ceil((m6.balestarttime - m6.balepftime) * 24 * 60 * 60) BALESTAYTIME,
  851. ceil(m6.PFBALEWGT - m6.BALELEAVEWGT) STLWGT
  852. from (select *
  853. from stl_ccm_optinfo
  854. union
  855. select * from j#stl_ccm_optinfo) m6) t6
  856. on t1.heatno = t6.heatno
  857. where to_char(t1.optdate,'yyyymmdd') between ? and ?
  858. order by t1.optdate
  859. ]]>
  860. </query>
  861. </queryMap>