<?xml version="1.0" encoding="UTF-8"?>
<queryMap desc="直接出库">
<query id="matxs.addOutReturn1" desc="插入到出库表">
	<![CDATA[
	INSERT INTO YDM_ZC_OUTLIST_XS (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,PONDER_NO,PONDER_GROSS_WT,M_BILL_NO,SEND_NUM,
		VSTEL,VSTEL_DESC,HAND_FLAG,PRODUCT_FLAG,MAT_STATUS,RECEIV_NO,RECEIV_NM,MEMO,FINISHPRO_MOLD,IN_MOLD,
		SUPPLY_UNIT_CODE,SUPPLY_UNIT,IS_DEALER,PROCESS_CDOE,PROCESS_DESC,BAL_YEAR_MONTH) 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 T1.BASENAME FROM COM_BASE_INFO T1 WHERE T1.BASECODE=?),?,
		(SELECT T1.PROCESS_CODE FROM COM_BASE_PLINE T1 WHERE T1.PLINE_CODE=?),
		(SELECT T1.PROCESS_DESC FROM COM_BASE_PLINE T1 WHERE T1.PLINE_CODE=?),
		?)
		]]>
	</query>
	<query id="matxs.addMatNoReturn1" desc="新增材料表">
	<![CDATA[
	INSERT INTO MAT_ZC_M_XS (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, OLD_ORDER_NO, OLD_ORDER_SEQ, OLD_ORDER_SEQ_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, INSTOCK_TIME, INSTOCK_FLAG, PRO_BC, PRO_BZ, RPO_TIME, CREATE_NAME, 
CREATE_TIME, ORD_PK, ORD_LN_PK, ORD_LN_DLY_PK ,JUDGE_STD_NAME, JUDGE_STD_CODE, 
PONDER_NO, PONDER_GROSS_WT,PIPMEMO,FINISHPRO_MOLD,IN_MOLD,
SUPPLY_UNIT_CODE,SUPPLY_UNIT,IS_DEALER,JUDGE_RESULT_CODE,JUDGE_RESULT)
VALUES (?, ?, ?, ?, ?,
  ?, ?, ?, ?, ?,
  ?, ?, ?, ?, ?, 
  ?, ?, ?, ?, ?,
  ?, ?, ?, ?, ?, 
  ?, ?, ?, ?, ?, 
  ?, ?, ?, ?, TO_NUMBER(?), 
  ?, ?, TO_NUMBER(?), TO_NUMBER(?), TO_NUMBER(?), 
  ?, (SELECT T1.BASENAME FROM COM_BASE_INFO T1 WHERE T1.BASECODE=?), 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(?),?,?,?,?,
  (SELECT T1.BASENAME FROM COM_BASE_INFO T1 WHERE T1.BASECODE=?),?,'40740701',(SELECT T1.BASENAME FROM COM_BASE_INFO T1 WHERE T1.BASECODE='40740701'))
	]]>
	</query>
	<query id="matxs.addMatNoReturn" desc="新增材料表">
	<![CDATA[
	INSERT INTO MAT_ZC_M_XS (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, ORDER_NO, ORDER_SEQ, ORDER_SEQ_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, INSTOCK_TIME, INSTOCK_FLAG, PRO_BC, PRO_BZ, RPO_TIME, CREATE_NAME, 
CREATE_TIME, ORD_PK, ORD_LN_PK, ORD_LN_DLY_PK ,JUDGE_STD_NAME, JUDGE_STD_CODE, 
PONDER_NO, PONDER_GROSS_WT,PIPMEMO,FINISHPRO_MOLD,IN_MOLD,
SUPPLY_UNIT_CODE,SUPPLY_UNIT,IS_DEALER,JUDGE_RESULT_CODE,JUDGE_RESULT)
VALUES (?, ?, ?, ?, ?, 
 ?, ?, ?, ?, ?, 
 ?, ?, ?, ?, ?, 
 ?, ?, ?, ?, ?, 
 ?, ?, ?, ?, ?, 
 ?, ?, ?, ?, ?, 
 ?, ?, ?, ?, TO_NUMBER(?), 
 ?, ?, TO_NUMBER(?), TO_NUMBER(?), TO_NUMBER(?), 
 ?, (SELECT T1.BASENAME FROM COM_BASE_INFO T1 WHERE T1.BASECODE=?), 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(?),?,?,?,?,
 (SELECT T1.BASENAME FROM COM_BASE_INFO T1 WHERE T1.BASECODE=?),?,
 '40740701',(SELECT T1.BASENAME FROM COM_BASE_INFO T1 WHERE T1.BASECODE='40740701'))
	]]>
	</query>
	<query id="matxs.addOutReturn" desc="插入到出库表">
	<![CDATA[
	INSERT INTO YDM_ZC_OUTLIST_XS (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,PONDER_NO,PONDER_GROSS_WT,M_BILL_NO,SEND_NUM,
		VSTEL,VSTEL_DESC,HAND_FLAG,PRODUCT_FLAG,MAT_STATUS,RECEIV_NO,RECEIV_NM,MEMO,FINISHPRO_MOLD,IN_MOLD,
		SUPPLY_UNIT_CODE,SUPPLY_UNIT,IS_DEALER,PROCESS_CDOE,PROCESS_DESC,BAL_YEAR_MONTH,PRO_ORDER_NO,
		RETURN_TYPE,RETURN_CODE) 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 T1.BASENAME FROM COM_BASE_INFO T1 WHERE T1.BASECODE=?),(SELECT IS_DEALER FROM MAT_ZC_M T0 WHERE T0.MAT_NO=?),
		(SELECT T0.PROCESS_CDOE FROM MAT_ZC_M T0 WHERE T0.MAT_NO=?),(SELECT T0.PROCESS_DESC FROM MAT_ZC_M T0 WHERE T0.MAT_NO=?),
		?,(SELECT T0.PRO_ORDER_NO FROM MAT_ZC_M T0 WHERE T0.MAT_NO=?),?,?
		)
		]]>
	</query>
	<query id = "matxs.insertMat" desc = "插入材料表">
<![CDATA[
	   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
     ) VALUES  (?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,
             ?,?,?,?,?,?,?,?,?,?,?,?,
             TO_NUMBER(?),ROUND(TO_NUMBER(?),4),TO_DATE(?,'YYYY-MM-DD HH24:MI:SS'),TO_DATE(?,'YYYY-MM-DD HH24:MI:SS'),
             ?,?,'1','1',?,?,TO_NUMBER(?),?,?,?,?,?,?,?,?,?,?,?,?,?)
		]]>
</query>
<query id = "matxs.deleteMat" desc = "删除物料表">
DELETE  FROM  MAT_ZC_M_XS T WHERE T.MAT_NO = ?
</query>
<query id = "matxs.insertInList" desc = "插入入库表">
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)
VALUES
  (?,
   ?,
   ?,
   ?,
   ?,
   ?,
   ?,
   ?,
   ?,
   ?,
   ?,
   ?,
   ?,
   ?,
   ?,
   ?,
   ?,
   ?,
   ?,
   ?,
   ?,
   ?,
   ?,
   ?,
   ?,
   ?,
   ?,
   ?,
   ?,
   ?,
   ?,
   ?,
   ?,
   ?,
   ?,
   ?,
   ?,
   to_date(?,'YYYY-MM-DD HH24:MI:SS'),?,?,?,?,?,?,?,?,to_date(?,'YYYY-MM-DD HH24:MI:SS'),?,?,?,?,?,?,?,?,?,?,to_date(?,'YYYY-MM-DD HH24:MI:SS'),?,?,?,?,?,?,?,?,?,?)
</query>
<query id = "matxs.insertMat1" desc = "插入材料表(成品)">
<![CDATA[
	   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,
     
     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,
     BEGINNING_FLAG,
     JUDGE_GRADE
     ) VALUES  (?,?,?,?,?,?,?,?,?,?,?,?,?,
             ?,?,?,?,?,?,?,?,?,?,?,?,
             TO_NUMBER(?),ROUND(TO_NUMBER(?),4),TO_DATE(?,'YYYY-MM-DD HH24:MI:SS'),TO_DATE(?,'YYYY-MM-DD HH24:MI:SS'),
             ?,?,'1','1','801402','80150202',TO_NUMBER(?),?,?,?,?,?,?,'1',?)
		]]>
</query>

