<?xml version="1.0" encoding="UTF-8"?>
<queryMap desc = "上料锯切">
<query id = "FrmFeedSaw.queryMinResult" desc = "查询">
<![CDATA[
SELECT REGEXP_REPLACE(T.JUDGE_STOVE_NO, '-.*', '') JUDGE_STOVE_NO,
       DECODE(T.COL_SHIFT, 1, '早班', 2, '中班', 3, '夜班', 0, '常白班') COL_SHIFT,
       DECODE(T.COL_GROUP, 1, '甲', 2, '乙', 3, '丙', 4, '丁') COL_GROUP,
       T.PLINE_CODE,
       (SELECT B.PLINE_NAME
          FROM COM_BASE_PLINE B
         WHERE B.PLINE_CODE = T.PLINE_CODE) PLINE_NAME,
       TO_CHAR(MAX(T.END_TIME), 'YYYY-MM-DD HH24:MI:SS') START_TIME,
       T.FEED_ROW_NO,
       T.LOT_NO,
       T.DB_NUM ,
       NVL(COUNT(*), 0) FEED_NUM,
       (T.DB_NUM * COUNT(*)) - NVL(SUM(T.SCRAP_DBNUM), 0) CUT_NUM,
       NVL(SUM(T.SCRAP_DBNUM), 0) AFTER_SCRAP_NUM,
       (SELECT COUNT(*)
          FROM MIL_FEED_RACK B
         WHERE B.MAT_NO IS NOT NULL
           AND B.STATUS = '3'
           AND B.JUDGE_STOVE_NO = T.JUDGE_STOVE_NO
           AND B.RESULT_NO=T.RESULT_NO
           AND B.COL_SHIFT = T.COL_SHIFT
           AND B.COL_GROUP = T.COL_GROUP) BEFORE_SCRAP_NUM,
       T3.VARIETIES,
       T3.GRADENAME,
       T3.PIPE_SECTION,
       T2.FEED_LENGTH,
       T2.DB_LENGTH,
       TRIM(T1.REMARK) REMARK,
        T.COL_USER
  FROM MIL_FEED_RACK      T,
       MIL_FEEDSAW_RESULT T1,
       MIL_FEED_PLAN      T2,
       MIL_PLAN           T3
 WHERE  T.JUDGE_STOVE_NO = T2.JUDGE_STOVE_NO
   AND T.FEED_ROW_NO=T2.FEED_ROW_NO(+)
   AND T.JUDGE_STOVE_NO = T3.JUDGE_STOVE_NO(+)
   AND T.RESULT_NO=T3.ID
   AND T.JUDGE_STOVE_NO = T1.JUDGE_STOVE_NO(+)
   AND T.RESULT_NO = T1.RESULT_NO(+)
   AND T.STATUS != '3'
]]>
</query>

<query id = "FrmFeedSaw.updateResult1" desc = "修改锯切">
<![CDATA[
UPDATE MIL_FEED_RACK T
   SET T.COL_SHIFT = ?,
       T.COL_GROUP = ?,
       T.END_TIME  = TO_DATE(?, 'YYYY-MM-DD HH24:MI:SS')
 WHERE T.JUDGE_STOVE_NO = ? || '-01'
   AND NVL(T.COL_USER,'/') = NVL(?,'/')
]]>
</query>

<query id = "FrmFeedSaw.updateResult2" desc = "环形炉">
<![CDATA[
UPDATE MIL_FUR_RACK T
   SET T.COL_SHIFT = ?,
       T.COL_GROUP = ?,
       T.IN_SHIFT  = ?,
       T.IN_GROUP  = ?,
       T.END_TIME  = TO_DATE(?, 'YYYY-MM-DD HH24:MI:SS')
 WHERE T.JUDGE_STOVE_NO = ? || '-01'
  -- AND NVL(T.COL_USER, '/') = NVL(?, '/')
]]>
</query>

