<?xml version="1.0" encoding="UTF-8"?>
<queryMap desc = "入库记录红冲">
<query id = "FrmInListRead.doQueryInList" desc = "查询库存记录">
<![CDATA[
 SELECT 
       T1.LOT_NO,
       T1.PRO_ORDER_NO,
       T1.JUDGE_STOVE_NO,
       T1.BATCH_NO,
       T1.BATCH_GROUD_NO,
       T1.PRODUCCODE,
       T1.PRODUCNAME,
       T1.STEELCODE,
       T1.STEELNAME,
       T1.SPEC_CODE,
       T1.SPEC_NAME,
       T1.MODEL_CODE,
       T1.MODEL_DESC,
       T1.STD_CODE,
       T1.STD_NAME,
       T1.ORDER_NO,
       T1.ORDER_SEQ,
       T1.ORDER_SEQ_NO,
       T1.ACT_DIMATER,
       T1.ACT_HEIGHT,
       T1.BELONG_CODE,
       T1.BELONG_NAME,
       T1.STD_STYLE,
       T1.STD_STYLE_DESC,
       T1.GRADECODE,
       T1.GRADENAME,
      sum(T1.ACT_COUNT)
            ACT_COUNT,
            to_char(sum(T1.Act_Weight),'FM999999990.000')
           Act_Weight,
           
       T1.ACT_LEN,
       
       T1.LEN_NO,
       T1.LEN_DESC,
       T1.LEN_UNIT,
       max(to_char(T1.ACT_LEN_MIN,'FM999990.00')) AS ACT_LEN_MIN,
       max(to_char(T1.ACT_LEN_MAX,'FM999990.00')) AS ACT_LEN_MAX,
       max(to_char(T1.ACT_LEN_MIN,'FM999990.00')||'-'||to_char(T1.ACT_LEN_MAX,'FM999990.00')) as LEN,
       max(to_char(T1.INSTOCK_TIME,'YYYY-MM-DD HH24:MI:SS')) INSTOCK_TIME,
       T2.STORAGE_NO,
       S.STORAGE_NAME,
       T1.MEMO,
       T1.MAT_STATUS,
       T1.JUDGE_STD_CODE,
       T1.JUDGE_STD_NAME,
       T1.PLINE_CODE,
       T1.PLINE_NAME,
       T1.ORD_LN_PK,
       T1.ORD_PK,
       T1.ORD_LN_DLY_PK,
       T1.MAT_ORIGIN_CODE,
       T1.MAT_ORIGIN_NAME,
       T1.SOURE_CODE,
       T1.SOURE_NAME,
       --to_char(to_date(T1.BAL_YEAR_MONTH,'YYYY-MM'),'yyyy-MM') as BAL_YEAR_MONTH,
       T1.PRODUCT_FLAG,
       T1.MATERIAL_NO,
       T1.MATERIAL_NAME
  FROM MAT_ZC_M T1, YDM_ZC_BUTTRESS T2
 LEFT JOIN ydm_bs_storage S ON S.STORAGE_NO=T2.STORAGE_NO
 WHERE T1.JUDGE_STOVE_NO = T2.JUDGE_STOVE_NO
   AND T1.BATCH_NO = T2.BATCH_NO
    AND T1.MAT_NO=T2.MAT_NO
    AND T1.QCM_STAUS = '00'
]]>
</query>
<query id = "FrmInListRead.doQueryInListRead" desc = "查询红冲记录">
 SELECT 
       t.INSTOCK_DOC,
       t.LOT_NO,
       t.PRO_ORDER_NO,
       t.JUDGE_STOVE_NO,
       t.BATCH_NO,
       t.BATCH_GROUD_NO,
       t.MATERIAL_NO,
       t.MATERIAL_NAME,
       t.PRODUCCODE,
       t.PRODUCNAME,
       t.STD_CODE,
       t.STD_NAME,
       t.STEELCODE,
       t.STEELNAME,
       t.STD_STYLE,
       t.STD_STYLE_DESC,
       t.SPEC_CODE,
       t.SPEC_NAME,
       t.MODEL_CODE,
       t.MODEL_DESC,
       t.ACT_DIMATER,
       t.ACT_HEIGHT,
       to_char(t.ACT_LEN_MIN,'FM999990.00') AS ACT_LEN_MIN,
       to_char(t.ACT_LEN_MAX,'FM999990.00') AS ACT_LEN_MAX,
       to_char(t.ACT_LEN_MIN,'FM999990.00')||'-'||to_char(t.ACT_LEN_MAX,'FM999990.00') as LEN,
       sum(t.ACT_COUNT) as ACT_COUNT,
       to_char(sum(t.ACT_WEIGHT),'FM999999990.000') as ACT_WEIGHT,
       sum(nvl(t.ACT_LEN,0)) as ACT_LEN,
       t.BELONG_CODE,
       t.BELONG_NAME,
       s.STORAGE_NAME,
       t.MEMO,
       t.CREATE_NAME,
       max(to_char(t.INSTOCK_TIME,'YYYY-MM-DD HH24:MI:SS')) as INSTOCK_TIME,
       max(to_char(t.IN_TIME_F,'YYYY-MM-DD HH24:MI:SS')) AS IN_TIME_F,
       to_char(to_date(t.BAL_YEAR_MONTH,'YYYY-MM'),'yyyy-MM') as BAL_YEAR_MONTH,
       --t.BAL_YEAR_MONTH,
       t.ORDER_NO,
     t.ORDER_SEQ,
     t.DELIVERY_NO,
     t.JUDGE_STD_CODE,
     t.JUDGE_STD_NAME,
     t.PLINE_CODE,
     t.PLINE_NAME,
     t.GRADECODE,
     t.GRADENAME,
     t.PRODUCT_FLAG,
     t.MAT_STATUS,
     t.ZB_RCDID,
     d.SALE_AREA_DESC,
       d.create_name AS ordercreatename,
       t.ORD_LN_PK,
       t.ORD_LN_DLY_PK
 FROM YDM_ZC_INLIST t
  left join  ydm_bs_storage s
  on t.STORAGE_NO = s.STORAGE_NO
  left join  SLM_ORDER_HEAD d on 
   t.ord_pk = d.ord_pk
 where t.INSTOCK_TYPE_CODE ='800704'