<query id = "matxs.insertMat" desc = "插入材料表(商品)">
<![CDATA[
	   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,
     BEGINNING_FLAG,
     JUDGE_GRADE  
     ) VALUES  (?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,
             ?,?,?,?,?,?,?,?,?,?,?,?,
             TO_NUMBER(?),ROUND(TO_NUMBER(?),4),TO_DATE(?,'YYYY-MM-DD HH24:MI:SS'),TO_DATE(?,'YYYY-MM-DD HH24:MI:SS'),
             ?,?,'1','1','801403','80150301',TO_NUMBER(?),?,?,?,?,?,?,'1',?)
		]]>

</query>

<query id = "matxs.updateIntal" desc = "修改期初处理标志">
UPDATE YDM_ZC_INITIAL T SET T.HANDLE_LOG ='1' WHERE T.INITIAL_ID=?
</query>

	<query id="FrmPipeInventoryInXs.addMatZcM" desc="新增物料信息">
	<![CDATA[ 
	    INSERT INTO MAT_ZC_M_XS
  (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,
   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,
   ORD_PK,
   ORD_LN_PK,
   ORD_LN_DLY_PK,
   OLD_ORD_PK,
   OLD_ORD_LN_PK,
   OLD_ORD_LN_DLY_PK,
   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,
   BAL_YEAR_MONTH,
   SOURE_CODE,
   SOURE_NAME,
   SUPPLY_UNIT_CODE,
   SUPPLY_UNIT,
   IS_DEALER,
   PROCESS_CDOE,
   PROCESS_DESC
   )
VALUES
  ('#STD_CODE#',
   '#STD_NAME#',
   '#STD_STYLE#',
   '#STD_STYLE_DESC#',
   '',
   '',
   '',
   '',
   '',
   '',
   '',
   '',
   '',
   '',
   '',
   '',
   '#PLINE_CODE#',
   '#PLINE_NAME#',
   '#MAT_ORIGIN_CODE#',
   '#MAT_ORIGIN_NAME#',
   '',
   '',
   '',
   '',
   '',
   '',
   '',
   '',
   '',
   '',
   '',
   '#ACT_DIMATER#',
   '#ACT_HEIGHT#',
   '#ACT_LEN#',
   '#ACT_LEN_MIN#',
   '#ACT_LEN_MAX#',
   '#ACT_COUNT#',
   '#ACT_WEIGHT#',
   '#ACT_THEORY_WEIGHT#',
   '',
   '#BELONG_CODE#',
   '#BELONG_NAME#',
   '',
   '',
   '',
   '',
   NULL,
   '',
   '',
   '',
   '',
   '',
   '',
   '',
   '',
   '',
   '',
   NULL,
   '',
   '',
   '',
   NULL,
   '',
   '',
   NULL,
   '',
   '',
   '',
   '',
   '',
   '',
   '',
   '',
   NULL,
   '',
   '',
   '',
   '',
   '',
   NULL,
   NULL,
   '',
   NULL,
   '',
   '',
   NULL,
   '',
   '',
   NULL,
   '',
   '',
   NULL,
   '',
   '',
   '',
   '',
   '',
   '#JUDGE_RESULT_CODE#',
   '#JUDGE_RESULT#',
   NULL,
   '',
   '',
   '',
   '',
   '',
   '',
   '',
   '',
   '',
   '',
   '',
   '',
   '',
   '',
   '',
   SYSDATE,
   '#MAT_NO#',
   '#PRODUCT_FLAG#',
   '#MAT_STATUS#',
   '',
   '',
   '#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#',
   '',
   '',
   '',
   '',
   '',
   '',
   NULL,
   '',
   '',
   NULL,
   '',
   '',
   '#MEMO#',
   '#CREATE_NAME#',
   NULL,
   '',
   NULL,
   '',
   '',
   '',
   '#BAL_YEAR_MONTH#',
   '#SOURE_CODE#',
   '#SOURE_NAME#',
   '#SUPPLY_UNIT_CODE#',
   '#SUPPLY_UNIT#',
   '0',
   '#PROCESS_CDOE#',
   '#PROCESS_DESC#'
   )
	]]>
	</query>
	<query id="FrmPipeInventoryInXs.addYdmZcInlist" desc="新增入库信息">
		<![CDATA[
	   INSERT INTO YDM_ZC_INLIST_XS
  (ORD_PK,
   ORD_LN_PK,
   ORD_LN_DLY_PK,
   DEPARTMENT_CODE,
   DEPARTMENT_DESC,
   INSTOCK_SQE,
   INSTOCK_DOC,
   INSTOCK_TYPE_CODE,
   INSTOCK_TYPE_NAME,
   INSTOCK_BAR_CODE,
   ICCAR_NO,
   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,
   PRO_ORDER_NO,
   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,
   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,
   INSTOCK_TIME,
   IN_BC,
   IN_BZ,
   BAR_CODE,
   HAND_FLAG,
   MEMO,
   VALIDFLAG,
   CREATE_NAME,
   CREATE_TIME,
   UPDATE_NAME,
   UPDATE_TIME,
   DELETE_NAME,
   DELETE_TIME,
   BAL_YEAR_MONTH,
   SOURE_CODE,
   SOURE_NAME,
   SUPPLY_UNIT_CODE,
   SUPPLY_UNIT,
   IS_DEALER,
   PROCESS_CDOE,
   PROCESS_DESC)
VALUES
  ('',
   '',
   '',
   '',
   '',
   '#INSTOCK_SQE#',
   '#INSTOCK_DOC#',
   '#INSTOCK_TYPE_CODE#',
   '#INSTOCK_TYPE_NAME#',
   '',
   '',
   '',
   '#MAT_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#',
   '#BELONG_CODE#',
   '#BELONG_NAME#',
   '#STORAGE_NO#',
   '#LOCATION_NO#',
   '',
   '',
   '#STORAGE_ATTR#',
   '#STORAGE_ATTR_NAME#',
   '#STORAGE_TYPE_NO#',
   '#STORAGE_TYPE_NAME#',
   '#MANAGEMENT_NO#',
   '#MANAGEMENT_NAME#',
   NULL,
   '',
   '',
   NULL,
   '',
   '',
   '',
   '',
   '#MEMO#',
   '1',
   '#CREATE_NAME#',
   SYSDATE,
   '',
   NULL,
   '',
   NULL,
   '#BAL_YEAR_MONTH#',
   '#SOURE_CODE#',
   '#SOURE_NAME#',
   '#SUPPLY_UNIT_CODE#',
   '#SUPPLY_UNIT#',
   '0',
   '#PROCESS_CDOE#',
   '#PROCESS_DESC#')
		]]>
	</query>
	<query id = "FrmPipeEnterXs.insertMat" desc = "插入材料表">
<![CDATA[
	   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,
     PACK_NO,
     IN_MOLD,
     JUDGE_RESULT_CODE,
     JUDGE_RESULT,
     ZBS_FLAG,
     SUPPLY_UNIT_CODE,
     SUPPLY_UNIT,
     FLAG_STOVE_NO_ZG,
     IS_DEALER,
     PROCESS_CDOE,
     PROCESS_DESC,IN_TYPE
     ) VALUES  (?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,
             ?,?,?,?,?,?,?,?,?,?,?,?,
             TO_NUMBER(?),ROUND(TO_NUMBER(?),4),TO_DATE(?,'YYYY-MM-DD HH24:MI:SS'),TO_DATE(?,'YYYY-MM-DD HH24:MI:SS'),
             ?,?,'1','1',?,?,TO_NUMBER(?),?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,'40740701','合格','2',?,?,?,?,?,?,'802205')
		]]>
</query>

<query id = "FrmPipeEnterXs.insertInList" desc = "插入入库表">
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,HAND_FLAG,MAT_ORIGIN_CODE,MAT_ORIGIN_NAME,SOURE_CODE,SOURE_NAME,MATERIAL_NO,
    MATERIAL_NAME,IN_MOLD,SUPPLY_UNIT_CODE,SUPPLY_UNIT,IS_DEALER,PROCESS_CDOE,PROCESS_DESC,LOCATION_NO,IN_TYPE)
