<?xml version="1.0" encoding="UTF-8"?>
<queryMap desc = "修改处理结果">
<query id = "FrmQueryScrapBack.doQueryData" desc = "查询处理结果">
<![CDATA[
SELECT T.RESULT_NO,
       T.JUDGE_STOVE_NO,
       T.SEQ,
       T.PROCESS_NO AS PROCESS_NO_CODE,
       DECODE(T.PROCESS_NO,
              0,
              '锯切前',
              1,
              '锯切后',
              2,
              '加热炉',
              3,
              '穿孔',
              4,
              '连轧',
              5,
              '再加热炉',
              6,
              '定径',
              7,
              '分切前',
              8,
              '分切后',
              9,
              '矫直',
              10,
              '探伤',
              11,
              '质检') PROCESS_NO,
       T.SRACP_REASON,
       T.PRO_PLAN_ID,
       T.GX_PLAN_NO,
       T.PLINE_CODE,
       T.MAT_NO,
       T.GROUP_FLAG,
       T.NEW_HEAT_NO,
       T.NEW_MAT_NO,
       (SELECT S.BASENAME
          FROM COM_BASE_INFO S
         WHERE S.BASECODE = T.HANDLE_RESULT) HANDLE_RESULT,
       DECODE(T.FLAG, '0', '未处理', '1', '已处理') FLAG,
       T.REMARK,
       T.SCRAP_USER,
       TO_CHAR(T.TIME, 'YYYY-MM-DD HH24:MI:SS') TIME,
       DECODE(T.SCRAP_SHIFT, '0', '常白班', '1', '早', '2', '中', 3, '晚') SCRAP_SHIFT,
       DECODE(T.SCRAP_GROUP, '1', '甲', 2, '乙', 3, '丙', 4, '丁') SCRAP_GROUP,
       T.COL_USER,
       TO_CHAR(T.COL_TIME, 'YYYY-MM-DD HH24:MI:SS') COL_TIME,
       DECODE(T.COL_SHIFT, '0', '常白班', '1', '早', '2', '中', 3, '晚') COL_SHIFT,
       DECODE(T.COL_GROUP, '1', '甲', 2, '乙', 3, '丙', 4, '丁') COL_GROUP,
       ROUND(1000 * T2.DB_HEIGHT / T2.DB_LENGTH, 3) DBZ
  FROM MIL_SLAB_SCRAP T, MIL_PLAN T2
 WHERE T.JUDGE_STOVE_NO = T2.JUDGE_STOVE_NO
   AND T.PRO_PLAN_ID = T2.PRO_PLAN_ID
   AND T.GX_PLAN_NO = T2.GX_PLAN_NO
   AND T.JUDGE_STOVE_NO || '&' LIKE ('%' || ? || '%')
   AND T.PLINE_CODE = ?
   AND T.GROUP_FLAG = '0'
   AND T.PLINE_CODE = 'C072'
   AND T.PROCESS_NO < 2
 ]]>
</query>

<query id = "FrmQueryScrapBack.SelectAcount" desc = "查询支数">
<![CDATA[
SELECT COUNT(1) ACOUNT
  FROM MAT_GP_M_HISTORY T, MIL_PLAN T1
 WHERE T.JUDGE_STOVE_NO = T1.FEED_HEAT_NO
   AND T.PRO_PLAN_ID_ZG = T1.PRO_PLAN_ID
   AND T.GX_PLAN_NO_ZG = T1.GX_PLAN_NO
   AND T1.JUDGE_STOVE_NO = ?
   AND T1.PRO_PLAN_ID = ?
   AND T1.GX_PLAN_NO = ?
 ]]>
</query>

<query id = "FrmQueryScrapBack.SelectIsFC" desc = "验证是否是返库的炉号">
<![CDATA[
SELECT COUNT(1) ACOUNT
  FROM MIL_SLAB_SCRAP T
 WHERE T.JUDGE_STOVE_NO = ?
   AND T.PRO_PLAN_ID = ?
   AND T.GX_PLAN_NO = ?
   AND T.MAT_NO = ?
   AND T.HANDLE_RESULT = '500202'
   AND T.FLAG = '1'
 ]]>
