<?xml version="1.0" encoding="UTF-8"?>
<queryMap desc="装车实绩管理sql">
	<query id="FrmPipeLoad.queryDelivery" desc="查询发货实绩表信息">
		<![CDATA[
		 SELECT T.LOADVEHICLE_NO,
		       T.TALLYSHEET_NO,
		       (SELECT MAX(DISTINCT  DECODE(CASE
                WHEN M.BILL_TICKET_STATUS = 0 AND M.OUTSTOCK_TICKET_STATUS = 0 AND
                     M.TRANSMNY_TICKET_STATUS = 0 THEN
                 0
                WHEN M.BILL_TICKET_STATUS = 2 AND M.OUTSTOCK_TICKET_STATUS = 2 AND
                     M.TRANSMNY_TICKET_STATUS = 2 THEN
                 2
                ELSE
                 (CASE
                   WHEN M.BILL_STATUS >= 4 THEN
                    1
                   ELSE
                    4
                 END)
              END,
              '1',
              '票据对齐(' || M.BILL_TICKET_STATUS || M.OUTSTOCK_TICKET_STATUS ||
              M.TRANSMNY_TICKET_STATUS || ')',
              '2',
              '提单结束',
              DECODE(M.BILL_STATUS,
                     '0',
                     '提单编制',
                     '1',
                     '提单下发',
                     '2',
                     '(预留)',
                     '3',
                     '提单执行',
                     '4',
                     '提单关闭',
                     '5',
                     '结算接收'))) FROM YDM_ZC_BILL_M M WHERE M.BILL_NO=T.BILL_NO)AS BILL_STATUS ,
		       DECODE(T.LOADVEHICLE_TYPE, '1', '实际', '2', '虚拟') AS LOADVEHICLE_TYPE,
		       DECODE(T.AFFIRM_FLAG, '0', '未确认', '1', '确认') AS AFFIRM_FLAG,
		       T.BILL_NO,
		       T.VEHICLE_NO,
		       B.BASENAME AS TRANS_TYPE,
		       T.RECEIV_NO,
		       T.RECEIV_NM,
		       T.STATION_NO,
		       T.STATION_NM,
		       T.SPCL_LN_NO,
		       T.SPCL_LN_NM,
		       T.SHIP_LOT_NO,
		       T.PLANT,
		       T.PLANT_DESC,
		       T.VSTEL_CODE,
		       T.VSTEL_DESC,
		       T.CARRIER_NO,
		       T.CARRY_COMPANY_CODE,
		       T.CARRY_COMPANY_NAME,
		       TO_CHAR(NVL(T.STACKING_WT,0),'FM999999990.000') AS STACKING_WT,
		       NVL(T.STACKING_PIECE,0) AS STACKING_PIECE,
		       TO_CHAR(NVL(T.STACKING_TOTL_LEN,0),'FM999999990.00') AS STACKING_TOTL_LEN,    
		       T.PONDER_NO,
		       TO_CHAR(NVL(T.PONDER_GROSS_WT,'0'),'FM999999990.000') AS PONDER_GROSS_WT,
		       T.OUT_STOCK_CODE,
		       T.DELIVY_PLACE_CODE,
		       T.DELIVY_PLACE_NAME,
		       T.STLMT_UNIT_NO,
		       T.STLMT_UNIT_NM,
		       T.CONFIRM_NAME,
		       TO_CHAR(T.CONFIRM_TIME,'YYYY-MM-DD HH24:MI:SS') AS CONFIRM_TIME,
		       TO_CHAR(T.INFACTORY_TIME,'YYYY-MM-DD HH24:MI:SS') AS INFACTORY_TIME,
		       TO_CHAR(T.LOAD_TIME,'YYYY-MM-DD HH24:MI:SS') AS LOAD_TIME,
		       TO_CHAR(T.DELIVY_TIME,'YYYY-MM-DD HH24:MI:SS') AS DELIVY_TIME,
		       T.MEMO,
		       DECODE(T.VALIDFLAG, '0', '无效', '1', '有效') AS VALIDFLAG,
		       T.CREATE_NAME,
		       T.PRINT_NUM,
		       T.PRD_CLS,
		       TO_CHAR(T.PRINT_FLAG,'YYYY-MM-DD HH24:MI:SS') AS PRINT_FLAG,
		       TO_CHAR(T.CREATE_TIME,'YYYY-MM-DD HH24:MI:SS') AS CREATE_TIME,
		       (SELECT DISTINCT M.SALE_ORG_DESC FROM YDM_ZC_BILL_M M WHERE M.BILL_NO=T.BILL_NO) SALE_ORG_DESC
		  FROM YDM_ZC_LOADVEHICLE T
		  LEFT JOIN COM_BASE_INFO B ON B.BASECODE=T.TRANS_TYPE
		 WHERE T.LOADVEHICLE_NO || '&' LIKE ('%' || ? || '%')
		   AND T.TALLYSHEET_NO || '&' LIKE ('%' || ? || '%')
		   AND T.BILL_NO || '&' LIKE ('%' || ? || '%')
		   AND T.RECEIV_NO || '&' LIKE ('%' || ? || '%')
		   AND DECODE(?, NULL, SYSDATE,T.LOAD_TIME) BETWEEN DECODE(?, NULL, SYSDATE,TO_DATE(?,'YYYY-MM-DD HH24:MI:SS'))
		   AND DECODE(?, NULL, SYSDATE,TO_DATE(?,'YYYY-MM-DD HH24:MI:SS')) 
		   AND T.AFFIRM_FLAG || '&' LIKE ('%' || ? || '%')
		   AND T.VEHICLE_NO || '&' LIKE ('%' || ? || '%')
		   AND T.VALIDFLAG = '1'
		   AND T.ZOUT_FLAG='0'
		   AND T.RETURN_FLAG='0'
     	]]>
	</query>
	
		<query id="FrmPipeLoad.queryDeliveryByWl" desc="查询发货实绩表信息">
		<![CDATA[
		 SELECT T.LOADVEHICLE_NO,
		       T.TALLYSHEET_NO,
		       DECODE(T.LOADVEHICLE_TYPE, '1', '实际', '2', '虚拟') AS LOADVEHICLE_TYPE,
		       DECODE(T.AFFIRM_FLAG, '0', '未确认', '1', '确认') AS AFFIRM_FLAG,
		       T.BILL_NO,
		       T.VEHICLE_NO,
		       B.BASENAME AS TRANS_TYPE,
		       T.RECEIV_NO,
		       T.RECEIV_NM,
		       T.STATION_NO,
		       T.STATION_NM,
		       T.SPCL_LN_NO,
		       T.SPCL_LN_NM,
		       T.SHIP_LOT_NO,
		       T.PLANT,
		       T.PLANT_DESC,
		       T.VSTEL_CODE,
		       T.VSTEL_DESC,
		       T.CARRIER_NO,
		       T.CARRY_COMPANY_CODE,
		       T.CARRY_COMPANY_NAME,
		       TO_CHAR(NVL(T.STACKING_WT,0),'FM999999990.000') AS STACKING_WT,
		       NVL(T.STACKING_PIECE,0) AS STACKING_PIECE,
		       TO_CHAR(NVL(T.STACKING_TOTL_LEN,0),'FM999999990.00') AS STACKING_TOTL_LEN,    
		       T.PONDER_NO,
		       TO_CHAR(NVL(T.PONDER_GROSS_WT,'0'),'FM999999990.000') AS PONDER_GROSS_WT,
		       T.OUT_STOCK_CODE,
		       T.DELIVY_PLACE_CODE,
		       T.DELIVY_PLACE_NAME,
		       T.STLMT_UNIT_NO,
		       T.STLMT_UNIT_NM,
		       TO_CHAR(T.INFACTORY_TIME,'YYYY-MM-DD HH24:MI:SS') AS INFACTORY_TIME,
		       TO_CHAR(T.LOAD_TIME,'YYYY-MM-DD HH24:MI:SS') AS LOAD_TIME,
		       TO_CHAR(T.DELIVY_TIME,'YYYY-MM-DD HH24:MI:SS') AS DELIVY_TIME,
		       T.MEMO,
		       DECODE(T.VALIDFLAG, '0', '无效', '1', '有效') AS VALIDFLAG,
		       T.CREATE_NAME,
		       T.PRINT_NUM,
		       T.PRD_CLS,
		       TO_CHAR(T.PRINT_FLAG,'YYYY-MM-DD HH24:MI:SS') AS PRINT_FLAG,
		       TO_CHAR(T.CREATE_TIME,'YYYY-MM-DD HH24:MI:SS') AS CREATE_TIME,
		       (SELECT DISTINCT M.SALE_ORG FROM YDM_ZC_BILL_M M WHERE M.BILL_NO=T.BILL_NO) SALE_ORG,
		       (SELECT DISTINCT M.SALE_ORG_DESC FROM YDM_ZC_BILL_M M WHERE M.BILL_NO=T.BILL_NO) SALE_ORG_DESC,
		       (SELECT DISTINCT M.management_name FROM YDM_ZC_BILL_M M WHERE M.BILL_NO=T.BILL_NO) SALE_AREA,
		       T.CARRIER_CODE,
		       T.CARRIER_NAME,
		       T.CAR_LICENSE,
		       T.DRIVER_CODE,
		       T.DRIVER_NAME
		  FROM YDM_ZC_LOADVEHICLE T
		  LEFT JOIN COM_BASE_INFO B ON B.BASECODE=T.TRANS_TYPE
		 WHERE T.LOADVEHICLE_NO =?

     	]]>
	</query>
	
		
	
	<query id="FrmPipeLoad.insertWlDelivery" desc="查询发货实绩表信息">
		<![CDATA[
		 INSERT INTO  TMS_LOADVEHICLE_M
		 (BILL_NO,LOADVEHICLE_NO,TALLYSHEET_NO,VEHICLE_NO,TRANS_TYPE,
		 RECEIV_NO,RECEIV_NM,STATION_NO,STATION_NM,SPCL_LN_NO,
		 SPCL_LN_NM,STACKING_WT,STACKING_PIECE,STACKING_TOTL_LEN,GROSS_WGT,
		 OUTSTOCK_TIME,CREATE_NAME,CREATE_TIME,SALE_ORG,SALE_ORG_DESC,
		 SALE_AREA,STAUS,CARRIER_CODE,CARRIER_NAME,CAR_LICENSE,
		 DRIVER_CODE,DRIVER_NAME,OUT_STORAGE_NO,OUT_STORAGE_NAME
		 )
		 VALUES
		 (?,?,?,?,?,
		 ?,?,?,?,?,
		 ?,?,?,?,?,
		 SYSDATE,?,SYSDATE,?,?,
		 ?,?,?,?,?,
		 ?,?,?,?
		 )

     	]]>
	</query>
	
	<query id="FrmPipeLoad.queryWlStatus" desc="查询发货实绩表信息">
		<![CDATA[
		 select staus from  TMS_LOADVEHICLE_M T
		  WHERE T.LOADVEHICLE_NO=?

     	]]>
	</query>
	
	<query id="FrmPipeLoad.deleteWlM" desc="查询发货实绩表信息">
		<![CDATA[
		 DELETE  TMS_LOADVEHICLE_M T
		  WHERE T.LOADVEHICLE_NO=?

     	]]>
	</query>
	
	<query id="FrmPipeLoad.queryMativery" desc="查询发货实绩表理货单号对应的材料信息">
		<![CDATA[
SELECT T.JUDGE_STOVE_NO,
       T.BATCH_NO,
       T.GROUP_NO,
       T.ORDER_NO||'/'||T.ORDER_SEQ AS ORDER_SEQ_NO1,
       T.ORDER_NO,
       T.ORDER_SEQ,
       T.ORDER_SEQ_NO,
       T.LOADVEHICLE_NO,
       T.BILL_NO,
       T.TALLYSHEET_NO,
       T.VEHICLE_NO,
       T.MATERIAL_NO,
       T.PRODUCNAME,
       T.GRADENAME,
       T.STEELNAME,
       T.SPEC_NAME,
       T.MODEL_DESC,
       T.STORAGE_NO,
       T.LOCATION_NO,
       (SELECT T1.LOCATION_NAME FROM YDM_BS_LOCATION T1 WHERE T1.LOCATION_NO = T.LOCATION_NO)LOCATION_NAME,
       B.STORAGE_NAME,
       T.STD_CODE,
       T.STD_NAME,
       T.STD_STYLE_DESC,
       T.CREATE_NAME,
       T.CREDIT_NO,
       T.PORT_DESC,
       TO_CHAR(MAX(T.Create_Time),'YYYY-MM-DD HH24:MI:SS') AS CREATE_TIME,
       MAX(T.PONDER_NO) AS PONDER_NO,
       T.ORD_PK,
       T.ORD_LN_PK,
       T.ORD_LN_DLY_PK,
       T.VSTEL_DESC,
       TO_CHAR(T.ACT_LEN_MIN, 'FM990.00') || '-' ||
       TO_CHAR(T.ACT_LEN_MAX, 'FM990.00') AS LENFW,
       DECODE((SELECT MAX(B.PRT_FLAG)
                FROM YDM_ZC_BILL_C B
               WHERE B.BILL_NO = T.BILL_NO
                 AND B.JUDGE_STOVE_NO = T.JUDGE_STOVE_NO
                 AND NVL(B.BATCH_NO,'/') = NVL(T.BATCH_NO,'/')
                 AND B.GROUP_NO = T.GROUP_NO
                 AND B.ORD_LN_DLY_PK = T.ORD_LN_DLY_PK
                 AND B.VALIDFLAG = '1'),
              '0',
              '否',
              '1',
              '是') AS WEIGH_FLAG,
       TO_CHAR(NVL(SUM(T.ACT_LEN), 0),'FM999999990.00') AS ACT_LEN,
       NVL(SUM(T.ACT_COUNT), 0) AS ACT_COUNT,
       TO_CHAR(NVL(SUM(T.ACT_WEIGHT), 0),'FM999999990.000') AS ACT_WEIGHT,
       TO_CHAR(NVL(SUM(T.PONDER_GROSS_WT), '0'),'FM999999990.000') AS PONDER_GROSS_WT,
       NVL(SUM(T.SEND_NUM),0) AS SEND_NUM,
       S.SUPPLY_UNIT,
       TO_CHAR(W.RECORD_DATE2, 'YYYY-MM-DD HH24:MI:SS') RECORD_DATE2,
       (SELECT IS_OVERSTOCK FROM YDM_ZC_BILL_M WHERE BILL_NO = T.BILL_NO AND ROWNUM = 1) IS_OVERSTOCK
  FROM YDM_ZC_LOADVEHICLE_MAT T
  LEFT JOIN YDM_BS_STORAGE B
    ON B.STORAGE_NO = T.STORAGE_NO
   LEFT JOIN SLM_ORDER_HEAD S
    ON S.ORD_PK = T.ORD_PK
    LEFT JOIN CMM_WEIGHT_RESULT W
    ON W.RESULT_NO =T.PONDER_NO
   WHERE T.LOADVEHICLE_NO = ?
   AND T.BILL_NO = ?
   AND T.VEHICLE_NO = ?
   AND T.TALLYSHEET_NO = ?
   AND T.RETURN_FLAG='0'
     	]]>
	</query>

	<query id="FrmPipeLoad.queryMativery_Hw" desc="查询发货实绩表理货单号对应的材料信息">
		<![CDATA[
SELECT
		T.BILL_NO,
		T.TALLYSHEET_NO,
		T.LOADVEHICLE_NO,
		T.JUDGE_STOVE_NO,
       T.BATCH_NO,
       T.GROUP_NO,
       TO_CHAR(NVL(SUM(T.ACT_WEIGHT), 0),'FM999999990.000') AS THEORY_WEIGHT,
       NVL(SUM(T.ACT_COUNT),0) AS SEND_NUM,
       TO_CHAR(NVL(W.HOOK_WEIGHT, 0),'FM999999990.000') AS HOOK_WEIGHT,
       TO_CHAR(NVL(SUM(T.PONDER_GROSS_WT), 0),'FM999999990.000') AS PONDER_GROSS_WT
  FROM YDM_ZC_LOADVEHICLE_MAT T
  LEFT JOIN YDM_BS_STORAGE B
    ON B.STORAGE_NO = T.STORAGE_NO
   LEFT JOIN YDM_ZC_HOOK_WEIGHT W
   	ON  W.BILL_NO = T.BILL_NO
		AND W.TALLYSHEET_NO =  T.TALLYSHEET_NO
		AND W.LOADVEHICLE_NO = T.LOADVEHICLE_NO
		AND W.JUDGE_STOVE_NO = T.JUDGE_STOVE_NO
		AND W.BATCH_NO = T.BATCH_NO
		AND W.GROUP_NO = T.GROUP_NO
   WHERE T.LOADVEHICLE_NO = ?
   AND T.BILL_NO = ?
   AND T.VEHICLE_NO = ?
   AND T.TALLYSHEET_NO = ?
   AND T.RETURN_FLAG='0'
     	]]>
	</query>
	
	<query id="FrmPipeLoad.queryMativeryByWl1" desc="查询发货实绩表理货单号对应的材料信息">
		<![CDATA[
SELECT T.JUDGE_STOVE_NO,
       T.MAT_NO,
       T.BATCH_NO,
       T.GROUP_NO,
       T.ORDER_NO||'/'||T.ORDER_SEQ AS ORDER_SEQ_NO1,
       T.ORDER_NO,
       T.ORDER_SEQ,
       T.ORDER_SEQ_NO,
       T.LOADVEHICLE_NO,
       T.BILL_NO,
       T.TALLYSHEET_NO,
       T.VEHICLE_NO,
       T.MATERIAL_NO,
       T.PRODUCNAME,
       T.GRADENAME,
       T.STEELNAME,
       T.SPEC_NAME,
       T.MODEL_DESC,
       T.STORAGE_NO,
       B.STORAGE_NAME,
       T.STD_CODE,
       T.STD_NAME,
       T.STD_STYLE_DESC,
       T.CREATE_NAME,
       T.CREDIT_NO,
       T.PORT_DESC,
       TO_CHAR(T.Create_Time,'YYYY-MM-DD HH24:MI:SS') AS CREATE_TIME,
       T.PONDER_NO AS PONDER_NO,
       T.ORD_PK,
       T.ORD_LN_PK,
       T.ORD_LN_DLY_PK,
       T.VSTEL,
       T.VSTEL_DESC,
       TO_CHAR(T.ACT_LEN_MIN, 'FM990.00') || '-' ||
       TO_CHAR(T.ACT_LEN_MAX, 'FM990.00') AS LENFW,
       TO_CHAR(NVL(T.ACT_LEN, 0),'FM999999990.00') AS ACT_LEN,
       NVL(T.ACT_COUNT, 0) AS ACT_COUNT,
       TO_CHAR(NVL(T.ACT_WEIGHT, 0),'FM999999990.000') AS ACT_WEIGHT,
       TO_CHAR(NVL(T.PONDER_GROSS_WT, '0'),'FM999999990.000') AS PONDER_GROSS_WT,
       NVL(T.SEND_NUM,0) AS SEND_NUM,
       COALESCE(T.STOVE_NO, get_max_stove_no(t.judge_stove_no)) STOVE_NO,
       T.LOT_NO LOT_NO,
       T.MATERIAL_NAME MATERIAL_NAME,
       T.PRODUCCODE PRODUCCODE,
       T.STD_CODE STD_CODE,
       T.GRADECODE GRADECODE,
       T.STEELCODE STEELCODE,
       T.STD_STYLE STD_STYLE,
       T.SPEC_CODE SPEC_CODE,
       T.MODEL_CODE MODEL_CODE,
       T.PLINE_CODE PLINE_CODE,
       T.PLINE_NAME PLINE_NAME,
       T.ACT_DIMATER ACT_DIMATER,
       T.ACT_HEIGHT ACT_HEIGHT,
       T.ACT_LEN_MIN ACT_LEN_MIN, T.RETURN_FLAG,T.LOADVEHICLE_SQE,T.VALIDFLAG,
       T.ACT_LEN_MAX ACT_LEN_MAX
  FROM YDM_ZC_LOADVEHICLE_MAT T
  LEFT JOIN YDM_BS_STORAGE B
    ON B.STORAGE_NO = T.STORAGE_NO
   WHERE T.LOADVEHICLE_NO = ?
   AND T.BILL_NO = ?
   AND T.VEHICLE_NO = ?
   AND T.TALLYSHEET_NO = ?
   AND T.RETURN_FLAG='0'
    ORDER BY T.JUDGE_STOVE_NO, T.BATCH_NO ASC
     	]]>
	</query>
	
		<query id="FrmPipeLoad.queryMativeryByWl" desc="查询发货实绩表理货单号对应的材料信息">
		<![CDATA[
SELECT T.JUDGE_STOVE_NO,
       T.BATCH_NO,
       T.GROUP_NO,
       T.ORDER_NO||'/'||T.ORDER_SEQ AS ORDER_SEQ_NO1,
       T.ORDER_NO,
       T.ORDER_SEQ,
       T.ORDER_SEQ_NO,
       T.LOADVEHICLE_NO,
       T.BILL_NO,
       T.TALLYSHEET_NO,
       T.VEHICLE_NO,
       T.MATERIAL_NO,
       T.PRODUCNAME,
       T.GRADENAME,
       T.STEELNAME,
       T.SPEC_NAME,
       T.MODEL_DESC,
       T.STORAGE_NO,
       B.STORAGE_NAME,
       T.STD_CODE,
       T.STD_NAME,
       T.STD_STYLE_DESC,
       T.CREATE_NAME,
       T.CREDIT_NO,
       T.PORT_DESC,
       TO_CHAR(MAX(T.Create_Time),'YYYY-MM-DD HH24:MI:SS') AS CREATE_TIME,
       MAX(T.PONDER_NO) AS PONDER_NO,
       T.ORD_PK,
       T.ORD_LN_PK,
       T.ORD_LN_DLY_PK,
       T.VSTEL,
       T.VSTEL_DESC,
       TO_CHAR(T.ACT_LEN_MIN, 'FM990.00') || '-' ||
       TO_CHAR(T.ACT_LEN_MAX, 'FM990.00') AS LENFW,
       DECODE((SELECT MAX(B.PRT_FLAG)
                FROM YDM_ZC_BILL_C B
               WHERE B.BILL_NO = T.BILL_NO
                 AND B.JUDGE_STOVE_NO = T.JUDGE_STOVE_NO
                 AND NVL(B.BATCH_NO,'/') = NVL(T.BATCH_NO,'/')
                 AND B.GROUP_NO = T.GROUP_NO
                 AND B.ORD_LN_DLY_PK = T.ORD_LN_DLY_PK
                 AND B.VALIDFLAG = '1'),
              '0',
              '否',
              '1',
              '是') AS WEIGH_FLAG,
       TO_CHAR(NVL(SUM(T.ACT_LEN), 0),'FM999999990.00') AS ACT_LEN,
       NVL(SUM(T.ACT_COUNT), 0) AS ACT_COUNT,
       TO_CHAR(NVL(SUM(T.ACT_WEIGHT), 0),'FM999999990.000') AS ACT_WEIGHT,
       TO_CHAR(NVL(SUM(T.PONDER_GROSS_WT), '0'),'FM999999990.000') AS PONDER_GROSS_WT,
       NVL(SUM(T.SEND_NUM),0) AS SEND_NUM,
       MAX(T.STOVE_NO) STOVE_NO,
       MAX(T.LOT_NO) LOT_NO,
       MAX(T.MATERIAL_NAME) MATERIAL_NAME,
       MAX(T.PRODUCCODE) PRODUCCODE,
       MAX(T.STD_CODE) STD_CODE,
       MAX(T.GRADECODE) GRADECODE,
       MAX(T.STEELCODE) STEELCODE,
       MAX(T.STD_STYLE) STD_STYLE,
       MAX(T.SPEC_CODE) SPEC_CODE,
       MAX(T.MODEL_CODE) MODEL_CODE,
       MAX(T.PLINE_CODE) PLINE_CODE,
       MAX(T.PLINE_NAME) PLINE_NAME,
       MAX(T.ACT_DIMATER) ACT_DIMATER,
       MAX(T.ACT_HEIGHT) ACT_HEIGHT,
       MAX(T.ACT_LEN_MIN) ACT_LEN_MIN,
       MAX(T.ACT_LEN_MAX) ACT_LEN_MAX
  FROM YDM_ZC_LOADVEHICLE_MAT T
  LEFT JOIN YDM_BS_STORAGE B
    ON B.STORAGE_NO = T.STORAGE_NO
   WHERE T.LOADVEHICLE_NO = ?
   AND T.BILL_NO = ?
   AND T.VEHICLE_NO = ?
   AND T.TALLYSHEET_NO = ?
   AND T.RETURN_FLAG='0'
   GROUP BY T.JUDGE_STOVE_NO, T.BATCH_NO,T.STD_CODE, T.GROUP_NO, T.ORDER_NO, 
   T.ORDER_SEQ, T.ORDER_SEQ_NO, T.LOADVEHICLE_NO, T.BILL_NO, T.TALLYSHEET_NO,
    T.VEHICLE_NO,T.CREDIT_NO,T.PORT_DESC,T.MATERIAL_NO, T.PRODUCNAME, 
    T.GRADENAME, T.STEELNAME, T.SPEC_NAME, T.MODEL_DESC, T.STORAGE_NO,T.VSTEL,
    T.VSTEL_DESC, B.STORAGE_NAME, T.STD_NAME, T.STD_STYLE_DESC, T.CREATE_NAME,
	T.ORD_PK,T.ORD_LN_PK,T.ORD_LN_DLY_PK,T.ACT_LEN_MIN,T.ACT_LEN_MAX  ORDER BY T.JUDGE_STOVE_NO, T.BATCH_NO ASC
     	]]>
	</query>
	
	<query id="FrmPipeLoad.insertWlMat" desc="查询发货实绩表信息">
		<![CDATA[
		 INSERT INTO  TMS_LOADVEHICLE_C
		 (LOADVEHICLE_SQE,LOADVEHICLE_NO,BILL_NO,TALLYSHEET_NO,VEHICLE_NO,
		 ORDER_NO,ORDER_SEQ,ORDER_SEQ_NO,STOVE_NO,LOT_NO,
		 JUDGE_STOVE_NO,BATCH_NO,GROUP_NO,MATERIAL_NO,MATERIAL_NAME,
		 PRODUCCODE,PRODUCNAME,STD_CODE,STD_NAME,GRADECODE,
		 GRADENAME,STEELCODE,STEELNAME,STD_STYLE,STD_STYLE_DESC,
		 SPEC_CODE,SPEC_NAME,MODEL_CODE,MODEL_DESC,PLINE_CODE,
		 PLINE_NAME,ACT_DIMATER,ACT_HEIGHT,ACT_LEN_MIN,ACT_LEN_MAX,
		 ACT_COUNT,ACT_WEIGHT,PONDER_NO,PONDER_GROSS_WT,VSTEL,
		 VSTEL_DESC,OUT_STORAGE_NO,OUT_STORAGE_NAME,CREATE_NAME,CREATE_TIME,
		 SEND_NUM,ORD_PK,ORD_LN_PK,ORD_LN_DLY_PK,ACT_LEN
		 )
		 VALUES
		 (?,?,?,?,?,
		 ?,?,?,?,?,
		 ?,?,?,?,?,
		 ?,?,?,?,?,
		 ?,?,?,?,?,
		 ?,?,?,?,?,
		 ?,?,?,?,?,
		 ?,?,?,?,?,
		 ?,?,?,?,SYSDATE,
		 ?,?,?,?,?
		 )

     	]]>
	</query>
	
			<query id="FrmPipeLoad.deleteWlC" desc="查询发货实绩表信息">
		<![CDATA[
		 DELETE  TMS_LOADVEHICLE_C T
		  WHERE T.LOADVEHICLE_NO=?

     	]]>
	</query>
	
		<query id="FrmPipeLoad.insertWlBill" desc="查询发货实绩表信息">
		<![CDATA[
		 INSERT INTO  TMS_WAYBILL_D
		 (WAYBILL_NO,EXPENSES_SQE,EXPENSES_TYPE_CODE,EXPENSES_TYPE_DESC,EXPENSES_FLAG,
		 BALANCE_TYPE_NAME,VALIDFLAG,CREATE_USERID,CREATE_NAME,CREATE_TIME
		 )
		 VALUES
		 (?,?,?,?,?,
		 ?,?,?,?,SYSDATE
		 )

     	]]>
	</query>
	
	<query id="FrmPipeLoad.deleteWlBill" desc="查询发货实绩表信息">
		<![CDATA[
		 DELETE  TMS_WAYBILL_D T
		  WHERE T.WAYBILL_NO=?

     	]]>
	</query>
	
			<query id="FrmPipeLoad.queryConBaseInfo" desc="查询发货实绩表信息">
		<![CDATA[
		 select basename from com_base_info where basecode=?

     	]]>
	</query>
	
	<query id="FrmPipeLoad.updateDelivery" desc="修改发货实绩表信息">
		<![CDATA[
		UPDATE YDM_ZC_LOADVEHICLE SET 
		  VEHICLE_NO=?,
		  INFACTORY_TIME=to_date(?,'YYYY-MM-DD HH24:MI:SS'),
		  DELIVY_TIME=to_date(?,'YYYY-MM-DD HH24:MI:SS'),
		  MEMO=?
		WHERE LOADVEHICLE_NO=?
		   AND VALIDFLAG='1'
     	]]>
	</query>
	<query id="FrmPipeLoad.updateDelConfirm" desc="修改发货实绩表信息确认">
		<![CDATA[
		UPDATE  YDM_ZC_LOADVEHICLE SET AFFIRM_FLAG='1',CONFIRM_NAME=?,CONFIRM_TIME=SYSDATE WHERE LOADVEHICLE_NO= ? AND VALIDFLAG='1'
     	]]>
	</query>
	<query id="FrmPipeLoad.updateDelCancel" desc="修改发货实绩表信息取消确认">
		<![CDATA[
		UPDATE  ydm_zc_loadvehicle SET AFFIRM_FLAG='0',CONFIRM_NAME=NULL,CONFIRM_TIME=NULL WHERE LOADVEHICLE_NO= ? AND VALIDFLAG='1'
     	]]>
	</query>
	<query id="FrmPipeLoad.updateMatConfirm" desc="修改发货材料表信息确认标志">
		<![CDATA[
		UPDATE  ydm_zc_loadvehicle_mat SET VALIDFLAG='2' WHERE LOADVEHICLE_NO= ?
		-- AND VALIDFLAG
     	]]>
	</query>
	<query id="FrmPipeLoad.updateMatCancel" desc="修改发货材料表信息取消确认标志">
		<![CDATA[
		UPDATE  ydm_zc_loadvehicle_mat SET VALIDFLAG='1' WHERE LOADVEHICLE_NO= ?
     	]]>
	</query>
	<query id="FrmPipeLoad.queryAppFlag" desc="查询确认标志">
	<![CDATA[
    select T.AFFIRM_FLAG  from YDM_ZC_LOADVEHICLE t where T.LOADVEHICLE_NO=?
	]]>
	</query>
	<query id="FrmPipeLoad.queryVelFalg" desc="查询结算标志">
	<![CDATA[
    SELECT T.VALIDFLAG,T.LOADVEHICLE_NO FROM YDM_ZC_LOADVEHICLE_MAT T WHERE T.LOADVEHICLE_NO=?
	]]>
	</query>
	<query id="FrmPipeLoad.queryLodSqe" desc="查询装车材料主键数据">
	<![CDATA[
   SELECT T.LOADVEHICLE_SQE
  FROM YDM_ZC_LOADVEHICLE_MAT T
 WHERE T.LOADVEHICLE_NO = ?
   AND T.BILL_NO = ?
   AND T.TALLYSHEET_NO = ?
   AND T.VEHICLE_NO = ?
   AND T.JUDGE_STOVE_NO = ?
   AND NVL(T.BATCH_NO,'/') = NVl(?,'/')
   AND T.GROUP_NO = ?
   AND T.ORD_LN_DLY_PK = ?
   AND NVL(T.STD_CODE,'/')=NVL(?,'/')
   AND T.VALIDFLAG='1'
   ORDER BY T.LOADVEHICLE_SQE ASC
	]]>
	</query>
	
		<query id="FrmPipeLoad.queryLodSqeNew" desc="查询装车材料主键数据">
	<![CDATA[
   SELECT T.LOADVEHICLE_SQE
  FROM YDM_ZC_LOADVEHICLE_MAT T
 WHERE T.LOADVEHICLE_NO = ?
   AND T.BILL_NO = ?
   AND T.TALLYSHEET_NO = ?
   AND T.VEHICLE_NO = ?
   AND T.JUDGE_STOVE_NO = ?
   AND NVL(T.BATCH_NO,'/') = NVl(?,'/')
   AND T.GROUP_NO = ?
   AND T.ORD_LN_PK = ?
   AND NVL(T.STD_CODE,'/')=NVL(?,'/')
   AND T.VALIDFLAG='1'
   AND NVL(TO_CHAR(T.ACT_LEN_MIN, 'FM990.00'),'/')=NVL(?,'/')
   AND NVL(TO_CHAR(T.ACT_LEN_MAX, 'FM990.00'),'/')=NVL(?,'/')
   AND NVL(TRIM(T.STD_NAME),'/') = NVl(TRIM(?),'/')
   AND T.LOCATION_NO = ?
   ORDER BY T.LOADVEHICLE_SQE ASC
	]]>
	</query>
	
	<query id="FrmPipeLoad.QueryBillType" desc="查询提单表状态">
	<![CDATA[
	SELECT T.BILL_STATUS,T.SALE_ORG,T.SUPPLY_UNIT FROM YDM_ZC_BILL_M T WHERE T.BILL_NO=? AND T.VALIDFLAG='1'
     ]]>
	</query>
	<query id="FrmPipeLoad.queryTallPond" desc="确认查询是否输入过磅单号，过磅重量">
	<![CDATA[
SELECT T.PONDER_NO,T.LOADVEHICLE_NO
  FROM YDM_ZC_LOADVEHICLE_MAT T
 WHERE T.PONDER_NO = ?
   AND T.VALIDFLAG = '1'
   Group by T.PONDER_NO,T.LOADVEHICLE_NO
     ]]>
	</query>
	<query id="FrmPipeLoad.queryTallPond1" desc="确认查询是否输入过磅单号，过磅重量">
	<![CDATA[
SELECT MIN(T.PONDER_NO) AS PONDER_NO, MIN(T.PONDER_GROSS_WT) AS PONDER_GROSS_WT
  FROM YDM_ZC_LOADVEHICLE_MAT T
 WHERE T.LOADVEHICLE_NO = ?
   AND T.BILL_NO = ?
   AND T.TALLYSHEET_NO = ?
   AND T.VEHICLE_NO = ?
   --AND T.JUDGE_STOVE_NO = ?
   --AND NVL(T.BATCH_NO,'/') = NVl(?,'/')
   --AND T.GROUP_NO = ?
   --AND T.ORD_PK = ?
   --AND T.ORD_LN_PK = ?
   --AND T.ORD_LN_DLY_PK = ?
   --AND T.VALIDFLAG = '1'
     ]]>
	</query>
	<query id="FrmPipeLoad.queryLoadMatNo" desc="查询装车单号向下材料号">
	<![CDATA[
	SELECT VEHICLE_NO,
       ORDER_NO,
       ORDER_SEQ,
       ORDER_SEQ_NO       AS DELIVERY_NO,
       MAT_NO,
       LOT_NO,
       JUDGE_STOVE_NO,
       BATCH_NO,
       GROUP_NO           AS BATCH_GROUD_NO,
       STOVE_NO,
       MATERIAL_NO,
       MATERIAL_NAME,
       PRODUCCODE,
       PRODUCNAME,
       STD_CODE,
       STD_NAME,
       GRADECODE,
       GRADENAME,
       STEELCODE,
       STEELNAME,
       STD_STYLE,
       STD_STYLE_DESC,
       SPEC_CODE,
       SPEC_NAME,
       MODEL_CODE,
       MODEL_DESC,
       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,
       PRO_BC,
       PRO_BZ,
       RPO_TIME,
       SALE_ORG           AS BELONG_CODE,
       SALE_ORG_DESC      AS BELONG_NAME,
       STORAGE_TYPE_NO,
       STORAGE_TYPE_NAME,
       MANAGEMENT_NO,
       MANAGEMENT_NAME,
       STORAGE_NO,
       LOCATION_NO,
       LARY_NO,
       LOC_NO,
       TRANS_TPE,
       RECEIV_NO,
       RECEIV_NM,
       STATION_NO,
       STATION_NM,
       SPCL_LN_NO,
       SPCL_LN_NM,
       PLANT,
       PLANT_DESC,
       VSTEL,
       VSTEL_DESC,
       CARRY_COMPANY_CODE,
       CARRY_COMPANY_NAME,
       OUT_STOCK_CODE,
       DELIVY_PLACE_CODE,
       DELIVY_PLACE_NAME,
       STLMT_UNIT_NO,
       STLMT_UNIT_NM,
       ORD_PK,
       ORD_LN_PK,
       ORD_LN_DLY_PK,
       DEPARTMENT_CODE,
       DEPARTMENT_DESC,
       PONDER_NO,
       PONDER_GROSS_WT,
       JUDGE_STD_NAME,
       JUDGE_STD_CODE,
       SEND_NUM,FINISHPRO_MOLD,IN_MOLD,
       LOADVEHICLE_SQE,
       LOADVEHICLE_NO,
       VALIDFLAG  validflag_Mat,
       TO_CHAR(SEN_TIME,'YYYY-MM-DD HH24:MI:SS') SEN_TIME,
       (SELECT SUPPLY_UNIT FROM SLM_ORDER_HEAD WHERE ORD_PK = T.ORD_PK AND ROWNUM = 1)SUPPLY_UNIT_CODE
  FROM YDM_ZC_LOADVEHICLE_MAT T
  WHERE LOADVEHICLE_NO = ?
  AND BILL_NO = ?
  AND TALLYSHEET_NO = ?
  AND VEHICLE_NO = ?
 ORDER BY MAT_NO ASC
     ]]>
	</query>
	<query id="FrmPipeLoad.updateOutPondWt" desc="修改出库表过磅重量">
	<![CDATA[
UPDATE YDM_ZC_OUTLIST T SET T.PONDER_NO=?, T.PONDER_GROSS_WT=TO_NUMBER(?) WHERE T.OUTSTOCK_TYPE_CODE=? AND T.MAT_NO=?
     ]]>
	</query>
	<query id="FrmPipeLoad.updatePintFlag" desc="回写打印次数，打印时间">
	<![CDATA[
UPDATE YDM_ZC_LOADVEHICLE T
   SET T.PRINT_NUM = TO_NUMBER(NVL(T.PRINT_NUM, 0)) +'1', T.PRINT_FLAG = TO_DATE(?,'YYYY-MM-DD HH24:MI:SS') WHERE T.LOADVEHICLE_NO = ? 
     ]]>
	</query>
	<query id="FrmPipeLoad.AddMatZcBackup" desc="新增材料表MAT_ZC_BACKUP">
	<![CDATA[  
DECLARE 
BEGIN
 INSERT INTO MAT_ZC_BACKUP (MAT_NO, PRODUCT_FLAG, MAT_STATUS, 
LOT_NO, STOVE_NO, JUDGE_STOVE_NO, BATCH_NO, BATCH_GROUD_NO, MAT_SQE_NO, 
SAMPLE_FLAG, CUTTING_FLAG, ORIGIN_MAT_NO, MATERIAL_NO, MATERIAL_NAME, 
INPUT_MATERIAL_NAME, INPUT_MATERIAL_NO, INPUT_ORIGIN_CODE, 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, PRO_ORDER_NO1, PRO_ORDER_ID, PRO_ORDER_ID1, ORDER_NO, ORDER_SEQ, 
ORDER_SEQ_NO, CRAF_NO, PROCESS_CDOE, PROCESS_DESC, NEXT_PROCESS_CDOE, 
NEXT_PROCESS_DESC, PLINE_CODE, PLINE_NAME, MAT_ORIGIN_CODE, MAT_ORIGIN_NAME, 
DIMATER, HEIGHT, LEN_NO, LEN_DESC, LEN_UNIT, LEN_MIN, LEN_MAX, TARG_DIMATER, 
TARG_HEIGHT, TARG_LEN_MIN, TARG_LEN_MAX, ACT_DIMATER, ACT_HEIGHT, ACT_LEN, 
ACT_LEN_MIN, ACT_LEN_MAX, ACT_COUNT, ACT_WEIGHT, ACT_THEORY_WEIGHT, 
MEASURE_FLAG, BELONG_CODE, BELONG_NAME, PACK_FLAG, PACK_TYPE_CODE, 
PACK_TYPE_NAME, PACK_NO, PACK_TIME, PACK_MAT_WT, MAT_GROSS_WT, MAT_GOWHERE_CODE, 
MAT_GOWHERE_NAME, COOL_HOT_FLAG, MAT_RETURN_FLAG, HEAT_TREAT_NO, POST_FLAG, 
LOCK_FLAG, MNG_LOCK_RSN_CODE, MNG_LOCK_TIME, MNG_LOCK_MAKER, MNG_LOCK_REMARK, 
LOCK_RSN_CODE, LOCK_TIME, LOCK_MAKER, LOCK_REMARK, UNLOCK_TIME, UNLOCK_MAKER, 
UNLOCK_REMARK, OLD_ORDER_NO, OLD_ORDER_SEQ, OLD_ORDER_SEQ_NO, OLD_MATERIAL_NO, 
OLD_MATERIAL_NAME, REMAIN_RSN_CODE, REMAIN_JUGDE_TIME, REMAIN_JUGDE_MAKER, 
REMAIN_JUGDE_CODE, REMAIN_REMARK, JUGDE_APPLY_FLAG, JUGDE_APPLY_CODE, 
JUGDE_APPLY_TIME, JUGDE_SCAN_TIME, FACE_RESULT_CODE, FACE_RESULT_TIME, 
FACE_MAKER, SPEC_RESULT_CODE, SPEC_RESULT_TIME, SPEC_MAKER, CHEM_RESULT_CODE, 
CHEM_RESULT_TIME, CHEM_MAKER, PHY_RESULT_CODE, PHY_RESULT_TIME, PHY_MAKER, 
DETECT_REPORT_NO, DETECT_RESULT_CODE, WPRESSURE_REPORT_NO, 
WPRESSURE_RESULT_CODE, JUDGE_RESULT_CODE, JUDGE_RESULT, JUDGE_RESULT_TIME, 
JUDGE_MAKER, BUG_NO, BUG_DEAL, REPAIR_FLAG, REPAIR_REMARK, SAMPLING_FLAG, 
SAMPLING_TYPE, SAMPLING_NO, CHECKOUT_NO, CHEM_STCHECK_NO, CHEM_PROCHECK_NO, 
SH_CHECK_NO, COME_PROC_FLAG, CONFM_FLAG, INSTOCK_FLAG, INSTOCK_TIME, 
OUTSTOCK_TIME, PRO_BC, PRO_BZ, RPO_TIME, BAR_CODE, BEGINNING_FLAG, MEMO, 
CREATE_NAME, CREATE_TIME, UPDATE_NAME, UPDATE_TIME, REQ_BL_ID, IF_BATCHED_JG, 
COUPCUT_BATCH_ID, ORD_PK, ORD_LN_PK, ORD_LN_DLY_PK, OLD_ORD_PK, OLD_ORD_LN_PK, 
OLD_ORD_LN_DLY_PK, BAL_YEAR_MONTH, JUDGE_STD_NAME, JUDGE_STD_CODE, JUDGE_GRADE, 
PIPMEMO, TEST, SOURE_CODE, SOURE_NAME, PONDER_NO, PONDER_GROSS_WT, MEMO1, 
JUDGE_ID, MNG_LOCK_FLAG, LOCK_ID, PRO_NO, LOCK_LIKU, PLN_GRADECODE, 
PLN_GRADENAME, PLN_STEELCODE, PLN_STEELNAME, QCM_STAUS, OUTSTOCK_DOC, 
HEAT_PLAN_NO, ZG_STOVE_SQE, GX_PLAN_NO, ZG_MAT_NO, FINISHPRO_MOLD, IN_MOLD, IN_TYPE,
TARGET, PROCESS_STATUS, JUGDE_CONVICTED, GX_PLAN_NO1, FIXTYPE_CODE, 
QUALITY_GROUP_ZG, FLAG_STOVE_NO_ZG, ZG_PHY_RESULT_PATH, ZG_FACE_RESULT_PATH, 
ZG_SPEC_RESULT_PATH, VRP_HEAT_PLAN_NO, VRP_LOT_NO, VRP_SAMPLE_FLAG, 
VRP_PRO_ORDER_NO, VRP_PRO_ORDER_NO1, VRP_PRO_ORDER_ID, VRP_PRO_ORDER_ID1, 
VRP_ACT_DIMATER, VRP_ACT_HEIGHT, VRP_JUGDE_APPLY_FLAG, VRP_JUGDE_APPLY_CODE, 
VRP_JUGDE_APPLY_TIME, VRP_FACE_RESULT_CODE, VRP_FACE_RESULT_TIME, 
VRP_FACE_MAKER, VRP_FACE_RESULT_PATH, VRP_SPEC_RESULT_CODE, 
VRP_SPEC_RESULT_TIME, VRP_SPEC_MAKER, VRP_SPEC_RESULT_PATH, VRP_PHY_RESULT_CODE, 
VRP_PHY_RESULT_TIME, VRP_PHY_MAKER, VRP_PHY_RESULT_PATH, VRP_JUDGE_RESULT_CODE, 
VRP_JUDGE_RESULT_TIME, VRP_JUDGE_MAKER, VRP_GX_PLAN_NO, VRP_GX_PLAN_NO1, 
VPR_JUGDE_CONVICTED, VPR_QUALITY_GROUP_ZG, VPR_FLAG_STOVE_NO_ZG, 
HTT_HEAT_PLAN_NO, HTT_LOT_NO, HTT_SAMPLE_FLAG, HTT_PRO_ORDER_NO, 
HTT_PRO_ORDER_NO1, HTT_PRO_ORDER_ID, HTT_PRO_ORDER_ID1, HTT_GX_PLAN_NO, 
HTT_GX_PLAN_NO1, HTT_JUGDE_APPLY_FLAG, HTT_JUGDE_APPLY_CODE, 
HTT_JUGDE_APPLY_TIME, HTT_FACE_RESULT_CODE, HTT_FACE_RESULT_TIME, 
HTT_FACE_MAKER, HTT_FACE_RESULT_PATH, HTT_SPEC_RESULT_CODE, 
HTT_SPEC_RESULT_TIME, HTT_SPEC_MAKER, HTT_SPEC_RESULT_PATH, HTT_PHY_RESULT_CODE, 
HTT_PHY_RESULT_TIME, HTT_PHY_MAKER, HTT_PHY_RESULT_PATH, HTT_JUDGE_RESULT_CODE, 
HTT_JUDGE_RESULT_TIME, HTT_JUDGE_MAKER, HTT_JUGDE_CONVICTED, 
HTT_QUALITY_GROUP_ZG, HTT_FLAG_STOVE_NO_ZG, PRC_LOT_NO, PRC_SAMPLE_FLAG, 
PRC_PRO_ORDER_NO, PRC_PRO_ORDER_NO1, PRC_PRO_ORDER_ID, PRC_PRO_ORDER_ID1, 
PRC_GX_PLAN_NO, PRC_GX_PLAN_NO1, PRC_JUGDE_APPLY_FLAG, PRC_JUGDE_APPLY_CODE, 
PRC_JUGDE_APPLY_TIME, PRC_FACE_RESULT_CODE, PRC_FACE_RESULT_TIME, 
PRC_FACE_MAKER, PRC_FACE_RESULT_PATH, PRC_SPEC_RESULT_CODE, 
PRC_SPEC_RESULT_TIME, PRC_SPEC_MAKER, PRC_SPEC_RESULT_PATH, PRC_PHY_RESULT_CODE, 
PRC_PHY_RESULT_TIME, PRC_PHY_MAKER, PRC_PHY_RESULT_PATH, PRC_JUDGE_RESULT_CODE, 
PRC_JUDGE_RESULT_TIME, PRC_JUDGE_MAKER, PRC_JUGDE_CONVICTED, 
PRC_QUALITY_GROUP_ZG, PRC_FLAG_STOVE_NO_ZG, PRC_HEAT_PLAN_NO, 
VRP_JUDGE_STD_NAME, VRP_JUDGE_STD_CODE, HTT_JUDGE_STD_NAME, HTT_JUDGE_STD_CODE, 
PRC_JUDGE_STD_NAME, PRC_JUDGE_STD_CODE, VRP_CRAF_NO, HTT_CRAF_NO, PRC_CRAF_NO, 
VRP_CHEM_RESULT_CODE, VRP_CHEM_RESULT_TIME, VRP_CHEM_MAKER, 
HTT_CHEM_RESULT_CODE, HTT_CHEM_RESULT_TIME, HTT_CHEM_MAKER, 
PRC_CHEM_RESULT_CODE, PRC_CHEM_RESULT_TIME, PRC_CHEM_MAKER, DETECT_REPORT_NO1, 
DETECT_RESULT_CODE1, TESTING_GRADE, TESTING_TYPE, TESTING_GRADE1, TESTING_TYPE1, 
ZG_PLINE_CODE, ZG_PLINE_NAME, VRP_PLINE_CODE, VRP_PLINE_NAME, HTT_PLINE_CODE, 
HTT_PLINE_NAME, PRC_PLINE_CODE, PRC_PLINE_NAME,VRP_QCM_STAUS,HTT_QCM_STAUS,PRC_QCM_STAUS,ZG_MEMO,ZBS_FLAG,ZBS_ID,JG_ZBS_ID,MEASURING_SEQ,
SUPPLY_UNIT_CODE,SUPPLY_UNIT,IS_DEALER) 
SELECT MAT_NO, PRODUCT_FLAG, 
'80150303', LOT_NO, STOVE_NO, JUDGE_STOVE_NO, BATCH_NO, BATCH_GROUD_NO, 
MAT_SQE_NO, SAMPLE_FLAG, CUTTING_FLAG, ORIGIN_MAT_NO, MATERIAL_NO, 
MATERIAL_NAME, INPUT_MATERIAL_NAME, INPUT_MATERIAL_NO, INPUT_ORIGIN_CODE, 
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, PRO_ORDER_NO1, PRO_ORDER_ID, PRO_ORDER_ID1, 
ORDER_NO, ORDER_SEQ, ORDER_SEQ_NO, CRAF_NO, PROCESS_CDOE, PROCESS_DESC, 
NEXT_PROCESS_CDOE, NEXT_PROCESS_DESC, PLINE_CODE, PLINE_NAME, MAT_ORIGIN_CODE, 
MAT_ORIGIN_NAME, DIMATER, HEIGHT, LEN_NO, LEN_DESC, LEN_UNIT, LEN_MIN, LEN_MAX, 
TARG_DIMATER, TARG_HEIGHT, TARG_LEN_MIN, TARG_LEN_MAX, ACT_DIMATER, ACT_HEIGHT, 
ACT_LEN, ACT_LEN_MIN, ACT_LEN_MAX, ACT_COUNT, ACT_WEIGHT, ACT_THEORY_WEIGHT, 
MEASURE_FLAG, BELONG_CODE, BELONG_NAME, PACK_FLAG, PACK_TYPE_CODE, 
PACK_TYPE_NAME, PACK_NO, PACK_TIME, PACK_MAT_WT, MAT_GROSS_WT, MAT_GOWHERE_CODE, 
MAT_GOWHERE_NAME, COOL_HOT_FLAG, MAT_RETURN_FLAG, HEAT_TREAT_NO, POST_FLAG, 
LOCK_FLAG, MNG_LOCK_RSN_CODE, MNG_LOCK_TIME, MNG_LOCK_MAKER, MNG_LOCK_REMARK, 
LOCK_RSN_CODE, LOCK_TIME, LOCK_MAKER, LOCK_REMARK, UNLOCK_TIME, UNLOCK_MAKER, 
UNLOCK_REMARK, OLD_ORDER_NO, OLD_ORDER_SEQ, OLD_ORDER_SEQ_NO, OLD_MATERIAL_NO, 
OLD_MATERIAL_NAME, REMAIN_RSN_CODE, REMAIN_JUGDE_TIME, REMAIN_JUGDE_MAKER, 
REMAIN_JUGDE_CODE, REMAIN_REMARK, JUGDE_APPLY_FLAG, JUGDE_APPLY_CODE, 
JUGDE_APPLY_TIME, JUGDE_SCAN_TIME, FACE_RESULT_CODE, FACE_RESULT_TIME, 
FACE_MAKER, SPEC_RESULT_CODE, SPEC_RESULT_TIME, SPEC_MAKER, CHEM_RESULT_CODE, 
CHEM_RESULT_TIME, CHEM_MAKER, PHY_RESULT_CODE, PHY_RESULT_TIME, PHY_MAKER, 
DETECT_REPORT_NO, DETECT_RESULT_CODE, WPRESSURE_REPORT_NO, 
WPRESSURE_RESULT_CODE, JUDGE_RESULT_CODE, JUDGE_RESULT, JUDGE_RESULT_TIME, 
JUDGE_MAKER, BUG_NO, BUG_DEAL, REPAIR_FLAG, REPAIR_REMARK, SAMPLING_FLAG, 
SAMPLING_TYPE, SAMPLING_NO, CHECKOUT_NO, CHEM_STCHECK_NO, CHEM_PROCHECK_NO, 
SH_CHECK_NO, COME_PROC_FLAG, CONFM_FLAG, INSTOCK_FLAG, INSTOCK_TIME, 
OUTSTOCK_TIME, PRO_BC, PRO_BZ, RPO_TIME, BAR_CODE, BEGINNING_FLAG, MEMO, 
CREATE_NAME, CREATE_TIME, UPDATE_NAME, UPDATE_TIME, REQ_BL_ID, IF_BATCHED_JG, 
COUPCUT_BATCH_ID, ORD_PK, ORD_LN_PK, ORD_LN_DLY_PK, OLD_ORD_PK, OLD_ORD_LN_PK, 
OLD_ORD_LN_DLY_PK, BAL_YEAR_MONTH, JUDGE_STD_NAME, JUDGE_STD_CODE, JUDGE_GRADE, 
PIPMEMO, TEST, SOURE_CODE, SOURE_NAME, PONDER_NO, PONDER_GROSS_WT, MEMO1, JUDGE_ID, 
MNG_LOCK_FLAG, LOCK_ID, PRO_NO, LOCK_LIKU, PLN_GRADECODE, PLN_GRADENAME, 
PLN_STEELCODE, PLN_STEELNAME, QCM_STAUS, OUTSTOCK_DOC, HEAT_PLAN_NO, 
ZG_STOVE_SQE, GX_PLAN_NO, ZG_MAT_NO, FINISHPRO_MOLD, IN_MOLD, IN_TYPE,TARGET,
PROCESS_STATUS, JUGDE_CONVICTED, GX_PLAN_NO1, FIXTYPE_CODE, QUALITY_GROUP_ZG, 
FLAG_STOVE_NO_ZG, ZG_PHY_RESULT_PATH, ZG_FACE_RESULT_PATH, ZG_SPEC_RESULT_PATH, 
VRP_HEAT_PLAN_NO, VRP_LOT_NO, VRP_SAMPLE_FLAG, VRP_PRO_ORDER_NO, 
VRP_PRO_ORDER_NO1, VRP_PRO_ORDER_ID, VRP_PRO_ORDER_ID1, VRP_ACT_DIMATER, 
VRP_ACT_HEIGHT, VRP_JUGDE_APPLY_FLAG, VRP_JUGDE_APPLY_CODE, 
VRP_JUGDE_APPLY_TIME, VRP_FACE_RESULT_CODE, VRP_FACE_RESULT_TIME, 
VRP_FACE_MAKER, VRP_FACE_RESULT_PATH, VRP_SPEC_RESULT_CODE, 
VRP_SPEC_RESULT_TIME, VRP_SPEC_MAKER, VRP_SPEC_RESULT_PATH, VRP_PHY_RESULT_CODE, 
VRP_PHY_RESULT_TIME, VRP_PHY_MAKER, VRP_PHY_RESULT_PATH, VRP_JUDGE_RESULT_CODE, 
VRP_JUDGE_RESULT_TIME, VRP_JUDGE_MAKER, VRP_GX_PLAN_NO, VRP_GX_PLAN_NO1, 
VPR_JUGDE_CONVICTED, VPR_QUALITY_GROUP_ZG, VPR_FLAG_STOVE_NO_ZG, 
HTT_HEAT_PLAN_NO, HTT_LOT_NO, HTT_SAMPLE_FLAG, HTT_PRO_ORDER_NO, 
HTT_PRO_ORDER_NO1, HTT_PRO_ORDER_ID, HTT_PRO_ORDER_ID1, HTT_GX_PLAN_NO, 
HTT_GX_PLAN_NO1, HTT_JUGDE_APPLY_FLAG, HTT_JUGDE_APPLY_CODE, 
HTT_JUGDE_APPLY_TIME, HTT_FACE_RESULT_CODE, HTT_FACE_RESULT_TIME, 
HTT_FACE_MAKER, HTT_FACE_RESULT_PATH, HTT_SPEC_RESULT_CODE, 
HTT_SPEC_RESULT_TIME, HTT_SPEC_MAKER, HTT_SPEC_RESULT_PATH, HTT_PHY_RESULT_CODE, 
HTT_PHY_RESULT_TIME, HTT_PHY_MAKER, HTT_PHY_RESULT_PATH, HTT_JUDGE_RESULT_CODE, 
HTT_JUDGE_RESULT_TIME, HTT_JUDGE_MAKER, HTT_JUGDE_CONVICTED, 
HTT_QUALITY_GROUP_ZG, HTT_FLAG_STOVE_NO_ZG, PRC_LOT_NO, PRC_SAMPLE_FLAG, 
PRC_PRO_ORDER_NO, PRC_PRO_ORDER_NO1, PRC_PRO_ORDER_ID, PRC_PRO_ORDER_ID1, 
PRC_GX_PLAN_NO, PRC_GX_PLAN_NO1, PRC_JUGDE_APPLY_FLAG, PRC_JUGDE_APPLY_CODE, 
PRC_JUGDE_APPLY_TIME, PRC_FACE_RESULT_CODE, PRC_FACE_RESULT_TIME, 
PRC_FACE_MAKER, PRC_FACE_RESULT_PATH, PRC_SPEC_RESULT_CODE, 
PRC_SPEC_RESULT_TIME, PRC_SPEC_MAKER, PRC_SPEC_RESULT_PATH, PRC_PHY_RESULT_CODE, 
PRC_PHY_RESULT_TIME, PRC_PHY_MAKER, PRC_PHY_RESULT_PATH, PRC_JUDGE_RESULT_CODE, 
PRC_JUDGE_RESULT_TIME, PRC_JUDGE_MAKER, PRC_JUGDE_CONVICTED, 
PRC_QUALITY_GROUP_ZG, PRC_FLAG_STOVE_NO_ZG, PRC_HEAT_PLAN_NO, 
VRP_JUDGE_STD_NAME, VRP_JUDGE_STD_CODE, HTT_JUDGE_STD_NAME, HTT_JUDGE_STD_CODE, 
PRC_JUDGE_STD_NAME, PRC_JUDGE_STD_CODE, VRP_CRAF_NO, HTT_CRAF_NO, PRC_CRAF_NO, 
VRP_CHEM_RESULT_CODE, VRP_CHEM_RESULT_TIME, VRP_CHEM_MAKER, 
HTT_CHEM_RESULT_CODE, HTT_CHEM_RESULT_TIME, HTT_CHEM_MAKER, 
PRC_CHEM_RESULT_CODE, PRC_CHEM_RESULT_TIME, PRC_CHEM_MAKER, DETECT_REPORT_NO1, 
DETECT_RESULT_CODE1, TESTING_GRADE, TESTING_TYPE, TESTING_GRADE1, TESTING_TYPE1, 
ZG_PLINE_CODE, ZG_PLINE_NAME, VRP_PLINE_CODE, VRP_PLINE_NAME, HTT_PLINE_CODE, 
HTT_PLINE_NAME, PRC_PLINE_CODE, PRC_PLINE_NAME,VRP_QCM_STAUS,HTT_QCM_STAUS,PRC_QCM_STAUS,ZG_MEMO,ZBS_FLAG,ZBS_ID,JG_ZBS_ID,MEASURING_SEQ,
SUPPLY_UNIT_CODE,SUPPLY_UNIT,IS_DEALER
 FROM MAT_ZC_M WHERE MAT_NO = ?; 
DELETE YDM_ZC_BUTTRESS WHERE MAT_NO = ?;
DELETE MAT_ZC_M WHERE MAT_NO = ?;
DELETE MAT_ZC_M_XS WHERE MAT_NO = ?;
 END;
 ]]>
	</query>
	<query id="FrmPipeLoad.AddMatNoZc" desc="新增材料表（删除材料表MAT_ZC_BACKUP）">
	<![CDATA[  
DECLARE 
BEGIN
 INSERT INTO MAT_ZC_M (MAT_NO, PRODUCT_FLAG, MAT_STATUS, 
LOT_NO, STOVE_NO, JUDGE_STOVE_NO, BATCH_NO, BATCH_GROUD_NO, MAT_SQE_NO, 
SAMPLE_FLAG, CUTTING_FLAG, ORIGIN_MAT_NO, MATERIAL_NO, MATERIAL_NAME, 
INPUT_MATERIAL_NAME, INPUT_MATERIAL_NO, INPUT_ORIGIN_CODE, 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, PRO_ORDER_NO1, PRO_ORDER_ID, PRO_ORDER_ID1, ORDER_NO, ORDER_SEQ, 
ORDER_SEQ_NO, CRAF_NO, PROCESS_CDOE, PROCESS_DESC, NEXT_PROCESS_CDOE, 
NEXT_PROCESS_DESC, PLINE_CODE, PLINE_NAME, MAT_ORIGIN_CODE, MAT_ORIGIN_NAME, 
DIMATER, HEIGHT, LEN_NO, LEN_DESC, LEN_UNIT, LEN_MIN, LEN_MAX, TARG_DIMATER, 
TARG_HEIGHT, TARG_LEN_MIN, TARG_LEN_MAX, ACT_DIMATER, ACT_HEIGHT, ACT_LEN, 
ACT_LEN_MIN, ACT_LEN_MAX, ACT_COUNT, ACT_WEIGHT, ACT_THEORY_WEIGHT, 
MEASURE_FLAG, BELONG_CODE, BELONG_NAME, PACK_FLAG, PACK_TYPE_CODE, 
PACK_TYPE_NAME, PACK_NO, PACK_TIME, PACK_MAT_WT, MAT_GROSS_WT, MAT_GOWHERE_CODE, 
MAT_GOWHERE_NAME, COOL_HOT_FLAG, MAT_RETURN_FLAG, HEAT_TREAT_NO, POST_FLAG, 
LOCK_FLAG, MNG_LOCK_RSN_CODE, MNG_LOCK_TIME, MNG_LOCK_MAKER, MNG_LOCK_REMARK, 
LOCK_RSN_CODE, LOCK_TIME, LOCK_MAKER, LOCK_REMARK, UNLOCK_TIME, UNLOCK_MAKER, 
UNLOCK_REMARK, OLD_ORDER_NO, OLD_ORDER_SEQ, OLD_ORDER_SEQ_NO, OLD_MATERIAL_NO, 
OLD_MATERIAL_NAME, REMAIN_RSN_CODE, REMAIN_JUGDE_TIME, REMAIN_JUGDE_MAKER, 
REMAIN_JUGDE_CODE, REMAIN_REMARK, JUGDE_APPLY_FLAG, JUGDE_APPLY_CODE, 
JUGDE_APPLY_TIME, JUGDE_SCAN_TIME, FACE_RESULT_CODE, FACE_RESULT_TIME, 
FACE_MAKER, SPEC_RESULT_CODE, SPEC_RESULT_TIME, SPEC_MAKER, CHEM_RESULT_CODE, 
CHEM_RESULT_TIME, CHEM_MAKER, PHY_RESULT_CODE, PHY_RESULT_TIME, PHY_MAKER, 
DETECT_REPORT_NO, DETECT_RESULT_CODE, WPRESSURE_REPORT_NO, 
WPRESSURE_RESULT_CODE, JUDGE_RESULT_CODE, JUDGE_RESULT, JUDGE_RESULT_TIME, 
JUDGE_MAKER, BUG_NO, BUG_DEAL, REPAIR_FLAG, REPAIR_REMARK, SAMPLING_FLAG, 
SAMPLING_TYPE, SAMPLING_NO, CHECKOUT_NO, CHEM_STCHECK_NO, CHEM_PROCHECK_NO, 
SH_CHECK_NO, COME_PROC_FLAG, CONFM_FLAG, INSTOCK_FLAG, INSTOCK_TIME, 
OUTSTOCK_TIME, PRO_BC, PRO_BZ, RPO_TIME, BAR_CODE, BEGINNING_FLAG, MEMO, 
CREATE_NAME, CREATE_TIME, UPDATE_NAME, UPDATE_TIME, REQ_BL_ID, IF_BATCHED_JG, 
COUPCUT_BATCH_ID, ORD_PK, ORD_LN_PK, ORD_LN_DLY_PK, OLD_ORD_PK, OLD_ORD_LN_PK, 
OLD_ORD_LN_DLY_PK, BAL_YEAR_MONTH, JUDGE_STD_NAME, JUDGE_STD_CODE, JUDGE_GRADE, 
PIPMEMO, TEST, SOURE_CODE, SOURE_NAME, PONDER_NO, PONDER_GROSS_WT, MEMO1, 
JUDGE_ID, MNG_LOCK_FLAG, LOCK_ID, PRO_NO, LOCK_LIKU, PLN_GRADECODE, 
PLN_GRADENAME, PLN_STEELCODE, PLN_STEELNAME, QCM_STAUS, OUTSTOCK_DOC, 
HEAT_PLAN_NO, ZG_STOVE_SQE, GX_PLAN_NO, ZG_MAT_NO, FINISHPRO_MOLD, IN_MOLD, 
TARGET, PROCESS_STATUS, JUGDE_CONVICTED, GX_PLAN_NO1, FIXTYPE_CODE, 
QUALITY_GROUP_ZG, FLAG_STOVE_NO_ZG, ZG_PHY_RESULT_PATH, ZG_FACE_RESULT_PATH, 
ZG_SPEC_RESULT_PATH, VRP_HEAT_PLAN_NO, VRP_LOT_NO, VRP_SAMPLE_FLAG, 
VRP_PRO_ORDER_NO, VRP_PRO_ORDER_NO1, VRP_PRO_ORDER_ID, VRP_PRO_ORDER_ID1, 
VRP_ACT_DIMATER, VRP_ACT_HEIGHT, VRP_JUGDE_APPLY_FLAG, VRP_JUGDE_APPLY_CODE, 
VRP_JUGDE_APPLY_TIME, VRP_FACE_RESULT_CODE, VRP_FACE_RESULT_TIME, 
VRP_FACE_MAKER, VRP_FACE_RESULT_PATH, VRP_SPEC_RESULT_CODE, 
VRP_SPEC_RESULT_TIME, VRP_SPEC_MAKER, VRP_SPEC_RESULT_PATH, VRP_PHY_RESULT_CODE, 
VRP_PHY_RESULT_TIME, VRP_PHY_MAKER, VRP_PHY_RESULT_PATH, VRP_JUDGE_RESULT_CODE, 
VRP_JUDGE_RESULT_TIME, VRP_JUDGE_MAKER, VRP_GX_PLAN_NO, VRP_GX_PLAN_NO1, 
VPR_JUGDE_CONVICTED, VPR_QUALITY_GROUP_ZG, VPR_FLAG_STOVE_NO_ZG, 
HTT_HEAT_PLAN_NO, HTT_LOT_NO, HTT_SAMPLE_FLAG, HTT_PRO_ORDER_NO, 
HTT_PRO_ORDER_NO1, HTT_PRO_ORDER_ID, HTT_PRO_ORDER_ID1, HTT_GX_PLAN_NO, 
HTT_GX_PLAN_NO1, HTT_JUGDE_APPLY_FLAG, HTT_JUGDE_APPLY_CODE, 
HTT_JUGDE_APPLY_TIME, HTT_FACE_RESULT_CODE, HTT_FACE_RESULT_TIME, 
HTT_FACE_MAKER, HTT_FACE_RESULT_PATH, HTT_SPEC_RESULT_CODE, 
HTT_SPEC_RESULT_TIME, HTT_SPEC_MAKER, HTT_SPEC_RESULT_PATH, HTT_PHY_RESULT_CODE, 
HTT_PHY_RESULT_TIME, HTT_PHY_MAKER, HTT_PHY_RESULT_PATH, HTT_JUDGE_RESULT_CODE, 
HTT_JUDGE_RESULT_TIME, HTT_JUDGE_MAKER, HTT_JUGDE_CONVICTED, 
HTT_QUALITY_GROUP_ZG, HTT_FLAG_STOVE_NO_ZG, PRC_LOT_NO, PRC_SAMPLE_FLAG, 
PRC_PRO_ORDER_NO, PRC_PRO_ORDER_NO1, PRC_PRO_ORDER_ID, PRC_PRO_ORDER_ID1, 
PRC_GX_PLAN_NO, PRC_GX_PLAN_NO1, PRC_JUGDE_APPLY_FLAG, PRC_JUGDE_APPLY_CODE, 
PRC_JUGDE_APPLY_TIME, PRC_FACE_RESULT_CODE, PRC_FACE_RESULT_TIME, 
PRC_FACE_MAKER, PRC_FACE_RESULT_PATH, PRC_SPEC_RESULT_CODE, 
PRC_SPEC_RESULT_TIME, PRC_SPEC_MAKER, PRC_SPEC_RESULT_PATH, PRC_PHY_RESULT_CODE, 
PRC_PHY_RESULT_TIME, PRC_PHY_MAKER, PRC_PHY_RESULT_PATH, PRC_JUDGE_RESULT_CODE, 
PRC_JUDGE_RESULT_TIME, PRC_JUDGE_MAKER, PRC_JUGDE_CONVICTED, 
PRC_QUALITY_GROUP_ZG, PRC_FLAG_STOVE_NO_ZG, PRC_HEAT_PLAN_NO, 
VRP_JUDGE_STD_NAME, VRP_JUDGE_STD_CODE, HTT_JUDGE_STD_NAME, HTT_JUDGE_STD_CODE, 
PRC_JUDGE_STD_NAME, PRC_JUDGE_STD_CODE, VRP_CRAF_NO, HTT_CRAF_NO, PRC_CRAF_NO, 
VRP_CHEM_RESULT_CODE, VRP_CHEM_RESULT_TIME, VRP_CHEM_MAKER, 
HTT_CHEM_RESULT_CODE, HTT_CHEM_RESULT_TIME, HTT_CHEM_MAKER, 
PRC_CHEM_RESULT_CODE, PRC_CHEM_RESULT_TIME, PRC_CHEM_MAKER, DETECT_REPORT_NO1, 
DETECT_RESULT_CODE1, TESTING_GRADE, TESTING_TYPE, TESTING_GRADE1, TESTING_TYPE1, 
ZG_PLINE_CODE, ZG_PLINE_NAME, VRP_PLINE_CODE, VRP_PLINE_NAME, HTT_PLINE_CODE, 
HTT_PLINE_NAME, PRC_PLINE_CODE, PRC_PLINE_NAME,VRP_QCM_STAUS,HTT_QCM_STAUS,PRC_QCM_STAUS,ZG_MEMO,ZBS_FLAG,ZBS_ID,JG_ZBS_ID,MEASURING_SEQ,
SUPPLY_UNIT_CODE,SUPPLY_UNIT,IS_DEALER) 
SELECT MAT_NO, PRODUCT_FLAG, 
'80150302', LOT_NO, STOVE_NO, JUDGE_STOVE_NO, BATCH_NO, BATCH_GROUD_NO, 
MAT_SQE_NO, SAMPLE_FLAG, CUTTING_FLAG, ORIGIN_MAT_NO, MATERIAL_NO, 
MATERIAL_NAME, INPUT_MATERIAL_NAME, INPUT_MATERIAL_NO, INPUT_ORIGIN_CODE, 
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, PRO_ORDER_NO1, PRO_ORDER_ID, PRO_ORDER_ID1, 
ORDER_NO, ORDER_SEQ, ORDER_SEQ_NO, CRAF_NO, PROCESS_CDOE, PROCESS_DESC, 
NEXT_PROCESS_CDOE, NEXT_PROCESS_DESC, PLINE_CODE, PLINE_NAME, MAT_ORIGIN_CODE, 
MAT_ORIGIN_NAME, DIMATER, HEIGHT, LEN_NO, LEN_DESC, LEN_UNIT, LEN_MIN, LEN_MAX, 
TARG_DIMATER, TARG_HEIGHT, TARG_LEN_MIN, TARG_LEN_MAX, ACT_DIMATER, ACT_HEIGHT, 
ACT_LEN, ACT_LEN_MIN, ACT_LEN_MAX, ACT_COUNT, ACT_WEIGHT, ACT_THEORY_WEIGHT, 
MEASURE_FLAG, BELONG_CODE, BELONG_NAME, PACK_FLAG, PACK_TYPE_CODE, 
PACK_TYPE_NAME, PACK_NO, PACK_TIME, PACK_MAT_WT, MAT_GROSS_WT, MAT_GOWHERE_CODE, 
MAT_GOWHERE_NAME, COOL_HOT_FLAG, MAT_RETURN_FLAG, HEAT_TREAT_NO, POST_FLAG, 
LOCK_FLAG, MNG_LOCK_RSN_CODE, MNG_LOCK_TIME, MNG_LOCK_MAKER, MNG_LOCK_REMARK, 
LOCK_RSN_CODE, LOCK_TIME, LOCK_MAKER, LOCK_REMARK, UNLOCK_TIME, UNLOCK_MAKER, 
UNLOCK_REMARK, OLD_ORDER_NO, OLD_ORDER_SEQ, OLD_ORDER_SEQ_NO, OLD_MATERIAL_NO, 
OLD_MATERIAL_NAME, REMAIN_RSN_CODE, REMAIN_JUGDE_TIME, REMAIN_JUGDE_MAKER, 
REMAIN_JUGDE_CODE, REMAIN_REMARK, JUGDE_APPLY_FLAG, JUGDE_APPLY_CODE, 
JUGDE_APPLY_TIME, JUGDE_SCAN_TIME, FACE_RESULT_CODE, FACE_RESULT_TIME, 
FACE_MAKER, SPEC_RESULT_CODE, SPEC_RESULT_TIME, SPEC_MAKER, CHEM_RESULT_CODE, 
CHEM_RESULT_TIME, CHEM_MAKER, PHY_RESULT_CODE, PHY_RESULT_TIME, PHY_MAKER, 
DETECT_REPORT_NO, DETECT_RESULT_CODE, WPRESSURE_REPORT_NO, 
WPRESSURE_RESULT_CODE, JUDGE_RESULT_CODE, JUDGE_RESULT, JUDGE_RESULT_TIME, 
JUDGE_MAKER, BUG_NO, BUG_DEAL, REPAIR_FLAG, REPAIR_REMARK, SAMPLING_FLAG, 
SAMPLING_TYPE, SAMPLING_NO, CHECKOUT_NO, CHEM_STCHECK_NO, CHEM_PROCHECK_NO, 
SH_CHECK_NO, COME_PROC_FLAG, CONFM_FLAG, INSTOCK_FLAG, INSTOCK_TIME, 
OUTSTOCK_TIME, PRO_BC, PRO_BZ, RPO_TIME, BAR_CODE, BEGINNING_FLAG, MEMO, 
CREATE_NAME, CREATE_TIME, UPDATE_NAME, UPDATE_TIME, REQ_BL_ID, IF_BATCHED_JG, 
COUPCUT_BATCH_ID, ORD_PK, ORD_LN_PK, ORD_LN_DLY_PK, OLD_ORD_PK, OLD_ORD_LN_PK, 
OLD_ORD_LN_DLY_PK, BAL_YEAR_MONTH, JUDGE_STD_NAME, JUDGE_STD_CODE, JUDGE_GRADE, 
PIPMEMO, TEST, SOURE_CODE, SOURE_NAME, PONDER_NO, PONDER_GROSS_WT, MEMO1, JUDGE_ID, 
MNG_LOCK_FLAG, LOCK_ID, PRO_NO, LOCK_LIKU, PLN_GRADECODE, PLN_GRADENAME, 
PLN_STEELCODE, PLN_STEELNAME, QCM_STAUS, OUTSTOCK_DOC, HEAT_PLAN_NO, 
ZG_STOVE_SQE, GX_PLAN_NO, ZG_MAT_NO, FINISHPRO_MOLD, IN_MOLD, TARGET, 
PROCESS_STATUS, JUGDE_CONVICTED, GX_PLAN_NO1, FIXTYPE_CODE, QUALITY_GROUP_ZG, 
FLAG_STOVE_NO_ZG, ZG_PHY_RESULT_PATH, ZG_FACE_RESULT_PATH, ZG_SPEC_RESULT_PATH, 
VRP_HEAT_PLAN_NO, VRP_LOT_NO, VRP_SAMPLE_FLAG, VRP_PRO_ORDER_NO, 
VRP_PRO_ORDER_NO1, VRP_PRO_ORDER_ID, VRP_PRO_ORDER_ID1, VRP_ACT_DIMATER, 
VRP_ACT_HEIGHT, VRP_JUGDE_APPLY_FLAG, VRP_JUGDE_APPLY_CODE, 
VRP_JUGDE_APPLY_TIME, VRP_FACE_RESULT_CODE, VRP_FACE_RESULT_TIME, 
VRP_FACE_MAKER, VRP_FACE_RESULT_PATH, VRP_SPEC_RESULT_CODE, 
VRP_SPEC_RESULT_TIME, VRP_SPEC_MAKER, VRP_SPEC_RESULT_PATH, VRP_PHY_RESULT_CODE, 
VRP_PHY_RESULT_TIME, VRP_PHY_MAKER, VRP_PHY_RESULT_PATH, VRP_JUDGE_RESULT_CODE, 
VRP_JUDGE_RESULT_TIME, VRP_JUDGE_MAKER, VRP_GX_PLAN_NO, VRP_GX_PLAN_NO1, 
VPR_JUGDE_CONVICTED, VPR_QUALITY_GROUP_ZG, VPR_FLAG_STOVE_NO_ZG, 
HTT_HEAT_PLAN_NO, HTT_LOT_NO, HTT_SAMPLE_FLAG, HTT_PRO_ORDER_NO, 
HTT_PRO_ORDER_NO1, HTT_PRO_ORDER_ID, HTT_PRO_ORDER_ID1, HTT_GX_PLAN_NO, 
HTT_GX_PLAN_NO1, HTT_JUGDE_APPLY_FLAG, HTT_JUGDE_APPLY_CODE, 
HTT_JUGDE_APPLY_TIME, HTT_FACE_RESULT_CODE, HTT_FACE_RESULT_TIME, 
HTT_FACE_MAKER, HTT_FACE_RESULT_PATH, HTT_SPEC_RESULT_CODE, 
HTT_SPEC_RESULT_TIME, HTT_SPEC_MAKER, HTT_SPEC_RESULT_PATH, HTT_PHY_RESULT_CODE, 
HTT_PHY_RESULT_TIME, HTT_PHY_MAKER, HTT_PHY_RESULT_PATH, HTT_JUDGE_RESULT_CODE, 
HTT_JUDGE_RESULT_TIME, HTT_JUDGE_MAKER, HTT_JUGDE_CONVICTED, 
HTT_QUALITY_GROUP_ZG, HTT_FLAG_STOVE_NO_ZG, PRC_LOT_NO, PRC_SAMPLE_FLAG, 
PRC_PRO_ORDER_NO, PRC_PRO_ORDER_NO1, PRC_PRO_ORDER_ID, PRC_PRO_ORDER_ID1, 
PRC_GX_PLAN_NO, PRC_GX_PLAN_NO1, PRC_JUGDE_APPLY_FLAG, PRC_JUGDE_APPLY_CODE, 
PRC_JUGDE_APPLY_TIME, PRC_FACE_RESULT_CODE, PRC_FACE_RESULT_TIME, 
PRC_FACE_MAKER, PRC_FACE_RESULT_PATH, PRC_SPEC_RESULT_CODE, 
PRC_SPEC_RESULT_TIME, PRC_SPEC_MAKER, PRC_SPEC_RESULT_PATH, PRC_PHY_RESULT_CODE, 
PRC_PHY_RESULT_TIME, PRC_PHY_MAKER, PRC_PHY_RESULT_PATH, PRC_JUDGE_RESULT_CODE, 
PRC_JUDGE_RESULT_TIME, PRC_JUDGE_MAKER, PRC_JUGDE_CONVICTED, 
PRC_QUALITY_GROUP_ZG, PRC_FLAG_STOVE_NO_ZG, PRC_HEAT_PLAN_NO, 
VRP_JUDGE_STD_NAME, VRP_JUDGE_STD_CODE, HTT_JUDGE_STD_NAME, HTT_JUDGE_STD_CODE, 
PRC_JUDGE_STD_NAME, PRC_JUDGE_STD_CODE, VRP_CRAF_NO, HTT_CRAF_NO, PRC_CRAF_NO, 
VRP_CHEM_RESULT_CODE, VRP_CHEM_RESULT_TIME, VRP_CHEM_MAKER, 
HTT_CHEM_RESULT_CODE, HTT_CHEM_RESULT_TIME, HTT_CHEM_MAKER, 
PRC_CHEM_RESULT_CODE, PRC_CHEM_RESULT_TIME, PRC_CHEM_MAKER, DETECT_REPORT_NO1, 
DETECT_RESULT_CODE1, TESTING_GRADE, TESTING_TYPE, TESTING_GRADE1, TESTING_TYPE1, 
ZG_PLINE_CODE, ZG_PLINE_NAME, VRP_PLINE_CODE, VRP_PLINE_NAME, HTT_PLINE_CODE, 
HTT_PLINE_NAME, PRC_PLINE_CODE, PRC_PLINE_NAME,VRP_QCM_STAUS,HTT_QCM_STAUS,PRC_QCM_STAUS,ZG_MEMO,ZBS_FLAG,ZBS_ID,JG_ZBS_ID,MEASURING_SEQ,
SUPPLY_UNIT_CODE,SUPPLY_UNIT,IS_DEALER
 FROM MAT_ZC_BACKUP WHERE MAT_NO = ?; 
 
 INSERT INTO MAT_ZC_M_XS (MAT_NO, PRODUCT_FLAG, MAT_STATUS, 
LOT_NO, STOVE_NO, JUDGE_STOVE_NO, BATCH_NO, BATCH_GROUD_NO, MAT_SQE_NO, 
SAMPLE_FLAG, CUTTING_FLAG, ORIGIN_MAT_NO, MATERIAL_NO, MATERIAL_NAME, 
INPUT_MATERIAL_NAME, INPUT_MATERIAL_NO, INPUT_ORIGIN_CODE, 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, PRO_ORDER_NO1, PRO_ORDER_ID, PRO_ORDER_ID1, ORDER_NO, ORDER_SEQ, 
ORDER_SEQ_NO, CRAF_NO, PROCESS_CDOE, PROCESS_DESC, NEXT_PROCESS_CDOE, 
NEXT_PROCESS_DESC, PLINE_CODE, PLINE_NAME, MAT_ORIGIN_CODE, MAT_ORIGIN_NAME, 
DIMATER, HEIGHT, LEN_NO, LEN_DESC, LEN_UNIT, LEN_MIN, LEN_MAX, TARG_DIMATER, 
TARG_HEIGHT, TARG_LEN_MIN, TARG_LEN_MAX, ACT_DIMATER, ACT_HEIGHT, ACT_LEN, 
ACT_LEN_MIN, ACT_LEN_MAX, ACT_COUNT, ACT_WEIGHT, ACT_THEORY_WEIGHT, 
MEASURE_FLAG, BELONG_CODE, BELONG_NAME, PACK_FLAG, PACK_TYPE_CODE, 
PACK_TYPE_NAME, PACK_NO, PACK_TIME, PACK_MAT_WT, MAT_GROSS_WT, MAT_GOWHERE_CODE, 
MAT_GOWHERE_NAME, COOL_HOT_FLAG, MAT_RETURN_FLAG, HEAT_TREAT_NO, POST_FLAG, 
LOCK_FLAG, MNG_LOCK_RSN_CODE, MNG_LOCK_TIME, MNG_LOCK_MAKER, MNG_LOCK_REMARK, 
LOCK_RSN_CODE, LOCK_TIME, LOCK_MAKER, LOCK_REMARK, UNLOCK_TIME, UNLOCK_MAKER, 
UNLOCK_REMARK, OLD_ORDER_NO, OLD_ORDER_SEQ, OLD_ORDER_SEQ_NO, OLD_MATERIAL_NO, 
OLD_MATERIAL_NAME, REMAIN_RSN_CODE, REMAIN_JUGDE_TIME, REMAIN_JUGDE_MAKER, 
REMAIN_JUGDE_CODE, REMAIN_REMARK, JUGDE_APPLY_FLAG, JUGDE_APPLY_CODE, 
JUGDE_APPLY_TIME, JUGDE_SCAN_TIME, FACE_RESULT_CODE, FACE_RESULT_TIME, 
FACE_MAKER, SPEC_RESULT_CODE, SPEC_RESULT_TIME, SPEC_MAKER, CHEM_RESULT_CODE, 
CHEM_RESULT_TIME, CHEM_MAKER, PHY_RESULT_CODE, PHY_RESULT_TIME, PHY_MAKER, 
DETECT_REPORT_NO, DETECT_RESULT_CODE, WPRESSURE_REPORT_NO, 
WPRESSURE_RESULT_CODE, JUDGE_RESULT_CODE, JUDGE_RESULT, JUDGE_RESULT_TIME, 
JUDGE_MAKER, BUG_NO, BUG_DEAL, REPAIR_FLAG, REPAIR_REMARK, SAMPLING_FLAG, 
SAMPLING_TYPE, SAMPLING_NO, CHECKOUT_NO, CHEM_STCHECK_NO, CHEM_PROCHECK_NO, 
SH_CHECK_NO, COME_PROC_FLAG, CONFM_FLAG, INSTOCK_FLAG, INSTOCK_TIME, 
OUTSTOCK_TIME, PRO_BC, PRO_BZ, RPO_TIME, BAR_CODE, BEGINNING_FLAG, MEMO, 
CREATE_NAME, CREATE_TIME, UPDATE_NAME, UPDATE_TIME, REQ_BL_ID, IF_BATCHED_JG, 
COUPCUT_BATCH_ID, ORD_PK, ORD_LN_PK, ORD_LN_DLY_PK, OLD_ORD_PK, OLD_ORD_LN_PK, 
OLD_ORD_LN_DLY_PK, BAL_YEAR_MONTH, JUDGE_STD_NAME, JUDGE_STD_CODE, JUDGE_GRADE, 
PIPMEMO, TEST, SOURE_CODE, SOURE_NAME, PONDER_NO, PONDER_GROSS_WT, MEMO1, 
JUDGE_ID, MNG_LOCK_FLAG, LOCK_ID, PRO_NO, LOCK_LIKU, PLN_GRADECODE, 
PLN_GRADENAME, PLN_STEELCODE, PLN_STEELNAME, QCM_STAUS, OUTSTOCK_DOC, 
HEAT_PLAN_NO, ZG_STOVE_SQE, GX_PLAN_NO, ZG_MAT_NO, FINISHPRO_MOLD, IN_MOLD, 
TARGET, PROCESS_STATUS, JUGDE_CONVICTED, GX_PLAN_NO1, FIXTYPE_CODE, 
QUALITY_GROUP_ZG, FLAG_STOVE_NO_ZG, ZG_PHY_RESULT_PATH, ZG_FACE_RESULT_PATH, 
ZG_SPEC_RESULT_PATH, VRP_HEAT_PLAN_NO, VRP_LOT_NO, VRP_SAMPLE_FLAG, 
VRP_PRO_ORDER_NO, VRP_PRO_ORDER_NO1, VRP_PRO_ORDER_ID, VRP_PRO_ORDER_ID1, 
VRP_ACT_DIMATER, VRP_ACT_HEIGHT, VRP_JUGDE_APPLY_FLAG, VRP_JUGDE_APPLY_CODE, 
VRP_JUGDE_APPLY_TIME, VRP_FACE_RESULT_CODE, VRP_FACE_RESULT_TIME, 
VRP_FACE_MAKER, VRP_FACE_RESULT_PATH, VRP_SPEC_RESULT_CODE, 
VRP_SPEC_RESULT_TIME, VRP_SPEC_MAKER, VRP_SPEC_RESULT_PATH, VRP_PHY_RESULT_CODE, 
VRP_PHY_RESULT_TIME, VRP_PHY_MAKER, VRP_PHY_RESULT_PATH, VRP_JUDGE_RESULT_CODE, 
VRP_JUDGE_RESULT_TIME, VRP_JUDGE_MAKER, VRP_GX_PLAN_NO, VRP_GX_PLAN_NO1, 
VPR_JUGDE_CONVICTED, VPR_QUALITY_GROUP_ZG, VPR_FLAG_STOVE_NO_ZG, 
HTT_HEAT_PLAN_NO, HTT_LOT_NO, HTT_SAMPLE_FLAG, HTT_PRO_ORDER_NO, 
HTT_PRO_ORDER_NO1, HTT_PRO_ORDER_ID, HTT_PRO_ORDER_ID1, HTT_GX_PLAN_NO, 
HTT_GX_PLAN_NO1, HTT_JUGDE_APPLY_FLAG, HTT_JUGDE_APPLY_CODE, 
HTT_JUGDE_APPLY_TIME, HTT_FACE_RESULT_CODE, HTT_FACE_RESULT_TIME, 
HTT_FACE_MAKER, HTT_FACE_RESULT_PATH, HTT_SPEC_RESULT_CODE, 
HTT_SPEC_RESULT_TIME, HTT_SPEC_MAKER, HTT_SPEC_RESULT_PATH, HTT_PHY_RESULT_CODE, 
HTT_PHY_RESULT_TIME, HTT_PHY_MAKER, HTT_PHY_RESULT_PATH, HTT_JUDGE_RESULT_CODE, 
HTT_JUDGE_RESULT_TIME, HTT_JUDGE_MAKER, HTT_JUGDE_CONVICTED, 
HTT_QUALITY_GROUP_ZG, HTT_FLAG_STOVE_NO_ZG, PRC_LOT_NO, PRC_SAMPLE_FLAG, 
PRC_PRO_ORDER_NO, PRC_PRO_ORDER_NO1, PRC_PRO_ORDER_ID, PRC_PRO_ORDER_ID1, 
PRC_GX_PLAN_NO, PRC_GX_PLAN_NO1, PRC_JUGDE_APPLY_FLAG, PRC_JUGDE_APPLY_CODE, 
PRC_JUGDE_APPLY_TIME, PRC_FACE_RESULT_CODE, PRC_FACE_RESULT_TIME, 
PRC_FACE_MAKER, PRC_FACE_RESULT_PATH, PRC_SPEC_RESULT_CODE, 
PRC_SPEC_RESULT_TIME, PRC_SPEC_MAKER, PRC_SPEC_RESULT_PATH, PRC_PHY_RESULT_CODE, 
PRC_PHY_RESULT_TIME, PRC_PHY_MAKER, PRC_PHY_RESULT_PATH, PRC_JUDGE_RESULT_CODE, 
PRC_JUDGE_RESULT_TIME, PRC_JUDGE_MAKER, PRC_JUGDE_CONVICTED, 
PRC_QUALITY_GROUP_ZG, PRC_FLAG_STOVE_NO_ZG, PRC_HEAT_PLAN_NO, 
VRP_JUDGE_STD_NAME, VRP_JUDGE_STD_CODE, HTT_JUDGE_STD_NAME, HTT_JUDGE_STD_CODE, 
PRC_JUDGE_STD_NAME, PRC_JUDGE_STD_CODE, VRP_CRAF_NO, HTT_CRAF_NO, PRC_CRAF_NO, 
VRP_CHEM_RESULT_CODE, VRP_CHEM_RESULT_TIME, VRP_CHEM_MAKER, 
HTT_CHEM_RESULT_CODE, HTT_CHEM_RESULT_TIME, HTT_CHEM_MAKER, 
PRC_CHEM_RESULT_CODE, PRC_CHEM_RESULT_TIME, PRC_CHEM_MAKER, DETECT_REPORT_NO1, 
DETECT_RESULT_CODE1, TESTING_GRADE, TESTING_TYPE, TESTING_GRADE1, TESTING_TYPE1, 
ZG_PLINE_CODE, ZG_PLINE_NAME, VRP_PLINE_CODE, VRP_PLINE_NAME, HTT_PLINE_CODE, 
HTT_PLINE_NAME, PRC_PLINE_CODE, PRC_PLINE_NAME,VRP_QCM_STAUS,HTT_QCM_STAUS,PRC_QCM_STAUS,ZG_MEMO,ZBS_FLAG,ZBS_ID,JG_ZBS_ID,MEASURING_SEQ,
SUPPLY_UNIT_CODE,SUPPLY_UNIT,IS_DEALER) 
SELECT MAT_NO, PRODUCT_FLAG, 
'80150302', LOT_NO, STOVE_NO, JUDGE_STOVE_NO, BATCH_NO, BATCH_GROUD_NO, 
MAT_SQE_NO, SAMPLE_FLAG, CUTTING_FLAG, ORIGIN_MAT_NO, MATERIAL_NO, 
MATERIAL_NAME, INPUT_MATERIAL_NAME, INPUT_MATERIAL_NO, INPUT_ORIGIN_CODE, 
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, PRO_ORDER_NO1, PRO_ORDER_ID, PRO_ORDER_ID1, 
ORDER_NO, ORDER_SEQ, ORDER_SEQ_NO, CRAF_NO, PROCESS_CDOE, PROCESS_DESC, 
NEXT_PROCESS_CDOE, NEXT_PROCESS_DESC, PLINE_CODE, PLINE_NAME, MAT_ORIGIN_CODE, 
MAT_ORIGIN_NAME, DIMATER, HEIGHT, LEN_NO, LEN_DESC, LEN_UNIT, LEN_MIN, LEN_MAX, 
TARG_DIMATER, TARG_HEIGHT, TARG_LEN_MIN, TARG_LEN_MAX, ACT_DIMATER, ACT_HEIGHT, 
ACT_LEN, ACT_LEN_MIN, ACT_LEN_MAX, ACT_COUNT, ACT_WEIGHT, ACT_THEORY_WEIGHT, 
MEASURE_FLAG, BELONG_CODE, BELONG_NAME, PACK_FLAG, PACK_TYPE_CODE, 
PACK_TYPE_NAME, PACK_NO, PACK_TIME, PACK_MAT_WT, MAT_GROSS_WT, MAT_GOWHERE_CODE, 
MAT_GOWHERE_NAME, COOL_HOT_FLAG, MAT_RETURN_FLAG, HEAT_TREAT_NO, POST_FLAG, 
LOCK_FLAG, MNG_LOCK_RSN_CODE, MNG_LOCK_TIME, MNG_LOCK_MAKER, MNG_LOCK_REMARK, 
LOCK_RSN_CODE, LOCK_TIME, LOCK_MAKER, LOCK_REMARK, UNLOCK_TIME, UNLOCK_MAKER, 
UNLOCK_REMARK, OLD_ORDER_NO, OLD_ORDER_SEQ, OLD_ORDER_SEQ_NO, OLD_MATERIAL_NO, 
OLD_MATERIAL_NAME, REMAIN_RSN_CODE, REMAIN_JUGDE_TIME, REMAIN_JUGDE_MAKER, 
REMAIN_JUGDE_CODE, REMAIN_REMARK, JUGDE_APPLY_FLAG, JUGDE_APPLY_CODE, 
JUGDE_APPLY_TIME, JUGDE_SCAN_TIME, FACE_RESULT_CODE, FACE_RESULT_TIME, 
FACE_MAKER, SPEC_RESULT_CODE, SPEC_RESULT_TIME, SPEC_MAKER, CHEM_RESULT_CODE, 
CHEM_RESULT_TIME, CHEM_MAKER, PHY_RESULT_CODE, PHY_RESULT_TIME, PHY_MAKER, 
DETECT_REPORT_NO, DETECT_RESULT_CODE, WPRESSURE_REPORT_NO, 
WPRESSURE_RESULT_CODE, JUDGE_RESULT_CODE, JUDGE_RESULT, JUDGE_RESULT_TIME, 
JUDGE_MAKER, BUG_NO, BUG_DEAL, REPAIR_FLAG, REPAIR_REMARK, SAMPLING_FLAG, 
SAMPLING_TYPE, SAMPLING_NO, CHECKOUT_NO, CHEM_STCHECK_NO, CHEM_PROCHECK_NO, 
SH_CHECK_NO, COME_PROC_FLAG, CONFM_FLAG, INSTOCK_FLAG, INSTOCK_TIME, 
OUTSTOCK_TIME, PRO_BC, PRO_BZ, RPO_TIME, BAR_CODE, BEGINNING_FLAG, MEMO, 
CREATE_NAME, CREATE_TIME, UPDATE_NAME, UPDATE_TIME, REQ_BL_ID, IF_BATCHED_JG, 
COUPCUT_BATCH_ID, ORD_PK, ORD_LN_PK, ORD_LN_DLY_PK, OLD_ORD_PK, OLD_ORD_LN_PK, 
OLD_ORD_LN_DLY_PK, BAL_YEAR_MONTH, JUDGE_STD_NAME, JUDGE_STD_CODE, JUDGE_GRADE, 
PIPMEMO, TEST, SOURE_CODE, SOURE_NAME, PONDER_NO, PONDER_GROSS_WT, MEMO1, JUDGE_ID, 
MNG_LOCK_FLAG, LOCK_ID, PRO_NO, LOCK_LIKU, PLN_GRADECODE, PLN_GRADENAME, 
PLN_STEELCODE, PLN_STEELNAME, QCM_STAUS, OUTSTOCK_DOC, HEAT_PLAN_NO, 
ZG_STOVE_SQE, GX_PLAN_NO, ZG_MAT_NO, FINISHPRO_MOLD, IN_MOLD, TARGET, 
PROCESS_STATUS, JUGDE_CONVICTED, GX_PLAN_NO1, FIXTYPE_CODE, QUALITY_GROUP_ZG, 
FLAG_STOVE_NO_ZG, ZG_PHY_RESULT_PATH, ZG_FACE_RESULT_PATH, ZG_SPEC_RESULT_PATH, 
VRP_HEAT_PLAN_NO, VRP_LOT_NO, VRP_SAMPLE_FLAG, VRP_PRO_ORDER_NO, 
VRP_PRO_ORDER_NO1, VRP_PRO_ORDER_ID, VRP_PRO_ORDER_ID1, VRP_ACT_DIMATER, 
VRP_ACT_HEIGHT, VRP_JUGDE_APPLY_FLAG, VRP_JUGDE_APPLY_CODE, 
VRP_JUGDE_APPLY_TIME, VRP_FACE_RESULT_CODE, VRP_FACE_RESULT_TIME, 
VRP_FACE_MAKER, VRP_FACE_RESULT_PATH, VRP_SPEC_RESULT_CODE, 
VRP_SPEC_RESULT_TIME, VRP_SPEC_MAKER, VRP_SPEC_RESULT_PATH, VRP_PHY_RESULT_CODE, 
VRP_PHY_RESULT_TIME, VRP_PHY_MAKER, VRP_PHY_RESULT_PATH, VRP_JUDGE_RESULT_CODE, 
VRP_JUDGE_RESULT_TIME, VRP_JUDGE_MAKER, VRP_GX_PLAN_NO, VRP_GX_PLAN_NO1, 
VPR_JUGDE_CONVICTED, VPR_QUALITY_GROUP_ZG, VPR_FLAG_STOVE_NO_ZG, 
HTT_HEAT_PLAN_NO, HTT_LOT_NO, HTT_SAMPLE_FLAG, HTT_PRO_ORDER_NO, 
HTT_PRO_ORDER_NO1, HTT_PRO_ORDER_ID, HTT_PRO_ORDER_ID1, HTT_GX_PLAN_NO, 
HTT_GX_PLAN_NO1, HTT_JUGDE_APPLY_FLAG, HTT_JUGDE_APPLY_CODE, 
HTT_JUGDE_APPLY_TIME, HTT_FACE_RESULT_CODE, HTT_FACE_RESULT_TIME, 
HTT_FACE_MAKER, HTT_FACE_RESULT_PATH, HTT_SPEC_RESULT_CODE, 
HTT_SPEC_RESULT_TIME, HTT_SPEC_MAKER, HTT_SPEC_RESULT_PATH, HTT_PHY_RESULT_CODE, 
HTT_PHY_RESULT_TIME, HTT_PHY_MAKER, HTT_PHY_RESULT_PATH, HTT_JUDGE_RESULT_CODE, 
HTT_JUDGE_RESULT_TIME, HTT_JUDGE_MAKER, HTT_JUGDE_CONVICTED, 
HTT_QUALITY_GROUP_ZG, HTT_FLAG_STOVE_NO_ZG, PRC_LOT_NO, PRC_SAMPLE_FLAG, 
PRC_PRO_ORDER_NO, PRC_PRO_ORDER_NO1, PRC_PRO_ORDER_ID, PRC_PRO_ORDER_ID1, 
PRC_GX_PLAN_NO, PRC_GX_PLAN_NO1, PRC_JUGDE_APPLY_FLAG, PRC_JUGDE_APPLY_CODE, 
PRC_JUGDE_APPLY_TIME, PRC_FACE_RESULT_CODE, PRC_FACE_RESULT_TIME, 
PRC_FACE_MAKER, PRC_FACE_RESULT_PATH, PRC_SPEC_RESULT_CODE, 
PRC_SPEC_RESULT_TIME, PRC_SPEC_MAKER, PRC_SPEC_RESULT_PATH, PRC_PHY_RESULT_CODE, 
PRC_PHY_RESULT_TIME, PRC_PHY_MAKER, PRC_PHY_RESULT_PATH, PRC_JUDGE_RESULT_CODE, 
PRC_JUDGE_RESULT_TIME, PRC_JUDGE_MAKER, PRC_JUGDE_CONVICTED, 
PRC_QUALITY_GROUP_ZG, PRC_FLAG_STOVE_NO_ZG, PRC_HEAT_PLAN_NO, 
VRP_JUDGE_STD_NAME, VRP_JUDGE_STD_CODE, HTT_JUDGE_STD_NAME, HTT_JUDGE_STD_CODE, 
PRC_JUDGE_STD_NAME, PRC_JUDGE_STD_CODE, VRP_CRAF_NO, HTT_CRAF_NO, PRC_CRAF_NO, 
VRP_CHEM_RESULT_CODE, VRP_CHEM_RESULT_TIME, VRP_CHEM_MAKER, 
HTT_CHEM_RESULT_CODE, HTT_CHEM_RESULT_TIME, HTT_CHEM_MAKER, 
PRC_CHEM_RESULT_CODE, PRC_CHEM_RESULT_TIME, PRC_CHEM_MAKER, DETECT_REPORT_NO1, 
DETECT_RESULT_CODE1, TESTING_GRADE, TESTING_TYPE, TESTING_GRADE1, TESTING_TYPE1, 
ZG_PLINE_CODE, ZG_PLINE_NAME, VRP_PLINE_CODE, VRP_PLINE_NAME, HTT_PLINE_CODE, 
HTT_PLINE_NAME, PRC_PLINE_CODE, PRC_PLINE_NAME,VRP_QCM_STAUS,HTT_QCM_STAUS,PRC_QCM_STAUS,ZG_MEMO,ZBS_FLAG,ZBS_ID,JG_ZBS_ID,MEASURING_SEQ,
SUPPLY_UNIT_CODE,SUPPLY_UNIT,IS_DEALER
 FROM MAT_ZC_BACKUP WHERE MAT_NO = ?; 
 
DELETE MAT_ZC_BACKUP WHERE MAT_NO = ?;
 END;
 ]]>
	</query>
	<!-- <query id="FrmPipeLoad.updateMatZcNo" desc="修改材料表过磅重量">
	<![CDATA[
    UPDATE MAT_ZC_M T SET T.MAT_STATUS='80150303', T.PONDER_NO=?, T.PONDER_GROSS_WT=TO_NUMBER(?) WHERE T.MAT_NO=?
     ]]>
	</query>
	
	<query id="FrmPipeLoad.updateMatZcNo1" desc="修改材料表过磅重量">
	<![CDATA[
    UPDATE MAT_ZC_M T SET T.MAT_STATUS='80150302', T.PONDER_NO=?, T.PONDER_GROSS_WT=TO_NUMBER(?) WHERE T.MAT_NO=?
     ]]>
	</query>
	-->
	<query id="FrmPipeLoad.insertOutList" desc="插入出库表">
	<![CDATA[
	INSERT INTO YDM_ZC_OUTLIST (OUTSTOCK_SQE, OUTSTOCK_DOC, 
		OUTSTOCK_TYPE_CODE, OUTSTOCK_TYPE_NAME, VEHICLE_NO, MAT_NO, LOT_NO, STOVE_NO, 
		JUDGE_STOVE_NO, BATCH_NO, BATCH_GROUD_NO, MATERIAL_NO, MATERIAL_NAME, 
		PRODUCCODE, PRODUCNAME, STD_CODE, STD_NAME, GRADECODE, GRADENAME, STEELCODE, 
		STEELNAME, STD_STYLE, STD_STYLE_DESC, SPEC_CODE, SPEC_NAME, MODEL_CODE, 
		MODEL_DESC, PLINE_CODE, PLINE_NAME, ACT_DIMATER, ACT_HEIGHT, 
		ACT_LEN, ACT_LEN_MIN, ACT_LEN_MAX, ACT_COUNT, ACT_WEIGHT, ACT_THEORY_WEIGHT, 
		STORAGE_NO, LOCATION_NO, LARY_NO, LOC_NO, 
		STORAGE_ATTR, STORAGE_ATTR_NAME, STORAGE_TYPE_NO, STORAGE_TYPE_NAME, 
		MANAGEMENT_NO, MANAGEMENT_NAME, RPO_TIME, PRO_BC, PRO_BZ, OUTSTOCK_TIME, OUT_BC, 
		OUT_BZ, CREATE_NAME, CREATE_TIME, ORD_PK, ORD_LN_PK, ORD_LN_DLY_PK,ORDER_NO,ORDER_SEQ,DELIVERY_NO,DEPARTMENT_CODE,DEPARTMENT_DESC,
		BELONG_CODE,BELONG_NAME,BAL_YEAR_MONTH,PONDER_NO,PONDER_GROSS_WT,
		SEND_NUM,VSTEL,VSTEL_DESC,FINISHPRO_MOLD,IN_MOLD,MEMO,BILL_NO,supply_unit_code,supply_unit,IS_DEALER,
		PROCESS_CDOE,PROCESS_DESC,PRO_ORDER_NO) VALUES (?, 
		?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?,
		?, ?, ?, ?, ?, ?, ?, TO_NUMBER(?), ?, ?, ?, TO_NUMBER(?), TO_NUMBER(?), ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, 
		TO_DATE(?,'YYYY-MM-DD HH24:MI:SS'), ?, ?, TO_DATE(?,'YYYY-MM-DD HH24:MI:SS'), ?, 
		?, ?, TO_DATE(?,'YYYY-MM-DD HH24:MI:SS'), ?, ?, ?,?,?,?,?,?,?,?,?,?,
		TO_NUMBER(?),TO_NUMBER(?),?,?,?,?,(SELECT A.MEMO FROM MAT_ZC_M A WHERE A.MAT_NO=?),?,?,?,
		(SELECT A.IS_DEALER FROM MAT_ZC_M A WHERE A.MAT_NO=?),(SELECT A.PROCESS_CDOE FROM MAT_ZC_M A WHERE A.MAT_NO=?),
		(SELECT A.PROCESS_DESC FROM MAT_ZC_M A WHERE A.MAT_NO=?),(SELECT A.PRO_ORDER_NO FROM MAT_ZC_M A WHERE A.MAT_NO=?))
	]]>
	</query>
	<query id="FrmPipeLoad.queryBillCFlag" desc="查询提单是否过磅">
	<![CDATA[
  SELECT T.PRT_FLAG
  FROM YDM_ZC_BILL_C T
 WHERE T.BILL_NO = ?
 GROUP BY T.PRT_FLAG
     ]]>
	</query>

	<query id="FrmPipeLoad.queryOutlistFlag" desc="查询出库数量">
		<![CDATA[
			SELECT count(1) AS SL FROM YDM_ZC_OUTLIST C
			WHERE
				C.OUTSTOCK_TYPE_CODE = '800805'
				AND C.MAT_NO IN (
					(
					SELECT
						T.MAT_NO
					FROM
						YDM_ZC_LOADVEHICLE_MAT T
					WHERE
						T.BILL_NO = ?
						AND T.LOADVEHICLE_NO = ?
						AND T.TALLYSHEET_NO = ?
						AND T.VEHICLE_NO = ?
						AND T.MAT_NO = C.MAT_NO
					)
				)
				AND decode( c.Bill_no, NULL, '1', c.Bill_no ) = decode( c.Bill_no, NULL, '1',? )
     ]]>
	</query>
	
	<query id="FrmPipeLoad.querySuppUnit" desc="查询制造商">
	<![CDATA[
	  SELECT T1.SUPPLY_UNIT SUPPLY_UNIT_CODE,
	  (SELECT T.BASENAME FROM COM_BASE_INFO T WHERE T.BASECODE=T1.SUPPLY_UNIT) SUPPLY_UNIT
	  FROM SLM_ORDER_HEAD T1,YDM_ZC_BILL_M T2
	 WHERE T1.ORD_PK=T2.ORD_PK
	 AND T2.BILL_NO = ?
 
     ]]>
	</query>
	
	<query id="FrmPipeLoad.queryOutBill" desc="查询出库表是否有记录">
	<![CDATA[
SELECT T.MAT_NO
  FROM YDM_ZC_OUTLIST T
 WHERE T.MAT_NO=?
   AND T.OUTSTOCK_TYPE_CODE = '800805'
     ]]>
	</query>
	<query id="FrmPipeEntruck.updateOut" desc="查询出库表是否有记录">
	<![CDATA[
UPDATE YDM_ZC_OUTLIST T SET T.PONDER_NO=?,T.PONDER_GROSS_WT=TO_NUMBER(?)
 WHERE T.MAT_NO=?
   AND T.OUTSTOCK_TYPE_CODE = '800805'
     ]]>
	</query>
		<query id="FrmPipeLoad.queryBaseInfo" desc="结转确认">
	<![CDATA[
SELECT T.MEMO FROM COM_BASE_INFO T WHERE T.BASECODE=? AND T.VALIDFLAG='1'
     ]]>
	</query>
		<query id="FrmPipeLoad.updatProOrd" desc="确认回写进程">
	<![CDATA[
UPDATE PROCESS_ORDER_M T
   SET T.OUT_NUM = NVL(TO_NUMBER(T.OUT_NUM), 0) + TO_NUMBER(?),
       T.OUT_WGT = NVL(TO_NUMBER(T.OUT_WGT), 0) + TO_NUMBER(?)
 WHERE ORD_LN_DLY_PK = ?
     ]]>
	</query>
		<query id="FrmPipeLoad.deleteProOrd" desc="取消确认回写进程">
	<![CDATA[
UPDATE PROCESS_ORDER_M T
   SET T.OUT_NUM = NVL(TO_NUMBER(T.OUT_NUM), 0) - TO_NUMBER(?),
       T.OUT_WGT = NVL(TO_NUMBER(T.OUT_WGT), 0) - TO_NUMBER(?)
 WHERE ORD_LN_DLY_PK = ?
     ]]>
	</query>
	<query id = "FrmPipeLoad.selectYearMoth" desc = "查询期初中是否存在">
 SELECT COUNT(1) ACOUNT
   FROM YDM_ZC_INITIAL T
  WHERE (T.BAL_YEAR_MONTH ,T.SUPPLY_UNIT_CODE) in
        ( SELECT TO_CHAR(ADD_MONTHS(TO_DATE(MIN(L.BAL_YEAR_MONTH), 'YYYY-MM'), 1),
               'YYYYMM') BAL_YEAR_MONTH,M.SUPPLY_UNIT
  FROM YDM_ZC_LOADVEHICLE_MAT L LEFT JOIN YDM_ZC_BILL_M M ON M.BILL_NO = L.BILL_NO
          WHERE L.BILL_NO= ?
           AND L.TALLYSHEET_NO = ?
           AND L.LOADVEHICLE_NO = ? GROUP BY M.SUPPLY_UNIT)
	</query>
		<query id = "FrmPipeLoad.queryaffigeFlag" desc = "查询装车单是否确认">