<query id = "FrmFeedSaw.updateResult3" desc = "修改穿孔">
<![CDATA[
UPDATE MIL_PERFORATION_RACK T
   SET T.COL_SHIFT  = ?,
       T.COL_GROUP  = ?,
       T.END_PERFORATION_TIME = TO_DATE(?, 'YYYY-MM-DD HH24:MI:SS')
 WHERE T.JUDGE_STOVE_NO = ? || '-01'
 AND NVL(T.COL_USER,'/') = NVL(?,'/')
]]>
</query>

<query id = "FrmFeedSaw.updateResult4" desc = "修改连轧">
<![CDATA[
UPDATE MIL_ROLLING_RACK T
   SET T.COL_SHIFT  = ?,
       T.COL_GROUP  = ?,
       T.END_ROLLING_TIME = TO_DATE(?, 'YYYY-MM-DD HH24:MI:SS')
 WHERE T.JUDGE_STOVE_NO = ? || '-01'
 AND NVL(T.COL_USER,'/') = NVL(?,'/')
]]>
</query>

<query id = "FrmFeedSaw.updateResult6" desc = "修改定径">
<![CDATA[
UPDATE MIL_SIZING_RACK T
   SET T.COL_SHIFT  = ?,
       T.COL_GROUP  = ?,
       T.END_SIZING_TIME = TO_DATE(?, 'YYYY-MM-DD HH24:MI:SS')
 WHERE T.JUDGE_STOVE_NO = ? || '-01'
 AND NVL(T.COL_USER,'/') = NVL(?,'/')
]]>
</query>

<query id = "FrmFeedSaw.updateResult11" desc = "修改热取样">
<![CDATA[
UPDATE MIL_HOT_CHECK T
   SET T.COL_SHIFT  = ?,
       T.COL_GROUP  = ?,
       T.CHECK_DATE = TO_DATE(?, 'YYYY-MM-DD HH24:MI:SS')
 WHERE T.JUDGE_STOVE_NO = ? || '-01'
 AND NVL(T.INSPECTOR,'/') = NVL(?,'/')
]]>
</query>

<query id = "FrmFeedSaw.updateResult9" desc = "修改管排锯">
<![CDATA[
UPDATE MIL_SAW_RACK T
   SET T.COL_SHIFT  = ?,
       T.COL_GROUP  = ?,
       T.END_SAW_TIME = TO_DATE(?, 'YYYY-MM-DD HH24:MI:SS')
 WHERE T.JUDGE_STOVE_NO = ? || '-01'
 AND NVL(T.COL_USER,'/') = NVL(?,'/')
]]>
</query>

<query id = "FrmFeedSaw.updateResult10" desc = "修改矫直">
<![CDATA[
UPDATE MIL_STRAIGH_RACK T
   SET T.COL_SHIFT  = ?,
       T.COL_GROUP  = ?,
       T.END_STRAIGHTENING_TIME = TO_DATE(?, 'YYYY-MM-DD HH24:MI:SS')
 WHERE T.JUDGE_STOVE_NO = ? || '-01'
 AND NVL(T.COL_USER,'/') = NVL(?,'/')
]]>
</query>

<query id = "FrmFeedSaw.updateResult7" desc = "修改探伤">
<![CDATA[
UPDATE MIL_TESTING_RACK T
   SET T.COL_SHIFT  = ?,
       T.COL_GROUP  = ?,
       T.END_INSPECTION_TIME = TO_DATE(?, 'YYYY-MM-DD HH24:MI:SS')
 WHERE T.JUDGE_STOVE_NO  LIKE ( ? || '-%')
 AND NVL(T.COL_USER,'/') = NVL(?,'/')
]]>
</query>

<query id = "FrmFeedSaw.updateResult8" desc = "修改人工质检">
<![CDATA[
UPDATE MIL_SURFACE_RESULT T
   SET T.COL_SHIFT  = ?,
       T.COL_GROUP  = ?,
       T.END_TIME = TO_DATE(?, 'YYYY-MM-DD HH24:MI:SS')
 WHERE T.JUDGE_STOVE_NO = ?
AND NVL(T.COL_USER,'/') = NVL(?,'/')
]]>
</query>

</queryMap>