<?xml version="1.0" encoding="UTF-8"?>
<queryMap desc="倒库入库接收">
	<query id="FrmPuorLib.QueryBillC" desc="查询信息">
<![CDATA[
    SELECT T.BILL_NO,
               T.ORDER_NO || '/' || T.ORDER_SEQ AS ORDER_SEQ_NO,
               T.ORDER_NO,
               T.ORDER_SEQ,
               T.DELIVERY_NO,
               (SELECT B.BASENAME
                  FROM COM_BASE_INFO B
                 WHERE B.BASECODE = T.PLAN_TRANS_TYPE) AS PLAN_TRANS_TYPE,
               C.JUDGE_STOVE_NO,
               C.BATCH_NO,
               C.GROUP_NO,
               C.STORAGE_NO,
               S.STORAGE_NAME,
               T.CREATE_NAME,
               TO_CHAR(T.CREATE_TIME, 'YYYY-MM-DD HH24:MI:SS') AS CREATE_TIME,
               C.PRODUCNAME,
               C.STEELNAME,
               C.SPEC_NAME,
               C.STD_NAME,
               C.GRADENAME,
               C.STD_STYLE_DESC,
               C.MODEL_DESC,
               C.VSTEL,
               C.VSTEL_DESC,      
               T.STATION_NM,
               T.SPCL_LN_NM,
               T.RECEIV_NM,
               T.ORD_LN_DLY_PK,
               T.SALE_ORG,
               T.SALE_ORG_DESC,
               SUM(NVL(C.ACT_COUNT, 0)) AS ACT_COUNT,
               SUM(NVL(C.ACT_WEIGHT, 0)) AS ACT_WEIGHT,
               SUM(NVL(C.ACT_LEN, 0)) AS ACT_LEN,
               DECODE(C.MOVE_LOAD_FLAG,'0','未进行','1','倒库出库','2','入库接收') AS MOVE_LOAD_FLAG       
          FROM YDM_ZC_BILL_M T, YDM_ZC_BILL_C C, YDM_BS_STORAGE S
         WHERE T.BILL_NO = C.BILL_NO(+)
           AND T.ORD_LN_DLY_PK = C.ORD_LN_DLY_PK(+)
           AND C.STORAGE_NO = S.STORAGE_NO(+)
           AND T.BILL_NO =?  
         GROUP BY T.BILL_NO,
                  T.ORDER_NO,
                  T.ORDER_SEQ,
                  T.DELIVERY_NO,
                  T.PLAN_TRANS_TYPE,
                  C.JUDGE_STOVE_NO,
                  C.BATCH_NO,
                  C.GROUP_NO,
                  C.STORAGE_NO,
                  C.VSTEL,
                  C.VSTEL_DESC,
                  S.STORAGE_NAME,
                  T.CREATE_NAME,
                  T.CREATE_TIME,
                  C.PRODUCNAME,
                  C.STEELNAME,
                  C.SPEC_NAME,
                  T.STATION_NM,
                  T.ORD_LN_DLY_PK,
                  T.SPCL_LN_NM,
                  C.STD_NAME,
                  C.GRADENAME,
                  T.RECEIV_NM,
                  C.STD_STYLE_DESC,
                  C.MODEL_DESC,
                  T.ISPRECLOSE,
                  T.SALE_ORG,
                  T.SALE_ORG_DESC,
                  C.MOVE_LOAD_FLAG
         ORDER BY T.CREATE_TIME DESC
]]>
	</query>
	<query id="FrmPuorLib.QueryOut" desc="装车皮倒库查询">
