<?xml version="1.0" encoding="UTF-8"?>
<queryMap desc="镦拔扩热扩实绩">

	<query id="FrmVrpMil.ReturnVrpColdingD1Result" desc="删除热扩从表实绩">
		<![CDATA[	
DELETE vrp_hotexp_face_D
 WHERE RESULT_NO = ?  AND  M_RESULT_NO=?
		]]>
	</query>

	<query id="FrmVrpMil.AddVrpReKuo" desc="判断是否有热扩轧实绩">
        <![CDATA[
 INSERT INTO VRP_HOTEXP_FACE_M
  (RESULT_NO,
   HEAT_PLAN_NO,
   ZY_BATCH_ID,
   PRO_PLAN_ID,
   GX_PLAN_NO,
   PLINE_CODE,
   PLINE_NAME,
   SIZE_D,
   SIZE_S,
   SIZE_W,
   SIZE_L,
   PRO_NUM,
   PRO_WT,
   ACC_NUM,
   ACC_WT,
   FAIL_NUM,
   FAIL_WT,
   OFFLINE_NUM,
   OFFLINE_WT,
   RE_NUM,
   RE_WT,
   MONITORDEMAND,
   IF_MONITOR_DBK,
   PRODUCER,
   PRDCR_NO,
   PRODUCER_TIME,
   LOAD_TIME,
   LOAD_SHIFT,
   LOAD_GROUP,
   LOAD_USER,
   COL_MODE,
   CREATE_TIME)
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="FrmVrpMil.doQueryInList" desc="查询入库实绩">
        <![CDATA[
  SELECT T.INSTOCK_DOC,
  		T.ORDER_NO,
  		T.ORDER_SEQ,
  		T.ORD_LN_DLY_PK,
  		T.JUDGE_STOVE_NO,
  		T.BATCH_NO,
  		T.BATCH_GROUD_NO,
  		T.PRODUCNAME,
  		T.STD_STYLE_DESC,
  		T.STEELNAME,
  		T.SPEC_NAME,
  		T.MODEL_DESC,
  		T.JUDGE_STD_CODE,
  		T.STD_NAME,
  		T.GRADENAME,
  		T.ACT_DIMATER,
  		T.ACT_HEIGHT,
  		T.ACT_LEN_MAX,
  		T.ACT_LEN_MIN,
  		SUM(T.ACT_LEN) ACT_LEN,
  		SUM(T.ACT_COUNT) ACT_COUNT,
  		SUM(T.ACT_WEIGHT) ACT_WEIGHT,
  		T.STORAGE_ATTR_NAME,
  		T.PLINE_NAME,
  		DECODE(T.PRODUCT_FLAG,'801401','在制品','801402','成品','801403','商品')PRODUCT_FLAG,
  		T.PIPMEMO,
  		T.BAL_YEAR_MONTH,
  		T.CREATE_NAME,
  		TO_CHAR(T.CREATE_TIME, 'YYYY-MM-DD HH24:MI:SS') CREATE_TIME,
  		TO_CHAR(T.INSTOCK_TIME, 'YYYY-MM-DD HH24:MI:SS') INSTOCK_TIME
  FROM YDM_ZC_INLIST T
  WHERE PLINE_NAME='720旋扩'
        ]]>
	</query>

	<query id="FrmVrpMil.doQuery" desc="查询镦拔扩计划表">
        <![CDATA[
		SELECT T.HEAT_PLAN_NO,
       T.ZY_BATCH_ID,
       T.PROD_INDEX,
       T.PRO_PLAN_ID,
       T.GX_PLAN_NO,
       T.PLINE_CODE,
       T.PLINE_NAME,
       T.ZG_HEAT_PLAN_NO,
       T.HEATNO_LAST,
       T.ZG_BATCH_NO,
       T.ISENDGX,
       T.ORDER_SOURCE,
       T.ORD_LN_DLY_PK,
       T.ORDER_NO,
       T.ORDER_SEQ,
       T.DELIVERY_NO,
       T.REQ_BL_ID,
       T.GRADECODE,
       T.GRADENAME,
       T.AIMOUTDIAMETER,
       T.AIMWALLTHICK,
       T.AIMLENGTH,
       T.OUTDIAMETER_IN,
       T.WALLTHICK_IN,
       T.LENGTH_IN,
       T.LENGTHMAX_IN,
       T.LENGTHMIN_IN,
       T.LEN_CUTHEAD,
       T.LEN_CUTEND,
       T.INWL_ID,
       T.INWL_DESC,
       T.IN_WT,
       T.IN_NUM,
       T.IF_WL_MATCHED,
       T.OUTWL_ID,
       T.OUTWL_DESC,
       T.OUT_WT,
       T.OUT_NUM,
       T.IF_MONITOR_DBK,
       T.PRDCR_NO,
       T.MONITOR_POINT,
       T.CRAFT_FILE_NO,
       T.CRAFT_FILE_MAN,
       T.CRAFT_SEQ,
       T.STATION_ROAD,
       T.PLANSTATUS,
       T.IN_WT_REAL,
       T.IN_NUM_REAL,
       T.OUT_WT_REAL,
       T.OUT_NUM_REAL,
       T.CREATE_NAME,
       TO_CHAR(T.CREATE_TIME, 'YYYY-MM-DD HH24:MI:SS') CREATE_TIME,
       T.UPDATE_NAME,
       TO_CHAR(T.UPDATE_TIME, 'YYYY-MM-DD HH24:MI:SS') UPDATE_TIME,
       T.BATCH_GROUD_NO
  FROM PLN_ZY_DBK_M T
		WHERE T.HEAT_PLAN_NO=?
        ]]>
	</query>
	<query id="FrmVrpMil.queryMatNoM" desc="自动生存材料号">
		<![CDATA[
	 SELECT T.MAT_NO FROM MAT_ZC_M T WHERE T.JUDGE_STOVE_NO=? AND T.BATCH_NO=? ORDER BY T.MAT_NO DESC
		]]>
	</query>
	<query id="FrmVrpMil.doPipe1" desc="插入（成品下的废品）">
<![CDATA[
INSERT INTO MAT_ZC_M
  (MAT_NO,
   PRODUCT_FLAG,
   MAT_STATUS,
   JUDGE_STOVE_NO,
   BATCH_NO,
   BATCH_GROUD_NO,
   MATERIAL_NO,
   MATERIAL_NAME,
   INPUT_MATERIAL_NAME,
   INPUT_MATERIAL_NO,
   GRADECODE,
   GRADENAME,
   MODEL_CODE,
   MODEL_DESC,
   ORDER_NO,
   ORDER_SEQ,
   CRAF_NO,
   PROCESS_CDOE,
   PROCESS_DESC,
   PLINE_CODE,
   PLINE_NAME,
   MAT_ORIGIN_CODE,
   MAT_ORIGIN_NAME,
   TARG_DIMATER,
   TARG_HEIGHT,
   ACT_DIMATER,
   ACT_HEIGHT,
   ACT_LEN,
   ACT_LEN_MIN,
   ACT_LEN_MAX,
   ACT_COUNT,
   ACT_WEIGHT,
   ACT_THEORY_WEIGHT,
   MEMO,
   CREATE_NAME,
   CREATE_TIME,
   ORD_LN_DLY_PK,
   PRO_NO,
   HEAT_PLAN_NO,
   GX_PLAN_NO)
VALUES
  (?,
   ?,   
   ?,
   ?,
   ?,
   ?,
   ?,
   ?,
   ?,
   ?,
   ?,
   ?,
   ?,
   ?,
   ?,
   ?,
   ?,
   ?,
   ?,
   ?,
   ?,
   ?,
   ?,
   ?,
   ?,
   ?,
   ?,
   ?,
   ?,
   ?,
   ?,
   ?,
   ?,
   ?,
   ?,
   TO_DATE(?, 'YYYY-MM-DD HH24:MI:SS'),
   ?,
   ?,
   ?,
   ?)

]]>
	</query>
	<query id="FrmVrpMil.doPipe2" desc="插入（成品下的废品）">
<![CDATA[
INSERT INTO YDM_ZC_BUTTRESS
  (MAT_NO,
   JUDGE_STOVE_NO,
   BATCH_NO,
   BATCH_GROUD_NO,
   STORAGE_NO,
   LOCATION_NO,
   LARY_NO,
   LOC_NO,
   STORAGE_ATTR,
   STORAGE_ATTR_NAME,
   STORAGE_TYPE_NO,
   STORAGE_TYPE_NAME,
   MANAGEMENT_NO,
   MANAGEMENT_NAME,
   MEMO,
   CREATE_NAME,
   CREATE_TIME,
   DEPARTMENT_CODE,
   DEPARTMENT_DESC)
VALUES
  (?,
   ?,
   ?,
   ?,
   ?,
   ?,
   ?,
   ?,
   ?,
   ?,
   ?,
   ?,
   ?,
   ?,
   ?,
   ?,
   TO_DATE(?, 'YYYY-MM-DD HH24:MI:SS'),
   ?,
   ?)
]]>
	</query>
	<query id="FrmVrpMil.doPipe3" desc="插入（成品下的废品）">
<![CDATA[
INSERT INTO YDM_ZC_INLIST
  (INSTOCK_SQE,
   INSTOCK_DOC,
   INSTOCK_TYPE_CODE,
   INSTOCK_TYPE_NAME,
   INSTOCK_BAR_CODE,
   MAT_NO,
   LOT_NO,
   STOVE_NO,
   JUDGE_STOVE_NO,
   BATCH_NO,
   BATCH_GROUD_NO,
   MATERIAL_NO,
   MATERIAL_NAME,
   GRADECODE,
   GRADENAME,
   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, 
   STORAGE_ATTR,
   STORAGE_ATTR_NAME,
   STORAGE_TYPE_NO,
   STORAGE_TYPE_NAME,
   IN_BC,
   IN_BZ,
   CREATE_NAME,
   CREATE_TIME,
 
   ORD_LN_DLY_PK,
   DEPARTMENT_CODE,
   DEPARTMENT_DESC,
   ORDER_NO,
   ORDER_SEQ,
   DELIVERY_NO,
   PRODUCT_FLAG,
   MAT_STATUS,
   IN_TIME_F,
   BAL_YEAR_MONTH,
   AFFIRM_LOG,
   M_BILL_NO,
   ZG_STOVE_SQE)
VALUES
  (?,
   ?,
   ?,
   ?,
   ?,
   ?,
   ?,
   ?,
   ?,
   ?,
   ?,
   ?,
   ?,
   ?,
   ?,
   ?,
   ?,
   ?,
   ?,
   ?,
   ?,
   ?,
   ?,
   ?,   
   ?,
   ?,
   ?,
   ?,
   ?,
   ?,
   ?,
   ?,
   ?,
   ?,
   ?,
   TO_DATE(?, 'YYYY-MM-DD HH24:MI:SS'),
   ?,
   ?,
   ?,
   ?,
   ?,
   ?,
   ?,
   ?,
   TO_DATE(?, 'YYYY-MM-DD HH24:MI:SS'),
   ?,
   ?,
   ?,
   ?)

]]>
	</query>
	<query id="FrmVrpMil.cancelPipeIn" desc="撤销交库">
		DECLARE
		BEGIN
		DELETE FROM
		YDM_ZC_INLIST T WHERE T.INSTOCK_DOC = ? AND T.JUDGE_STOVE_NO = ?
		AND
		T.BATCH_NO=?AND T.BATCH_GROUD_NO = ?;
		DELETE FROM MAT_ZC_M T WHERE
		T.JUDGE_STOVE_NO = ? AND T.BATCH_NO = ? AND
		T.BATCH_GROUD_NO = ?;
		DELETE FROM YDM_ZC_BUTTRESS T WHERE T.JUDGE_STOVE_NO = ? AND
		T.BATCH_NO = ?
		AND T.BATCH_GROUD_NO = ?;
		END;
	</query>
	<query id="FrmVrpMil.doQueryInListbbbbbbbbbbbbb" desc="查询入库实绩">
<![CDATA[
 SELECT 
       t.INSTOCK_DOC,
       t.JUDGE_STOVE_NO,
       t.BATCH_NO,
       t.PRODUCCODE,
       t.PRODUCNAME,
       t.STD_CODE,
       t.STD_NAME,
       t.STEELCODE,
       t.STEELNAME,
       t.STD_STYLE,
       t.STD_STYLE_DESC,
       t.SPEC_CODE,
       t.SPEC_NAME,
       t.MODEL_CODE,
       t.MODEL_DESC,
       t.ACT_DIMATER,
       t.ACT_HEIGHT,
       to_char(t.ACT_LEN_MIN,'FM999990.00') AS ACT_LEN_MIN,
       to_char(t.ACT_LEN_MAX,'FM999990.00') AS ACT_LEN_MAX,
       --to_char(t.ACT_LEN_MIN,'FM999990.00')||'-'||to_char(t.ACT_LEN_MAX,'FM999990.00') as LEN,
       sum(t.ACT_COUNT) as ACT_COUNT,
       to_char(sum(t.ACT_WEIGHT),'FM999999990.000') as ACT_WEIGHT,
       sum(nvl(t.ACT_LEN,0)) as ACT_LEN,
       t.BELONG_CODE,
       t.BELONG_NAME,
       s.STORAGE_NAME AS STORAGE_NO,
       t.MEMO,
       t.CREATE_NAME,
       max(to_char(t.INSTOCK_TIME,'YYYY-MM-DD HH24:MI:SS')) as INSTOCK_TIME,
       max(to_char(t.IN_TIME_F,'YYYY-MM-DD')) AS IN_TIME_F,
       to_char(to_date(t.BAL_YEAR_MONTH,'YYYY-MM'),'yyyy-MM') as BAL_YEAR_MONTH,
       --t.BAL_YEAR_MONTH,
       t.ORDER_NO,
     t.ORDER_SEQ,
     t.DELIVERY_NO,
     t.JUDGE_STD_CODE,
     t.JUDGE_STD_NAME,
     t.PLINE_CODE,
     t.PLINE_NAME,
     t.GRADECODE,
     t.GRADENAME,
     t.MATERIAL_NO,
     t.MATERIAL_NAME,
     DECODE(t.PRODUCT_FLAG,'801401','在制品','801402','成品','801403','商品')PRODUCT_FLAG,
     t.MAT_STATUS,
     t.ZB_RCDID,
     --d.SALE_AREA_DESC,
       --d.create_name AS ordercreatename,
       t.PIPMEMO,
       t.BATCH_GROUD_NO,
       m.basename as GROUPNAME
 FROM YDM_ZC_INLIST t
  left join  ydm_bs_storage s
  on t.STORAGE_NO = s.STORAGE_NO
  --left join  SLM_ORDER_HEAD d on 
   --t.ord_pk = d.ord_pk
   left join (select m.pline_code,g.basename
  from com_base_pline m, com_base_info g
 where m.group_pay = g.basecode) m on m.pline_code = t.pline_code
 where t.INSTOCK_TYPE_CODE ='800701'
   AND t.JUDGE_STOVE_NO || '&' LIKE ('%' || upper(?) || '%')
   AND t.PLINE_CODE = ?
   AND t.HAND_FLAG = '0'
   ]]>
	</query>

	<query id="FrmVrpMil.doQueryStoreNo" desc="查询仓库信息">
		SELECT S.STORAGE_NO,
		S.STORAGE_TYPE_NO, S.STORAGE_TYPE_NAME
		FROM COM_BASE_PLINE T,
		YDM_BS_STORAGE S
		--WHERE T.DEPARTMENT_CODE = S.MANAGEMENT_NO
		WHERE
		T.PLINE_CODE = ?
	</query>
	<query id="FrmVrpMil.doQueryGoType" desc="查询去向">
		SELECT T.GO_TYPE FROM
		VRP_COM_INFO T WHERE T.ORDER_NO||'/'||T.ORDER_SEQ = ?
	</query>
	<query id="FrmVrpMil.doQueryQaStove" desc="查询表检炉批信息">
		SELECT
		T.JUDGE_STOVE_NO, T.LOT_NO
		FROM MIL_SURFACE_RESULT T
		WHERE
		T.JUDGE_STOVE_NO = ?
		AND T.PLINE_CODE = ?
		GROUP BY T.JUDGE_STOVE_NO,
		T.LOT_NO
	</query>


	<query id="FrmVrpMil.doQuerySingleJugStove" desc="投入产出">
        <![CDATA[
  SELECT T.BATCH_NO,
       T.JUDGE_STOVE_NO,
       T.PRO_PLAN_ID,
       T.ACT_MATERIAL_NAME,
       T.HEAT_PLAN_NO,
       SUM(NVL(FAIL_NUM, 0)) FAIL_NUM,
       (SELECT SUM(NVL(PRO_NUM, 0))
          FROM VRP_COM_INFO T1
         WHERE T1.JUDGE_STOVE_NO = T.JUDGE_STOVE_NO
              AND  T1.BATCH_NO = T.BATCH_NO
           AND T1.STATION_CODE = '406202') PRO_NUM
       FROM VRP_COM_INFO T    
       WHERE 1=1
        ]]>
	</query>

	<query id="FrmVrpMil.doPipe" 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_BASENAME       COM_BASE_INFO.BASENAME%TYPE := NULL;
  V_ICOUNT         NUMBER := 1;
  V_TIME           YDM_ZC_INLIST.CREATE_TIME%TYPE := SYSDATE;
  V_BATHYEAR       YDM_ZC_INLIST.BAL_YEAR_MONTH%TYPE := TO_CHAR(SYSDATE,'YYYYMM');
  V_BATCH_GROUD_NO MAT_ZC_M.BATCH_GROUD_NO%TYPE := NULL;
BEGIN
    INSERT INTO YDM_ZC_BUTTRESS
      (JUDGE_STOVE_NO,
       BATCH_NO,
       BATCH_GROUD_NO,
       STORAGE_NO,
       LOCATION_NO,
       STORAGE_TYPE_NO,
       STORAGE_TYPE_NAME,
       CREATE_NAME,
       MAT_NO,
       CREATE_TIME,
       MANAGEMENT_NO,
       MANAGEMENT_NAME,
       DEPARTMENT_CODE,
       DEPARTMENT_DESC)
    VALUES
      (?,
       ?,
       ?,
       ?,
       ?,
       ?,
       ?,
       ?,
       ?,
       V_TIME,
       ?,
       ?,
       ?,
       ?);
    INSERT INTO YDM_ZC_INLIST
      (MANAGEMENT_NO,
       MANAGEMENT_NAME,
       INSTOCK_SQE,
       INSTOCK_DOC,
       INSTOCK_TYPE_CODE,
       INSTOCK_TYPE_NAME,
       MAT_NO,
       LOT_NO,
       STOVE_NO,
       JUDGE_STOVE_NO,
       BATCH_NO,
       BATCH_GROUD_NO,
       PRODUCCODE,
       PRODUCNAME,
       STD_CODE,
       STD_NAME,
       STEELCODE,
       STEELNAME,
       STD_STYLE,
       STD_STYLE_DESC,
       SPEC_CODE,
       SPEC_NAME,
       MODEL_CODE,
       MODEL_DESC,
       ACT_DIMATER,
       ACT_HEIGHT,
       ACT_LEN_MIN,
       ACT_LEN_MAX,
       ACT_COUNT,
       ACT_WEIGHT,
       ACT_THEORY_WEIGHT,
       BELONG_CODE,
       BELONG_NAME,
       STORAGE_NO,
       MEMO,
       VALIDFLAG,
       CREATE_NAME,
       CREATE_TIME,
       ORDER_NO,
       ORDER_SEQ,
       DELIVERY_NO,
       ORD_PK,
       ORD_LN_PK,
       ORD_LN_DLY_PK,
       PRODUCT_FLAG,
       MAT_STATUS,
       INSTOCK_TIME,
       ZB_RCDID,
       ACT_LEN,
       DEPARTMENT_CODE,
       DEPARTMENT_DESC,
       JUDGE_STD_NAME,
       PLINE_CODE,
       PLINE_NAME,
       GRADECODE,
       GRADENAME,
       BAL_YEAR_MONTH,
       IN_TIME_F,
       PIPMEMO,
       MAT_ORIGIN_CODE,
       MAT_ORIGIN_NAME,
       SOURE_CODE,
       SOURE_NAME,
       MATERIAL_NO,
       MATERIAL_NAME,
       PRO_ORDER_NO)
    VALUES
      (?,
       ?,
       ?,
       ?,
       ?,
       ?,
       ?,
       ?,
       ?,
       ?,
       ?,
       ?,
       ?,
       ?,
       ?,
       ?,
       ?,
       ?,
       ?,
       ?,
       ?,
       ?,
       ?,
       ?,
       ?,
       ?,
       ?,
       ?,
       ?,
       ?,
       ?,
       ?,
       ?,
       ?,
       ?,
       ?,
       ?,
       V_TIME,
       ?,
       ?,
       ?,
       ?,
       ?,
       ?,
       ?,
       ?,
       V_TIME,
       ?,
       ?,
       ?,
       ?,
       ?,
       ?,
       ?,
       ?,
       ?,
       V_BATHYEAR,
       V_TIME,
       ?,
       ?,
       ?,
       ?,
       ?,
       ?,
       ?,
       ?);
       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,
       PRO_ORDER_NO)
    VALUES
      (?,
       ?,
       ?,
       ?,
       ?,
       ?,
       ?,
       ?,
       ?,
       ?,
       ?,
       ?,
       ?,
       ?,
       ?,
       ?,
       ?,
       ?,
       ?,
       ?,
       ?,
       ?,
       ?,
       ?,
       ?,
       ?,
       ?,
       ?,
       ?,
       ?,
       ?,
       ?,
       ?,
       ?,
       ?,
       ?,
       ?,
       V_TIME,
       ?,
       ?,
       ?,
       ?,
       ?,
       ?,
       ?,
       ?,
       V_TIME,
       ?,
       ?,
       ?,
       ?,
       ?,
       ?,
       ?,
       ?,
       ?,
       V_BATHYEAR,
       V_TIME,
       ?,
       ?,
       ?,
       ?,
       ?,
       ?,
       ?,
       ?);
    INSERT INTO MAT_ZC_M
      (JUDGE_STOVE_NO,
       BATCH_NO,
       BATCH_GROUD_NO,
       PRODUCCODE,
       PRODUCNAME,
       STEELCODE,
       STEELNAME,
       SPEC_CODE,
       SPEC_NAME,
       MODEL_CODE,
       MODEL_DESC,
       STD_CODE,
       STD_NAME,
       BELONG_CODE,
       BELONG_NAME,
       STD_STYLE,
       STD_STYLE_DESC,
       ORDER_NO,
       ORDER_SEQ,
       ORDER_SEQ_NO,
       ORD_PK,
       ORD_LN_PK,
       ORD_LN_DLY_PK,
       ACT_DIMATER,
       ACT_HEIGHT,
       LEN_NO,
       LEN_DESC,
       LEN_UNIT,
       ACT_LEN_MIN,
       ACT_LEN_MAX,
       CREATE_NAME,
       ACT_COUNT,
       ACT_WEIGHT,
       CREATE_TIME,
       INSTOCK_TIME,
       MAT_NO,
       MEMO,
       JUGDE_APPLY_FLAG,
       INSTOCK_FLAG,
       PRODUCT_FLAG,
       MAT_STATUS,
       ACT_LEN,
       JUDGE_STD_NAME,
       BAL_YEAR_MONTH,
       PLINE_CODE,
       PLINE_NAME,
       GRADECODE,
       GRADENAME,
       PIPMEMO,
       OLD_ORDER_NO,
       JUDGE_RESULT_TIME,
       MAT_ORIGIN_CODE,
       MAT_ORIGIN_NAME,
       SOURE_CODE,
       SOURE_NAME,
       MATERIAL_NO,
       MATERIAL_NAME,
       PLN_GRADECODE,
       PLN_GRADENAME,
       PLN_STEELCODE,
       PLN_STEELNAME,
       PRO_ORDER_NO,
       DETECT_RESULT_CODE,
       FACE_RESULT_CODE,
       QCM_STAUS,
       SAMPLE_FLAG,
       HEAT_PLAN_NO,
       ZG_STOVE_SQE,
       PRO_ORDER_ID)
    VALUES
      (?,
       ?,
       ?,
       ?,
       ?,
       ?,
       ?,
       ?,
       ?,
       ?,
       ?,
       ?,
       ?,
       ?,
       ?,
       ?,
       ?,
       ?,
       ?,
       ?,
       ?,
       ?,
       ?,
       ?,
       ?,
       ?,
       ?,
       ?,
       ?,
       ?,
       ?,
       ?,
       ?,
       V_TIME,
       V_TIME,
       ?,
       '',
       ?,
       ?,
       ?,
       ?,
       ?,
       ?,
       V_BATHYEAR,
       ?,
       ?,
       ?,
       ?,
       ?,
       ?,
       ?,
       ?,
       ?,
       ?,
       ?,
       ?,
       ?,
       ?,
       ?,
       ?,
       ?,
       ?,
       ?,
       ?,
       ?,
       ?,
       ?,
       ?,
       ?);
       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,
       PLN_GRADECODE,
       PLN_GRADENAME,
       PLN_STEELCODE,
       PLN_STEELNAME,
       PRO_ORDER_NO,
       DETECT_RESULT_CODE,
       FACE_RESULT_CODE,
       QCM_STAUS,
       SAMPLE_FLAG,
       HEAT_PLAN_NO,
       ZG_STOVE_SQE,
       PRO_ORDER_ID)
    VALUES
      (?,
       ?,
       ?,
       ?,
       ?,
       ?,
       ?,
       ?,
       ?,
       ?,
       ?,
       ?,
       ?,
       ?,
       ?,
       ?,
       ?,
       ?,
       ?,
       ?,
       ?,
       ?,
       ?,
       ?,
       ?,
       ?,
       ?,
       ?,
       ?,
       ?,
       ?,
       ?,
       ?,
       V_TIME,
       V_TIME,
       ?,
       '',
       ?,
       ?,
       ?,
       ?,
       ?,
       ?,
       V_BATHYEAR,
       ?,
       ?,
       ?,
       ?,
       ?,
       ?,
       ?,
       ?,
       ?,
       ?,
       ?,
       ?,
       ?,
       ?,
       ?,
       ?,
       ?,
       ?,
       ?,
       ?,
       ?,
       ?,
       ?,
       ?,
       ?);
       UPDATE MIL_PLAN T SET T.STATUS = '99' WHERE T.ID = ?;
