<?xml version="1.0" encoding="UTF-8"?>
<queryMap desc = "连轧">
<query id = "FrmRollingReport.doQueryData" desc = "查询">
<![CDATA[
SELECT T2.LOT_NO,
       REGEXP_REPLACE(T.JUDGE_STOVE_NO, '-.*', '') JUDGE_STOVE_NO,
       (SELECT B.PLINE_NAME
          FROM COM_BASE_PLINE B
         WHERE B.PLINE_CODE = T.PLINE_CODE) PLINE_CODE,
       T1.STEELNAME,
       T1.GRADENAME,
       T.TUBESIZE PIPE_SIZE,
       T.LIMIT_SPEED,
       T.RACK_SPEED1,
       T.RACK_SPEED2,
       T.RACK_SPEED3,
       T.RACK_SPEED4,
       T.RACK_SPEED5,
       T.RACK_SPEED6,
       T.RACK_SPACE1,
       T.RACK_SPACE2,
       T.RACK_SPACE3,
       T.RACK_SPACE4,
       T.RACK_SPACE5,
       T.RACK_SPACE6,
       T.EXT1_RACK_SPEED,
       COUNT(T2.STATUS) ROLLINGNUM,
       CASE
         WHEN T2.STATUS = '1' THEN
          COUNT(T2.STATUS)
         ELSE
          0
       END SCRAP_NUM,
       T2.SCRAP_REASON,
       CASE
         WHEN T2.STATUS = '0' THEN
          COUNT(T2.STATUS)
         ELSE
          0
       END QUALIFIED_NUM,
       TO_CHAR(T2.END_ROLLING_TIME, 'YYYY-MM-DD HH24:MI:SS') END_TIME,
       DECODE(T2.COL_SHIFT, '1', '早班', '2', '中班', '3', '夜班', '0', '常白班') COL_SHIFT,
       DECODE(T2.COL_GROUP, '1', '甲', '2', '乙', '3', '丙', '4', '丁') COL_GROUP,
       T2.COL_USER,
       T.REMARK,
       t.vrs_speed,
       t.INSERT_LENGTH,
       t.ROLLING_FORCE1,
       t.ROLLING_FORCE2,
       t.ROLLING_FORCE3,
       t.ROLLING_FORCE4,
       t.ROLLING_FORCE5,
       t.ROLLING_FORCE6,
       t.ROLLING_FORCE7
  FROM MIL_ROLLING_RACK T2
  LEFT JOIN MIL_PLAN T1
    ON T2.JUDGE_STOVE_NO = T1.JUDGE_STOVE_NO
  LEFT JOIN MIL_ROLLING_RESULT T
    ON T2.JUDGE_STOVE_NO = T.JUDGE_STOVE_NO
 WHERE T2.END_ROLLING_TIME >= to_date(?, 'yyyy-MM-dd HH24:mi:ss')
   AND T2.END_ROLLING_TIME <= to_date(?, 'yyyy-MM-dd HH24:mi:ss')
   AND T2.COL_SHIFT || '&' LIKE ('%' || ? || '%')
   AND T2.COL_GROUP || '&' LIKE ('%' || ? || '%')
   AND T2.JUDGE_STOVE_NO  || '&' LIKE ('%' || ? || '%')
]]>
</query>
</queryMap>