VALUES
  (?,
   ?,
   ?,
   ?,
   ?,
   ?,
   ?,
   ?,
   ?,
   ?,
   ?,
   ?,
   ?,
   ?,
   ?,
   ?,
   ?,
   ?,
   ?,
   ?,
   ?,
   ?,
   ?,
   ?,
   ?,
   ?,
   ?,
   ?,
   ?,
   ?,
   ?,
   ?,
   ?,
   ?,
   ?,
   ?,
   ?,
   to_date(?,'YYYY-MM-DD HH24:MI:SS'),?,?,?,?,?,?,?,?,to_date(?,'YYYY-MM-DD HH24:MI:SS'),?,?,?,?,?,?,?,?,?,?,to_date(?,'YYYY-MM-DD HH24:MI:SS'),?,?,?,?,'1',?,?,?,?,?,?,?,?,?,?,?,?,?,'802205')
</query>

<query id = "examineDataXs.insertOutList" desc = "写出库表">
 INSERT INTO YDM_ZC_OUTLIST_XS(
        DEPARTMENT_CODE,
        DEPARTMENT_DESC,
        PRODUCT_FLAG,
        MAT_STATUS,
        JUDGE_STD_NAME,
        JUDGE_STD_CODE,
        BAL_YEAR_MONTH,
        OUTSTOCK_SQE,
        OUTSTOCK_DOC,
        OUTSTOCK_TYPE_CODE,
        OUTSTOCK_TYPE_NAME,
        MAT_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,
        BELONG_CODE,
        BELONG_NAME,
        STORAGE_NO,
        LOCATION_NO,
        MANAGEMENT_NO,
        MANAGEMENT_NAME,
        OUTSTOCK_TIME,
        OUT_BC,
        OUT_BZ,
        MEMO,
        VALIDFLAG,
        CREATE_NAME,
        CREATE_TIME,
    SUPPLY_UNIT_CODE,
    SUPPLY_UNIT)
 VALUES( 
        ?,
        ?,
        ?,
        ?,
        ?,
        ?,
        ?,
        ?,
        ?,
        ?,
        ?,
        ?,
        ?,
        ?,
        ?,
        ?,
        ?,
        ?,
        ?,
        ?,
        ?,
        ?,
        ?,
        ?,
        ?,
        ?,
        ?,
        ?,
        ?,
        ?,
        ?,
        ?,
        ?,
        ?,
        ?,
        ?,
        ?,
        ?,
        ?,
        ?,
        ?,
        ?,
        ?,
        ?,
        ?,
        ?,
        ?,
        SYSDATE,
        ?,
        ?,
        ?,
        ?,
        ?,
        SYSDATE,?,?)
</query>

<query id = "examineDataXs.insertMat" desc = "插入材料表">
<![CDATA[
	   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,
     
     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,
     OLD_ORDER_NO,
     JUDGE_RESULT_TIME,
     MAT_ORIGIN_CODE,
     MAT_ORIGIN_NAME,
     SOURE_CODE,
     SOURE_NAME,
     MATERIAL_NO,
     MATERIAL_NAME,
     LOT_NO,
     STOVE_NO,
     ZBS_FLAG,
     ZBS_ID,
     SUPPLY_UNIT_CODE,
     SUPPLY_UNIT
     ) VALUES  (?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,
             ?,?,?,?,?,?,
             TO_NUMBER(?),ROUND(TO_NUMBER(?),4),TO_DATE(?,'YYYY-MM-DD HH24:MI:SS'),TO_DATE(?,'YYYY-MM-DD HH24:MI:SS'),
             ?,?,'1','1','801402','80150202',TO_NUMBER(?),?,?,?,?,?,?,?,?,TO_DATE(?,'YYYY-MM-DD'),?,?,?,?,?,?,?,?,?,?,?,?)
		]]>
</query>

<query id = "examineDataXs.insertInList" desc = "写入库表">
INSERT INTO YDM_ZC_INLIST_XS
  (MANAGEMENT_NO,
   MANAGEMENT_NAME,
   INSTOCK_SQE,
   INSTOCK_DOC,
   INSTOCK_TYPE_CODE,
   INSTOCK_TYPE_NAME,
   MAT_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,
   PRODUCT_FLAG,
   MAT_STATUS,
   INSTOCK_TIME,
   ACT_LEN,
   DEPARTMENT_CODE,
   DEPARTMENT_DESC,
   JUDGE_STD_NAME,
   PLINE_CODE,
   PLINE_NAME,
   GRADECODE,
   GRADENAME,
   BAL_YEAR_MONTH,
   IN_TIME_F,
   PIPMEMO,
   MAT_ORIGIN_CODE,
   MAT_ORIGIN_NAME,
   SOURE_CODE,
   SOURE_NAME,
   MATERIAL_NO,
   MATERIAL_NAME,
    SUPPLY_UNIT_CODE,
    SUPPLY_UNIT)
VALUES
  (?,
   ?,
   ?,
   ?,
   ?,
   ?,
   ?,
   ?,
   ?,
   ?,
   ?,
   ?,
   ?,
   ?,
   ?,
   ?,
   ?,
   ?,
   ?,
   ?,
   ?,
   ?,
   ?,
   ?,
   ?,
   ?,
   ?,
   ?,
   ?,
   ?,
   ?,
   ?,
   ?,
   ?,
   ?,
   to_date(?, 'YYYY-MM-DD HH24:MI:SS'),
   ?,
   ?,
   ?,
   ?,
   ?,
   ?,
   '801402',
   '80150202',
   to_date(?, 'YYYY-MM-DD HH24:MI:SS'),
   ?,
   ?,
   ?,
   ?,
   ?,
   ?,
   ?,
   ?,
   ?,
   ?,
   to_date(?, 'YYYY-MM-DD HH24:MI:SS'),
   ?,
   ?,
   ?,
   ?,
   ?,
   ?,
   ?,?,?)
</query>

<query id = "CorePipeInTempXs.REDINSERTMAT1" desc = "插入物料表(红冲成品)">
	<![CDATA[
	   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,
     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
     ) VALUES  (?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,
             ?,?,?,?,?,?,?,?,
             TO_NUMBER(?),ROUND(TO_NUMBER(?),4),TO_DATE(?,'YYYY-MM-DD HH24:MI:SS'),TO_DATE(?,'YYYY-MM-DD HH24:MI:SS'),
             ?,?,?,?,?,?,TO_NUMBER(?),?,?,?,?,?,?)
		]]>
		</query>
		
		<query id = "CorePipeInTempXs.REDINSERTMAT1" desc = "插入物料表(红冲成品)">
	<![CDATA[
	   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,
     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
     ) VALUES  (?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,
             ?,?,?,?,?,?,?,?,
             TO_NUMBER(?),ROUND(TO_NUMBER(?),4),TO_DATE(?,'YYYY-MM-DD HH24:MI:SS'),TO_DATE(?,'YYYY-MM-DD HH24:MI:SS'),
             ?,?,?,?,?,?,TO_NUMBER(?),?,?,?,?,?,?)
		]]>
	</query>

	<query id="CorePipeInTempXs.DELETEPIPEDIN" desc="撤销缴库">
		<![CDATA[
	     DELETE FROM MAT_ZC_M_XS
	     WHERE  JUDGE_STOVE_NO=? AND BATCH_NO= ? and BATCH_GROUD_NO = ?
		]]>
	</query>
	
		<query id = "CorePipeInTempXs.DeleteInList" desc ="删除入库表信息">
	DELETE FROM YDM_ZC_INLIST_XS T WHERE T.INSTOCK_DOC =  ? and T.JUDGE_STOVE_NO = ? and t.BATCH_NO = ? and t.BATCH_GROUD_NO = ?
	</query>
	
	<query id = "CorePipeInTempXs.insertInList1" desc = "对入库表进行插入1">
	 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,PIPMEMO,MAT_ORIGIN_CODE,MAT_ORIGIN_NAME,SOURE_CODE,SOURE_NAME,MATERIAL_NO,MATERIAL_NAME,IN_MOLD,PACK_NO,SUPPLY_UNIT_CODE,SUPPLY_UNIT)
