<?xml version="1.0" encoding="UTF-8"?>
<queryMap desc="">
	<query id="StoveBase.insertZYDBK" desc="插入PLN_ZY_DBK_S表">
             <![CDATA[
               INSERT INTO PLN_ZY_DBK_M(
			        ZG_BATCH_NO,
			        ORDER_SOURCE,
			        ORDER_NO,
			        ORDER_SEQ,
			        REQ_BL_ID,
			        GRADECODE,
			        GRADENAME,
			        AIMOUTDIAMETER,
			        AIMWALLTHICK,
			        AIMLENGTH,
			        OUTDIAMETER_IN,
			        WALLTHICK_IN,
			        LENGTH_IN,
			        LENGTHMAX_IN,
			        LENGTHMIN_IN,
			        LEN_CUTHEAD,
			        LEN_CUTEND,
			        INWL_ID,
			        INWL_DESC,
			        IN_WT,
			        IN_NUM,
			        IF_WL_MATCHED,
			        OUTWL_ID,
			        OUTWL_DESC,
			        OUT_WT,
			        OUT_NUM,
			        IF_MONITOR_DBK,
			        PRDCR_NO,
			        MONITOR_POINT,
			        CRAFT_FILE_NO,
			        CRAFT_FILE_MAN,
			        CRAFT_SEQ,
			        STATION_ROAD,
			        PLANSTATUS,
			        IN_WT_REAL,
			        IN_NUM_REAL,
			        OUT_WT_REAL,
			        OUT_NUM_REAL,
			        CREATE_NAME,
			        CREATE_TIME,
			        UPDATE_NAME,
			        UPDATE_TIME,
			        HEAT_PLAN_NO,
			        ZY_BATCH_ID,
			        PROD_INDEX,
			        PRO_PLAN_ID,
			        GX_PLAN_NO,
			        PLINE_CODE,
			        PLINE_NAME,
			        ZG_HEAT_PLAN_NO,
			        HEATNO_LAST)
			 VALUES( 
			        '#ZG_BATCH_NO#',
			        '#ORDER_SOURCE#',
			        '#ORDER_NO#',
			        '#ORDER_SEQ#',
			        '#REQ_BL_ID#',
			        '#GRADECODE#',
			        '#GRADENAME#',
			        '#AIMOUTDIAMETER#',
			        '#AIMWALLTHICK#',
			        '#AIMLENGTH#',
			        '#OUTDIAMETER_IN#',
			        '#WALLTHICK_IN#',
			        '#LENGTH_IN#',
			        '#LENGTHMAX_IN#',
			        '#LENGTHMIN_IN#',
			        '#LEN_CUTHEAD#',
			        '#LEN_CUTEND#',
			        '#INWL_ID#',
			        '#INWL_DESC#',
			        '#IN_WT#',
			        '#IN_NUM#',
			        '#IF_WL_MATCHED#',
			        '#OUTWL_ID#',
			        '#OUTWL_DESC#',
			        '#OUT_WT#',
			        '#OUT_NUM#',
			        '#IF_MONITOR_DBK#',
			        '#PRDCR_NO#',
			        '#MONITOR_POINT#',
			        '#CRAFT_FILE_NO#',
			        '#CRAFT_FILE_MAN#',
			        '#CRAFT_SEQ#',
			        '#STATION_ROAD#',
			        '#PLANSTATUS#',
			        '#IN_WT_REAL#',
			        '#IN_NUM_REAL#',
			        '#OUT_WT_REAL#',
			        '#OUT_NUM_REAL#',
			        '#CREATE_NAME#',
			        SYSDATE,
			        '#UPDATE_NAME#',
			        SYSDATE,
			        '#HEAT_PLAN_NO#',
			        '#ZY_BATCH_ID#',
			        '#PROD_INDEX#',
			        '#PRO_PLAN_ID#',
			        '#GX_PLAN_NO#',
			        '#PLINE_CODE#',
			        '#PLINE_NAME#',
			        '#ZG_HEAT_PLAN_NO#',
			        '#HEATNO_LAST#')
                 ]]>
	</query>
	<query id="StoveBase.UpdateOrderRows" desc="更新PLN_Order_DBK_S表">
             <![CDATA[
               	  UPDATE PLN_ORDER_DBK_S
   					SET 
			        BATCHED_WT = '#BATCHED_WT#',
			        BATCHED_NUM = '#BATCHED_NUM#'
					 WHERE
					PRO_PLAN_ID = ? and
			        GX_PLAN_NO = ?
                 ]]>
	</query>
	<query id="StoveBase.queryMaxHeat_Plan_No" desc="查询PLN_ZY_JGX_M表最大的">
             <![CDATA[
               select max(to_number("SUBSTR"(HEAT_PLAN_NO, 10, 4))) as num FROM(select HEAT_PLAN_NO from wencheng t where to_char(t.CREATE_TIME,'yyyymmdd')=to_char(sysdate,'yyyymmdd'))
                 ]]>
	</query>
	<query id="StoveBase.queryBatchMatch" desc="查询指定工序订单的炉计划已排量和投入利库量">
             <![CDATA[
               	  SELECT BATCHED_WT,BATCHED_NUM,Match_Wt_In,Match_Num_In,IN_NUM_S,ADD_NUM_IN FROM wencheng 
               	  where
					PRO_PLAN_ID = ? and
			        GX_PLAN_NO = ?
                 ]]>
	</query>
	<query id="StoveBase.UpdateOrder_WT_NUM" desc="更新指定工序订单表的炉计划已排量">
             <![CDATA[
               	 UPDATE wencheng
			   SET 
			        BATCHED_WT = ?,
			        BATCHED_NUM = ?
			 WHERE
			 PRO_PLAN_ID = ? and
			        GX_PLAN_NO = ?
			        ]]>
	</query>
	<query id="StoveBase.UpdateOrder_MatchIn_WT_NUM" desc="更新指定工序订单表的投入利库量">
             <![CDATA[
               	 UPDATE wencheng
			   SET 
			        MatchWtIn = ?,
			        MatchNumIn = ?
			 WHERE
			 PRO_PLAN_ID = ? and
			        GX_PLAN_NO = ?
			        ]]>
	</query>
	<query id="StoveBase.UpdatePlnStatus" desc="更新指定作业计划的计划状态">
             <![CDATA[
               	 UPDATE wencheng
			   SET 
			        PLANSTATUS =?,
			        UPDATE_NAME=?,
			        UPDATE_TIME= SYSDATE
			 WHERE
			 		HEAT_PLAN_NO=?
			        ]]>
	</query>
	<query id="StoveBase.queryMaxProdIndex" desc="查询ProdIndex的最大值">
             <![CDATA[
              select max(To_number(PROD_INDEX)) as PROD_INDEX from wencheng
                 ]]>
	</query>
	<query id="StoveBase.queryCHECKJVAL" desc="查询ORD_LN_DLY_PK对应的">
             <![CDATA[
              SELECT t.CHECK_J_VAL from COM_MSC_JG t where t.CODE_JG in (SELECT CODE_JG from PLN_SALEORD a where a.ORD_LN_DLY_PK = ?) 
                 ]]>
	</query>
	<query id="StoveBase.queryOrderStatus" desc="查询工序订单的执行状态">
             <![CDATA[
              select exe_status from wencheng where pro_plan_id = ? and gx_plan_no = ? 
                 ]]>
	</query>
	<query id="StoveBase.queryPlanStatus" desc="查询作业计划的计划状态">
             <![CDATA[
              SELECT planstatus from wencheng where heat_plan_no = ?
                 ]]>
	</query>
</queryMap>