<![CDATA[
SELECT T.ORDER_NO||'/'||T.ORDER_SEQ AS ORDER_SEQ_NO,
       T.OUTSTOCK_DOC,
       T.OUTSTOCK_TYPE_NAME,
       T.JUDGE_STOVE_NO,
       T.BATCH_NO,
       T.BATCH_GROUD_NO,
       T.PRODUCNAME,
       T.STD_NAME,
       T.GRADENAME,
       T.STEELNAME,
       T.STD_STYLE_DESC,
       T.SPEC_NAME,
       T.MODEL_DESC,
       T.ACT_DIMATER,
       T.ACT_HEIGHT,
       SUM(T.ACT_LEN) AS ACT_LEN,
       T.ACT_LEN_MIN,
       T.ACT_LEN_MAX,
       SUM(T.ACT_COUNT) AS ACT_COUNT,
       SUM(T.ACT_WEIGHT) AS ACT_WEIGHT,
       SUM(T.ACT_THEORY_WEIGHT) AS ACT_THEORY_WEIGHT,
       T.BELONG_NAME,
       (SELECT S.STORAGE_NAME FROM YDM_BS_STORAGE S WHERE S.STORAGE_NO=T.STORAGE_NO) AS STORAGE_NO,
       (SELECT W.STORAGE_NAME FROM YDM_BS_STORAGE W WHERE W.STORAGE_NO=T.TAR_STORAGE_NO) AS TAR_STORAGE_NO,
       DECODE(T.TAR_REC_FLAG,'0','未接收','1','已接收') AS TAR_REC_FLAG,
       TO_CHAR(T.INSTOCK_TIME, 'YYYY-MM-DD HH24:MI:SS') INSTOCK_TIME,
       TO_CHAR(T.OUTSTOCK_TIME, 'YYYY-MM-DD HH24:MI:SS') OUTSTOCK_TIME,
       T.CREATE_NAME,
       TO_CHAR(T.CREATE_TIME, 'YYYY-MM-DD HH24:MI:SS') CREATE_TIME,
       T.ORD_LN_DLY_PK,
       T.ORDER_NO,
       T.ORDER_SEQ,
       T.DELIVERY_NO,
       T.M_BILL_NO
  FROM YDM_ZC_OUTLIST T
 WHERE T.M_BILL_NO = ?
 AND T.OUTSTOCK_TYPE_CODE = '800807'
 GROUP BY T.OUTSTOCK_DOC,
          T.OUTSTOCK_TYPE_NAME,
          T.JUDGE_STOVE_NO,
          T.BATCH_NO,
          T.BATCH_GROUD_NO,
          T.PRODUCNAME,
          T.STD_NAME,
          T.GRADENAME,
          T.STEELNAME,
          T.STD_STYLE_DESC,
          T.SPEC_NAME,
          T.MODEL_DESC,
          T.ACT_DIMATER,
          T.ACT_HEIGHT,
          T.ACT_LEN_MIN,
          T.ACT_LEN_MAX,
          T.BELONG_NAME,
          T.STORAGE_NO,
          T.TAR_STORAGE_NO,
          T.TAR_REC_FLAG,
          T.INSTOCK_TIME,
          T.OUTSTOCK_TIME,
          T.CREATE_NAME,
          T.CREATE_TIME,
          T.ORD_LN_DLY_PK,
          T.ORDER_NO,
          T.ORDER_SEQ,
          T.DELIVERY_NO,
          T.M_BILL_NO
  ORDER BY T.OUTSTOCK_DOC ASC
]]>
	</query>
	<query id="FrmPuorLib.queryOutPZ" desc="装车皮倒库查询">