</query>

<query id = "FrmQueryScrapBack.SelectIsNoChang" desc = "验证返库的炉号是否还在库里或者用作其它">
<![CDATA[
SELECT COUNT(1) ACOUNT
  FROM MAT_GP_M T
 WHERE T.MAT_NO = ?
   AND T.PRO_PLAN_ID_ZG IS NULL
   AND T.GX_PLAN_NO_ZG IS NULL
   AND T.MAT_STATUS = '80150102'
   AND T.HANGING_FLAG = '0'
 ]]>
</query>

<query id = "FrmQueryScrapBack.updateResult" desc = "修改处理结果">
UPDATE MIL_SLAB_SCRAP T
   SET T.COL_SHIFT     = ?,
       T.COL_GROUP     = ?,
       T.COL_USER      = ?,
       T.Handle_Result = ?,
       T.COL_TIME      = TO_DATE(?, 'YYYY-MM-DD HH24:MI:SS'),
       T.FLAG          = ?
 WHERE T.JUDGE_STOVE_NO = ?
   AND T.MAT_NO = ?
</query>
<query id = "FrmQueryScrapBack.updatePort" desc = "修改进程表">
UPDATE PORT_MIL_BATCH_SAMPLE_RESULT T
   SET T.HANDLE_RESULT = ?
 WHERE T.JUDGE_STOVE_NO = ?
   AND (T.M_MAT_NO = ? OR T.M_M_MAT_NO = ?)
</query>

<query id = "FrmQueryScrapBack.updateResultBack" desc = "修改处理结果">
UPDATE MIL_SLAB_SCRAP T
   SET T.FLAG          = '0',
       T.COL_SHIFT     = ?,
       T.COL_GROUP     = ?,
       T.COL_USER      = ?,
       T.Handle_Result = '0',
       T.COL_TIME      = TO_DATE(?, 'YYYY-MM-DD HH24:MI:SS')
 WHERE T.JUDGE_STOVE_NO = ?
   AND T.MAT_NO = ?
</query>