VALUES
  (?,
   ?,
   ?,
   ?,
   ?,
   ?,
   ?,
   ?,
   ?,
   ?,
   ?,
   ?,
   ?,
   ?,
   ?,
   ?,
   ?,
   ?,
   ?,
   ?,
   ?,
   ?,
   ?,
   ?,
   ?,
   ?,
   ?,
   ?,
   ?,
   ?,
   ?,
   ?,
   ?,
   ?,
   ?,
   ?,
   ?,
   to_date(?,'YYYY-MM-DD HH24:MI:SS'),?,?,?,?,?,?,'801402','80150205',to_date(?,'YYYY-MM-DD HH24:MI:SS'),?,?,?,?,?,?,?,?,?,?,to_date(?,'YYYY-MM-DD HH24:MI:SS'),?,?,?,?,?,?,?,?,?,'120501','天津钢管制造有限公司')

	</query>
	
	<query id="CorePipeInTempXs.INSERTMAT" desc="插入材料">
		<![CDATA[
	   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,
     OLD_ORDER_NO,
     JUDGE_RESULT_TIME,
     MAT_ORIGIN_CODE,
     MAT_ORIGIN_NAME,
     SOURE_CODE,
     SOURE_NAME,
     MATERIAL_NO,
     MATERIAL_NAME,
     PACK_NO,
     IN_MOLD,
     ZBS_FLAG,
     JUDGE_RESULT_CODE,
     JUDGE_RESULT,
     SUPPLY_UNIT_CODE,
     SUPPLY_UNIT
     --OUT_FACTORY_FLAG,
     --TREASURY_TIME
     ) VALUES  (?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,
             ?,?,?,?,?,?,?,?,?,?,?,?,
             TO_NUMBER(?),ROUND(TO_NUMBER(?),4),TO_DATE(?,'YYYY-MM-DD HH24:MI:SS'),TO_DATE(?,'YYYY-MM-DD HH24:MI:SS'),
             ?,?,'1','1','801403','80150301',TO_NUMBER(?),?,?,?,?,?,?,?,?,TO_DATE(?,'YYYY-MM-DD'),?,?,?,?,?,?,?,?,'2','40740701','合格','120501','天津钢管制造有限公司')
		]]>
	</query>
	
	<query id = "CorePipeInTempXs.insertInList" desc = "对入库表进行插入">
	 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,PIPMEMO,MAT_ORIGIN_CODE,MAT_ORIGIN_NAME,SOURE_CODE,SOURE_NAME,MATERIAL_NO,MATERIAL_NAME,IN_MOLD,PACK_NO,SUPPLY_UNIT_CODE,SUPPLY_UNIT)
VALUES
  (?,
   ?,
   ?,
   ?,
   ?,
   ?,
   ?,
   ?,
   ?,
   ?,
   ?,
   ?,
   ?,
   ?,
   ?,
   ?,
   ?,
   ?,
   ?,
   ?,
   ?,
   ?,
   ?,
   ?,
   ?,
   ?,
   ?,
   ?,
   ?,
   ?,
   ?,
   ?,
   ?,
   ?,
   ?,
   ?,
   ?,
   to_date(?,'YYYY-MM-DD HH24:MI:SS'),?,?,?,?,?,?,'801403','80150301',to_date(?,'YYYY-MM-DD HH24:MI:SS'),?,?,?,?,?,?,?,?,?,?,to_date(?,'YYYY-MM-DD HH24:MI:SS'),?,?,?,?,?,?,?,?,?,'120501','天津钢管制造有限公司')

	</query>
	
	<query id="CorePipeInTempXs.INSERTMAT1" desc="插入材料1">
		<![CDATA[
	   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,
     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,
     OLD_ORDER_NO,
     JUDGE_RESULT_TIME,
     MAT_ORIGIN_CODE,
     MAT_ORIGIN_NAME,
     SOURE_CODE,
     SOURE_NAME,
     MATERIAL_NO,
     MATERIAL_NAME,
     PACK_NO,
     IN_MOLD,
     ZBS_FLAG,
     JUDGE_RESULT_CODE,
     JUDGE_RESULT,
     --OUT_FACTORY_FLAG,
     --TREASURY_TIME
      SUPPLY_UNIT_CODE,
     SUPPLY_UNIT
     ) VALUES  (?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,
             ?,?,?,?,?,?,?,?,
             TO_NUMBER(?),ROUND(TO_NUMBER(?),4),TO_DATE(?,'YYYY-MM-DD HH24:MI:SS'),TO_DATE(?,'YYYY-MM-DD HH24:MI:SS'),
             ?,?,'1','1','801402','80150202',TO_NUMBER(?),?,?,?,?,?,?,?,?,TO_DATE(?,'YYYY-MM-DD'),?,?,?,?,?,?,?,?,'2','40740701','合格','120501','天津钢管制造有限公司')
		]]>
	</query>
	
	<query id = "CorePipeInTempXs.INSERTMAT2" desc = "插入材料表3">
	<![CDATA[
	   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,
     OLD_ORDER_NO,
     JUDGE_RESULT_TIME,
     MAT_ORIGIN_CODE,
     MAT_ORIGIN_NAME,
     SOURE_CODE,
     SOURE_NAME,
     MATERIAL_NO,
     MATERIAL_NAME,
     PACK_NO,
     IN_MOLD,
     ZBS_FLAG,
     JUDGE_RESULT_CODE,
     JUDGE_RESULT,
     --OUT_FACTORY_FLAG,
     --TREASURY_TIME,
     SUPPLY_UNIT_CODE,
     SUPPLY_UNIT
     ) VALUES  (?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,
             ?,?,?,?,?,?,?,?,?,?,?,?,
             TO_NUMBER(?),ROUND(TO_NUMBER(?),4),TO_DATE(?,'YYYY-MM-DD HH24:MI:SS'),TO_DATE(?,'YYYY-MM-DD HH24:MI:SS'),
             ?,?,'1','1','801402','80150202',TO_NUMBER(?),?,?,?,?,?,?,?,?,TO_DATE(?,'YYYY-MM-DD'),?,?,?,?,?,?,?,?,'2','40740701','合格','120501','天津钢管制造有限公司')
		]]>
	</query>
	
	<query id="FrmPipePayInXs.AddSInList" desc="新增入库信息">
	<![CDATA[ 
	insert into ydm_zc_inlist_XS (
		instock_sqe, instock_doc, instock_type_code, 
		instock_type_name, 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, pro_order_no, 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, 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, 
		in_bc, in_bz, create_name, create_time, instock_time 
		) 
	values (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, 
		    ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, 
		    ?, to_date(?,'YYYY/MM/DD HH24:MI:SS'), ?, ?, ?, ?, ?, SYSDATE, SYSDATE )
	]]>
	</query>
	
	<query id="FrmPipeMoveInXs.AddMoveList" desc="新增到入库实绩表">
	<![CDATA[
	INSERT INTO YDM_ZC_INLIST_XS (
    INSTOCK_SQE, INSTOCK_DOC, INSTOCK_TYPE_CODE, 
    INSTOCK_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, PRO_ORDER_NO, 
    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, 
    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, IN_BC, IN_BZ, CREATE_NAME, INSTOCK_TIME, CREATE_TIME,DEPARTMENT_CODE,DEPARTMENT_DESC,ORD_PK,ORD_LN_PK ,
    ORD_LN_DLY_PK ,ORDER_NO ,ORDER_SEQ ,DELIVERY_NO,PRODUCT_FLAG,MAT_STATUS,IN_TIME_F,AFFIRM_LOG, FINISHPRO_MOLD ,IN_MOLD 
    ) 
  VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, 
      ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, 
      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_DATE(?,'YYYY-MM-DD HH24:MI:SS'),'1',?,?)
  ]]>
	</query>
	
	<query id = "FrmFrimRedChongXs.updateMatZcWgt" desc = "修改库存信息">
UPDATE MAT_ZC_M_XS T 
   SET T.ACT_WEIGHT  = '#ACT_WEIGHT#',
       T.ACT_LEN     = '#ACT_LEN#',
       T.INSTOCK_DOC = '#INSTOCK_DOC#',
       T.MNG_LOCK_FLAG = '1',
       T.MNG_LOCK_REMARK = '红冲'
 WHERE T.MAT_NO = '#MAT_NO#'
</query>

<query id = "FrmFrimRedChongXs.updateMatZcWgtStorage" desc = "修改库存剩余信息">
UPDATE MAT_ZC_M T
   SET T.ACT_WEIGHT  = '#ACT_WEIGHT#',
       T.ACT_LEN     = '#ACT_LEN#'
 WHERE T.MAT_NO = '#MAT_NO#'
</query>