SELECT T.AFFIRM_FLAG
  FROM YDM_ZC_LOADVEHICLE T
 WHERE T.BILL_NO = ?
   AND T.TALLYSHEET_NO = ?
   AND T.LOADVEHICLE_NO = ?
   AND T.VALIDFLAG = '1'
	</query>
	<query id = "FrmPipeLoad.insertHookWeight" desc = "">
		INSERT INTO YDM_ZC_HOOK_WEIGHT(
		BILL_NO,
		TALLYSHEET_NO,
		LOADVEHICLE_NO,
		JUDGE_STOVE_NO,
		BATCH_NO,
		GROUP_NO,
		SEND_NUM,
		THEORY_WEIGHT,
		HOOK_WEIGHT)
		VALUES(
		?,
		?,
		?,
		?,
		?,
		?,
		?,
		?,
		?)
	</query>
	<query id = "FrmPipeLoad.selCountHookWeight" desc = "">
		SELECT COUNT(*) FROM YDM_ZC_HOOK_WEIGHT T
		WHERE T.BILL_NO =?
		AND T.TALLYSHEET_NO =?
		AND T.LOADVEHICLE_NO =?
		AND T.JUDGE_STOVE_NO =?
		AND T.BATCH_NO =?
		AND T.GROUP_NO =?
	</query>
	<query id = "FrmPipeLoad.deleteHookWeight" desc = "">
		DELETE  FROM YDM_ZC_HOOK_WEIGHT T
		WHERE T.BILL_NO =?
		AND T.TALLYSHEET_NO=?
		AND T.LOADVEHICLE_NO=?
		AND T.JUDGE_STOVE_NO=?
		AND T.BATCH_NO=?
		AND T.GROUP_NO=?
	</query>


	<query id="FrmPipeLoad.getMatInfoSql" desc="查询装车材料主键数据">
		<![CDATA[
			SELECT
				A.*,B.ACT_WEIGHT,B.LOADVEHICLE_SQE,B.MAT_NO
			FROM
				(
				SELECT
					SUM( ACT_WEIGHT ) ACT_WEIGHT_SUM,
					BILL_NO,
					TALLYSHEET_NO,
					VEHICLE_NO
				FROM
					YDM_ZC_LOADVEHICLE_MAT
				WHERE
					BILL_NO = ?
					AND TALLYSHEET_NO = ?
					AND VEHICLE_NO = ?
				GROUP BY
					BILL_NO,
					TALLYSHEET_NO,
					VEHICLE_NO
				) A
				LEFT JOIN YDM_ZC_LOADVEHICLE_MAT B ON A.BILL_NO = B.BILL_NO
				AND A.TALLYSHEET_NO = B.TALLYSHEET_NO
				AND A.VEHICLE_NO = B.VEHICLE_NO
	]]>
	</query>
</queryMap>