<query id = "FrmQueryScrapBack.returnLibrary" desc = "返库">
<![CDATA[
DECLARE
  V_INSTOCK_DOC      YDM_GP_INLIST.INSTOCK_DOC%TYPE := NULL; --入库单编号
  V_STORAGE_NO       YDM_GP_BUTTRESS.STORAGE_NO%TYPE := NULL; --仓库代码
  V_LOCATION_NO      YDM_GP_BUTTRESS.LOCATION_NO%TYPE := NULL; --库位代码
  V_LOCATION_NAME    YDM_GP_BUTTRESS.LOCATION_NAME%TYPE := NULL; --库位名称
  V_FEED_HEAT_NO     MAT_GP_M.JUDGE_STOVE_NO%TYPE := NULL; --炼钢判定炉号
  V_MAT_NO           MAT_GP_M.MAT_NO%TYPE := NULL; --材料号
  V_TIME             YDM_GP_OUTLIST.CREATE_TIME%TYPE := SYSDATE; --系统时间
  V_OUTSTOCK_DOC_HO  YDM_GP_OUTLIST.OUTSTOCK_DOC%TYPE := NULL; --红冲出库单编号
  V_OUTSTOCK_PLAN_NO YDM_GP_OUTLIST.OUTSTOCK_PLAN_NO%TYPE := NULL; --轧管炉计划ID
  V_PLINE_NAME       COM_BASE_PLINE.PLINE_NAME%TYPE := NULL;
  V_ICOUNT           NUMBER := 1;
  V_JUDGE_STOVE_NO   MIL_SLAB_SCRAP.JUDGE_STOVE_NO%TYPE := ?;
  V_PRO_PLAN_ID      MIL_SLAB_SCRAP.PRO_PLAN_ID%TYPE := ?;
  V_GX_PLAN_NO       MIL_SLAB_SCRAP.GX_PLAN_NO%TYPE := ?;
  V_PLINE_CODE       MIL_SLAB_SCRAP.PLINE_CODE%TYPE := ?;
  V_COL_USER         MIL_SLAB_SCRAP.COL_USER%TYPE := ?;
  S_MAT_NO           MIL_SLAB_SCRAP.MAT_NO%TYPE := ?; --管坯剔除子表材料号

BEGIN
  --找到炼钢判定炉号
  SELECT T.FEED_HEAT_NO, T.ID
    INTO V_FEED_HEAT_NO, V_OUTSTOCK_PLAN_NO
    FROM MIL_PLAN T
   WHERE T.JUDGE_STOVE_NO = V_JUDGE_STOVE_NO
     AND T.PRO_PLAN_ID = V_PRO_PLAN_ID
     AND T.GX_PLAN_NO = V_GX_PLAN_NO;

  --产线名称
  SELECT B.PLINE_NAME
    INTO V_PLINE_NAME
    FROM COM_BASE_PLINE B
   WHERE B.PLINE_CODE = V_PLINE_CODE;

  --生成材料号
  SELECT V_FEED_HEAT_NO ||
         LPAD(NVL(MAX(SUBSTR(T2.MAT_NO, LENGTH(T2.MAT_NO) - 2)), 0) + 1,
              3,
              0) MAT_NO
    INTO V_MAT_NO
    FROM (SELECT MAX(T.MAT_NO) MAT_NO
            FROM MAT_GP_M T
           WHERE T.JUDGE_STOVE_NO = V_FEED_HEAT_NO
          UNION ALL
          SELECT MAX(T1.MAT_NO) MAT_NO
            FROM YDM_GP_INLIST T1
           WHERE T1.JUDGE_STOVE_NO = V_FEED_HEAT_NO
          UNION ALL
          SELECT MAX(T3.MAT_NO) MAT_NO
            FROM MAT_GP_M_HISTORY T3
           WHERE T3.JUDGE_STOVE_NO = V_FEED_HEAT_NO) T2;

  --生成 返库入库单编号
  SELECT 'FK' || TO_CHAR(V_TIME, 'YYMMDD') ||
         LPAD(NVL(MAX(SUBSTR(T.INSTOCK_DOC, 9)), 0) + 1, 5, 0) DI
    INTO V_INSTOCK_DOC
    FROM YDM_GP_INLIST T
   WHERE TO_CHAR(T.INSTOCK_TIME, 'YYYY-MM-DD') =
         TO_CHAR(V_TIME, 'YYYY-MM-DD')
     AND T.INSTOCK_TYPE_CODE = '800710';

  --生成 红冲出库单编号
  SELECT 'HO' || TO_CHAR(V_TIME, 'YYMMDD') ||
         LPAD(NVL(MAX(SUBSTR(T.OUTSTOCK_DOC, 9)), 0) + 1, 5, 0) DI
    INTO V_OUTSTOCK_DOC_HO
    FROM YDM_GP_OUTLIST T
   WHERE TO_CHAR(T.CREATE_TIME, 'YYYY-MM-DD') =
         TO_CHAR(V_TIME, 'YYYY-MM-DD')
     and t.outstock_type_code = '800806';

  --仓库代码
  SELECT DECODE(V_PLINE_CODE,
                'C008',
                'TCC7',
                'C009',
                'TCC5',
                'C010',
                'TCC6',
                'C017',
                'TCC8'),
         DECODE(V_PLINE_CODE,
                'C008',
                'TCC710101',
                'C009',
                'TCC510104',
                'C010',
                'TCC611202',
                'C017',
                'TCC811502'),
         DECODE(V_PLINE_CODE,
                'C008',
                '回库料架1-1',
                'C009',
                '管坯库A区四号料架',
                'C010',
                '虚拟库位',
                'C017',
                '虚拟库位一号')
    INTO V_STORAGE_NO, V_LOCATION_NO, V_LOCATION_NAME
    FROM DUAL;

  FOR MYROW IN (SELECT t.*
                  FROM MAT_GP_M_HISTORY T
                 WHERE T.JUDGE_STOVE_NO = V_FEED_HEAT_NO
                   AND T.PRO_PLAN_ID_ZG = V_PRO_PLAN_ID
                   AND T.GX_PLAN_NO_ZG = V_GX_PLAN_NO
                   AND ROWNUM <= 1
                 ORDER BY T.MAT_NO) LOOP
  
    --管坯剔除子表写新材料号
    UPDATE MIL_SLAB_SCRAP T
       SET T.NEW_MAT_NO = V_MAT_NO
     WHERE T.MAT_NO = S_MAT_NO;
  
    --复制数据到物料主表
    insert into MAT_GP_M
      select * from MAT_GP_M_HISTORY t where t.mat_no = MYROW.MAT_NO;
  
    update MAT_GP_M t
       set t.mat_no            = V_MAT_NO,
           T.MAT_STATUS        = '80150102',
           T.HANGING_FLAG      = '0',
           T.PRO_PLAN_ID_ZG    = '',
           T.GX_PLAN_NO_ZG     = '',
           T.FIX_NUM           = 1,
           T.ACT_LEN           = MYROW.FIX_LEN,
           T.ACT_WEIGHT        = ROUND(MYROW.ACT_WEIGHT / MYROW.FIX_NUM, 3),
           T.ACT_THEORY_WEIGHT = ROUND(MYROW.ACT_THEORY_WEIGHT /
                                       MYROW.FIX_NUM,
                                       3),
           T.CREATE_NAME       = V_COL_USER,
           T.CREATE_TIME       = V_TIME,
           T.INSTOCK_TIME      = V_TIME,
           T.LK_FLAG           = '0',
           T.INSTANCY_FLAG     = '0'
     WHERE T.MAT_NO = MYROW.MAT_NO;
  
    --插入位置表
    INSERT INTO YDM_GP_BUTTRESS
      (MAT_NO,
       JUDGE_STOVE_NO,
       STORAGE_NO,
       LOCATION_NO,
       LARY_NO,
       STORAGE_ATTR,
       STORAGE_ATTR_NAME,
       STORAGE_TYPE_NO,
       STORAGE_TYPE_NAME,
       
       CREATE_NAME,
       CREATE_TIME,
       LOCATION_NAME)
    VALUES
      (V_MAT_NO,
       MYROW.JUDGE_STOVE_NO,
       V_STORAGE_NO,
       V_LOCATION_NO,
       1,
       '800302',
       '投料库',
       '800201',
       '管坯',
       
       V_COL_USER,
       V_TIME,
       V_LOCATION_NAME);
  
    --插入红冲出库记录
    INSERT INTO YDM_GP_OUTLIST
      (OUTSTOCK_SQE,
       OUTSTOCK_PLAN_NO,
       OUTSTOCK_DOC,
       OUTSTOCK_TYPE_CODE,
       OUTSTOCK_TYPE_NAME,
       
       MAT_NO,
       PRODUCT_FLAG,
       MAT_STATUS,
       STOVE_NO,
       FLAG_STOVE_NO,
       JUDGE_STOVE_NO,
       CAST_NO,
       CCMID,
       MATERIAL_NO,
       MATERIAL_NAME,
       GRADECODE,
       GRADENAME,
       STD_CODE,
       STD_NAME,
       DIMATER,
       HEIGHT,
       ACT_LEN,
       FIX_NUM,
       FIX_LEN,
       ACT_COUNT,
       ACT_WEIGHT,
       ACT_THEORY_WEIGHT,
       PONDER_NO,
       PONDER_GROSS_WT,
       PLINE_CODE,
       PLINE_NAME,
       PRO_ORDER_NO,
       ORDER_NO,
       ORDER_SEQ,
       ORDER_SEQ_NO,
       ORD_PK,
       ORD_LN_PK,
       ORD_LN_DLY_PK,
       BELONG_CODE,
       BELONG_NAME,
       BAR_CODE,
       STORAGE_NO,
       LOCATION_NO,
       
       RPO_TIME,
       PRO_BC,
       PRO_BZ,
       BAL_YEAR_MONTH,
       
       OUTSTOCK_TIME,
       
       MEMO,
       CREATE_NAME,
       CREATE_TIME,
       UPDATE_NAME,
       UPDATE_TIME,
       
       GROUD_NO,
       PRINT_STOVE_NO,
       PRO_PLAN_ID_ZG,
       GX_PLAN_NO_ZG,
       MAT_GOWHERE_CODE,
       MAT_GOWHERE_NAME)
    VALUES
      (V_OUTSTOCK_DOC_HO || LPAD(V_ICOUNT, 4, 0),
       V_OUTSTOCK_PLAN_NO,
       V_OUTSTOCK_DOC_HO,
       '800806',
       '出库红冲',
       
       V_MAT_NO,
       MYROW.PRODUCT_FLAG,
       MYROW.MAT_STATUS,
       MYROW.STOVE_NO,
       MYROW.FLAG_STOVE_NO,
       MYROW.JUDGE_STOVE_NO,
       MYROW.CAST_NO,
       MYROW.CCMID,
       MYROW.MATERIAL_NO,
       MYROW.MATERIAL_NAME,
       MYROW.GRADECODE,
       MYROW.GRADENAME,
       MYROW.STD_CODE,
       MYROW.STD_NAME,
       MYROW.DIMATER,
       MYROW.HEIGHT,
       MYROW.FIX_LEN,
       1,
       MYROW.FIX_LEN,
       -1,
       -ROUND(MYROW.ACT_WEIGHT / MYROW.FIX_NUM, 3),
       -ROUND(MYROW.ACT_WEIGHT / MYROW.FIX_NUM, 3),
       MYROW.PONDER_NO,
       MYROW.PONDER_GROSS_WT,
       MYROW.PLINE_CODE,
       MYROW.PLINE_NAME,
       MYROW.PRO_ORDER_NO,
       MYROW.ORDER_NO,
       MYROW.ORDER_SEQ,
       MYROW.ORDER_SEQ_NO,
       MYROW.ORD_PK,
       MYROW.ORD_LN_PK,
       MYROW.ORD_LN_DLY_PK,
       MYROW.BELONG_CODE,
       MYROW.BELONG_NAME,
       MYROW.BAR_CODE,
       V_STORAGE_NO,
       V_LOCATION_NO,
       
       V_TIME,
       MYROW.PRO_BC,
       MYROW.PRO_BZ,
       TO_CHAR(V_TIME, 'YYYYMM'),
       
       V_TIME,
       
       MYROW.MEMO,
       V_COL_USER,
       V_TIME,
       V_COL_USER,
       V_TIME,
       
       MYROW.GROUD_NO,
       MYROW.PRINT_STOVE_NO,
       '',
       '',
       V_PLINE_CODE,
       V_PLINE_NAME);
  
    V_ICOUNT := V_ICOUNT + 1;
  END LOOP;
END;
 ]]>