<query id = "FrmExamineJudge.examineData_RXs" desc= "入库信息">
	<![CDATA[
	declare
  v_Instock_doc  ydm_zc_inlist.instock_doc%type := null; --入库单号
  v_instock_sqe  ydm_zc_inlist.instock_sqe%type := null; --入库流水
  v_Imemo        com_base_info.memo%type := null;
  v_Icount       NUMBER := 1;
  v_time         ydm_zc_outlist.create_time%type := sysdate;
  v_bathYear     mat_zc_m.bal_year_month%type := to_char(sysdate, 'yyyyMM');
  v_matNo        mat_zc_m.mat_no%type := null; --材料号
  v_matCount     Number := 1;
  v_groupNo      mat_zc_m.batch_groud_no%type := null; --组号
  v_act_dimater  mat_zc_m.act_dimater%type := null;--外径
  v_act_height  mat_zc_m.act_height%type := null;--壁厚
begin
    --外径壁厚
    SELECT
        DIMATER,HEIGHT
    into
        v_act_dimater,v_act_height
    FROM COM_BASE_SPEC WHERE SPEC_CODE = ?;
    --生成入库单号
    select memo into v_Imemo from com_base_info where basecode = ?;
    select v_Imemo || to_char(sysdate, 'yymmdd') ||
           Lpad(NVL(MAX(substr(t.instock_doc, 9)), 0) + 1, 5, 0) instock_doc
      into v_Instock_doc
      from ydm_zc_inlist t
     where t.instock_type_code = ?
       AND trunc(t.CREATE_TIME) =
           trunc(sysdate);
    --生成材料号
    SELECT Lpad(NVL(MAX(substr(t1.mat_no, length(t1.mat_no) - 3)), 0) + 1, 4, 0)
  into v_matCount
  FROM (SELECT T.MAT_NO
          FROM MAT_ZC_M T
         WHERE T.JUDGE_STOVE_NO = ?
           AND T.BATCH_NO = ?
        UNION ALL
        SELECT T.MAT_NO
          FROM MAT_ZC_TRACK T
         WHERE T.JUDGE_STOVE_NO = ?
           AND T.BATCH_NO = ?) T1;
    --生成组号
    SELECT Lpad(NVL(MAX(t.batch_groud_no), 0) + 1, 3, 0)
      into v_groupNo
      FROM MAT_ZC_M T
     WHERE T.JUDGE_STOVE_NO = ?
       AND T.BATCH_NO = ?;
    for myrow in (SELECT T.*,
                         S.STORAGE_NO,
                         S.LOCATION_NO,
                         S.STORAGE_ATTR,
                         S.Storage_Attr_Name,
                         S.Storage_Type_No,
                         S.Storage_Type_Name
                    FROM MAT_ZC_M T, YDM_ZC_BUTTRESS S
                   WHERE T.MAT_NO = S.MAT_NO
                     AND T.JUDGE_ID = ?) loop
      v_matNo := myrow.judge_stove_no || myrow.batch_no ||
                 Lpad(v_matCount, 4, 0);
         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,
         
         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,
         OLD_ORDER_NO,
         JUDGE_RESULT_TIME,
         MAT_ORIGIN_CODE,
         MAT_ORIGIN_NAME,
         SOURE_CODE,
         SOURE_NAME,
         MATERIAL_NO,
         MATERIAL_NAME,
         ZBS_FLAG,
         ZBS_ID,
         MEASURING_SEQ,
         JG_ZBS_ID,
         SUPPLY_UNIT_CODE,
         SUPPLY_UNIT,
         IS_DEALER,
         LOT_NO,
         STOVE_NO,
         PROCESS_CDOE,
         PROCESS_DESC)
      VALUES
        (myrow.JUDGE_STOVE_NO,
         myrow.BATCH_NO,
         v_groupNo,
         ?,
         ?,
         ?,
         ?,
         ?,
         ?,
         ?,
         ?,
         myrow.std_code,
         myrow.STD_NAME,
         myrow.BELONG_CODE,
         myrow.BELONG_NAME,
         ?,
         ?,
         
         v_act_dimater,
         v_act_height,
         myrow.LEN_NO,
         myrow.LEN_DESC,
         myrow.LEN_UNIT,
         myrow.ACT_LEN_MIN,
         myrow.ACT_LEN_MAX,
         ?,
         
         myrow.ACT_COUNT,
         myrow.ACT_WEIGHT,
         v_time,
         v_time,
         v_matNo,
         myrow.MEMO,
         myrow.JUGDE_APPLY_FLAG,
         myrow.INSTOCK_FLAG,
         myrow.PRODUCT_FLAG,
         myrow.MAT_STATUS,
         myrow.ACT_LEN,
         myrow.JUDGE_STD_NAME,
         v_bathYear,
         myrow.PLINE_CODE,
         myrow.PLINE_NAME,
         myrow.GRADECODE,
         myrow.GRADENAME,
         myrow.PIPMEMO,
         myrow.OLD_ORDER_NO,
         myrow.JUDGE_RESULT_TIME,
         myrow.MAT_ORIGIN_CODE,
         myrow.MAT_ORIGIN_NAME,
         myrow.SOURE_CODE,
         myrow.SOURE_NAME,
         ?,
         ?,
         myrow.ZBS_FLAG,
         myrow.ZBS_ID,
         myrow.MEASURING_SEQ,
         myrow.JG_ZBS_ID,
         myrow.SUPPLY_UNIT_CODE,
         myrow.SUPPLY_UNIT,
         myrow.IS_DEALER,
        myrow.LOT_NO,
         myrow.STOVE_NO,
         myrow.PROCESS_CDOE,
         myrow.PROCESS_DESC);

         
         INSERT INTO YDM_ZC_INLIST_XS
        (MANAGEMENT_NO,
         MANAGEMENT_NAME,
         INSTOCK_SQE,
         INSTOCK_DOC,
         INSTOCK_TYPE_CODE,
         INSTOCK_TYPE_NAME,
         MAT_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,
         PRODUCT_FLAG,
         MAT_STATUS,
         INSTOCK_TIME,
         ACT_LEN,
         DEPARTMENT_CODE,
         DEPARTMENT_DESC,
         JUDGE_STD_NAME,
         PLINE_CODE,
         PLINE_NAME,
         GRADECODE,
         GRADENAME,
         BAL_YEAR_MONTH,
         IN_TIME_F,
         PIPMEMO,
         MAT_ORIGIN_CODE,
         MAT_ORIGIN_NAME,
         SOURE_CODE,
         SOURE_NAME,
         MATERIAL_NO,
         MATERIAL_NAME,
         SUPPLY_UNIT_CODE,
         SUPPLY_UNIT,
         IS_DEALER,
          LOT_NO,
         STOVE_NO,
         PROCESS_CDOE,
         PROCESS_DESC)
      VALUES
        (?,
         ?,
         v_instock_sqe,
         v_Instock_doc,
         ?,
         ?,
         v_matNo,
         myrow.JUDGE_STOVE_NO,
         myrow.BATCH_NO,
         v_groupNo,
         ?,
         ?,
         myrow.STD_CODE,
         myrow.STD_NAME,
         
         ?,
         ?,
         ?,
         ?,
         ?,
         ?,
         ?,
         ?,
         v_act_dimater,
         v_act_height,
         myrow.ACT_LEN_MIN,
         myrow.ACT_LEN_MAX,
         myrow.ACT_COUNT,
         myrow.ACT_WEIGHT,
         myrow.ACT_THEORY_WEIGHT,
         myrow.BELONG_CODE,
         myrow.BELONG_NAME,
         myrow.STORAGE_NO,
         
         myrow.MEMO,
         '1',
         ?,
         v_time,
         myrow.PRODUCT_FLAG,
         myrow.MAT_STATUS,
         v_time,
         myrow.ACT_LEN,
         ?,
         ?,
         myrow.JUDGE_STD_NAME,
         myrow.PLINE_CODE,
         myrow.PLINE_NAME,
         myrow.GRADECODE,
         myrow.GRADENAME,
         ?,
         v_time,
         myrow.PIPMEMO,
         myrow.MAT_ORIGIN_CODE,
         myrow.MAT_ORIGIN_NAME,
         myrow.SOURE_CODE,
         myrow.SOURE_NAME,
         ?,
         ?,
         myrow.SUPPLY_UNIT_CODE,
         myrow.SUPPLY_UNIT,
         myrow.IS_DEALER,
          myrow.LOT_NO,
        myrow. STOVE_NO,
         myrow.PROCESS_CDOE,
         myrow.PROCESS_DESC);
      v_matCount := v_matCount + 1;
      v_Icount   := v_Icount + 1;
    end loop;
end;
	]]>
	</query>
	
	<query id = "FrmExamineJudgeXs.examineData1_" desc = "插入出库表">
	<![CDATA[
	declare
  v_Outstock_doc ydm_zc_outlist.outstock_doc%type := null; --出库单号
  v_outstock_sqe ydm_zc_outlist.outstock_sqe%type := null; --出库流水
  
  v_Memo         com_base_info.memo%type := null;
  v_Ocount       NUMBER := 1;
  v_time         ydm_zc_outlist.create_time%type := sysdate;
  v_bathYear     mat_zc_m.bal_year_month%type := to_char(sysdate, 'yyyyMM');
begin
    --生成出库单号
    select memo into v_Memo from com_base_info where basecode = ?;
    select v_Memo || to_char(sysdate, 'yymmdd') ||
           Lpad(NVL(MAX(substr(outstock_doc, 9)), 0) + 1, 5, 0) outstock_doc
      into v_Outstock_doc
      from ydm_zc_outlist t
     where t.outstock_type_code = ?
       AND trunc(t.CREATE_TIME) =
           trunc(sysdate);
    for myrow in (SELECT T.*,
                         S.STORAGE_NO,
                         S.LOCATION_NO,
                         S.STORAGE_ATTR,
                         S.Storage_Attr_Name,
                         S.Storage_Type_No,
                         S.Storage_Type_Name
                    FROM MAT_ZC_M T, YDM_ZC_BUTTRESS S
                   WHERE T.MAT_NO = S.MAT_NO
                     AND T.JUDGE_ID = ?) loop
      INSERT INTO YDM_ZC_OUTLIST_XS
        (DEPARTMENT_CODE,
         DEPARTMENT_DESC,
         PRODUCT_FLAG,
         MAT_STATUS,
         JUDGE_STD_NAME,
         JUDGE_STD_CODE,
         BAL_YEAR_MONTH,
         OUTSTOCK_SQE,
         OUTSTOCK_DOC,
         OUTSTOCK_TYPE_CODE,
         OUTSTOCK_TYPE_NAME,
         MAT_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,
         BELONG_CODE,
         BELONG_NAME,
         STORAGE_NO,
         LOCATION_NO,
         MANAGEMENT_NO,
         MANAGEMENT_NAME,
         OUTSTOCK_TIME,
         OUT_BC,
         OUT_BZ,
         MEMO,
         VALIDFLAG,
         CREATE_NAME,
         CREATE_TIME,
         SUPPLY_UNIT_CODE,
         SUPPLY_UNIT,
         IS_DEALER,
         LOT_NO,
         STOVE_NO,
         PROCESS_CDOE,
         PROCESS_DESC)
      VALUES
        (?,
         ?,
         myrow.product_flag,
         myrow.mat_status,
         myrow.judge_std_name,
         myrow.judge_std_code,
         ?,
         v_outstock_sqe,
         v_Outstock_doc,
         ?,
         ?,
         myrow.mat_no,
         myrow.JUDGE_STOVE_NO,
         myrow.BATCH_NO,
         myrow.BATCH_GROUD_NO,
         myrow.MATERIAL_NO,
         myrow.MATERIAL_NAME,
         myrow.PRODUCCODE,
         myrow.PRODUCNAME,
         myrow.STD_CODE,
         myrow.STD_NAME,
         myrow.GRADECODE,
         myrow.GRADENAME,
         myrow.STEELCODE,
         myrow.STEELNAME,
         myrow.STD_STYLE,
         myrow.STD_STYLE_DESC,
         myrow.SPEC_CODE,
         myrow.SPEC_NAME,
         myrow.MODEL_CODE,
         myrow.MODEL_DESC,
         myrow.PLINE_CODE,
         myrow.PLINE_NAME,
         myrow.ACT_DIMATER,
         myrow.ACT_HEIGHT,
         myrow.ACT_LEN,
         myrow.ACT_LEN_MIN,
         myrow.ACT_LEN_MAX,
         myrow.ACT_COUNT,
         myrow.ACT_WEIGHT,
         myrow.ACT_THEORY_WEIGHT,
         myrow.BELONG_CODE,
         myrow.BELONG_NAME,
         myrow.STORAGE_NO,
         myrow.LOCATION_NO,
         ?,
         ?,
         v_time,
         '1',
         '1',
         myrow.pipmemo,
         '1',
         ?,
         v_time,
         myrow.SUPPLY_UNIT_CODE,
         myrow.SUPPLY_UNIT,
         myrow.IS_DEALER,
         myrow.LOT_NO,
         myrow.STOVE_NO,
         myrow.PROCESS_CDOE,
         myrow.PROCESS_DESC);
      v_Ocount   := v_Ocount + 1;
    end loop;
end;
	]]>
	</query>
	
	<query id = "CorePipeInTempXs.deleteMat" desc = "删除物料表">
	
	<![CDATA[
	delete from mat_zc_m_xs t where t.MAT_NO = ?
	]]>
	</query>
	
	<query id = "CorePipeInTemp.redInsertInList" desc = "红冲插入入库表">
	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,SUPPLY_UNIT_CODE,SUPPLY_UNIT)