END;
		]]>
	</query>

	<query id="FrmVrpMil.getInListDoc" desc="查询入库单号">
	<![CDATA[
	select INSTOCK_SQE,INSTOCK_DOC from ydm_zc_inlist 
    where 
    CREATE_TIME LIKE '%'|| to_date(?,'YYYY/MM/DD')||'%' 
    AND INSTOCK_TYPE_CODE LIKE '%'|| ? ||'%'
    order by INSTOCK_SQE desc
    ]]>
	</query>

	<query id="FrmVrpMil.queryGroupNo" desc="查询同炉同批组号">
		SELECT T.BATCH_GROUD_NO
		FROM MAT_ZC_M T WHERE T.JUDGE_STOVE_NO = ? AND
		T.BATCH_NO = ? ORDER BY
		T.BATCH_GROUD_NO DESC
	</query>
	<query id="FrmVrpMil.getInListDoc1" desc="查询入库流水">
	<![CDATA[
	select INSTOCK_SQE,INSTOCK_DOC from ydm_zc_inlist 
    where 
    CREATE_TIME LIKE '%'|| to_date(?,'YYYY/MM/DD')||'%' 
    AND INSTOCK_DOC LIKE '%'|| ? ||'%'
    order by INSTOCK_SQE desc
    ]]>
	</query>
	<query id="FrmVrpMil.SelectdoPipeInstore" desc="查询已入库支数">
		<![CDATA[	
	SELECT NVL(SUM(T.ACT_COUNT),0) ACOUNT
  FROM MAT_ZC_M T
 WHERE T.ZG_STOVE_SQE = ?
   AND T.BATCH_NO = ?
   --AND T.PRODUCT_FLAG = '801401'
			]]>
	</query>

	<query id="FrmVrpMil.queryHotingDKEY" desc="查询检验表最大实绩编号">
		<![CDATA[
SELECT 
       LPAD(SUBSTR(NVL(MAX(T.M_RESULT_NO), '000000'), -6, 6) + 1, 6, '0') AS M_RESULT_NO
  FROM VRP_HOTEXP_FACE_D T
 WHERE T.RESULT_NO = ?
		]]>
	</query>

	<query id="FrmVrpMil.queryHotKEY" desc="判断是否有过热扩实绩">
        <![CDATA[
	SELECT ? ||
	LPAD(SUBSTR(NVL(MAX(T.RESULT_NO),'000000'),-6,6) + 1, 6, '0') AS RESULT_NO
	FROM VRP_HOTEXP_FACE_M T
	WHERE TO_CHAR(T.CREATE_TIME,'YYYY-MM-DD') = ?
	AND T.PLINE_CODE= ?
        ]]>
	</query>


	<query id="FrmVrpMil.queryCountVrp" desc="查询计划下剩余上料支、吨">
		<![CDATA[
SELECT COUNT(*) COUNT,NVL(SUM(T.PRO_NUM),0) PRO_NUM,NVL(SUM(T.PRO_WT),0) PRO_WT  FROM VRP_HOTEXP_FACE_M T  WHERE HEAT_PLAN_NO=?
		]]>
	</query>

</queryMap>