</query>

<query id = "FrmQueryScrapBack.returnLibraryBack" desc = "撤销返库">
<![CDATA[
DECLARE
  V_NEW_MAT_NO MIL_SLAB_SCRAP.NEW_MAT_NO%TYPE := ?;
BEGIN
  DELETE FROM MAT_GP_M T WHERE T.MAT_NO = V_NEW_MAT_NO;
  DELETE FROM YDM_GP_BUTTRESS T WHERE T.MAT_NO = V_NEW_MAT_NO;

  /*DELETE FROM YDM_GP_INLIST T
  WHERE T.INSTOCK_TYPE_CODE = '800710'
    AND T.MAT_NO = V_NEW_MAT_NO;*/

  DELETE FROM YDM_GP_OUTLIST T
   WHERE T.OUTSTOCK_TYPE_CODE = '800806'
     AND T.MAT_NO = V_NEW_MAT_NO;
END;
 ]]>
</query>
<query id = "FrmQueryScrapBack.selectMilPlan" desc = "查询轧管炉计划">
SELECT T.*, S.OUTWL_ID, S.OUTWL_DESC,S.OUTDIAMETER,S.WALLTHICK,S.LEN_ROLL_MIN,S.LEN_ROLL_MAX,S.AIMLENGTH
  FROM MIL_PLAN T, PLN_ORDER_ZG_S S
 WHERE T.PRO_PLAN_ID = S.PRO_PLAN_ID
   AND T.GX_PLAN_NO = S.GX_PLAN_NO
   AND T.JUDGE_STOVE_NO = '#JUDGE_STOVE_NO#'
