<?xml version="1.0" encoding="UTF-8"?>
<queryMap desc="加工线炉计划">

	<query id="FrmPlanStoveG.queryPlanStoveME" desc="查询加工线虚拟炉计划">
            <![CDATA[
SELECT T.HEAT_PLAN_NO,
       S.GX_PRO_SEQ,
       T.STOVE_NO,
       T.JUDGE_STOVE_NO,
       DECODE(T.PLANSTATUS,
              '00',
              '计划',
              '10',
              '下发',
              '20',
              '生产中',
              '30',
              '生产完成',
              '40',
              '关闭') PLANSTATUS,
       DECODE(T.PER_STATUS,
              '00',
              '上料开始',
              '10',
              '探伤开始',
              '20',
              '切管开始',
              '30',
              '车丝开始',
              '40',
              '螺纹检验开始',
              '50',
              '拧接开始',
              '60',
              '通径开始',
              '70',
              '水压开始',
              '80',
              '倒凌开始',
              '90',
              '测量点开始','11','交库开始','') PER_STATUS,
       DECODE(T.BESIDE_STATUS,
              '00',
              '上料结束',
              '10',
              '探伤结束',
              '20',
              '切管结束',
              '30',
              '车丝结束',
              '40',
              '螺纹检验结束',
              '50',
              '拧接结束',
              '60',
              '通径结束',
              '70',
              '水压结束',
              '80',
              '倒凌结束',
              '90',
              '测量点结束','11','交库结束','') BESIDE_STATUS,
       T.UPPER_HEATPLAN_ID,
       T.PRO_PLAN_ID,
       T.GX_PLAN_NO,
       T.PLINE_CODE,
       T.PLINE_NAME,
       T.PROCESS_CODE_C,
       T.PROCESS_DESC_C,
       T.UPPER_PROCESS_CODE,
       T.NEXT_PROCESS_CODE,
       T.GOWHERE_CODE,
       T.GOWHERE_NAME,
       T.PROD_STANDARD,
       T.OUTPUT_STANDARD,
       DECODE(T.ISENDGX, '1', '是', '/') ISENDGX,
       DECODE(T.IF_MATCH_ODD, '1', '利库计划','2','组炉计划','3','精整利库','4','精整返线计划','5','合并计划','6','本工序精整利库','正常计划') IF_MATCH_ODD,
       DECODE(T.IF_DO_HEAT_PLAN, '1', '有', '无') IF_DO_HEAT_PLAN,
       T.ORDER_SOURCE,
       T.ORD_LN_DLY_PK,
    T.ORDER_NO || '/' || T.ORDER_SEQ ORDER_NO,
       T.ORDER_SEQ,
       T.DELIVERY_NO,
       T.REQ_BL_ID,
       T.IF_EXPORT,
       T.PRIORITY,
       T.PRIORITY_MEMO,
       T.PRO_MONTH,
       TO_CHAR(TO_DATE(T.PRO_DAY, 'YYYY-MM-DD'), 'YYYY-MM-DD') PRO_DAY,
       TO_CHAR(TO_DATE(T.BAL_YEAR_MONTH, 'YYYY-MM'), 'YYYY-MM') BAL_YEAR_MONTH,
       DECODE(T.IF_MONITOR, '1', '是', '/') IF_MONITOR,
       T.PRDCR_NO,
       T.MONITOR_POINT,
       T.BOM,
       T.WHOLE_BACKLOG,
       T.WHOLE_BACKLOG_DESC,
       T.STATION_ROAD,
       T.CIC,
       T.PIC,
       T.SIC,
       T.DIC,
       T.WIC,
       T.GIC,
       T.CRAFT_FILE_NO,
       T.CRAFT_FILE_MAN,
       T.CRAFT_SEQ,
       T.SEC_CRAFT_FILE_NO,
       T.GRADECODE,
       T.GRADENAME,
       T.STEELCODE,
       T.STEELNAME,
       T.PRODUCCODE,
       T.PRODUCNAME,
       T.MODEL_CODE,
       T.MODEL_DESC,
       T.INWL_ID,
       T.INWL_DESC,
       T.OUTWL_ID,
       T.OUTWL_DESC,
       T.OUTDIAMETER,
       T.WALLTHICK,
       T.LENGTHMIN,
       T.LENGTHMAX,
       T.OUTDIAMETER_IN,
       T.WALLTHICK_IN,
       T.LENGTH_IN,
       T.LENGTHMAX_IN,
       T.LENGTHMIN_IN,
       T.OUTNUM_CUT,
       T.PLN_INSINGLE_NUM,
       T.PLN_INSINGLE_WT,
       T.PLN_INDOUBLE_NUM,
       T.PLN_INDOUBLE_WT,
       T.PLN_OUTSINGLE_NUM,
       T.PLN_OUTSINGLE_W,
       T.PLN_OUTDOUBLE_NUM,
       T.PLN_OUTDOUBLE_W,
       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.DOWNMAN,
       TO_CHAR(T.DOWNTIME, 'YYYY-MM-DD HH24:MI:SS') DOWNTIME,
       T.INDEX_SEQ,
       S.PLN_DIVIDE_ID,
       S.ZY_BATCH_ID,
        T.DECISION,
        CASE WHEN T.UPPER_PROCESS_CODE='D' THEN
       (SELECT MAX(DECODE(Z.PLANSTATUS,'00','计划','10','下发','20','生产中','30','生产完成','40','关闭')) FROM PLN_ZY_ZG_M Z WHERE Z.Heat_Plan_No=T.Upper_Heatplan_Id) 
       WHEN T.UPPER_PROCESS_CODE='E' THEN 
          (SELECT MAX(DECODE(Z.PLANSTATUS,'00','计划','10','下发','20','生产中','30','生产完成','40','关闭')) FROM PLN_ZY_DBK_M Z WHERE Z.Heat_Plan_No=T.Upper_Heatplan_Id) 
           WHEN T.UPPER_PROCESS_CODE='F' THEN 
          (SELECT MAX(DECODE(Z.PLANSTATUS,'00','计划','10','下发','20','生产中','30','生产完成','40','关闭')) FROM PLN_ZY_RCL_M Z WHERE Z.Heat_Plan_No=T.Upper_Heatplan_Id) 
         ELSE
           ''
           END PLANSTATUS_GX,
            T.FEED_HEAT_NO,
           T.FLAG_STOVE_NO,T.MEMO,T.ZY_BATCH_ID_ZG,T.LOT_NO_GROUP,T.LOT_NO_SQE,T.DELIVERY_STATE_CODE,
           T.DELIVERY_STATE_NAME,
           DECODE(T.IS_LOAD_FLAG,'1','是','否')IS_LOAD_FLAG,
           DECODE(T.IS_WEIGHT_FLAG,'1','是','否')IS_WEIGHT_FLAG
  FROM PLN_ZY_JGX_M T, PLN_ORDER_JGX_S S
 WHERE T.PRO_PLAN_ID = S.PRO_PLAN_ID
   AND T.GX_PLAN_NO = S.GX_PLAN_NO
 ]]>
	</query>

	<query id="FrmPlanStoveG.queryPlanStoveReadyE" desc="查询加工线实际炉计划">
            <![CDATA[ SELECT T.HEAT_PLAN_NO,
       T.GX_PRO_SEQ,
       CASE
         WHEN T.ZY_BATCH_ID IS NULL THEN
          (SELECT S.ZY_BATCH_ID
             FROM PLN_ORDER_RCL_S S
            WHERE S.PRO_PLAN_ID = T.PRO_PLAN_ID
              AND S.GX_PLAN_NO = T.GX_PLAN_NO)
         ELSE
          T.ZY_BATCH_ID
       END ZY_BATCH_ID,
       T.STOVE_NO,
       T.JUDGE_STOVE_NO,
       DECODE(T.PLANSTATUS,'00','计划','10','下发','20','生产中','30','生产完成','40','关闭') PLANSTATUS,
        DECODE(T.PER_STATUS,
              '00',
              '上料开始',
              '10',
              '探伤开始',
              '20',
              '切管开始',
              '30',
              '车丝开始',
              '40',
              '螺纹检验开始',
              '50',
              '拧接开始',
              '60',
              '通径开始',
              '70',
              '水压开始',
              '80',
              '倒凌开始',
              '90',
              '测量点开始','11','交库开始','') PER_STATUS,
       DECODE(T.BESIDE_STATUS,
              '00',
              '上料结束',
              '10',
              '探伤结束',
              '20',
              '切管结束',
              '30',
              '车丝结束',
              '40',
              '螺纹检验结束',
              '50',
              '拧接结束',
              '60',
              '通径结束',
              '70',
              '水压结束',
              '80',
              '倒凌结束',
              '90',
              '测量点结束','11','交库结束','') BESIDE_STATUS,
       T.UPPER_HEATPLAN_ID,
       T.PRO_PLAN_ID,
       T.GX_PLAN_NO,
       T.PLINE_CODE,
       T.PLINE_NAME,
       T.PROCESS_CODE_C,
       T.PROCESS_DESC_C,
       T.UPPER_PROCESS_CODE,
       T.NEXT_PROCESS_CODE,
       T.GOWHERE_CODE,
       T.GOWHERE_NAME,
       T.PROD_STANDARD,
       T.OUTPUT_STANDARD,
       DECODE(T.ISENDGX,'1','是','/') ISENDGX,
       DECODE(T.IF_MATCH_ODD, '1', '利库计划','2','组炉计划','3','精整利库','4','精整返线计划','5','合并计划','6','本工序精整利库','正常计划') IF_MATCH_ODD,
        DECODE(T.IF_DO_HEAT_PLAN,'1','有','无') IF_DO_HEAT_PLAN,
       T.ORDER_SOURCE,
       T.ORD_LN_DLY_PK,
       T.ORDER_NO || '/' || T.ORDER_SEQ ORDER_NO,
       T.ORDER_SEQ,
       T.DELIVERY_NO,
       T.REQ_BL_ID,
       T.IF_EXPORT,
       T.PRIORITY,
       T.PRIORITY_MEMO,
       T.PRO_MONTH,
       TO_CHAR(TO_DATE(T.PRO_DAY, 'YYYY-MM-DD'), 'YYYY-MM-DD') PRO_DAY,
       TO_CHAR(TO_DATE(T.BAL_YEAR_MONTH, 'YYYY-MM'), 'YYYY-MM') BAL_YEAR_MONTH,
       DECODE(T.IF_MONITOR,'1','是','/') IF_MONITOR,
       T.PRDCR_NO,
       T.MONITOR_POINT,
       T.BOM,
       T.WHOLE_BACKLOG,
       T.WHOLE_BACKLOG_DESC,
       T.STATION_ROAD,
       T.CIC,
       T.PIC,
       T.SIC,
       T.DIC,
       T.WIC,T.GIC,
       T.CRAFT_FILE_NO,
       T.CRAFT_FILE_MAN,
       T.CRAFT_SEQ,
       T.SEC_CRAFT_FILE_NO,
       T.GRADECODE,
       T.GRADENAME,
       T.STEELCODE,
       T.STEELNAME,
       T.PRODUCCODE,
       T.PRODUCNAME,
       T.MODEL_CODE,
       T.MODEL_DESC,
       T.INWL_ID,
       T.INWL_DESC,
       T.OUTWL_ID,
       T.OUTWL_DESC,
       T.OUTDIAMETER_IN,
       T.WALLTHICK_IN,
       T.LENGTH_IN,
       T.LENGTHMAX_IN,
       T.LENGTHMIN_IN,
       T.OUTNUM_CUT,
       T.OUTDIAMETER,
       T.WALLTHICK,
       T.LENGTHMIN,
       T.LENGTHMAX,
       NVL(T.PLN_INSINGLE_NUM,0) PLN_INSINGLE_NUM,
       NVL(T.PLN_INSINGLE_WT,0) PLN_INSINGLE_WT,
       NVL(T.PLN_INDOUBLE_NUM,0) PLN_INDOUBLE_NUM,
       NVL(T.PLN_INDOUBLE_WT,0) PLN_INDOUBLE_WT,
       NVL(T.PLN_OUTSINGLE_NUM,0) PLN_OUTSINGLE_NUM,
       NVL(T.PLN_OUTSINGLE_W,0) PLN_OUTSINGLE_W,
       NVL(T.PLN_OUTDOUBLE_NUM,0) PLN_OUTDOUBLE_NUM,
       NVL(T.PLN_OUTDOUBLE_W,0) PLN_OUTDOUBLE_W,
       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.DOWNMAN,
       TO_CHAR(T.DOWNTIME, 'YYYY-MM-DD HH24:MI:SS') DOWNTIME,
       T.INDEX_SEQ,  
       T1.HEAT_PLAN_SQE,
       T1.BATCH_NO,
       T1.BATCH_GROUD_NO,
       T1.JUGDE_APPLY_CODE,     
       T1.PLAN_INDOUBLE_NUM,
       T1.PLAN_INDOUBLE_WT,
       T1.REAL_INDOUBLE_NUM,
       T1.REAL_INDOUBLE_WT,
       T1.REAL_OUTDOUBLE_NUM,
       T1.REAL_OUTDOUBLE_WT,
       T.DECISION,
        CASE WHEN T.UPPER_PROCESS_CODE='D' THEN
       (SELECT MAX(DECODE(Z.PLANSTATUS,'00','计划','10','下发','20','生产中','30','生产完成','40','关闭')) FROM PLN_ZY_ZG_M Z WHERE Z.Heat_Plan_No=T.Upper_Heatplan_Id) 
       WHEN T.UPPER_PROCESS_CODE='E' THEN 
          (SELECT MAX(DECODE(Z.PLANSTATUS,'00','计划','10','下发','20','生产中','30','生产完成','40','关闭')) FROM PLN_ZY_DBK_M Z WHERE Z.Heat_Plan_No=T.Upper_Heatplan_Id) 
           WHEN T.UPPER_PROCESS_CODE='F' THEN 
          (SELECT MAX(DECODE(Z.PLANSTATUS,'00','计划','10','下发','20','生产中','30','生产完成','40','关闭')) FROM PLN_ZY_RCL_M Z WHERE Z.Heat_Plan_No=T.Upper_Heatplan_Id) 
         ELSE
           ''
           END PLANSTATUS_GX,
           (SELECT NVL(SUM(M.ACT_COUNT), 0)
          FROM MAT_BC_M M
         WHERE M.JUDGE_STOVE_NO = T1.FEED_HEAT_NO
           AND NVL(M.JUGDE_APPLY_CODE, '/') = NVL(T1.JUGDE_APPLY_CODE, '/')
           AND M.HEAT_PLAN_NO_NEXT = T.HEAT_PLAN_NO
           AND M.BATCH_NO= T1.BATCH_NO
           AND M.BATCH_GROUD_NO = T1.BATCH_GROUD_NO
           AND M.MAT_STATUS = '80150103'
           AND M.NEXT_PROCESS_CDOE='G') ACT_COUNT,
            T.FEED_HEAT_NO,
           T.FLAG_STOVE_NO,T.MEMO,T.ZY_BATCH_ID_ZG,
     (select GET_BUTTRESS(T1.FEED_HEAT_NO,T1.BATCH_NO,T1.BATCH_GROUD_NO,'G',T1.HEAT_PLAN_NO) from dual) Storage_No,
    T.LOT_NO_GROUP,T.LOT_NO_SQE,
    T.DELIVERY_STATE_CODE,
    T.DELIVERY_STATE_NAME,
    (
	SELECT
		APPLY_DESC
	FROM
		QCM_PROBLEM_HANDLING
	WHERE
		JUDGE_STOVE_NO = T.FEED_HEAT_NO
		--AND ( BATCH_NO = '1' OR BATCH_NO = t1.BATCH_NO )
		--AND ( BATCH_GROUD_NO = '1' OR BATCH_GROUD_NO = t1.BATCH_GROUD_NO )
		AND PROCESS_CODE = 'G'
		AND ROWNUM = '1'
	) APPLY_DESC
  FROM PLN_ZY_JGX_M T,PLN_ZY_JGX_C T1
 WHERE T.HEAT_PLAN_NO=T1.HEAT_PLAN_NO(+)
              ]]>
	</query>
	<query id="FrmPlanStoveG.addPlnMJgx" desc="新增加工线虚拟炉计划">
            <![CDATA[ 
             INSERT INTO PLN_ZY_JGX_M
   (HEAT_PLAN_NO,
    ZY_BATCH_ID,
    STOVE_NO,
    JUDGE_STOVE_NO,
    BATCH_NO,
    PLANSTATUS,
    UPPER_HEATPLAN_ID,
    PRO_PLAN_ID,
    GX_PLAN_NO,
    PLINE_CODE,
    PLINE_NAME,
    PROCESS_CODE_C,
    PROCESS_DESC_C,
    UPPER_PROCESS_CODE,
    NEXT_PROCESS_CODE,
    GOWHERE_CODE,
    GOWHERE_NAME,
    PROD_STANDARD,
    OUTPUT_STANDARD,
    ISENDGX,
    IF_MATCH_ODD,
    IF_DO_HEAT_PLAN,
    ORDER_SOURCE,
    ORD_LN_DLY_PK,
    ORDER_NO,
    ORDER_SEQ,
    DELIVERY_NO,
    REQ_BL_ID,
    IF_EXPORT,
    PRIORITY,
    PRIORITY_MEMO,
    PRO_MONTH,
    PRO_DAY,
    BAL_YEAR_MONTH,
    IF_MONITOR,
    PRDCR_NO,
    MONITOR_POINT,
    MONITOR_MENT,
    MONITOR_MAN,
    BOM,
    WHOLE_BACKLOG,
    WHOLE_BACKLOG_DESC,
    STATION_ROAD,
    CIC,
    PIC,
    SIC,
    DIC,
    WIC,
    GIC,
    CRAFT_FILE_NO,
    CRAFT_SEQ,
    CRAFT_FILE_MAN,
    SEC_CRAFT_FILE_NO,
    INWL_ID,
    INWL_DESC,
    OUTWL_ID,
    OUTWL_DESC,
    STEELCODE,
    STEELNAME,
    GRADECODE,
    GRADENAME,
    PRODUCCODE,
    PRODUCNAME,
    MODEL_CODE,
    MODEL_DESC,
    OUTDIAMETER,
    WALLTHICK,
    LENGTHMIN,
    LENGTHMAX,
    OUTDIAMETER_IN,
    WALLTHICK_IN,
    OUTNUM_CUT,
    LENGTH_IN,
    LENGTHMAX_IN,
    LENGTHMIN_IN,
    PLN_INSINGLE_NUM,
    PLN_INSINGLE_WT,
    PLN_INDOUBLE_NUM,
    PLN_INDOUBLE_WT,
    PLN_OUTSINGLE_NUM,
    PLN_OUTSINGLE_W,
    PLN_OUTDOUBLE_NUM,
    PLN_OUTDOUBLE_W,
    CREATE_NAME,
    CREATE_TIME,
    INDEX_SEQ,
    GX_PRO_SEQ,
    SPEC_CODE,
    SPEC_NAME,
    STD_CODE,
    STD_NAME,
    STD_STYLE,
    STD_STYLE_DESC,
    DECISION,
    FEED_HEAT_NO,
    FLAG_STOVE_NO,
    MEMO,
    ZY_BATCH_ID_ZG,HEAT_PLAN_NO_OLD,IF_PRODUCT,LOT_NO_SQE)
 VALUES
   (?,
    '#ZY_BATCH_ID#',
    '#STOVE_NO#',
    '#JUDGE_STOVE_NO#',
    '#BATCH_NO#',
    '00',
    '#UPPER_HEATPLAN_ID#',
    '#PRO_PLAN_ID#',
    '#GX_PLAN_NO#',
    '#PLINE_CODE#',
    '#PLINE_NAME#',
    '#PROCESS_CODE_C#',
    '#PROCESS_DESC_C#',
    '#UPPER_PROCESS_CODE#',
    '#NEXT_PROCESS_CODE#',
    '#GOWHERE_CODE#',
    '#GOWHERE_NAME#',
    '#PROD_STANDARD#',
    '#OUTPUT_STANDARD#',
    '#ISENDGX#',
    '#IF_MATCH_ODD#',
    '#IF_DO_HEAT_PLAN#',
    '#ORDER_SOURCE#',
    '#ORD_LN_DLY_PK#',
    '#ORDER_NO#',
    '#ORDER_SEQ#',
    '#DELIVERY_NO#',
    '#REQ_BL_ID#',
    '#IF_EXPORT#',
    '#PRIORITY#',
    '#PRIORITY_MEMO#',
    '#PRO_MONTH#',
    '#PRO_DAY#',
    '#BAL_YEAR_MONTH#',
    '#IF_MONITOR#',
    '#PRDCR_NO#',
    '#MONITOR_POINT#',
    '#MONITOR_MENT#',
    '#MONITOR_MAN#',
    '#BOM#',
    '#WHOLE_BACKLOG#',
    '#WHOLE_BACKLOG_DESC#',
    '#STATION_ROAD#',
    '#CIC#',
    '#PIC#',
    '#SIC#',
    '#DIC#',
    '#WIC#',
    '#GIC#',
    '#CRAFT_FILE_NO#',
    '#CRAFT_SEQ#',
    '#CRAFT_FILE_MAN#',
    '#SEC_CRAFT_FILE_NO#',
    '#INWL_ID#',
    '#INWL_DESC#',
    '#OUTWL_ID#',
    '#OUTWL_DESC#',
    '#STEELCODE#',
    '#STEELNAME#',
    '#GRADECODE#',
    '#GRADENAME#',
    '#PRODUCCODE#',
    '#PRODUCNAME#',
    '#MODEL_CODE#',
    '#MODEL_DESC#',
    '#OUTDIAMETER#',
    '#WALLTHICK#',
    '#LENGTHMIN#',
    '#LENGTHMAX#',
    '#OUTDIAMETER_IN#',
    '#WALLTHICK_IN#',
    '#OUTNUM_CUT#',
    '#LENGTH_IN#',
    '#LENGTHMAX_IN#',
    '#LENGTHMIN_IN#',
    '#PLN_INSINGLE_NUM#',
    '#PLN_INSINGLE_WT#',
    '#PLN_INDOUBLE_NUM#',
    '#PLN_INDOUBLE_WT#',
    '#PLN_OUTSINGLE_NUM#',
    '#PLN_OUTSINGLE_W#',
    '#PLN_OUTDOUBLE_NUM#',
    '#PLN_OUTDOUBLE_W#',
    ?,
    SYSDATE,
    '#INDEX_SEQ#',
    '#GX_PRO_SEQ#',
    '#SPEC_CODE#',
    '#SPEC_NAME#',
    '#STD_CODE#',
    '#STD_NAME#',
    '#STD_STYLE#',
    '#STD_STYLE_DESC#',
    '#DECISION#',
    '#FEED_HEAT_NO#',
    '#FLAG_STOVE_NO#',
    '#MEMO#',
    '#ZY_BATCH_ID_ZG#','#HEAT_PLAN_NO_OLD#','#IF_PRODUCT#','#LOT_NO_SQE#')
              ]]>
	</query>
	<query id="FrmPlanStoveG.addPlnCJgx" desc="新增加工线实际炉计划">
            <![CDATA[ 
             INSERT INTO PLN_ZY_JGX_C(
        HEAT_PLAN_NO,
        HEAT_PLAN_SQE,
        JUGDE_APPLY_CODE,
        ZY_BATCH_ID,
        STOVE_NO,
        JUDGE_STOVE_NO,
        BATCH_NO,
        BATCH_GROUD_NO,
        PRO_PLAN_ID,
        GX_PLAN_NO,
        PLINE_CODE,
        PLINE_NAME,
        OUTDIAMETER_IN,
        WALLTHICK_IN,
        OUTNUM_CUT,
        LENGTH_IN,
        LENGTHMAX_IN,
        LENGTHMIN_IN,
        PLAN_INDOUBLE_NUM,
        PLAN_INDOUBLE_WT,
        REAL_INDOUBLE_NUM,
        REAL_INDOUBLE_WT,
        REAL_OUTDOUBLE_NUM,
        REAL_OUTDOUBLE_WT,
        FEED_HEAT_NO,
        FLAG_STOVE_NO)
 VALUES( 
        ?,
        ?,
        '#JUGDE_APPLY_CODE#',
        '#ZY_BATCH_ID#',
        '#STOVE_NO#',
        '#JUDGE_STOVE_NO#',
        '#BATCH_NO#',
        '#BATCH_GROUD_NO#',
        '#PRO_PLAN_ID#',
        '#GX_PLAN_NO#',
        '#PLINE_CODE#',
        '#PLINE_NAME#',
        '#OUTDIAMETER_IN#',
        '#WALLTHICK_IN#',
        '#OUTNUM_CUT#',
        '#LENGTH_IN#',
        '#LENGTHMAX_IN#',
        '#LENGTHMIN_IN#',
        '#PLAN_INDOUBLE_NUM#',
        '#PLAN_INDOUBLE_WT#',
        '#REAL_INDOUBLE_NUM#',
        '#REAL_INDOUBLE_WT#',
        '#REAL_OUTDOUBLE_NUM#',
        '#REAL_OUTDOUBLE_WT#',
        '#FEED_HEAT_NO#',
        '#FLAG_STOVE_NO#')
              ]]>
	</query>
	<query id="FrmPlanStoveG.addPlnMOldBf" desc="新增原主炉计划备份">
            <![CDATA[ 
           INSERT INTO PLN_ZY_JGX_M_OLD
  (HEAT_PLAN_NO_NEW,
   HEAT_PLAN_NO,
   ZY_BATCH_ID,
   STOVE_NO,
   JUDGE_STOVE_NO,
   BATCH_NO,
   PLANSTATUS,
   PER_STATUS,
   BESIDE_STATUS,
   UPPER_HEATPLAN_ID,
   PRO_PLAN_ID,
   GX_PLAN_NO,
   PLINE_CODE,
   PLINE_NAME,
   PROCESS_CODE_C,
   PROCESS_DESC_C,
   UPPER_PROCESS_CODE,
   NEXT_PROCESS_CODE,
   GOWHERE_CODE,
   GOWHERE_NAME,
   PROD_STANDARD,
   OUTPUT_STANDARD,
   ISENDGX,
   IF_MATCH_ODD,
   IF_DO_HEAT_PLAN,
   ORDER_SOURCE,
   ORD_LN_DLY_PK,
   ORDER_NO,
   ORDER_SEQ,
   DELIVERY_NO,
   REQ_BL_ID,
   IF_EXPORT,
   PRIORITY,
   PRIORITY_MEMO,
   PRO_MONTH,
   PRO_DAY,
   BAL_YEAR_MONTH,
   IF_MONITOR,
   PRDCR_NO,
   MONITOR_POINT,
   MONITOR_MENT,
   MONITOR_MAN,
   BOM,
   WHOLE_BACKLOG,
   WHOLE_BACKLOG_DESC,
   STATION_ROAD,
   CIC,
   PIC,
   SIC,
   DIC,
   WIC,
   GIC,
   CRAFT_FILE_NO,
   CRAFT_SEQ,
   CRAFT_FILE_MAN,
   SEC_CRAFT_FILE_NO,
   INWL_ID,
   INWL_DESC,
   OUTWL_ID,
   OUTWL_DESC,
   STEELCODE,
   STEELNAME,
   GRADECODE,
   GRADENAME,
   PRODUCCODE,
   PRODUCNAME,
   MODEL_CODE,
   MODEL_DESC,
   OUTDIAMETER,
   WALLTHICK,
   LENGTHMIN,
   LENGTHMAX,
   OUTDIAMETER_IN,
   WALLTHICK_IN,
   OUTNUM_CUT,
   LENGTH_IN,
   LENGTHMAX_IN,
   LENGTHMIN_IN,
   PLN_INSINGLE_NUM,
   PLN_INSINGLE_WT,
   PLN_INDOUBLE_NUM,
   PLN_INDOUBLE_WT,
   PLN_OUTSINGLE_NUM,
   PLN_OUTSINGLE_W,
   PLN_OUTDOUBLE_NUM,
   PLN_OUTDOUBLE_W,
   CREATE_NAME,
   CREATE_TIME,
   UPDATE_NAME,
   UPDATE_TIME,
   DOWNMAN,
   DOWNTIME,
   INDEX_SEQ,
   GX_PRO_SEQ,
   SPEC_CODE,
   SPEC_NAME,
   STD_CODE,
   STD_NAME,
   STD_STYLE,
   STD_STYLE_DESC,
   DECISION,
   FEED_HEAT_NO,
   FLAG_STOVE_NO,
   MEMO,
   ZY_BATCH_ID_ZG,
   HEAT_PLAN_NO_OLD,
   IF_PRODUCT,
   PLINE_CODE_W,
   PLINE_NAME_W,
   IS_BATCH,
   CHECK_NO,
   LOT_NO_GROUP,
   LOT_NO_SQE,
   IS_CLOSE,
   WAITING_DECISION_MEMO,
   IS_VISIBLE,
   LOADTIME)
  SELECT ?,
         HEAT_PLAN_NO,
         ZY_BATCH_ID,
         STOVE_NO,
         JUDGE_STOVE_NO,
         BATCH_NO,
         PLANSTATUS,
         PER_STATUS,
         BESIDE_STATUS,
         UPPER_HEATPLAN_ID,
         PRO_PLAN_ID,
         GX_PLAN_NO,
         PLINE_CODE,
         PLINE_NAME,
         PROCESS_CODE_C,
         PROCESS_DESC_C,
         UPPER_PROCESS_CODE,
         NEXT_PROCESS_CODE,
         GOWHERE_CODE,
         GOWHERE_NAME,
         PROD_STANDARD,
         OUTPUT_STANDARD,
         ISENDGX,
         IF_MATCH_ODD,
         IF_DO_HEAT_PLAN,
         ORDER_SOURCE,
         ORD_LN_DLY_PK,
         ORDER_NO,
         ORDER_SEQ,
         DELIVERY_NO,
         REQ_BL_ID,
         IF_EXPORT,
         PRIORITY,
         PRIORITY_MEMO,
         PRO_MONTH,
         PRO_DAY,
         BAL_YEAR_MONTH,
         IF_MONITOR,
         PRDCR_NO,
         MONITOR_POINT,
         MONITOR_MENT,
         MONITOR_MAN,
         BOM,
         WHOLE_BACKLOG,
         WHOLE_BACKLOG_DESC,
         STATION_ROAD,
         CIC,
         PIC,
         SIC,
         DIC,
         WIC,
         GIC,
         CRAFT_FILE_NO,
         CRAFT_SEQ,
         CRAFT_FILE_MAN,
         SEC_CRAFT_FILE_NO,
         INWL_ID,
         INWL_DESC,
         OUTWL_ID,
         OUTWL_DESC,
         STEELCODE,
         STEELNAME,
         GRADECODE,
         GRADENAME,
         PRODUCCODE,
         PRODUCNAME,
         MODEL_CODE,
         MODEL_DESC,
         OUTDIAMETER,
         WALLTHICK,
         LENGTHMIN,
         LENGTHMAX,
         OUTDIAMETER_IN,
         WALLTHICK_IN,
         OUTNUM_CUT,
         LENGTH_IN,
         LENGTHMAX_IN,
         LENGTHMIN_IN,
         PLN_INSINGLE_NUM,
         PLN_INSINGLE_WT,
         PLN_INDOUBLE_NUM,
         PLN_INDOUBLE_WT,
         PLN_OUTSINGLE_NUM,
         PLN_OUTSINGLE_W,
         PLN_OUTDOUBLE_NUM,
         PLN_OUTDOUBLE_W,
         CREATE_NAME,
         CREATE_TIME,
         UPDATE_NAME,
         UPDATE_TIME,
         DOWNMAN,
         DOWNTIME,
         INDEX_SEQ,
         GX_PRO_SEQ,
         SPEC_CODE,
         SPEC_NAME,
         STD_CODE,
         STD_NAME,
         STD_STYLE,
         STD_STYLE_DESC,
         DECISION,
         FEED_HEAT_NO,
         FLAG_STOVE_NO,
         MEMO,
         ZY_BATCH_ID_ZG,
         HEAT_PLAN_NO_OLD,
         IF_PRODUCT,
         PLINE_CODE_W,
         PLINE_NAME_W,
         IS_BATCH,
         CHECK_NO,
         LOT_NO_GROUP,
         LOT_NO_SQE,
         IS_CLOSE,
         WAITING_DECISION_MEMO,
         IS_VISIBLE,
         LOADTIME FROM PLN_ZY_JGX_M WHERE HEAT_PLAN_NO = ?  
              ]]>
	</query>
	<query id="FrmPlanStoveG.addPlnCOldBf" desc="新增原从炉计划备份">
            <![CDATA[ 
            INSERT INTO PLN_ZY_JGX_C_OLD
  (HEAT_PLAN_NO_NEW,
   HEAT_PLAN_NO,
   HEAT_PLAN_SQE,
   JUGDE_APPLY_CODE,
   ZY_BATCH_ID,
   STOVE_NO,
   JUDGE_STOVE_NO,
   BATCH_NO,
   BATCH_GROUD_NO,
   PRO_PLAN_ID,
   GX_PLAN_NO,
   PLINE_CODE,
   PLINE_NAME,
   OUTDIAMETER_IN,
   WALLTHICK_IN,
   OUTNUM_CUT,
   LENGTH_IN,
   LENGTHMAX_IN,
   LENGTHMIN_IN,
   PLAN_INDOUBLE_NUM,
   PLAN_INDOUBLE_WT,
   REAL_INDOUBLE_NUM,
   REAL_INDOUBLE_WT,
   REAL_OUTDOUBLE_NUM,
   REAL_OUTDOUBLE_WT,
   FEED_HEAT_NO,
   FLAG_STOVE_NO,
   PER_STATUS,
   BESIDE_STATUS,
   LOADTIME,
   PLINE_CODE_W,
   PLINE_NAME_W)
  SELECT ?,
         HEAT_PLAN_NO,
         HEAT_PLAN_SQE,
         JUGDE_APPLY_CODE,
         ZY_BATCH_ID,
         STOVE_NO,
         JUDGE_STOVE_NO,
         BATCH_NO,
         BATCH_GROUD_NO,
         PRO_PLAN_ID,
         GX_PLAN_NO,
         PLINE_CODE,
         PLINE_NAME,
         OUTDIAMETER_IN,
         WALLTHICK_IN,
         OUTNUM_CUT,
         LENGTH_IN,
         LENGTHMAX_IN,
         LENGTHMIN_IN,
         PLAN_INDOUBLE_NUM,
         PLAN_INDOUBLE_WT,
         REAL_INDOUBLE_NUM,
         REAL_INDOUBLE_WT,
         REAL_OUTDOUBLE_NUM,
         REAL_OUTDOUBLE_WT,
         FEED_HEAT_NO,
         FLAG_STOVE_NO,
         PER_STATUS,
         BESIDE_STATUS,
         LOADTIME,
         PLINE_CODE_W,
         PLINE_NAME_W
    FROM PLN_ZY_JGX_C
   WHERE HEAT_PLAN_NO = ?
            ]]>
	</query>
	<query id="FrmPlanStoveG.addPlnM" desc="撤销合并新增主炉计划备份">
            <![CDATA[ 
           INSERT INTO PLN_ZY_JGX_M
  (HEAT_PLAN_NO,
   ZY_BATCH_ID,
   STOVE_NO,
   JUDGE_STOVE_NO,
   BATCH_NO,
   PLANSTATUS,
   PER_STATUS,
   BESIDE_STATUS,
   UPPER_HEATPLAN_ID,
   PRO_PLAN_ID,
   GX_PLAN_NO,
   PLINE_CODE,
   PLINE_NAME,
   PROCESS_CODE_C,
   PROCESS_DESC_C,
   UPPER_PROCESS_CODE,
   NEXT_PROCESS_CODE,
   GOWHERE_CODE,
   GOWHERE_NAME,
   PROD_STANDARD,
   OUTPUT_STANDARD,
   ISENDGX,
   IF_MATCH_ODD,
   IF_DO_HEAT_PLAN,
   ORDER_SOURCE,
   ORD_LN_DLY_PK,
   ORDER_NO,
   ORDER_SEQ,
   DELIVERY_NO,
   REQ_BL_ID,
   IF_EXPORT,
   PRIORITY,
   PRIORITY_MEMO,
   PRO_MONTH,
   PRO_DAY,
   BAL_YEAR_MONTH,
   IF_MONITOR,
   PRDCR_NO,
   MONITOR_POINT,
   MONITOR_MENT,
   MONITOR_MAN,
   BOM,
   WHOLE_BACKLOG,
   WHOLE_BACKLOG_DESC,
   STATION_ROAD,
   CIC,
   PIC,
   SIC,
   DIC,
   WIC,
   GIC,
   CRAFT_FILE_NO,
   CRAFT_SEQ,
   CRAFT_FILE_MAN,
   SEC_CRAFT_FILE_NO,
   INWL_ID,
   INWL_DESC,
   OUTWL_ID,
   OUTWL_DESC,
   STEELCODE,
   STEELNAME,
   GRADECODE,
   GRADENAME,
   PRODUCCODE,
   PRODUCNAME,
   MODEL_CODE,
   MODEL_DESC,
   OUTDIAMETER,
   WALLTHICK,
   LENGTHMIN,
   LENGTHMAX,
   OUTDIAMETER_IN,
   WALLTHICK_IN,
   OUTNUM_CUT,
   LENGTH_IN,
   LENGTHMAX_IN,
   LENGTHMIN_IN,
   PLN_INSINGLE_NUM,
   PLN_INSINGLE_WT,
   PLN_INDOUBLE_NUM,
   PLN_INDOUBLE_WT,
   PLN_OUTSINGLE_NUM,
   PLN_OUTSINGLE_W,
   PLN_OUTDOUBLE_NUM,
   PLN_OUTDOUBLE_W,
   CREATE_NAME,
   CREATE_TIME,
   UPDATE_NAME,
   UPDATE_TIME,
   DOWNMAN,
   DOWNTIME,
   INDEX_SEQ,
   GX_PRO_SEQ,
   SPEC_CODE,
   SPEC_NAME,
   STD_CODE,
   STD_NAME,
   STD_STYLE,
   STD_STYLE_DESC,
   DECISION,
   FEED_HEAT_NO,
   FLAG_STOVE_NO,
   MEMO,
   ZY_BATCH_ID_ZG,
   HEAT_PLAN_NO_OLD,
   IF_PRODUCT,
   PLINE_CODE_W,
   PLINE_NAME_W,
   IS_BATCH,
   CHECK_NO,
   LOT_NO_GROUP,
   LOT_NO_SQE,
   IS_CLOSE,
   WAITING_DECISION_MEMO,
   IS_VISIBLE,
   LOADTIME)
  SELECT HEAT_PLAN_NO,
         ZY_BATCH_ID,
         STOVE_NO,
         JUDGE_STOVE_NO,
         BATCH_NO,
         PLANSTATUS,
         PER_STATUS,
         BESIDE_STATUS,
         UPPER_HEATPLAN_ID,
         PRO_PLAN_ID,
         GX_PLAN_NO,
         PLINE_CODE,
         PLINE_NAME,
         PROCESS_CODE_C,
         PROCESS_DESC_C,
         UPPER_PROCESS_CODE,
         NEXT_PROCESS_CODE,
         GOWHERE_CODE,
         GOWHERE_NAME,
         PROD_STANDARD,
         OUTPUT_STANDARD,
         ISENDGX,
         IF_MATCH_ODD,
         IF_DO_HEAT_PLAN,
         ORDER_SOURCE,
         ORD_LN_DLY_PK,
         ORDER_NO,
         ORDER_SEQ,
         DELIVERY_NO,
         REQ_BL_ID,
         IF_EXPORT,
         PRIORITY,
         PRIORITY_MEMO,
         PRO_MONTH,
         PRO_DAY,
         BAL_YEAR_MONTH,
         IF_MONITOR,
         PRDCR_NO,
         MONITOR_POINT,
         MONITOR_MENT,
         MONITOR_MAN,
         BOM,
         WHOLE_BACKLOG,
         WHOLE_BACKLOG_DESC,
         STATION_ROAD,
         CIC,
         PIC,
         SIC,
         DIC,
         WIC,
         GIC,
         CRAFT_FILE_NO,
         CRAFT_SEQ,
         CRAFT_FILE_MAN,
         SEC_CRAFT_FILE_NO,
         INWL_ID,
         INWL_DESC,
         OUTWL_ID,
         OUTWL_DESC,
         STEELCODE,
         STEELNAME,
         GRADECODE,
         GRADENAME,
         PRODUCCODE,
         PRODUCNAME,
         MODEL_CODE,
         MODEL_DESC,
         OUTDIAMETER,
         WALLTHICK,
         LENGTHMIN,
         LENGTHMAX,
         OUTDIAMETER_IN,
         WALLTHICK_IN,
         OUTNUM_CUT,
         LENGTH_IN,
         LENGTHMAX_IN,
         LENGTHMIN_IN,
         PLN_INSINGLE_NUM,
         PLN_INSINGLE_WT,
         PLN_INDOUBLE_NUM,
         PLN_INDOUBLE_WT,
         PLN_OUTSINGLE_NUM,
         PLN_OUTSINGLE_W,
         PLN_OUTDOUBLE_NUM,
         PLN_OUTDOUBLE_W,
         CREATE_NAME,
         CREATE_TIME,
         UPDATE_NAME,
         UPDATE_TIME,
         DOWNMAN,
         DOWNTIME,
         INDEX_SEQ,
         GX_PRO_SEQ,
         SPEC_CODE,
         SPEC_NAME,
         STD_CODE,
         STD_NAME,
         STD_STYLE,
         STD_STYLE_DESC,
         DECISION,
         FEED_HEAT_NO,
         FLAG_STOVE_NO,
         MEMO,
         ZY_BATCH_ID_ZG,
         HEAT_PLAN_NO_OLD,
         IF_PRODUCT,
         PLINE_CODE_W,
         PLINE_NAME_W,
         IS_BATCH,
         CHECK_NO,
         LOT_NO_GROUP,
         ?,
         IS_CLOSE,
         WAITING_DECISION_MEMO,
         IS_VISIBLE,
         LOADTIME FROM PLN_ZY_JGX_M_OLD WHERE HEAT_PLAN_NO_NEW=? AND HEAT_PLAN_NO = ?  
              ]]>
	</query>
	<query id="FrmPlanStoveG.addPlnC" desc="撤销合并新增从炉计划备份">
            <![CDATA[ 
            INSERT INTO PLN_ZY_JGX_C
  (HEAT_PLAN_NO,
   HEAT_PLAN_SQE,
   JUGDE_APPLY_CODE,
   ZY_BATCH_ID,
   STOVE_NO,
   JUDGE_STOVE_NO,
   BATCH_NO,
   BATCH_GROUD_NO,
   PRO_PLAN_ID,
   GX_PLAN_NO,
   PLINE_CODE,
   PLINE_NAME,
   OUTDIAMETER_IN,
   WALLTHICK_IN,
   OUTNUM_CUT,
   LENGTH_IN,
   LENGTHMAX_IN,
   LENGTHMIN_IN,
   PLAN_INDOUBLE_NUM,
   PLAN_INDOUBLE_WT,
   REAL_INDOUBLE_NUM,
   REAL_INDOUBLE_WT,
   REAL_OUTDOUBLE_NUM,
   REAL_OUTDOUBLE_WT,
   FEED_HEAT_NO,
   FLAG_STOVE_NO,
   PER_STATUS,
   BESIDE_STATUS,
   LOADTIME,
   PLINE_CODE_W,
   PLINE_NAME_W)
  SELECT HEAT_PLAN_NO,
         HEAT_PLAN_SQE,
         JUGDE_APPLY_CODE,
         ZY_BATCH_ID,
         STOVE_NO,
         JUDGE_STOVE_NO,
         BATCH_NO,
         BATCH_GROUD_NO,
         PRO_PLAN_ID,
         GX_PLAN_NO,
         PLINE_CODE,
         PLINE_NAME,
         OUTDIAMETER_IN,
         WALLTHICK_IN,
         OUTNUM_CUT,
         LENGTH_IN,
         LENGTHMAX_IN,
         LENGTHMIN_IN,
         PLAN_INDOUBLE_NUM,
         PLAN_INDOUBLE_WT,
         REAL_INDOUBLE_NUM,
         REAL_INDOUBLE_WT,
         REAL_OUTDOUBLE_NUM,
         REAL_OUTDOUBLE_WT,
         FEED_HEAT_NO,
         FLAG_STOVE_NO,
         PER_STATUS,
         BESIDE_STATUS,
         LOADTIME,
         PLINE_CODE_W,
         PLINE_NAME_W
    FROM PLN_ZY_JGX_C_OLD
   WHERE HEAT_PLAN_NO_NEW=? AND HEAT_PLAN_NO = ?
            ]]>
	</query>
	<query id="FrmPlanStoveG.queryPlanStoveReadyENew" desc="查询加工线实际炉计划">
            <![CDATA[ SELECT T.HEAT_PLAN_NO,
       T.GX_PRO_SEQ,
       CASE
         WHEN T.ZY_BATCH_ID IS NULL THEN
          (SELECT S.ZY_BATCH_ID
             FROM PLN_ORDER_RCL_S S
            WHERE S.PRO_PLAN_ID = T.PRO_PLAN_ID
              AND S.GX_PLAN_NO = T.GX_PLAN_NO)
         ELSE
          T.ZY_BATCH_ID
       END ZY_BATCH_ID,
       T.STOVE_NO,
       T.JUDGE_STOVE_NO,
       DECODE(T.PLANSTATUS,'00','计划','10','下发','20','生产中','30','生产完成','40','关闭') PLANSTATUS,
        DECODE(T.PER_STATUS,
              '00',
              '上料开始',
              '10',
              '探伤开始',
              '20',
              '切管开始',
              '30',
              '车丝开始',
              '40',
              '螺纹检验开始',
              '50',
              '拧接开始',
              '60',
              '通径开始',
              '70',
              '水压开始',
              '80',
              '倒凌开始',
              '90',
              '测量点开始','11','交库开始','') PER_STATUS,
       DECODE(T.BESIDE_STATUS,
              '00',
              '上料结束',
              '10',
              '探伤结束',
              '20',
              '切管结束',
              '30',
              '车丝结束',
              '40',
              '螺纹检验结束',
              '50',
              '拧接结束',
              '60',
              '通径结束',
              '70',
              '水压结束',
              '80',
              '倒凌结束',
              '90',
              '测量点结束','11','交库结束','') BESIDE_STATUS,
       T.UPPER_HEATPLAN_ID,
       T.PRO_PLAN_ID,
       T.GX_PLAN_NO,
       T.PLINE_CODE,
       T.PLINE_NAME,
       T.PROCESS_CODE_C,
       T.PROCESS_DESC_C,
       T.UPPER_PROCESS_CODE,
       T.NEXT_PROCESS_CODE,
       T.GOWHERE_CODE,
       T.GOWHERE_NAME,
       T.PROD_STANDARD,
       T.OUTPUT_STANDARD,
       DECODE(T.ISENDGX,'1','是','/') ISENDGX,
       DECODE(T.IF_MATCH_ODD, '1', '利库计划','2','组炉计划','3','精整利库','4','精整返线计划','5','合并计划','正常计划') IF_MATCH_ODD,
        DECODE(T.IF_DO_HEAT_PLAN,'1','有','无') IF_DO_HEAT_PLAN,
       T.ORDER_SOURCE,
       T.ORD_LN_DLY_PK,
       T.ORDER_NO || '/' || T.ORDER_SEQ ORDER_NO,
       T.ORDER_SEQ,
       T.DELIVERY_NO,
       T.REQ_BL_ID,
       T.IF_EXPORT,
       T.PRIORITY,
       T.PRIORITY_MEMO,
       T.PRO_MONTH,
       TO_CHAR(TO_DATE(T.PRO_DAY, 'YYYY-MM-DD'), 'YYYY-MM-DD') PRO_DAY,
       TO_CHAR(TO_DATE(T.BAL_YEAR_MONTH, 'YYYY-MM'), 'YYYY-MM') BAL_YEAR_MONTH,
       DECODE(T.IF_MONITOR,'1','是','/') IF_MONITOR,
       T.PRDCR_NO,
       T.MONITOR_POINT,
       T.BOM,
       T.WHOLE_BACKLOG,
       T.WHOLE_BACKLOG_DESC,
       T.STATION_ROAD,
       T.CIC,
       T.PIC,
       T.SIC,
       T.DIC,
       T.WIC,T.GIC,
       T.CRAFT_FILE_NO,
       T.CRAFT_FILE_MAN,
       T.CRAFT_SEQ,
       T.SEC_CRAFT_FILE_NO,
       T.GRADECODE,
       T.GRADENAME,
       T.STEELCODE,
       T.STEELNAME,
       T.PRODUCCODE,
       T.PRODUCNAME,
       T.MODEL_CODE,
       T.MODEL_DESC,
       T.INWL_ID,
       T.INWL_DESC,
       T.OUTWL_ID,
       T.OUTWL_DESC,
       T.OUTDIAMETER_IN,
       T.WALLTHICK_IN,
       T.LENGTH_IN,
       T.LENGTHMAX_IN,
       T.LENGTHMIN_IN,
       T.OUTNUM_CUT,
       T.OUTDIAMETER,
       T.WALLTHICK,
       T.LENGTHMIN,
       T.LENGTHMAX,
       NVL(T.PLN_INSINGLE_NUM,0) PLN_INSINGLE_NUM,
       NVL(T.PLN_INSINGLE_WT,0) PLN_INSINGLE_WT,
       NVL(T.PLN_INDOUBLE_NUM,0) PLN_INDOUBLE_NUM,
       NVL(T.PLN_INDOUBLE_WT,0) PLN_INDOUBLE_WT,
       NVL(T.PLN_OUTSINGLE_NUM,0) PLN_OUTSINGLE_NUM,
       NVL(T.PLN_OUTSINGLE_W,0) PLN_OUTSINGLE_W,
       NVL(T.PLN_OUTDOUBLE_NUM,0) PLN_OUTDOUBLE_NUM,
       NVL(T.PLN_OUTDOUBLE_W,0) PLN_OUTDOUBLE_W,
       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.DOWNMAN,
       TO_CHAR(T.DOWNTIME, 'YYYY-MM-DD HH24:MI:SS') DOWNTIME,
       T.INDEX_SEQ,  
       T1.HEAT_PLAN_SQE,
       T1.BATCH_NO,
       T1.BATCH_GROUD_NO,
       T1.JUGDE_APPLY_CODE,     
       T1.PLAN_INDOUBLE_NUM,
       T1.PLAN_INDOUBLE_WT,
       T1.REAL_INDOUBLE_NUM,
       T1.REAL_INDOUBLE_WT,
       T1.REAL_OUTDOUBLE_NUM,
       T1.REAL_OUTDOUBLE_WT,
       T.DECISION,
        CASE WHEN T.UPPER_PROCESS_CODE='D' THEN
       (SELECT MAX(DECODE(Z.PLANSTATUS,'00','计划','10','下发','20','生产中','30','生产完成','40','关闭')) FROM PLN_ZY_ZG_M Z WHERE Z.Heat_Plan_No=T.Upper_Heatplan_Id) 
       WHEN T.UPPER_PROCESS_CODE='E' THEN 
          (SELECT MAX(DECODE(Z.PLANSTATUS,'00','计划','10','下发','20','生产中','30','生产完成','40','关闭')) FROM PLN_ZY_DBK_M Z WHERE Z.Heat_Plan_No=T.Upper_Heatplan_Id) 
           WHEN T.UPPER_PROCESS_CODE='F' THEN 
          (SELECT MAX(DECODE(Z.PLANSTATUS,'00','计划','10','下发','20','生产中','30','生产完成','40','关闭')) FROM PLN_ZY_RCL_M Z WHERE Z.Heat_Plan_No=T.Upper_Heatplan_Id) 
         ELSE
           ''
           END PLANSTATUS_GX,
           (SELECT NVL(SUM(M.ACT_COUNT), 0)
          FROM MAT_BC_M M
         WHERE M.JUDGE_STOVE_NO = T1.FEED_HEAT_NO
           AND NVL(M.JUGDE_APPLY_CODE, '/') = NVL(T1.JUGDE_APPLY_CODE, '/')
           AND M.HEAT_PLAN_NO_NEXT = T.HEAT_PLAN_NO
           AND M.BATCH_NO= T1.BATCH_NO
           AND M.BATCH_GROUD_NO = T1.BATCH_GROUD_NO
           AND M.MAT_STATUS = '80150103'
           AND M.NEXT_PROCESS_CDOE='G') ACT_COUNT,
            T.FEED_HEAT_NO,
           T.FLAG_STOVE_NO,T.MEMO,T.ZY_BATCH_ID_ZG,
     (select GET_BUTTRESS(T1.FEED_HEAT_NO,T1.BATCH_NO,T1.BATCH_GROUD_NO,'G',T1.HEAT_PLAN_NO) from dual) Storage_No,
    T.LOT_NO_GROUP,T.LOT_NO_SQE,T.HEAT_PLAN_NO_NEW
  FROM PLN_ZY_JGX_M_OLD T,PLN_ZY_JGX_C_OLD T1
 WHERE T.HEAT_PLAN_NO=T1.HEAT_PLAN_NO(+)
              ]]>
	</query>
	<query id = "FrmPlanStoveG.updateGoWhere" desc = "修改去向">
		UPDATE PLN_ZY_JGX_M T
		SET T.GOWHERE_CODE = '#GOWHERE_CODE#', T.GOWHERE_NAME = '#GOWHERE_NAME#'
		WHERE T.HEAT_PLAN_NO = '#HEAT_PLAN_NO#'
	</query>
	<query id = "FrmPlanStoveG.updateLoadFlag" desc = "修改上料标识">
		UPDATE PLN_ZY_JGX_M T
		SET T.IS_LOAD_FLAG = '#IS_LOAD_FLAG#'
		WHERE T.HEAT_PLAN_NO = '#HEAT_PLAN_NO#'
	</query>
	<query id = "FrmPlanStoveG.updateIsWeight" desc = "修改过磅标识">
		UPDATE PLN_ZY_JGX_M T
		SET T.IS_WEIGHT_FLAG = '#IS_WEIGHT_FLAG#'
		WHERE T.HEAT_PLAN_NO = '#HEAT_PLAN_NO#'
	</query>
</queryMap>