<![CDATA[
SELECT T.ORDER_NO||'/'||T.ORDER_SEQ AS ORDER_SEQ_NO,
       T.OUTSTOCK_DOC,
       T.OUTSTOCK_TYPE_NAME,
       T.JUDGE_STOVE_NO,
       T.BATCH_NO,
       T.GROUD_NO AS BATCH_GROUD_NO,
       T.PRODUCNAME,
       T.JUDGE_STD_NAME AS STD_NAME,
       T.JUDGE_GRADENAME AS GRADENAME,
       T.SPEC_NAME,
       T.ACT_DIMATER,
       T.ACT_HEIGHT,
       SUM(T.ACT_LEN) AS ACT_LEN,
       T.ACT_LEN_MIN,
       T.ACT_LEN_MAX,
       SUM(T.ACT_COUNT) AS ACT_COUNT,
       SUM(T.ACT_WEIGHT) AS ACT_WEIGHT,
       SUM(T.ACT_THEORY_WEIGHT) AS ACT_THEORY_WEIGHT,
       T.BELONG_NAME,
       (SELECT S.STORAGE_NAME FROM YDM_BS_STORAGE S WHERE S.STORAGE_NO=T.STORAGE_NO) AS STORAGE_NO,
       (SELECT W.STORAGE_NAME FROM YDM_BS_STORAGE W WHERE W.STORAGE_NO=T.TAR_STORAGE_NO) AS TAR_STORAGE_NO,
       DECODE(T.TAR_REC_FLAG,'0','未接收','1','已接收') AS TAR_REC_FLAG,
       TO_CHAR(T.INSTOCK_TIME, 'YYYY-MM-DD HH24:MI:SS') INSTOCK_TIME,
       TO_CHAR(T.OUTSTOCK_TIME, 'YYYY-MM-DD HH24:MI:SS') OUTSTOCK_TIME,
       T.CREATE_NAME,
       TO_CHAR(T.CREATE_TIME, 'YYYY-MM-DD HH24:MI:SS') CREATE_TIME,
       T.ORD_LN_DLY_PK,
       T.ORDER_NO,
       T.ORDER_SEQ,
       T.ORDER_SEQ_NO AS DELIVERY_NO,
       T.M_BILL_NO
  FROM YMD_GP_OUTLIST T
 WHERE T.M_BILL_NO = ?
 AND T.OUTSTOCK_TYPE_CODE = '800807'
 GROUP BY T.OUTSTOCK_DOC,
          T.OUTSTOCK_TYPE_NAME,
          T.JUDGE_STOVE_NO,
          T.BATCH_NO,
          T.GROUD_NO,
          T.PRODUCNAME,
          T.JUDGE_STD_NAME,
          T.JUDGE_GRADENAME,
          T.SPEC_NAME,
          T.ACT_DIMATER,
          T.ACT_HEIGHT,
          T.ACT_LEN_MIN,
          T.ACT_LEN_MAX,
          T.BELONG_NAME,
          T.STORAGE_NO,
          T.TAR_STORAGE_NO,
          T.TAR_REC_FLAG,
          T.INSTOCK_TIME,
          T.OUTSTOCK_TIME,
          T.CREATE_NAME,
          T.CREATE_TIME,
          T.ORD_LN_DLY_PK,
          T.ORDER_NO,
          T.ORDER_SEQ,
          T.ORDER_SEQ_NO,
          T.M_BILL_NO
  ORDER BY T.OUTSTOCK_DOC ASC
]]>
	</query>
	<query id="FrmPuorLib.INSERTOUT" 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,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="FrmPuorLib.INSERTOUTPZ" desc="插入装车皮倒库记录(坯子)">
<![CDATA[
INSERT INTO ymd_gp_outlist (OUTSTOCK_SQE, OUTSTOCK_DOC, 
		OUTSTOCK_TYPE_CODE, OUTSTOCK_TYPE_NAME, VEHICLE_NO, MAT_NO, LOT_NO, STOVE_NO, 
    JUDGE_STOVE_NO, BATCH_NO, GROUD_NO, MATERIAL_NO, MATERIAL_NAME, 
    PRODUCCODE, PRODUCNAME, JUDGE_STD_CODE, JUDGE_STD_NAME, JUDGE_GRADECODE, JUDGE_GRADENAME,  SPEC_CODE, SPEC_NAME, 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,ORDER_SEQ_NO,DEPARTMENT_CODE,DEPARTMENT_DESC,
    BELONG_CODE,BELONG_NAME,BAL_YEAR_MONTH,PRODUCT_FLAG,MAT_STATUS,M_BILL_NO,TAR_STORAGE_NO,ACT_FIX_NUM,ACT_FIX_LEN) 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'), ?, ?, ?,?,?,?,?,?,?,?,?,?,?,?,?,TO_NUMBER(?),TO_NUMBER(?))
]]>
	</query>
	<query id="FrmPuorLib.UPDATEBILLC" desc="修改提单装车皮倒库标志">