</query>
<query id = "FrmQueryScrapBack.selectMatNoZg" desc = "查询材料号">
SELECT ? || 'F' ||
       LPAD(NVL(MAX(SUBSTR(T.MAT_NO, LENGTH(T.MAT_NO) - 3)), 0) + 1, 4, 0) MAT_NO
  FROM (SELECT MAX(T1.MAT_NO) MAT_NO
          FROM MAT_BC_M T1
         WHERE T1.JUDGE_STOVE_NO = ?
           AND T1.BATCH_NO = 'F'
        UNION ALL
        SELECT MAX(T3.MAT_NO) MAT_NO
          FROM MAT_ZC_BACKUP T3
         WHERE T3.JUDGE_STOVE_NO = ?
           AND T3.BATCH_NO = 'F'
        UNION ALL
        SELECT MAX(T4.MAT_NO) MAT_NO
          FROM YDM_BC_INLIST T4
         WHERE T4.JUDGE_STOVE_NO = ?
           AND T4.BATCH_NO = 'F') T
</query>
<query id = "FrmQueryScrapBack.selectWgtM" desc = "查询母坯重量">
SELECT SUM(T.INPUT_WEIGHT) WEIGHT
  FROM PORT_MIL_BATCH_SAMPLE_RESULT T
 WHERE T.JUDGE_STOVE_NO = '#JUDGE_STOVE_NO#'
   AND T.M_M_MAT_NO = '#MAT_NO#'
