<?xml version="1.0" encoding="UTF-8"?>
<queryMap desc="废品回库">
	<query id="CoupMatCollarShar.AddMatJgFaill" desc="新增废品库存">
        <![CDATA[
  INSERT INTO COUPLING_MAT_M(
        MAT_NO,
        RESULT_NO,
        WO_ID,
        PLINE_CODE,
        PLINE_NAME,
        JUDGE_STOVE_NO,
        BATCH_NO,
        BL_WL_ID,
        MIN_D,
        MIN_H,
        CODE_JG,
        GRADECODE,
        GRADENAME,
        STEELCODE,
        STEELNAME,
        MODEL_CODE,
        MODEL_DESC,
        OUTDIAMETER,
        WALLTHICK,
        SPEC_JG,
        SPEC_JG_DESC,
        STYLE_JG,
        DIAMETER,
        CHECK_J_VAL,
        AIMLENGTH,
        SINGLEWEIGHT,
        MONITORDEMAND,
        IF_MONITOR_JG,
        PRDCR_NO,
        PRODUCER,
        PRO_NUM,
        PRO_WT,
        COL_OPERATOR,
        RRO_TIME,
        PRO_SHIFT,
        PRO_GROUP,
        CREATE_NAME,
        CREATE_TIME,
        F_IN_TIME,
        BL_WL_DESC,
        MEMO,
        DEMAND_DETECTION,
        DEMAND_BLAST,
        DEMAND_BONDERIZING,
        DEMAND_COPPER,
        COAT_TYPE,
        BELONG_CODE,
        BELONG_NAME,
        CODE_JG_BL,
        CRAFT_FILE_NO,
        CRAFT_SEQ,
        FINAL_USER_DESC,
        MAT_ORIGIN_CODE,
        MAT_ORIGIN_NAME,
        SOURE_CODE,
        SOURE_NAME,
        JUDGE_STD_NAME,
        QCM_STAUS)
 VALUES( 
        '#MAT_NO#',
        '#RESULT_NO#',
        '#WO_ID#',
        '#PLINE_CODE#',
        '#PLINE_NAME#',
        '#JUDGE_STOVE_NO#',
        '#BATCH_NO#',
        '#BL_WL_ID#',
        '#MIN_D#',
        '#MIN_H#',
        '#CODE_JG#',
        '#GRADECODE#',
        '#GRADENAME#',
        '#STEELCODE#',
        '#STEELNAME#',
        '#MODEL_CODE#',
        '#MODEL_DESC#',
        '#OUTDIAMETER#',
        '#WALLTHICK#',
        '#SPEC_JG#',
        '#SPEC_JG_DESC#',
        '#STYLE_JG#',
        '#DIAMETER#',
        '#CHECK_J_VAL#',
        '#AIMLENGTH#',
        '#SINGLEWEIGHT#',
        '#MONITORDEMAND#',
        '#IF_MONITOR_JG#',
        '#PRDCR_NO#',
        '#PRODUCER#',
        '#PRO_NUM#',
        '#PRO_WT#',
        '#COL_OPERATOR#',
        SYSDATE,
        '#PRO_SHIFT#',
        '#PRO_GROUP#',
        '#CREATE_NAME#',
        SYSDATE,
        SYSDATE,
        '#BL_WL_DESC#',
        '#MEMO#',
        '#DEMAND_DETECTION#',
        '#DEMAND_BLAST#',
        '#DEMAND_BONDERIZING#',
        '#DEMAND_COPPER#',
        '#COAT_TYPE#',
        '#BELONG_CODE#',
        '#BELONG_NAME#',
        '#CODE_JG_BL#',
        '#CRAFT_FILE_NO#',
        '#CRAFT_SEQ#',
        '#FINAL_USER_DESC#',
        '#MAT_ORIGIN_CODE#',
        '#MAT_ORIGIN_NAME#',
        '#SOURE_CODE#',
        '#SOURE_NAME#',
        '#JUDGE_STD_NAME#',
        '#QCM_STAUS#')
        ]]>
	</query>
	<query id="CoupMatCollarShar.AddMatButJgFaill" desc="新增废品位置表">
        <![CDATA[
        INSERT INTO COUPLING_MAT_BUTTRESS
  (MAT_NO,
   MAT_NO_XH,
   PRODUCT_FLAG,
   MAT_STATUS,
   PRO_PLAN_ID,
   MAT_ORIGIN_CODE,
   MAT_ORIGIN_NAME,
   SOURE_CODE,
   SOURE_NAME,
   PIECES,
   WEIGHT,
   CUST_ALPHA_NO,
   ORDER_SPECIAL_DESC,
   ALPHA_CODE,
   KEP_NO,
   STORAGE_NO,
   LOCATION_NO,
   STORAGE_ATTR,
   STORAGE_ATTR_NAME,
   STORAGE_TYPE_NO,
   STORAGE_TYPE_NAME,
   MANAGEMENT_NO,
   MANAGEMENT_NAME,
   MEMO,
   CREATE_NAME,
   CREATE_TIME)
VALUES
  ('#MAT_NO#',
   '#MAT_NO_XH#',
   '#PRODUCT_FLAG#',
   '#MAT_STATUS#',
   '#PRO_PLAN_ID#',
   '#MAT_ORIGIN_CODE#',
   '#MAT_ORIGIN_NAME#',
   '#SOURE_CODE#',
   '#SOURE_NAME#',
   '#PIECES#',
   '#WEIGHT#',
   '#CUST_ALPHA_NO#',
   '#ORDER_SPECIAL_DESC#',
   '#ALPHA_CODE#',
   '#KEP_NO#',
   '#STORAGE_NO#',
   '#LOCATION_NO#',
   '#STORAGE_ATTR#',
   '#STORAGE_ATTR_NAME#',
   '#STORAGE_TYPE_NO#',
   '#STORAGE_TYPE_NAME#',
   '#MANAGEMENT_NO#',
   '#MANAGEMENT_NAME#',
   '#MEMO#',
   '#CREATE_NAME#',
   SYSDATE)
         ]]>
	</query>
	<query id="CoupMatCollarShar.QueryDeal" desc="查询交易表信息">
        <![CDATA[
        SELECT T.DEAL_ORDE,
       T.DEAL_TYPE_CODE,
       T.DEAL_TYPE_NAME,
       T.SOURCE_CODE,
       T.SOURCE_NAME,
       T.TAR_CODE,
       T.TAR_NAME,
       T.KEP_NO,
       T.MAT_NO,
       T.RESULT_NO,
       T.ZY_PLAN_ID,
       T.WO_ID,
       T.PRO_PLAN_ID,
       T.JG_GROUP_ID,
       T.PRO_PLAN_ID1,
       T.JG_GROUP_ID1,
       T.PLINE_CODE,
       T.PLINE_NAME,
       T.MAT_ORIGIN_CODE,
       T.MAT_ORIGIN_NAME,
       T.SOURE_CODE,
       T.SOURE_NAME,
       T.JUDGE_STOVE_NO,
       T.BATCH_NO,
       T.BL_WL_ID,
       T.BL_WL_DESC,
       T.MIN_D,
       T.MIN_H,
       T.CODE_JG,
       T.GRADECODE,
       T.GRADENAME,
       T.STEELCODE,
       T.STEELNAME,
       T.MODEL_CODE,
       T.MODEL_DESC,
       T.OUTDIAMETER,
       T.WALLTHICK,
       T.SPEC_JG,
       T.SPEC_JG_DESC,
       T.STYLE_JG,
       T.DIAMETER,
       T.CHECK_J_VAL,
       T.AIMLENGTH,
       T.SINGLEWEIGHT,
       T.MONITORDEMAND,
       T.IF_MONITOR_JG,
       T.PRDCR_NO,
       T.PRODUCER,
       TO_CHAR(T.PRODUCER_TIME, 'YYYY-MM-DD HH24:MI:SS') PRODUCER_TIME,
       T.MACH_NO,
       T.MACH_NM,
       NVL(T.DEAL_NUM, 0) DEAL_NUM,
       NVL(T.DEAL_WT, 0) DEAL_WT,
       T.BAL_YEAR_MONTH,
       TO_CHAR(T.F_IN_TIME, 'YYYY-MM-DD HH24:MI:SS') F_IN_TIME,
       TO_CHAR(T.DEAL_TIME, 'YYYY-MM-DD HH24:MI:SS') DEAL_TIME,
       T.STORAGE_NO,
       T.LOCATION_NO,
       T.STORAGE_ATTR,
       T.STORAGE_ATTR_NAME,
       T.STORAGE_TYPE_NO,
       T.STORAGE_TYPE_NAME,
       T.TAR_STORAGE_NO,
       T.TAR_LOCATION_NO,
       T.TAR_KEP_NO,
       T.TAR_STORAGE_ATTR,
       T.TAR_STORAGE_ATTR_NAME,
       T.TAR_STORAGE_TYPE_NO,
       T.TAR_STORAGE_TYPE_NAME,
       T.TAR_REC_FLAG,
       T.HAND_FLAG,
       T.DEMAND_COPPER,
       T.DEMAND_DETECTION,
       T.DEMAND_BLAST,
       T.DEMAND_BONDERIZING,
       T.CUST_ALPHA_NO,
       T.ORDER_SPECIAL_DESC,
       T.ALPHA_CODE,
       T.DETER_NO,
       T.DETER_RESULTS,
       T.COL_OPERATOR,
       T.MEMO,
       T.CREATE_NAME,
       TO_CHAR(T.CREATE_TIME, 'YYYY-MM-DD HH24:MI:SS') CREATE_TIME,
       T.UPDATE_NAME,
       TO_CHAR(T.UPDATE_TIME, 'YYYY-MM-DD HH24:MI:SS') UPDATE_TIME,
       T.PRODUCT_FLAG,
       T.MAT_STATUS,
       T.DETER_STATUS,
       T.CODE_JG_BL,
       T.CRAFT_FILE_NO,
       T.CRAFT_SEQ,
       T.BELONG_CODE,
       T.BELONG_NAME,
       T.COAT_TYPE,
       T.MAT_NO_XH,
       T.QCM_STAUS,
       NVL(T.USED_NUM, 0) USED_NUM,
       NVL(T.USED_WT, 0) USED_WT,
       NVL(T.FAILL_NUM, 0) FAILL_NUM,
       NVL(T.FAILL_WT, 0) FAILL_WT,
       NVL(T.BACK_NUM, 0) BACK_NUM,
       NVL(T.BACK_WT, 0) BACK_WT,
       T.OUT_FLAG,T.JG_ORDERNO,T.ORDER_NO,T.ORDER_SEQ,
       T.DELIVERY_NO,T.ORD_PK,T.ORD_LN_PK,
       T.ORD_LN_DLY_PK,T.CRAFT_SEQ_ORD,T.CRAFT_FILE_NO_ORD,
       T.STOVE_NO,
       T.FLAG_STOVE_NO
  FROM COUPLING_MAT_DEAL T
 WHERE T.DEAL_ORDE = ?        
         ]]>
	</query>
</queryMap>