VALUES
  (?,
   ?,
   ?,
   ?,
   ?,
   ?,
   ?,
   ?,
   ?,
   ?,
   ?,
   ?,
   ?,
   ?,
   ?,
   ?,
   ?,
   ?,
   ?,
   ?,
   ?,
   ?,
   ?,
   ?,
   ?,
   ?,
   ?,
   ?,
   ?,
   ?,
   ?,
   ?,
   ?,
   ?,
   ?,
   ?,
   ?,
   to_date(?,'YYYY-MM-DD HH24:MI:SS'),?,?,?,?,?,?,?,?,to_date(?,'YYYY-MM-DD HH24:MI:SS'),?,?,?,?,?,?,?,?,?,?,to_date(?,'YYYY-MM-DD HH24:MI:SS'),'120501','天津钢管制造有限公司')
	</query>
	
	<query id = "CorePipeInTempXs.updateMatWgtLen" desc = "修改材料表重量长度">
	UPDATE MAT_ZC_M_XS T SET T.ACT_WEIGHT = ?,T.ACT_LEN = ? WHERE T.MAT_NO = ?
	</query>
	
		<query id = "CorePipeInTempXs.updateInListWgtLen" desc = "修改入库表重量长度">
	UPDATE YDM_ZC_INLIST_XS T SET T.ACT_WEIGHT = ?,T.ACT_LEN = ? WHERE T.MAT_NO = ?
	</query>
	
	<query id="FrmPuorLibXs.INSERTIn" desc="新增装车皮入库">
	<![CDATA[
INSERT INTO YDM_ZC_INLIST_XS (INSTOCK_SQE, INSTOCK_DOC, INSTOCK_TYPE_CODE, 
INSTOCK_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, BELONG_CODE, BELONG_NAME, 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, 
INSTOCK_TIME, IN_BC, IN_BZ, CREATE_NAME, CREATE_TIME, ORD_PK, ORD_LN_PK, 
ORD_LN_DLY_PK, DEPARTMENT_CODE, DEPARTMENT_DESC, ORDER_NO, ORDER_SEQ, 
DELIVERY_NO, PRODUCT_FLAG, MAT_STATUS, JUDGE_STD_NAME, JUDGE_STD_CODE, 
BAL_YEAR_MONTH, M_BILL_NO) VALUES 
(?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?,?, ?, ?, ?, ?, ?, ?, ?, ?, 
?, ?, ?, ?, ?, ?, ?, TO_NUMBER(?), TO_NUMBER(?), 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'), ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)
	]]>
	</query>
	
	<query id="FrmPuorLibXs.UPDATEOut" desc=" 修改装车皮倒库接收标志">
<![CDATA[
UPDATE YDM_ZC_OUTLIST_XS T
   SET TAR_LOCATION_NO       = ?,
       TAR_LARY_NO           = ?,
       TAR_LOC_NO            = ?,
       TAR_STORAGE_ATTR      = ?,
       TAR_STORAGE_ATTR_NAME = ?,
       TAR_STORAGE_TYPE_NO   = ?,
       TAR_STORAGE_TYPE_NAME = ?,
       TAR_MANAGEMENT_NO     = ?,
       TAR_MANAGEMENT_NAME   = ?,
       TAR_DEPARTMENT_CODE   = ?,
       TAR_DEPARTMENT_DESC   = ?,
       INSTOCK_TIME =TO_DATE(?,'YYYY-MM-DD HH24:MI:SS'),
       IN_BC=?,
       IN_BZ=?,
       TAR_REC_FLAG          = '1'    
 WHERE M_BILL_NO = ?
   AND JUDGE_STOVE_NO = ?
   AND NVL(BATCH_NO,'/')=NVL(?,'/')
   AND BATCH_GROUD_NO = ?
   AND ORD_LN_DLY_PK = ?
   AND OUTSTOCK_TYPE_CODE ='800807'
]]>
	</query>
	
	<query id="FrmPuorLibXs.UPDATEBILLC" desc="修改提单装车皮倒库标志">
<![CDATA[
UPDATE YDM_ZC_BILL_C_XS T
   SET T.MOVE_LOAD_FLAG = ?
 WHERE T.BILL_NO = ?
   AND T.ORD_LN_DLY_PK = ?
   AND T.JUDGE_STOVE_NO = ?
   AND NVL(T.BATCH_NO,'/')=NVL(?,'/')
   AND T.GROUP_NO = ?
]]>
	</query>
	
	<query id="FrmVrpInLibraryXs.AddPlnInfo" desc="新增镦拔扩入库表">
		<![CDATA[
	INSERT INTO YDM_ZC_INLIST_XS (INSTOCK_SQE, INSTOCK_DOC, INSTOCK_TYPE_CODE, 
INSTOCK_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, PRO_ORDER_NO, 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, 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, INSTOCK_TIME, IN_BC, 
IN_BZ, MEMO, CREATE_NAME, CREATE_TIME, ORD_PK, ORD_LN_PK, ORD_LN_DLY_PK, 
DEPARTMENT_CODE, DEPARTMENT_DESC, ORDER_NO, ORDER_SEQ, DELIVERY_NO, 
PRODUCT_FLAG, MAT_STATUS, JUDGE_STD_NAME, JUDGE_STD_CODE, IN_TIME_F, 
LEN_NO, LEN_DESC, LEN_UNIT, PIPMEMO, SOURE_CODE, SOURE_NAME, 
MAT_ORIGIN_CODE, MAT_ORIGIN_NAME, AFFIRM_LOG,QCM_STAUS) VALUES (?, ?, 
?, ?, ?, 
?, ?, ?, ?, ?, ?, ?, 
?, ?, ?, ?, ?, ?, ?, 
?, ?, ?, ?, ?, ?, 
?, ?, ?, ?, ?, ?, 
?, ?,?, ?, ?,?, 
?,?, ?, ?, ?, ?, 
?, ?, ?, ?, ?, 
?, ?, 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_DATE(?,'YYYY-MM-DD HH24:MI:SS'),  ?, ?, ?, ?,?, ?, 
?, ?, ?,?)
		]]>
	</query>
	
	<query id="FrmVrpInLibraryXs.AddMatM" desc="末工序修改料表">
	<![CDATA[
UPDATE MAT_ZC_M_XS
   SET PRODUCT_FLAG = ?,
       MAT_STATUS   = ?,
       PROCESS_CDOE = ?,
       PROCESS_DESC = ?,
       VRP_PLINE_CODE = ?,
       VRP_PLINE_NAME = ?, 
       VRP_FACE_RESULT_CODE = ?,
       VRP_CHEM_RESULT_CODE = ?,
       VRP_GX_PLAN_NO = ?,
       VRP_GX_PLAN_NO1 = ?,
       VRP_SPEC_RESULT_CODE = ?,
       VRP_QCM_STAUS = ?,
       VRP_HEAT_PLAN_NO = ?,
       VRP_PRO_ORDER_ID = ?,
       VRP_PRO_ORDER_ID1 = ?,
       VRP_PRO_ORDER_NO = ?,
       VRP_PRO_ORDER_NO1 = ?,
       VRP_LOT_NO = ?,
       VRP_PHY_RESULT_CODE = ?,
       VRP_SAMPLE_FLAG = ?,
       VRP_CRAF_NO = ?,
       VPR_QUALITY_GROUP_ZG = ?,
       VRP_ACT_HEIGHT = ?,
       VRP_ACT_DIMATER = ?,
       MATERIAL_NO = ?,
       MATERIAL_NAME = ?,
       INPUT_MATERIAL_NAME = ?,
       INPUT_MATERIAL_NO = ?,
       INPUT_ORIGIN_CODE = ?,
       NEXT_PROCESS_CDOE = ?,
       NEXT_PROCESS_DESC = ?,
       PLINE_CODE = ?,
       PLINE_NAME = ?,   
       UPDATE_NAME = ?,
       UPDATE_TIME =TO_DATE(?, 'YYYY-MM-DD HH24:MI:SS'),
       VRP_JUDGE_RESULT_CODE=?,
       BELONG_CODE=?,
       BELONG_NAME=?,
       MAT_GOWHERE_CODE=?,
       MAT_GOWHERE_NAME=?,
       VPR_FLAG_STOVE_NO_ZG=?
      
 WHERE MAT_NO = ?
    ]]>
	</query>
	
	<query id="FrmPipeEntruckXs.insertOutList" desc="插入出库表">
	<![CDATA[
	INSERT INTO YDM_ZC_OUTLIST_XS (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,FINISHPRO_MOLD,IN_MOLD,supply_unit_code,supply_unit,IS_DEALER,
		PROCESS_CDOE,PROCESS_DESC,PRO_ORDER_NO,BILL_NO) VALUES (?,
		?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?,
		?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, 
		TO_DATE(?,'YYYY-MM-DD HH24:MI:SS'), ?, ?, TO_DATE(?,'YYYY-MM-DD HH24:MI:SS'), ?, 
		?, ?, TO_DATE(?,'YYYY-MM-DD HH24:MI:SS'), ?, ?, ?,?,?,?,?,?,?,?,?,?,?,
		(SELECT A.SUPPLY_UNIT_CODE FROM MAT_ZC_M A WHERE A.MAT_NO=?),(SELECT A.SUPPLY_UNIT 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="FrmPipeLoadXs.insertOutList" desc="插入出库表">
	<![CDATA[
	INSERT INTO YDM_ZC_OUTLIST_XS (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="FrmPuorLibXs.INSERTOUT" desc="插入装车皮倒库记录">
<![CDATA[
INSERT INTO YDM_ZC_OUTLIST_XS (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,PRODUCT_FLAG,MAT_STATUS,M_BILL_NO,TAR_STORAGE_NO) VALUES (?, 
		?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?,
		?, ?, ?, ?, ?, ?, ?, TO_NUMBER(?), TO_NUMBER(?), 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'), ?, ?, ?,?,?,?,?,?,?,?,?,?,?,?,?)
]]>
	</query>
	
	<query id="FrmPuorLibXs.deleteOut" desc="删除装车皮倒库数据">
<![CDATA[
DELETE YDM_ZC_OUTLIST_XS T WHERE T.M_BILL_NO=? 
AND T.JUDGE_STOVE_NO=? 
AND NVL(T.BATCH_NO,'/')=NVL(?,'/')
AND T.BATCH_GROUD_NO=? 
AND T.ORD_LN_DLY_PK=? 
AND T.OUTSTOCK_TYPE_CODE='800807'
]]>
	</query>
	
	<query id="FrmPipeInventoryOutXs.addYdmZcOutlit" desc="新增出库实绩记录">
	<![CDATA[
	  INSERT INTO YDM_ZC_OUTLIST_XS(
        ORDER_NO,
        ORDER_SEQ,
        DELIVERY_NO,
        ORD_PK,
        ORD_LN_PK,
        ORD_LN_DLY_PK,
        DEPARTMENT_CODE,
        DEPARTMENT_DESC,
        TAR_DEPARTMENT_CODE,
        TAR_DEPARTMENT_DESC,
        OUTSTOCK_SQE,
        OUTSTOCK_PLAN_NO,
        OUTSTOCK_DOC,
        OUTSTOCK_TYPE_CODE,
        OUTSTOCK_TYPE_NAME,
        ICCAR_NO,
        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,
        PRO_ORDER_NO,
        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,
        BAR_CODE,
        STORAGE_NO,
        LOCATION_NO,
        LARY_NO,
        LOC_NO,
        STORAGE_ATTR,
        STORAGE_ATTR_NAME,
        STORAGE_TYPE_NO,
        STORAGE_TYPE_NAME,
        MANAGEMENT_NO,
        MANAGEMENT_NAME,
        TAR_STORAGE_NO,
        TAR_LOCATION_NO,
        TAR_LARY_NO,
        TAR_LOC_NO,
        TAR_STORAGE_ATTR,
        TAR_STORAGE_ATTR_NAME,
        TAR_STORAGE_TYPE_NO,
        TAR_STORAGE_TYPE_NAME,
        TAR_MANAGEMENT_NO,
        TAR_MANAGEMENT_NAME,
        TAR_REC_FLAG,
        RPO_TIME,
        PRO_BC,
        PRO_BZ,
        INSTOCK_TIME,
        IN_BC,
        IN_BZ,
        OUTSTOCK_TIME,
        OUT_BC,
        OUT_BZ,
        MEMO,
        HAND_FLAG,
        VALIDFLAG,
        CREATE_NAME,
        CREATE_TIME,
        UPDATE_NAME,
        UPDATE_TIME,
        DELETE_NAME,
        DELETE_TIME,
        BAL_YEAR_MONTH,
        SUPPLY_UNIT_CODE,
        SUPPLY_UNIT,
        IS_DEALER,
        PROCESS_CDOE,
        PROCESS_DESC)
 VALUES( 
        '#ORDER_NO#',
        '#ORDER_SEQ#',
        '#DELIVERY_NO#',
        '#ORD_PK#',
        '#ORD_LN_PK#',
        '#ORD_LN_DLY_PK#',
        '#DEPARTMENT_CODE#',
        '#DEPARTMENT_DESC#',
        '#TAR_DEPARTMENT_CODE#',
        '#TAR_DEPARTMENT_DESC#',
        '#OUTSTOCK_SQE#',
        '',
        '#OUTSTOCK_DOC#',
        '#OUTSTOCK_TYPE_CODE#',
        '#OUTSTOCK_TYPE_NAME#',
        '',
        '',
        '#MAT_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#',
        '#BELONG_CODE#',
        '#BELONG_NAME#',
        '',
        '#STORAGE_NO#',
        '#LOCATION_NO#',
        '',
        '',
        '#STORAGE_ATTR#',
        '#STORAGE_ATTR_NAME#',
        '#STORAGE_TYPE_NO#',
        '#STORAGE_TYPE_NAME#',
        '',
        '',
        '',
        '',
        '',
        '',
        '',
        '',
        '',
        '',
        '',
        '',
        '0',
        NULL,
        '',
        '',
        NULL,
        '#IN_BC#',
        '#IN_BZ#',
        SYSDATE,
        '',
        '',
        '#MEMO#',
        '0',
        '1',
        '#CREATE_NAME#',
        SYSDATE,
        '#UPDATE_NAME#',
        NULL,
        '#DELETE_NAME#',
        NULL,
        '#BAL_YEAR_MONTH#',
        '#SUPPLY_UNIT_CODE#',
        '#SUPPLY_UNIT#',
        '#IS_DEALER#',
        '#PROCESS_CDOE#',
        '#PROCESS_DESC#')
	]]>
	</query>
	
	<query id="FrmPipeMoveOutXs.AddMoveList" desc="新增出库（倒库）记录">
    <![CDATA[insert into ydm_zc_outlist_XS
  (OUTSTOCK_SQE, OUTSTOCK_DOC,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,
   pro_order_no,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,out_bc, out_bz,rpo_time,pro_bc,pro_bz, 
   tar_storage_no,tar_location_no,TAR_LARY_NO,TAR_LOC_NO,tar_storage_attr,tar_storage_attr_name,
   tar_storage_type_no,tar_storage_type_name,tar_management_no,tar_management_name,
   storage_no,location_no,lary_no,loc_no,storage_attr,
   storage_attr_name,storage_type_no,storage_type_name,
   management_no,management_name,create_name,OUTSTOCK_TYPE_CODE,OUTSTOCK_TYPE_NAME,ORDER_NO,ORDER_SEQ,DELIVERY_NO,ORD_PK,ORD_LN_PK,ORD_LN_DLY_PK,PRODUCT_FLAG,MAT_STATUS,create_time,outstock_time,
   ICCAR_NO)
values
  (?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,
   ?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,to_date(?,'YYYY/MM/DD HH24:MI:SS'),
   ?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,to_date(?,'YYYY/MM/DD HH24:MI:SS'),to_date(?,'YYYY/MM/DD HH24:MI:SS'),?
   )
    ]]>
	</query>
	
	<query id="FrmPipeMoveInXs.deleteMoveList" desc="删除入库表">
	<![CDATA[
DELETE YDM_ZC_INLIST_XS T
 WHERE T.VALIDFLAG = '1'
   AND T.INSTOCK_TYPE_CODE = ?
   AND T.JUDGE_STOVE_NO = ?
   AND T.BATCH_NO = ?
   AND T.BATCH_GROUD_NO = ?
   AND T.INSTOCK_DOC = ?
		]]>
	</query>
	<query id="FrmPuorLibXs.deleteIn" desc="删除入库记录">
	<![CDATA[
DELETE YDM_ZC_INLIST T
 WHERE T.M_BILL_NO = ?
   AND T.JUDGE_STOVE_NO = ?
   AND NVL(T.BATCH_NO,'/')=NVL(?,'/')
   AND T.BATCH_GROUD_NO = ?
   AND T.ORD_LN_DLY_PK = ?
   AND T.INSTOCK_TYPE_CODE = '800705'
	]]>
	</query>
	<query id="FrmOutAutomaticXs.deleteOut" desc="删除出库表销售出库对应记录">
	<![CDATA[
DELETE YDM_ZC_OUTLIST_XS C
 WHERE C.OUTSTOCK_TYPE_CODE = '800805'
   AND C.MAT_NO IN ((SELECT T.MAT_NO
                    FROM YDM_ZC_BILL_C T
                   WHERE T.BILL_NO = ? 
                     AND T.MAT_NO=C.MAT_NO))
	]]>
	</query>
	<query id="FrmPipeEntruckXs.deleteOut" desc="删除出库表销售出库对应记录">
	<![CDATA[
--DELETE YDM_ZC_OUTLIST  WHERE OUTSTOCK_TYPE_CODE='800805' AND MAT_NO =?
DELETE YDM_ZC_OUTLIST_XS 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="FrmReturnDashedXs.deleteOutReturn" desc="删除出库表">
	<![CDATA[
	DELETE YDM_ZC_OUTLIST_XS T
 WHERE T.M_BILL_NO = ?
   AND T.JUDGE_STOVE_NO = ?
   AND T.BATCH_NO = ?
   AND T.BATCH_GROUD_NO = ?
   AND NVL(T.ORD_LN_DLY_PK,'/')=NVL(?,'/')
   AND T.OUTSTOCK_TYPE_CODE = '800806'
	]]>
	</query>
	
	<query id="FrmReturnDashedXs.deleteMatNoReturn" desc="删除材料表">
	<![CDATA[
	DELETE MAT_ZC_M_XS T
 WHERE T.MAT_NO IN (SELECT L.MAT_NO
                      FROM YDM_ZC_OUTLIST L
                     WHERE L.M_BILL_NO = ?
                       AND L.JUDGE_STOVE_NO = ?
                       AND L.BATCH_NO = ?
                       AND L.BATCH_GROUD_NO = ?
                       AND NVL(L.ORD_LN_DLY_PK,'/')=NVL(?,'/')
                       AND L.MAT_NO = T.MAT_NO
                       AND L.OUTSTOCK_TYPE_CODE = '800806')
        AND T.MAT_STATUS='80150301'
	]]>
	</query>
	<query id="FrmPipeMoveOutXs.deleteOutlist" desc="删除出库表">
	<![CDATA[	
	delete ydm_zc_outlist_xs where OUTSTOCK_SQE=?
   ]]>
	</query>
	<query id="FrmPipeInventoryOutXs.deleteMatZcMByMatNo" desc="根据材料号删除库存信息">
	<![CDATA[
	DELETE FROM MAT_ZC_M_XS T WHERE T.MAT_NO = ?
	]]>
	</query>
	<query id = "cancelPipDataXs.deleteInList" desc = "删除入库表">
	DELETE FROM YDM_ZC_INLIST_XS T WHERE T.MAT_NO = ? AND T.INSTOCK_TYPE_CODE = '800701'
	</query>
	<query id="FrmPipeInventoryOutXs.getMaxStockTakingDoc" desc="查询最大出库单号">
	<![CDATA[ 
	       SELECT 'TC' ||
       TO_CHAR(TO_NUMBER(NVL(SUBSTR(MAX(T.STOCKTAKING_DOC), 3),
                             TO_CHAR(SYSDATE, 'YYMMDD') || '00000')) + 1) INDEX_SEQ
  FROM YDM_ZC_STOCKTAKINGLIST T
	]]>
	</query>
	
</queryMap>