</query>
<query id = "FrmQueryScrapBack.selectWgt" desc = "查询单倍坯重量">
SELECT SUM(T.INPUT_WEIGHT) WEIGHT
  FROM PORT_MIL_BATCH_SAMPLE_RESULT T
 WHERE T.JUDGE_STOVE_NO = '#JUDGE_STOVE_NO#'
   AND T.M_MAT_NO = '#MAT_NO#'
</query>
<query id = "FrmQueryScrapBack.insertMatBc" desc = "插入库存">
 DECLARE
 BEGIN
 INSERT INTO MAT_BC_M(
        MAT_NO,
        PRODUCT_FLAG,
        MAT_STATUS,
        LOT_NO,
        STOVE_NO,
        JUDGE_STOVE_NO,
        BATCH_NO,
        BATCH_GROUD_NO,
        MATERIAL_NO,
        MATERIAL_NAME,
        PRODUCCODE,
        PRODUCNAME,
        STEELCODE,
        STEELNAME,
        GRADECODE,
        GRADENAME,
        SPEC_CODE,
        SPEC_NAME,
        MODEL_CODE,
        MODEL_DESC,
        STD_CODE,
        STD_NAME,
        STD_STYLE,
        STD_STYLE_DESC,
        PRO_ORDER_NO,
        PROCESS_CDOE,
        PROCESS_DESC,
        PLINE_CODE,
        PLINE_NAME,
        ACT_DIMATER,
        ACT_HEIGHT,
        ACT_LEN,
        ACT_LEN_MIN,
        ACT_LEN_MAX,
        ACT_COUNT,
        ACT_WEIGHT,
        ACT_THEORY_WEIGHT,
        BELONG_CODE,
        BELONG_NAME,
        JUDGE_RESULT_CODE,
        JUDGE_RESULT,
        INSTOCK_TIME,
        CREATE_NAME,
        CREATE_TIME,
        QCM_STAUS,
        HEAT_PLAN_NO,
        ZG_STOVE_SQE,
        GX_PLAN_NO,
        TARGET,
        PROCESS_STATUS,
        FLAG_STOVE_NO_ZG,
        BELONG_CODE_RESPONSE,
        BELONG_NAME_RESPONSE,
        SCRAP_TYPE)
 VALUES( 
        '#MAT_NO#',
        '#PRODUCT_FLAG#',
        '#MAT_STATUS#',
        '#LOT_NO#',
        '#STOVE_NO#',
        '#JUDGE_STOVE_NO#',
        '#BATCH_NO#',
        '#BATCH_GROUD_NO#',
        '#MATERIAL_NO#',
        '#MATERIAL_NAME#',
        '#PRODUCCODE#',
        '#PRODUCNAME#',
        '#STEELCODE#',
        '#STEELNAME#',
        '#GRADECODE#',
        '#GRADENAME#',
        '#SPEC_CODE#',
        '#SPEC_NAME#',
        '#MODEL_CODE#',
        '#MODEL_DESC#',
        '#STD_CODE#',
        '#STD_NAME#',
        '#STD_STYLE#',
        '#STD_STYLE_DESC#',
        '#PRO_ORDER_NO#',
        '#PROCESS_CDOE#',
        '#PROCESS_DESC#',
        '#PLINE_CODE#',
        '#PLINE_NAME#',
        '#ACT_DIMATER#',
        '#ACT_HEIGHT#',
        '#ACT_LEN#',
        '#ACT_LEN_MIN#',
        '#ACT_LEN_MAX#',
        '#ACT_COUNT#',
        '#ACT_WEIGHT#',
        '#ACT_THEORY_WEIGHT#',
        '#BELONG_CODE#',
        '#BELONG_NAME#',
        '#JUDGE_RESULT_CODE#',
        '#JUDGE_RESULT#',
        TO_DATE('#INSTOCK_TIME#','YYYY-MM-DD HH24:MI:SS'),
        '#CREATE_NAME#',
        TO_DATE('#CREATE_TIME#','YYYY-MM-DD HH24:MI:SS'),
        '#QCM_STAUS#',
        '#HEAT_PLAN_NO#',
        '#ZG_STOVE_SQE#',
        '#GX_PLAN_NO#',
        '#TARGET#',
        '#PROCESS_STATUS#',
        '#FLAG_STOVE_NO_ZG#',
        '#BELONG_CODE_RESPONSE#',
        '#BELONG_NAME_RESPONSE#',
        '#SCRAP_TYPE#');
         INSERT INTO YDM_BC_BUTTRESS(
        MAT_NO,
        JUDGE_STOVE_NO,
        BATCH_NO,
        BATCH_GROUD_NO,
        STORAGE_NO,
        LOCATION_NO,
        LARY_NO,
        CREATE_NAME,
        CREATE_TIME)
 VALUES( 
        '#MAT_NO#',
        '#JUDGE_STOVE_NO#',
        '#BATCH_NO#',
        '#BATCH_GROUD_NO#',
        '#STORAGE_NO#',
        '#LOCATION_NO#',
        '#LARY_NO#',
        '#CREATE_NAME#',
        TO_DATE('#CREATE_TIME#','YYYY-MM-DD HH24:MI:SS'));
 END;
</query>
</queryMap>