72d582945d4bc34d8358f893edaa1b24704ccabe.svn-base 5.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148
  1. <?xml version="1.0" encoding='UTF-8'?>
  2. <queryMap desc="酸轧轧制机组统计">
  3. <query id="UIC030001_01.SELECT">
  4. <![CDATA[
  5. select '普钢' LJ,
  6. sum(to_number(round(t.ACT_WGT / 1000, 2))) CL,
  7. round(sum(decode(t.CUT_EDGE_YN,
  8. 'True',
  9. to_number(round(t.ACT_WGT / 1000, 2)),
  10. 0)) / sum(to_number(round(t.ACT_WGT / 1000, 2))),
  11. 2) QBBL,
  12. round(avg(t.COIL_THK), 2) pjhd,
  13. round(avg(t.COIL_WTH), 2) pjkd,
  14. round(avg(to_number(t.ACT_WGT / 1000)), 2) PJJZ
  15. from C_TBL02_COIL_COMM t
  16. where t.MILL_DTIME BETWEEN ? AND ?
  17. and t.SPEC_STL_GRD not like '%W%'
  18. and t.MILL_GROUP <> '0'
  19. UNION ALL
  20. select '硅钢' LJ,
  21. sum(to_number(round(t.ACT_WGT / 1000, 2))) CL,
  22. round(sum(decode(t.CUT_EDGE_YN,
  23. 'True',
  24. to_number(round(t.ACT_WGT / 1000, 2)),
  25. 0)) / sum(to_number(round(t.ACT_WGT / 1000, 2))),
  26. 2) QBBL,
  27. round(avg(t.COIL_THK), 2) pjhd,
  28. round(avg(t.COIL_WTH), 2) pjkd,
  29. round(avg(to_number(t.ACT_WGT / 1000)), 2) PJJZ
  30. from C_TBL02_COIL_COMM t
  31. where t.MILL_DTIME BETWEEN ? AND ?
  32. and t.SPEC_STL_GRD like '%W%'
  33. and t.MILL_GROUP <> '0'
  34. UNION ALL
  35. select '累计' LJ,
  36. sum(to_number(round(t.ACT_WGT / 1000, 2))) CL,
  37. round(sum(decode(t.CUT_EDGE_YN,
  38. 'True',
  39. to_number(round(t.ACT_WGT / 1000, 2)),
  40. 0)) / sum(to_number(round(t.ACT_WGT / 1000, 2))),
  41. 2) QBBL,
  42. round(avg(t.COIL_THK), 2) pjhd,
  43. round(avg(t.COIL_WTH), 2) pjkd,
  44. round(avg(to_number(t.ACT_WGT / 1000)), 2) PJJZ
  45. from C_TBL02_COIL_COMM t
  46. where t.MILL_DTIME BETWEEN ? AND ?
  47. and t.MILL_GROUP <> '0'
  48. UNION ALL
  49. select '平均日产' LJ,
  50. round(sum(to_number(round(t.ACT_WGT / 1000, 2)))/
  51. (TO_DATE(?,'YYYY/MM/DD')-TO_DATE(?,'YYYY/MM/DD'))) CL,
  52. to_number('') QBBL,
  53. to_number('') pjhd,
  54. to_number('') pjkd,
  55. to_number('') PJJZ
  56. from C_TBL02_COIL_COMM t
  57. where t.MILL_DTIME BETWEEN ? AND ?
  58. and t.MILL_GROUP <> '0'
  59. ]]>
  60. </query>
  61. <query id="UIC030001_02.SELECT" desc="酸轧轧制机组">
  62. <![CDATA[
  63. select T.SPEC_STL_GRD LJ,
  64. round(sum(t.ACT_WGT) / 1000, 2) CL,
  65. --ROUND(sum(t1.coil_wgt) / 1000, 2) coil_wgt,
  66. ROUND((sum(t.ACT_WGT) / sum(t1.coil_wgt)) * 100, 2) || '%' ccl,
  67. SUM(T2.ZZSJ) ZZSJ,
  68. round(round(sum(t.ACT_WGT) / 1000, 2) / SUM(T2.ZZSJ), 2) * 60 JSCL,
  69. sum(t.COIL_LEN / 1000) COIL_LEN,
  70. round(sum(t.COIL_LEN / 1000) / SUM(T2.ZZSJ), 2) ZZSD
  71. from (select T.SPEC_STL_GRD,
  72. sum(t.ACT_WGT) act_wgt,
  73. SUBSTR(t.COIL_NO, 1, 11) coil_no,
  74. MAX(t.COIL_LEN) COIL_LEN
  75. from C_TBL02_COIL_COMM t
  76. where t.MILL_GROUP <> 0
  77. and t.ACT_WGT is not null
  78. -- and t.SPEC_STL_GRD = '50XW1300'
  79. and t.MILL_DTIME BETWEEN ? AND ?
  80. group by SUBSTR(t.COIL_NO, 1, 11), t.SPEC_STL_GRD) t,
  81. C_TBF03_SPEC_MILL t1,
  82. (select substr(t.L_COIL_NO, 1, 11) coil_no,
  83. t1.SPEC_STL_GRD,
  84. sum(ROUND(to_number((to_date(t.ROLLING_END1,
  85. 'yyyy-mm-dd hh24:mi:ss') -
  86. to_date(T.ROLLING_BEGIN1,
  87. 'yyyy-mm-dd hh24:mi:ss'))) * 24 * 60,
  88. 2)) zzsj
  89. from C_TBL02_PLTCM_RESULT t, c_tbl02_coil_comm t1
  90. where t1.COIL_NO = t.L_COIL_NO
  91. and t1.MILL_DTIME BETWEEN ? AND ?
  92. and (t.ROLLING_END1 not like '%年%' or T.ROLLING_BEGIN1 not like '%年%')
  93. and (t.ROLLING_END1 not like '%月%' or T.ROLLING_BEGIN1 not like '%月%')
  94. and (t.ROLLING_END1 not like '%日%' or T.ROLLING_BEGIN1 not like '%日%')
  95. --and t1.SPEC_STL_GRD = '50XW1300'
  96. group by t1.SPEC_STL_GRD, substr(t.L_COIL_NO, 1, 11)) T2
  97. where SUBSTR(t1.c_coil_no, 1, 11) = t.COIL_NO
  98. AND t.COIL_NO = T2.coil_no
  99. group by T.SPEC_STL_GRD
  100. union all
  101. select '累计' LJ,
  102. round(sum(t.ACT_WGT) / 1000, 2) CL,
  103. --ROUND(sum(t1.coil_wgt) / 1000, 2) coil_wgt,
  104. ROUND((sum(t.ACT_WGT) / sum(t1.coil_wgt)) * 100, 2) || '%' ccl,
  105. SUM(T2.ZZSJ) ZZSJ,
  106. round(round(sum(t.ACT_WGT) / 1000, 2) / SUM(T2.ZZSJ), 2) * 60 JSCL,
  107. sum(t.COIL_LEN / 1000) COIL_LEN,
  108. round(sum(t.COIL_LEN / 1000) / SUM(T2.ZZSJ), 2) ZZSD
  109. from (select T.SPEC_STL_GRD,
  110. sum(t.ACT_WGT) act_wgt,
  111. SUBSTR(t.COIL_NO, 1, 11) coil_no,
  112. MAX(t.COIL_LEN) COIL_LEN
  113. from C_TBL02_COIL_COMM t
  114. where t.MILL_GROUP <> 0
  115. and t.ACT_WGT is not null
  116. --and t.SPEC_STL_GRD = '50XW1300W'
  117. and t.MILL_DTIME BETWEEN ? AND ?
  118. group by SUBSTR(t.COIL_NO, 1, 11), t.SPEC_STL_GRD) t,
  119. C_TBF03_SPEC_MILL t1,
  120. (select substr(t.L_COIL_NO, 1, 11) coil_no,
  121. t1.SPEC_STL_GRD,
  122. sum(ROUND(to_number((to_date(t.ROLLING_END1,
  123. 'yyyy-mm-dd hh24:mi:ss') -
  124. to_date(T.ROLLING_BEGIN1,
  125. 'yyyy-mm-dd hh24:mi:ss'))) * 24 * 60,
  126. 2)) zzsj
  127. from C_TBL02_PLTCM_RESULT t, c_tbl02_coil_comm t1
  128. where t1.COIL_NO = t.L_COIL_NO
  129. and t1.MILL_DTIME BETWEEN ? AND ?
  130. and (t.ROLLING_END1 not like '%年%' or T.ROLLING_BEGIN1 not like '%年%')
  131. and (t.ROLLING_END1 not like '%月%' or T.ROLLING_BEGIN1 not like '%月%')
  132. and (t.ROLLING_END1 not like '%日%' or T.ROLLING_BEGIN1 not like '%日%')
  133. --and t1.SPEC_STL_GRD = '50XW1300W'
  134. group by t1.SPEC_STL_GRD, substr(t.L_COIL_NO, 1, 11)) T2
  135. where SUBSTR(t1.c_coil_no, 1, 11) = t.COIL_NO
  136. AND t.COIL_NO = T2.coil_no
  137. ]]>
  138. </query>
  139. </queryMap>