<![CDATA[
UPDATE YDM_ZC_BILL_C 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="FrmPuorLib.qureyBillC" desc="查询需要装车皮倒库的炉号信息">
<![CDATA[
SELECT T.BILL_NO,
       T.ORDER_NO,
       T.ORDER_SEQ,
       T.DELIVERY_NO,
       T.MAT_NO,
       T.LOT_NO,
       T.JUDGE_STOVE_NO,
       T.BATCH_NO,
       T.GROUP_NO AS BATCH_GROUD_NO,
       T.STOVE_NO,
       T.MATERIAL_NO,
       T.MATERIAL_NAME,
       T.PRODUCCODE,
       T.PRODUCNAME,
       T.STD_CODE,
       T.STD_NAME,
       T.GRADECODE,
       T.GRADENAME,
       T.STEELCODE,
       T.STEELNAME,
       T.STD_STYLE,
       T.STD_STYLE_DESC,
       T.SPEC_CODE,
       T.SPEC_NAME,
       T.MODEL_CODE,
       T.MODEL_DESC,
       T.PLINE_CODE,
       T.PLINE_NAME,
       T.ACT_DIMATER,
       T.ACT_HEIGHT,
       T.ACT_LEN,
       T.ACT_LEN_MIN,
       T.ACT_LEN_MAX,
       T.ACT_COUNT,
       T.ACT_WEIGHT,
       T.ACT_THEORY_WEIGHT,
       T.JUDGE_RESULT_CODE,
       T.PRO_BC,
       T.PRO_BZ,
       T.RPO_TIME,
       T.STORAGE_NO,
       T.LOCATION_NO,
       T.ORD_PK,
       T.ORD_LN_PK,
       T.ORD_LN_DLY_PK,
       T.VSTEL,
       T.VSTEL_DESC,
       M.SALE_ORG AS BELONG_CODE,
       M.SALE_ORG_DESC AS BELONG_NAME,
       T.ACT_FIX_NUM,
       T.ACT_FIX_LEN
  FROM YDM_ZC_BILL_C T ,YDM_ZC_BILL_M M
  WHERE T.BILL_NO=M.BILL_NO
  AND T.ORD_LN_DLY_PK=M.ORD_LN_DLY_PK
  AND 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="FrmPuorLib.queryStorage" desc="查询仓库信息">
<![CDATA[
SELECT T.STORAGE_NO,
       T.STORAGE_NAME,
       T.STORAGE_ATTR,
       T.STORAGE_ADDR_NO,
       T.STORAGE_ADDR_NAME,
       T.STORAGE_TYPE_NO,
       T.STORAGE_TYPE_NAME,
       T.STORAGE_ATTR_NAME,
       L.LOCATION_NO,
       L.LAY_MAX_NUM,
       L.COL_MAX_NUM
  FROM YDM_BS_STORAGE T ,YDM_BS_LOCATION L
  WHERE L.STORAGE_NO=T.STORAGE_NO
  AND T.STORAGE_NO=?
  AND L.LOCATION_NO=?
]]>
	</query>
	<query id="FrmPuorLib.deleteOut" desc="删除装车皮倒库数据">
<![CDATA[
DELETE YDM_ZC_OUTLIST 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="FrmPuorLib.deleteOutPz" desc="删除装车皮倒库数据(坯子)">
<![CDATA[
DELETE YMD_GP_OUTLIST T WHERE T.M_BILL_NO=? 
AND T.JUDGE_STOVE_NO=? 
AND NVL(T.BATCH_NO,'/')=NVL(?,'/')
AND T.GROUD_NO=? 
AND T.ORD_LN_DLY_PK=? 
AND T.OUTSTOCK_TYPE_CODE='800807'
]]>
	</query>
	<query id="FrmPuorLib.queryFlag" desc="查询提单是否装车皮">
<![CDATA[
SELECT  T.MOVE_LOAD_FLAG FROM YDM_ZC_BILL_C  T WHERE T.BILL_NO=?
AND  T.JUDGE_STOVE_NO=?
AND  NVL(T.BATCH_NO,'/')=NVL(?,'/')
AND  T.GROUP_NO=?
AND  T.ORD_LN_DLY_PK=? 
GROUP BY T.MOVE_LOAD_FLAG
]]>
	</query>
	<query id="FrmPuorLib.queryOutFlag" desc="查询倒库接收标志">
<![CDATA[
SELECT T.TAR_REC_FLAG
  FROM YDM_ZC_OUTLIST 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'
 GROUP BY T.TAR_REC_FLAG
]]>
	</query>
		<query id="FrmPuorLib.queryOutFlagPZ" desc="查询倒库接收标志(坯子)">
<![CDATA[
SELECT T.TAR_REC_FLAG
  FROM YMD_GP_OUTLIST T
 WHERE T.M_BILL_NO = ?
   AND T.JUDGE_STOVE_NO = ?
   AND NVL(T.BATCH_NO,'/')=NVL(?,'/')
   AND T.GROUD_NO = ?
   AND T.ORD_LN_DLY_PK = ?
   AND T.OUTSTOCK_TYPE_CODE = '800807'
 GROUP BY T.TAR_REC_FLAG
]]>
	</query>
	<query id="FrmPuorLib.qureyOutMatNo" desc="查询倒库信息">
<![CDATA[
SELECT 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,
       ORD_PK,
       ORD_LN_PK,
       ORD_LN_DLY_PK,
       ORDER_NO,
       ORDER_SEQ,
       DELIVERY_NO,
       PRODUCT_FLAG,
       MAT_STATUS,
       JUDGE_STD_NAME,
       JUDGE_STD_CODE,
       BAL_YEAR_MONTH,
       M_BILL_NO
  FROM YDM_ZC_OUTLIST
  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="FrmPuorLib.qureyOutMatNoPz" desc="查询倒库信息（坯子）">
<![CDATA[
SELECT MAT_NO,
       LOT_NO,
       STOVE_NO,
       JUDGE_STOVE_NO,
       BATCH_NO,
       GROUD_NO AS BATCH_GROUD_NO,
       MATERIAL_NO,
       MATERIAL_NAME,
       PRODUCCODE,
       PRODUCNAME,
       JUDGE_GRADECODE AS GRADECODE,
       JUDGE_GRADENAME AS   GRADENAME,       
       SPEC_CODE,
       SPEC_NAME,      
       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,
       ORD_PK,
       ORD_LN_PK,
       ORD_LN_DLY_PK,
       ORDER_NO,
       ORDER_SEQ,
       ORDER_SEQ_NO AS DELIVERY_NO,
       PRODUCT_FLAG,
       MAT_STATUS,
       JUDGE_STD_NAME AS STD_NAME,
       JUDGE_STD_CODE AS STD_CODE,
       BAL_YEAR_MONTH,
       M_BILL_NO,
       ACT_FIX_NUM,
       ACT_FIX_LEN
  FROM YMD_GP_OUTLIST
 WHERE  M_BILL_NO=?
  AND JUDGE_STOVE_NO=?
  AND NVL(BATCH_NO,'/')=NVL(?,'/')
  AND GROUD_NO=?
  AND ORD_LN_DLY_PK=?
  AND  OUTSTOCK_TYPE_CODE = '800807'
]]>
	</query>
	<query id="FrmPuorLib.UPDATEOut" desc=" 修改装车皮倒库接收标志">
<![CDATA[
UPDATE YDM_ZC_OUTLIST 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="FrmPuorLib.UPDATEOutPZ" desc=" 修改装车皮倒库接收标志(坯子)">
<![CDATA[
UPDATE ymd_gp_outlist T
   SET TAR_LOCATION_NO       = ?,
       TAR_LARY_NO           = ?,
       TAR_LOC_NO            = ?,
       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 GROUD_NO = ?
   AND ORD_LN_DLY_PK = ?
   AND OUTSTOCK_TYPE_CODE ='800807'
]]>
	</query>
	<query id="FrmPuorLib.QUERYInMax" desc="获取最大入库单号">
<![CDATA[
 SELECT MAX(INSTOCK_DOC) AS INSTOCK_DOC
   FROM YDM_ZC_INLIST
  WHERE INSTOCK_TYPE_CODE = ?
     AND TRUNC(CREATE_TIME)= TO_DATE(?,'YYYY-MM-DD'）
    ]]>
	</query>
	<query id="FrmPuorLib.QUERYInMaxPz" desc="获取最大入库单号">
<![CDATA[
 SELECT MAX(INSTOCK_DOC) AS INSTOCK_DOC
   FROM YMD_GP_INLIST
  WHERE INSTOCK_TYPE_CODE = ?
    AND CREATE_TIME LIKE '%' || TO_DATE(?, 'YYYY-MM-DD') || '%'
    ]]>
	</query>
	<query id="FrmPuorLib.QUERYInSeq" desc="查询入库流水号">
	<![CDATA[
      SELECT ? ||
         LPAD(SUBSTR(NVL(MAX(T.INSTOCK_SQE), '0000'), -4, 4) + 1, 4, '0') AS INSTOCK_SQE
    FROM YDM_ZC_INLIST T
   WHERE T.CREATE_TIME LIKE '%' || TO_DATE(?, 'YYYY-MM-DD') || '%'
     AND T.INSTOCK_TYPE_CODE =?
     AND T.INSTOCK_DOC = ?
	]]>
	</query>
	<query id="FrmPuorLib.QUERYInSeqPz" desc="查询入库流水号(坯子)">
	<![CDATA[
      SELECT ? ||
         LPAD(SUBSTR(NVL(MAX(T.INSTOCK_SQE), '0000'), -4, 4) + 1, 4, '0') AS INSTOCK_SQE
    FROM YMD_GP_INLIST T
   WHERE T.CREATE_TIME LIKE '%' || TO_DATE(?, 'YYYY-MM-DD') || '%'
     AND T.INSTOCK_TYPE_CODE =?
     AND T.INSTOCK_DOC = ?
	]]>
	</query>
	<query id="FrmPuorLib.INSERTIn" desc="新增装车皮入库">
	<![CDATA[
INSERT INTO YDM_ZC_INLIST (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="FrmPuorLib.INSERTInPz" desc="新增装车皮入库(坯子)">
	<![CDATA[
INSERT INTO Ymd_Gp_Inlist (INSTOCK_SQE, INSTOCK_DOC, INSTOCK_TYPE_CODE, 
INSTOCK_TYPE_NAME, VEHICLE_NO, MAT_NO, LOT_NO, STOVE_NO, JUDGE_STOVE_NO, 
BATCH_NO, GROUD_NO, MATERIAL_NO, MATERIAL_NAME, PRODUCCODE, PRODUCNAME, 
JUDGE_STD_CODE, JUDGE_STD_NAME, JUDGE_GRADECODE, JUDGE_GRADENAME, SPEC_CODE, SPEC_NAME, 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, 
ORDER_SEQ_NO, PRODUCT_FLAG, MAT_STATUS, 
BAL_YEAR_MONTH, M_BILL_NO,ACT_FIX_NUM,ACT_FIX_LEN) 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'), ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?,TO_NUMBER(?),TO_NUMBER(?))
	]]>
	</query>
	<query id="FrmPuorLib.queryIn" desc="查询入库信息">
	<![CDATA[
	SELECT T.INSTOCK_DOC,
       T.INSTOCK_TYPE_NAME,
       T.JUDGE_STOVE_NO,
       T.BATCH_NO,
       T.BATCH_GROUD_NO,
       T.MATERIAL_NAME,
       T.PRODUCNAME,
       T.STD_NAME,
       T.GRADENAME,
       T.STEELNAME,
       T.STD_STYLE_DESC,
       T.SPEC_NAME,
       T.MODEL_DESC,
       T.PLINE_NAME,
       NVL(SUM(T.ACT_LEN), 0) AS ACT_LEN,
       T.ACT_LEN_MIN,
       T.ACT_LEN_MAX,
       NVL(SUM(T.ACT_COUNT), 0) AS ACT_COUNT,
       NVL(SUM(T.ACT_WEIGHT), 0) AS ACT_WEIGHT,
       NVL(SUM(T.ACT_THEORY_WEIGHT), 0) AS ACT_THEORY_WEIGHT,
       T.BELONG_NAME,
      (SELECT S.STORAGE_NAME FROM YDM_BS_STORAGE S WHERE S.STORAGE_NO=T.STORAGE_NO) AS STORAGE_NO,
       TO_CHAR(T.INSTOCK_TIME, 'YYYY-MM-DD HH24:MI:SS') AS INSTOCK_TIME,
       T.CREATE_NAME,
       TO_CHAR(T.CREATE_TIME, 'YYYY-MM-DD HH24:MI:SS') AS CREATE_TIME,
       T.ORD_LN_DLY_PK,
       T.ORDER_NO||'/'||T.ORDER_SEQ AS ORDER_SEQ_NO,
       T.ORDER_NO,
       T.ORDER_SEQ,
       T.DELIVERY_NO,
       T.M_BILL_NO
  FROM YDM_ZC_INLIST T
 WHERE T.M_BILL_NO = ?
   AND T.INSTOCK_TYPE_CODE = '800705'
 GROUP BY T.INSTOCK_DOC,
          T.INSTOCK_TYPE_NAME,
          T.JUDGE_STOVE_NO,
          T.BATCH_NO,
          T.BATCH_GROUD_NO,
          T.MATERIAL_NAME,
          T.PRODUCNAME,
          T.STD_NAME,
          T.GRADENAME,
          T.STEELNAME,
          T.STD_STYLE_DESC,
          T.SPEC_NAME,
          T.MODEL_DESC,
          T.PLINE_NAME,
          T.ACT_LEN_MIN,
          T.ACT_LEN_MAX,
          T.BELONG_NAME,
          T.STORAGE_NO,
          T.INSTOCK_TIME,
          T.CREATE_NAME,
          T.CREATE_TIME,
          T.ORD_LN_DLY_PK,
          T.ORDER_NO,
          T.ORDER_SEQ,
          T.DELIVERY_NO,
          T.M_BILL_NO
 ORDER BY T.INSTOCK_DOC ASC
    ]]>
	</query>
	<query id="FrmPuorLib.queryInPZ" desc="查询入库信息">
	<![CDATA[
	SELECT T.INSTOCK_DOC,
       T.INSTOCK_TYPE_NAME,
       T.JUDGE_STOVE_NO,
       T.BATCH_NO,
       T.GROUD_NO AS BATCH_GROUD_NO,
       T.MATERIAL_NAME,
       T.PRODUCNAME,
       T.JUDGE_STD_NAME AS STD_NAME,
       T.JUDGE_GRADENAME AS GRADENAME,
       T.SPEC_NAME,
       T.PLINE_NAME,
       NVL(SUM(T.ACT_LEN), 0) AS ACT_LEN,
       T.ACT_LEN_MIN,
       T.ACT_LEN_MAX,
       NVL(SUM(T.ACT_COUNT), 0) AS ACT_COUNT,
       NVL(SUM(T.ACT_WEIGHT), 0) AS ACT_WEIGHT,
       NVL(SUM(T.ACT_THEORY_WEIGHT), 0) AS ACT_THEORY_WEIGHT,
       T.BELONG_NAME,
      (SELECT S.STORAGE_NAME FROM YDM_BS_STORAGE S WHERE S.STORAGE_NO=T.STORAGE_NO) AS STORAGE_NO,
       TO_CHAR(T.INSTOCK_TIME, 'YYYY-MM-DD HH24:MI:SS') AS INSTOCK_TIME,
       T.CREATE_NAME,
       TO_CHAR(T.CREATE_TIME, 'YYYY-MM-DD HH24:MI:SS') AS CREATE_TIME,
       T.ORD_LN_DLY_PK,
       T.ORDER_NO||'/'||T.ORDER_SEQ AS ORDER_SEQ_NO,
       T.ORDER_NO,
       T.ORDER_SEQ,
       T.ORDER_SEQ_NO AS DELIVERY_NO,
       T.M_BILL_NO
  FROM YMD_GP_INLIST T
 WHERE T.M_BILL_NO = ?
   AND T.INSTOCK_TYPE_CODE = '800705'
 GROUP BY T.INSTOCK_DOC,
          T.INSTOCK_TYPE_NAME,
          T.JUDGE_STOVE_NO,
          T.BATCH_NO,
          T.GROUD_NO,
          T.MATERIAL_NAME,
          T.PRODUCNAME,
          T.JUDGE_STD_NAME,
          T.JUDGE_GRADENAME,
          T.SPEC_NAME,
          T.PLINE_NAME,
          T.ACT_LEN_MIN,
          T.ACT_LEN_MAX,
          T.BELONG_NAME,
          T.STORAGE_NO,
          T.INSTOCK_TIME,
          T.CREATE_NAME,
          T.CREATE_TIME,
          T.ORD_LN_DLY_PK,
          T.ORDER_NO,
          T.ORDER_SEQ,
          T.ORDER_SEQ_NO,
          T.M_BILL_NO
 ORDER BY T.INSTOCK_DOC ASC
    ]]>
	</query>
		<query id="FrmPuorLib.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="FrmPuorLib.deleteInPz" desc="删除入库记录(坯子)">
	<![CDATA[
DELETE ymd_gp_inlist T
 WHERE T.M_BILL_NO = ?
   AND T.JUDGE_STOVE_NO = ?
   AND NVL(T.BATCH_NO,'/')=NVL(?,'/')
   AND T.GROUD_NO = ?
   AND T.ORD_LN_DLY_PK = ?
   AND T.INSTOCK_TYPE_CODE = '800705'
	]]>
	</query>
		<query id="FrmPuorLib.UPDATEOutFalg" desc="修改装车皮倒库接收标志">
	<![CDATA[
UPDATE YDM_ZC_OUTLIST T
   SET TAR_REC_FLAG = '0'    
 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="FrmPuorLib.UPDATEOutFalgPz" desc="修改装车皮倒库接收标志(坯子)">
	<![CDATA[
UPDATE YMD_GP_OUTLIST T
   SET TAR_REC_FLAG = '0'    
 WHERE M_BILL_NO = ?
   AND JUDGE_STOVE_NO = ?
   AND NVL(BATCH_NO,'/')=NVL(?,'/')
   AND GROUD_NO = ?
   AND ORD_LN_DLY_PK = ?
   AND OUTSTOCK_TYPE_CODE ='800807'
	]]>
	</query>
	<query id="FrmPuorLib.queryOutListPZ" desc="查询出库单号(坯子)">
	<![CDATA[
    SELECT MAX(OUTSTOCK_DOC) AS OUTSTOCK_DOC
    FROM YMD_GP_OUTLIST
   WHERE OUTSTOCK_TYPE_CODE = ?
    AND TO_CHAR(CREATE_TIME,'YYYY-MM-DD') =?
	]]>
	</query>
	<query id="FrmPuorLib.queryOutPz" desc="查询出库流水号(坯子)">
	<![CDATA[
   SELECT ? ||
         LPAD(SUBSTR(NVL(MAX(T.OUTSTOCK_SQE), '0000'), -4, 4) + 1, 4, '0') AS OUTSTOCK_SQE
    FROM YMD_GP_OUTLIST T
   WHERE TO_CHAR(T.CREATE_TIME,'YYYY-MM-DD') =?
     AND T.OUTSTOCK_TYPE_CODE =?
     AND T.OUTSTOCK_DOC = ?
	]]>
	</query>
</queryMap>
	