</query>
<query id = "FrmInListRead.SelectInListCount" desc = "查询入库实绩支数">
<![CDATA[
SELECT COUNT(1) ACT_COUNT
  FROM MAT_ZC_M T,YDM_ZC_BUTTRESS S
 WHERE T.MAT_NO = S.MAT_NO
   AND NVL(T.LOT_NO, '/') = NVL('#LOT_NO#', '/')
   AND T.JUDGE_STOVE_NO = '#JUDGE_STOVE_NO#'
   AND T.BATCH_NO = '#BATCH_NO#'
   AND T.BATCH_GROUD_NO = '#BATCH_GROUD_NO#'
   AND T.PRO_ORDER_NO = '#PRO_ORDER_NO#'
   AND T.ACT_LEN = '#ACT_LEN#'
   AND S.STORAGE_NO = '#STORAGE_NO#'
   AND T.BELONG_CODE LIKE || '&' LIKE ('%' || upper(?) || '%')
   ]]>
</query>
<query id = "FrmInListRead.doPipeRedDased" desc = "库存红冲">
<![CDATA[
DECLARE
  V_INSTOCK_DOC YDM_ZC_INLIST.INSTOCK_DOC%TYPE := NULL;
  V_INSTOCK_SQE YDM_ZC_INLIST.INSTOCK_SQE%TYPE := NULL;
  V_ICOUNT         NUMBER := 1;
BEGIN
  SELECT ? || TO_CHAR(SYSDATE, 'YYMMDD') ||
         LPAD(NVL(MAX(SUBSTR(T.INSTOCK_DOC, LENGTH(T.INSTOCK_DOC) - 4)), 0) + 1,
              5,
              0) INSTOCK_DOC
    INTO V_INSTOCK_DOC
    FROM YDM_ZC_INLIST T
   WHERE TRUNC(T.CREATE_TIME) = TRUNC(SYSDATE)
     AND T.INSTOCK_TYPE_CODE = ?;
  FOR MYROW IN (SELECT T1.*
                  FROM (SELECT T.*, S.STORAGE_NO
                          FROM MAT_ZC_M T, YDM_ZC_BUTTRESS S
                         WHERE T.MAT_NO = S.MAT_NO
                           AND T.LOT_NO = '#LOT_NO#'
                           AND T.PRO_ORDER_NO = '#PRO_ORDER_NO#'
                           AND T.JUDGE_STOVE_NO = '#JUDGE_STOVE_NO#'
                           AND T.BATCH_NO = '#BATCH_NO#'
                           AND T.BATCH_GROUD_NO = '#BATCH_GROUD_NO#'
                           AND T.ACT_LEN = '#ACT_LEN#'
                           AND T.MAT_STATUS = '#MAT_STATUS#'
                           AND S.STORAGE_NO = '#STORAGE_NO#'
                           AND T.BELONG_CODE || '&' LIKE (upper(?) || '%')
                         ORDER BY T.MAT_NO DESC) T1
                 WHERE ROWNUM <= #ACT_COUNT#) LOOP
                V_INSTOCK_SQE := V_INSTOCK_DOC || LPAD(V_ICOUNT, 4, 0);
    INSERT INTO YDM_ZC_INLIST
      (MANAGEMENT_NO,
       MANAGEMENT_NAME,
       INSTOCK_SQE,
       INSTOCK_DOC,
       INSTOCK_TYPE_CODE,
       INSTOCK_TYPE_NAME,
       MAT_NO,
       LOT_NO,
       STOVE_NO,
       JUDGE_STOVE_NO,
       BATCH_NO,
       BATCH_GROUD_NO,
       
       PRODUCCODE,
       PRODUCNAME,
       STD_CODE,
       STD_NAME,
       
       STEELCODE,
       STEELNAME,
       STD_STYLE,
       STD_STYLE_DESC,
       SPEC_CODE,
       SPEC_NAME,
       MODEL_CODE,
       MODEL_DESC,
       ACT_DIMATER,
       ACT_HEIGHT,
       ACT_LEN_MIN,
       ACT_LEN_MAX,
       ACT_COUNT,
       ACT_WEIGHT,
       ACT_THEORY_WEIGHT,
       BELONG_CODE,
       BELONG_NAME,
       STORAGE_NO,
       
       MEMO,
       VALIDFLAG,
       CREATE_NAME,
       CREATE_TIME,
       ORDER_NO,
       ORDER_SEQ,
       DELIVERY_NO,
       ORD_PK,
       ORD_LN_PK,
       ORD_LN_DLY_PK,
       PRODUCT_FLAG,
       MAT_STATUS,
       INSTOCK_TIME,
       ZB_RCDID,
       ACT_LEN,
       DEPARTMENT_CODE,
       DEPARTMENT_DESC,
       JUDGE_STD_NAME,
       PLINE_CODE,
       PLINE_NAME,
       GRADECODE,
       GRADENAME,
       BAL_YEAR_MONTH,
       IN_TIME_F,
       LEN_NO,
       LEN_DESC,
       LEN_UNIT,
       PIPMEMO,
       MAT_ORIGIN_CODE,
       MAT_ORIGIN_NAME,
       SOURE_CODE,
       SOURE_NAME,
       MATERIAL_NO,
       MATERIAL_NAME,
       PRO_ORDER_NO,
       QCM_STAUS)
    VALUES
      (?,
       ?,
       V_INSTOCK_SQE,
       V_INSTOCK_DOC,
       ?,
       '产出红冲',
       MYROW.MAT_NO,
       MYROW.LOT_NO,
       MYROW.STOVE_NO,
       MYROW.JUDGE_STOVE_NO,
       MYROW.BATCH_NO,
       MYROW.BATCH_GROUD_NO,
       MYROW.PRODUCCODE,
       MYROW.PRODUCNAME,
       MYROW.STD_CODE,
       MYROW.STD_NAME,
       MYROW.STEELCODE,
       MYROW.STEELNAME,
       MYROW.STD_STYLE,
       MYROW.STD_STYLE_DESC,
       MYROW.SPEC_CODE,
       MYROW.SPEC_NAME,
       MYROW.MODEL_CODE,
       MYROW.MODEL_DESC,
       MYROW.ACT_DIMATER,
       MYROW.ACT_HEIGHT,
       MYROW.ACT_LEN_MIN,
       MYROW.ACT_LEN_MAX,
       '-'|| MYROW.ACT_COUNT,
       '-'|| MYROW.ACT_WEIGHT,
       '',
       MYROW.BELONG_CODE,
       MYROW.BELONG_NAME,
       MYROW.STORAGE_NO,
       MYROW.MEMO,
       '1',
       ?,
       TO_DATE(?, 'YYYY-MM-DD HH24:MI:SS'),
       MYROW.ORDER_NO,
       MYROW.ORDER_SEQ,
       MYROW.ORDER_SEQ_NO,
       MYROW.ORD_PK,
       MYROW.ORD_LN_PK,
       MYROW.ORD_LN_DLY_PK,
       MYROW.PRODUCT_FLAG,
       MYROW.MAT_STATUS,
       TO_DATE(?, 'YYYY-MM-DD HH24:MI:SS'),
       '',
       '-'||MYROW.ACT_LEN,
       ?,
       ?,
       MYROW.JUDGE_STD_NAME,
       MYROW.PLINE_CODE,
       MYROW.PLINE_NAME,
       MYROW.GRADECODE,
       MYROW.GRADENAME,
       ?,
       TO_DATE(?, 'YYYY-MM-DD HH24:MI:SS'),
       MYROW.LEN_NO,
       MYROW.LEN_DESC,
       MYROW.LEN_UNIT,
       MYROW.PIPMEMO,
       MYROW.MAT_ORIGIN_CODE,
       MYROW.MAT_ORIGIN_NAME,
       MYROW.SOURE_CODE,
       MYROW.SOURE_NAME,
       MYROW.MATERIAL_NO,
       MYROW.MATERIAL_NAME,
       MYROW.PRO_ORDER_NO,
       MYROW.QCM_STAUS);
       INSERT INTO YDM_ZC_INLIST_XS
      (MANAGEMENT_NO,
       MANAGEMENT_NAME,
       INSTOCK_SQE,
       INSTOCK_DOC,
       INSTOCK_TYPE_CODE,
       INSTOCK_TYPE_NAME,
       MAT_NO,
       LOT_NO,
       STOVE_NO,
       JUDGE_STOVE_NO,
       BATCH_NO,
       BATCH_GROUD_NO,
       
       PRODUCCODE,
       PRODUCNAME,
       STD_CODE,
       STD_NAME,
       
       STEELCODE,
       STEELNAME,
       STD_STYLE,
       STD_STYLE_DESC,
       SPEC_CODE,
       SPEC_NAME,
       MODEL_CODE,
       MODEL_DESC,
       ACT_DIMATER,
       ACT_HEIGHT,
       ACT_LEN_MIN,
       ACT_LEN_MAX,
       ACT_COUNT,
       ACT_WEIGHT,
       ACT_THEORY_WEIGHT,
       BELONG_CODE,
       BELONG_NAME,
       STORAGE_NO,
       
       MEMO,
       VALIDFLAG,
       CREATE_NAME,
       CREATE_TIME,
       ORDER_NO,
       ORDER_SEQ,
       DELIVERY_NO,
       ORD_PK,
       ORD_LN_PK,
       ORD_LN_DLY_PK,
       PRODUCT_FLAG,
       MAT_STATUS,
       INSTOCK_TIME,
       ZB_RCDID,
       ACT_LEN,
       DEPARTMENT_CODE,
       DEPARTMENT_DESC,
       JUDGE_STD_NAME,
       PLINE_CODE,
       PLINE_NAME,
       GRADECODE,
       GRADENAME,
       BAL_YEAR_MONTH,
       IN_TIME_F,
       LEN_NO,
       LEN_DESC,
       LEN_UNIT,
       PIPMEMO,
       MAT_ORIGIN_CODE,
       MAT_ORIGIN_NAME,
       SOURE_CODE,
       SOURE_NAME,
       MATERIAL_NO,
       MATERIAL_NAME,
       PRO_ORDER_NO,
       QCM_STAUS)
    VALUES
      (?,
       ?,
       V_INSTOCK_SQE,
       V_INSTOCK_DOC,
       ?,
       '产出红冲',
       MYROW.MAT_NO,
       MYROW.LOT_NO,
       MYROW.STOVE_NO,
       MYROW.JUDGE_STOVE_NO,
       MYROW.BATCH_NO,
       MYROW.BATCH_GROUD_NO,
       MYROW.PRODUCCODE,
       MYROW.PRODUCNAME,
       MYROW.STD_CODE,
       MYROW.STD_NAME,
       MYROW.STEELCODE,
       MYROW.STEELNAME,
       MYROW.STD_STYLE,
       MYROW.STD_STYLE_DESC,
       MYROW.SPEC_CODE,
       MYROW.SPEC_NAME,
       MYROW.MODEL_CODE,
       MYROW.MODEL_DESC,
       MYROW.ACT_DIMATER,
       MYROW.ACT_HEIGHT,
       MYROW.ACT_LEN_MIN,
       MYROW.ACT_LEN_MAX,
       '-'|| MYROW.ACT_COUNT,
       '-'|| MYROW.ACT_WEIGHT,
       '',
       MYROW.BELONG_CODE,
       MYROW.BELONG_NAME,
       MYROW.STORAGE_NO,
       MYROW.MEMO,
       '1',
       ?,
       TO_DATE(?, 'YYYY-MM-DD HH24:MI:SS'),
       MYROW.ORDER_NO,
       MYROW.ORDER_SEQ,
       MYROW.ORDER_SEQ_NO,
       MYROW.ORD_PK,
       MYROW.ORD_LN_PK,
       MYROW.ORD_LN_DLY_PK,
       MYROW.PRODUCT_FLAG,
       MYROW.MAT_STATUS,
       TO_DATE(?, 'YYYY-MM-DD HH24:MI:SS'),
       '',
       '-'||MYROW.ACT_LEN,
       ?,
       ?,
       MYROW.JUDGE_STD_NAME,
       MYROW.PLINE_CODE,
       MYROW.PLINE_NAME,
       MYROW.GRADECODE,
       MYROW.GRADENAME,
       ?,
       TO_DATE(?, 'YYYY-MM-DD HH24:MI:SS'),
       MYROW.LEN_NO,
       MYROW.LEN_DESC,
       MYROW.LEN_UNIT,
       MYROW.PIPMEMO,
       MYROW.MAT_ORIGIN_CODE,
       MYROW.MAT_ORIGIN_NAME,
       MYROW.SOURE_CODE,
       MYROW.SOURE_NAME,
       MYROW.MATERIAL_NO,
       MYROW.MATERIAL_NAME,
       MYROW.PRO_ORDER_NO,
       MYROW.QCM_STAUS);
       DELETE FROM MAT_ZC_M T WHERE T.MAT_NO = MYROW.MAT_NO;
       DELETE FROM MAT_ZC_M_XS T WHERE T.MAT_NO = MYROW.MAT_NO;
       DELETE FROM YDM_ZC_BUTTRESS S WHERE S.MAT_NO = MYROW.MAT_NO;
       V_ICOUNT := V_ICOUNT + 1;
  END LOOP;
END;
]]>
</query>
<query id = "FrmInListRead.SelectInital" desc = "查询是否已存在下月期初">
<![CDATA[
SELECT COUNT(1)ACOUNT FROM YDM_ZC_INITIAL_ZG T WHERE T.BAL_YEAR_MONTH = ? AND T.BELONG_CODE || '&' LIKE (upper(?) || '%')
]]>
</query>
<query id = "FrmInListRead.cancelDoPipeRedDased" desc = "撤销红冲">
<![CDATA[
DECLARE
BEGIN
  FOR MYROW IN (SELECT T1.*
                  FROM (SELECT T.*
                          FROM YDM_ZC_INLIST T
                         WHERE T.LOT_NO = '#LOT_NO#'
                           AND T.PRO_ORDER_NO = '#PRO_ORDER_NO#'
                           AND T.JUDGE_STOVE_NO = '#JUDGE_STOVE_NO#'
                           AND T.BATCH_NO = '#BATCH_NO#'
                           AND T.BATCH_GROUD_NO = '#BATCH_GROUD_NO#'
                           AND T.INSTOCK_DOC = '#INSTOCK_DOC#'
                           AND T.INSTOCK_TYPE_CODE = '800704'
                           AND T.BELONG_CODE || '&' LIKE (upper(?) || '%')
                         ORDER BY T.MAT_NO DESC) T1
                 WHERE ROWNUM <= ABS(#ACT_COUNT#)) LOOP
    INSERT INTO YDM_ZC_BUTTRESS
      (JUDGE_STOVE_NO,
       BATCH_NO,
       BATCH_GROUD_NO,
       STORAGE_NO,
       LOCATION_NO,
       STORAGE_TYPE_NO,
       STORAGE_TYPE_NAME,
       
       CREATE_NAME,
       MAT_NO,
       CREATE_TIME,
       MANAGEMENT_NO,
       MANAGEMENT_NAME,
       DEPARTMENT_CODE,
       DEPARTMENT_DESC)
    VALUES
      (MYROW.JUDGE_STOVE_NO,
       MYROW.BATCH_NO,
       MYROW.BATCH_GROUD_NO,
       MYROW.STORAGE_NO,
       '',
       '',
       '',
       '#CREATE_NAME#',
       MYROW.MAT_NO,
       to_date('#CREATE_TIME#', 'YYYY-MM-DD HH24:MI:SS'),
       '#MANAGEMENT_NO#',
       '#MANAGEMENT_NAME#',
       '#DEPARTMENT_CODE#',
       '#DEPARTMENT_DESC#');
    INSERT INTO MAT_ZC_M
      (JUDGE_STOVE_NO,
       BATCH_NO,
       BATCH_GROUD_NO,
       PRODUCCODE,
       PRODUCNAME,
       STEELCODE,
       STEELNAME,
       SPEC_CODE,
       SPEC_NAME,
       MODEL_CODE,
       MODEL_DESC,
       STD_CODE,
       STD_NAME,
       BELONG_CODE,
       BELONG_NAME,
       STD_STYLE,
       STD_STYLE_DESC,
       ORDER_NO,
       ORDER_SEQ,
       ORDER_SEQ_NO,
       ORD_PK,
       ORD_LN_PK,
       ORD_LN_DLY_PK,
       ACT_DIMATER,
       ACT_HEIGHT,
       LEN_NO,
       LEN_DESC,
       LEN_UNIT,
       ACT_LEN_MIN,
       ACT_LEN_MAX,
       CREATE_NAME,
       
       ACT_COUNT,
       ACT_WEIGHT,
       CREATE_TIME,
       INSTOCK_TIME,
       MAT_NO,
       MEMO,
       JUGDE_APPLY_FLAG,
       INSTOCK_FLAG,
       PRODUCT_FLAG,
       MAT_STATUS,
       ACT_LEN,
       JUDGE_STD_NAME,
       BAL_YEAR_MONTH,
       PLINE_CODE,
       PLINE_NAME,
       GRADECODE,
       GRADENAME,
       PIPMEMO,
       MAT_ORIGIN_CODE,
       MAT_ORIGIN_NAME,
       SOURE_CODE,
       SOURE_NAME,
       MATERIAL_NO,
       MATERIAL_NAME,
       PRO_ORDER_NO,
       QCM_STAUS,
       LOT_NO)
    VALUES
      (MYROW.JUDGE_STOVE_NO,
       MYROW.BATCH_NO,
       MYROW.BATCH_GROUD_NO,
       MYROW.PRODUCCODE,
       MYROW.PRODUCNAME,
       MYROW.STEELCODE,
       MYROW.STEELNAME,
       MYROW.SPEC_CODE,
       MYROW.SPEC_NAME,
       MYROW.MODEL_CODE,
       MYROW.MODEL_DESC,
       MYROW.STD_CODE,
       MYROW.STD_NAME,
       MYROW.BELONG_CODE,
       MYROW.BELONG_NAME,
       MYROW.STD_STYLE,
       MYROW.STD_STYLE_DESC,
       MYROW.ORDER_NO,
       MYROW.ORDER_SEQ,
       MYROW.DELIVERY_NO,
       MYROW.ORD_PK,
       MYROW.ORD_LN_PK,
       MYROW.ORD_LN_DLY_PK,
       MYROW.ACT_DIMATER,
       MYROW.ACT_HEIGHT,
       MYROW.LEN_NO,
       MYROW.LEN_DESC,
       MYROW.LEN_UNIT,
       MYROW.ACT_LEN_MIN,
       MYROW.ACT_LEN_MAX,
       '#CREATE_NAME#',
       ABS(MYROW.ACT_COUNT),
       ABS(MYROW.ACT_WEIGHT),
       TO_DATE('#CREATE_TIME#', 'YYYY-MM-DD HH24:MI:SS'),
       TO_DATE('#CREATE_TIME#', 'YYYY-MM-DD HH24:MI:SS'),
       MYROW.MAT_NO,
       MYROW.MEMO,
       '1',
       '1',
       MYROW.PRODUCT_FLAG,
       MYROW.MAT_STATUS,
       ABS(MYROW.ACT_LEN),
       MYROW.JUDGE_STD_NAME,
       '#BAL_YEAR_MONTH#',
       MYROW.PLINE_CODE,
       MYROW.PLINE_NAME,
       MYROW.GRADECODE,
       MYROW.GRADENAME,
       MYROW.PIPMEMO,
       MYROW.MAT_ORIGIN_CODE,
       MYROW.MAT_ORIGIN_NAME,
       MYROW.SOURE_CODE,
       MYROW.SOURE_NAME,
       MYROW.MATERIAL_NO,
       MYROW.MATERIAL_NAME,
       MYROW.PRO_ORDER_NO,
       MYROW.QCM_STAUS,
       MYROW.LOT_NO);
       
       INSERT INTO MAT_ZC_M_XS
      (JUDGE_STOVE_NO,
       BATCH_NO,
       BATCH_GROUD_NO,
       PRODUCCODE,
       PRODUCNAME,
       STEELCODE,
       STEELNAME,
       SPEC_CODE,
       SPEC_NAME,
       MODEL_CODE,
       MODEL_DESC,
       STD_CODE,
       STD_NAME,
       BELONG_CODE,
       BELONG_NAME,
       STD_STYLE,
       STD_STYLE_DESC,
       ORDER_NO,
       ORDER_SEQ,
       ORDER_SEQ_NO,
       ORD_PK,
       ORD_LN_PK,
       ORD_LN_DLY_PK,
       ACT_DIMATER,
       ACT_HEIGHT,
       LEN_NO,
       LEN_DESC,
       LEN_UNIT,
       ACT_LEN_MIN,
       ACT_LEN_MAX,
       CREATE_NAME,
       
       ACT_COUNT,
       ACT_WEIGHT,
       CREATE_TIME,
       INSTOCK_TIME,
       MAT_NO,
       MEMO,
       JUGDE_APPLY_FLAG,
       INSTOCK_FLAG,
       PRODUCT_FLAG,
       MAT_STATUS,
       ACT_LEN,
       JUDGE_STD_NAME,
       BAL_YEAR_MONTH,
       PLINE_CODE,
       PLINE_NAME,
       GRADECODE,
       GRADENAME,
       PIPMEMO,
       MAT_ORIGIN_CODE,
       MAT_ORIGIN_NAME,
       SOURE_CODE,
       SOURE_NAME,
       MATERIAL_NO,
       MATERIAL_NAME,
       PRO_ORDER_NO,
       QCM_STAUS,
       LOT_NO)
    VALUES
      (MYROW.JUDGE_STOVE_NO,
       MYROW.BATCH_NO,
       MYROW.BATCH_GROUD_NO,
       MYROW.PRODUCCODE,
       MYROW.PRODUCNAME,
       MYROW.STEELCODE,
       MYROW.STEELNAME,
       MYROW.SPEC_CODE,
       MYROW.SPEC_NAME,
       MYROW.MODEL_CODE,
       MYROW.MODEL_DESC,
       MYROW.STD_CODE,
       MYROW.STD_NAME,
       MYROW.BELONG_CODE,
       MYROW.BELONG_NAME,
       MYROW.STD_STYLE,
       MYROW.STD_STYLE_DESC,
       MYROW.ORDER_NO,
       MYROW.ORDER_SEQ,
       MYROW.DELIVERY_NO,
       MYROW.ORD_PK,
       MYROW.ORD_LN_PK,
       MYROW.ORD_LN_DLY_PK,
       MYROW.ACT_DIMATER,
       MYROW.ACT_HEIGHT,
       MYROW.LEN_NO,
       MYROW.LEN_DESC,
       MYROW.LEN_UNIT,
       MYROW.ACT_LEN_MIN,
       MYROW.ACT_LEN_MAX,
       '#CREATE_NAME#',
       ABS(MYROW.ACT_COUNT),
       ABS(MYROW.ACT_WEIGHT),
       TO_DATE('#CREATE_TIME#', 'YYYY-MM-DD HH24:MI:SS'),
       TO_DATE('#CREATE_TIME#', 'YYYY-MM-DD HH24:MI:SS'),
       MYROW.MAT_NO,
       MYROW.MEMO,
       '1',
       '1',
       MYROW.PRODUCT_FLAG,
       MYROW.MAT_STATUS,
       ABS(MYROW.ACT_LEN),
       MYROW.JUDGE_STD_NAME,
       '#BAL_YEAR_MONTH#',
       MYROW.PLINE_CODE,
       MYROW.PLINE_NAME,
       MYROW.GRADECODE,
       MYROW.GRADENAME,
       MYROW.PIPMEMO,
       MYROW.MAT_ORIGIN_CODE,
       MYROW.MAT_ORIGIN_NAME,
       MYROW.SOURE_CODE,
       MYROW.SOURE_NAME,
       MYROW.MATERIAL_NO,
       MYROW.MATERIAL_NAME,
       MYROW.PRO_ORDER_NO,
       MYROW.QCM_STAUS,
       MYROW.LOT_NO);
       
       DELETE FROM YDM_ZC_INLIST T WHERE T.MAT_NO = MYROW.MAT_NO AND T.INSTOCK_TYPE_CODE = '800704';
       DELETE FROM YDM_ZC_INLIST_XS T WHERE T.MAT_NO = MYROW.MAT_NO AND T.INSTOCK_TYPE_CODE = '800704';
       
  END LOOP;
END;
]]>
</query>
<query id = "FrmInListRead.adjustBalYearMoth" desc = "调整结转年月">
UPDATE YDM_ZC_INLIST T SET T.BAL_YEAR_MONTH = ?,T.INSTOCK_TIME = TO_DATE(?,'YYYY-MM-DD HH24:MI:SS') WHERE T.INSTOCK_DOC = ?
</query>
</queryMap>