<?xml version="1.0" encoding="UTF-8"?>
<queryMap desc="炉计划公共类">

	<query id="StoveHelper.initPline" desc="初始化产线">
            <![CDATA[
            SELECT T.PLINE_CODE, T.PLINE_NAME
  FROM COM_BASE_PLINE T
 WHERE T.PROCESS_CODE = ?
   AND T.VALIDFLAG = '1'
              ]]>
	</query>
<query id="StoveHelper.getPlanZyZgM" desc="查询轧管虚拟炉计划">
            <![CDATA[
             SELECT 
       T.HEAT_PLAN_NO,
       T.GX_PRO_SEQ,
       T.ZY_BATCH_ID,
       CASE
         WHEN T.STOVE_NO IS NULL AND T.UPPER_PROCESS_CODE = 'B' THEN
          (SELECT O.STOVE_NO
             FROM PLN_STEELFOR_ORD O
            WHERE O.FURNACENO || '/' || O.SEQUENCENO = T.UPPER_HEATPLAN_ID)
         WHEN T.STOVE_NO IS NULL AND T.UPPER_PROCESS_CODE = 'C' THEN
            (SELECT O.STOVE_NO
             FROM PLN_STEELFOR_ORD O,PLN_ZY_DZ_M D
            WHERE O.FURNACENO || '/' || O.SEQUENCENO =D.UPPER_HEATPLAN_ID
            AND D.HEAT_PLAN_NO=T.UPPER_HEATPLAN_ID)
         ELSE
          T.STOVE_NO
       END STOVE_NO,
         CASE
         WHEN T.JUDGE_STOVE_NO IS NULL AND T.UPPER_PROCESS_CODE = 'B' THEN
          (SELECT O.JUDGE_STOVE_NO
             FROM PLN_STEELFOR_ORD O
            WHERE O.FURNACENO || '/' || O.SEQUENCENO = T.UPPER_HEATPLAN_ID)
         WHEN T.JUDGE_STOVE_NO IS NULL AND T.UPPER_PROCESS_CODE = 'C' THEN
            (SELECT O.JUDGE_STOVE_NO
             FROM PLN_STEELFOR_ORD O,PLN_ZY_DZ_M D
            WHERE O.FURNACENO || '/' || O.SEQUENCENO = D.UPPER_HEATPLAN_ID
            AND D.HEAT_PLAN_NO=T.UPPER_HEATPLAN_ID)
         ELSE
          T.JUDGE_STOVE_NO
       END JUDGE_STOVE_NO,
        CASE
         WHEN T.FLAG_STOVE_NO IS NULL AND T.UPPER_PROCESS_CODE = 'B' THEN
          (SELECT O.FLAG_STOVE_NO
             FROM PLN_STEELFOR_ORD O
            WHERE O.FURNACENO || '/' || O.SEQUENCENO = T.UPPER_HEATPLAN_ID)
         WHEN T.FLAG_STOVE_NO IS NULL AND T.UPPER_PROCESS_CODE = 'C' THEN
            (SELECT O.FLAG_STOVE_NO
             FROM PLN_STEELFOR_ORD O,PLN_ZY_DZ_M D
            WHERE O.FURNACENO || '/' || O.SEQUENCENO = D.UPPER_HEATPLAN_ID
            AND D.HEAT_PLAN_NO=T.UPPER_HEATPLAN_ID)
         ELSE
          T.FLAG_STOVE_NO
       END FLAG_STOVE_NO,
       T.PLANSTATUS,
       T.UPPER_HEATPLAN_ID,
       T.PRO_PLAN_ID,
       T.GX_PLAN_NO,
       T.CCM_PRO_PLAN_ID,
       T.CCM_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.ISENDGX,
       T.IF_MATCH_ODD,
       T.IF_DO_HEAT_PLAN,
       T.ORDER_SOURCE,
       T.ORD_LN_DLY_PK,
       T.ORDER_NO,
       T.ORDER_SEQ,
       T.DELIVERY_NO,
       T.REQ_BL_ID,
       T.IF_EXPORT,
       T.PRIORITY,
       T.PRIORITY_MEMO,
       T.PRO_MONTH,
       T.IF_LEN_CONTROL,
       T.IF_MINUS_SIC_ROLL,
       T.PROD_STANDARD,
       T.OUTPUT_STANDARD,
       T.DECISION,
       T.PROGY_MEMO,
       T.GOWHERE_CODE,
       T.GOWHERE_NAME,
       T.OUTS_BILLET_FL,
       T.GPTYPE,
       T.INWL_ID,
       T.INWL_DESC,
       T.OUTWL_ID,
       T.OUTWL_DESC,
       T.GRADECODE,
       T.GRADENAME,
       T.STEELCODE,
       T.STEELNAME,
       T.PRODUCCODE,
       T.PRODUCNAME,
       T.MODEL_CODE,
       T.MODEL_DESC,
       T.DIAMETER,
       T.LEN_GP_SINGLE,
       T.WT_GP_SINGLE,
       T.PLN_INSINGLE_NUM,
       T.PLN_INSINGLE_WT,
       T.PLN_OUTSINGLE_NUM,
       T.PLN_OUTSINGLE_W,
       T.OUTDIAMETER,
       T.WALLTHICK,
       T.OUTDIAMETER_ZG,
       T.WALLTHICK_ZG,
       T.AIMOUTDIAMETER,
       T.AIMWALLTHICK,
       T.THICKNESS_WALL,
       T.LEN_ROLL_MAX,
       T.LEN_ROLL_MIN,
       T.AIMLENGTH,
       T.ROLL_LENGTH,
       T.OUTNUM_CUT,
       T.CUT_TYPE,
       T.LEN_CUTEND,
       T.LEN_CUTHEAD,
       T.DIAMETER_MANDREL,
       T.PASS_CODE,
       T.PASS_NAME,
       T.IF_MONITOR,
       T.PRDCR_NO,
       T.MONITOR_POINT,
       T.BOM,
       T.WHOLE_BACKLOG,
       T.WHOLE_BACKLOG_DESC,
       T.CIC,
       T.PIC,
       T.SIC,
       T.DIC,
       T.CRAFT_FILE_NO,
       T.CRAFT_FILE_MAN,
       T.CRAFT_SEQ,
       T.SEC_CRAFT_FILE_NO,
       T.STATION_ROAD,
       T.PRO_DAY,
       T.BAL_YEAR_MONTH,
       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.IS_LOAD,
       T.PLN_TYPE,
       T.INDEX_SEQ,T.MEMO,T.FEED_HEAT_NO,(SELECT Y.ABRVITION
          FROM SLM_BASE_CUSTOMER Y
         WHERE Y.CUSTOMER_NO = S.FINAL_USER) FINAL_USER_DESC,
       S.FINAL_USER,
       S.SPEC_CODE,
       REPLACE(UPPER(S.SPEC_NAME), 'X', '*') SPEC_NAME,
       S.LENGTHDISC,
       S.STD_STYLE_DESC,
       S.STD_CODE,
       S.STD_NAME,
       (SELECT '【' || BASENAME || '】'
          FROM COM_BASE_INFO
         WHERE BASECODE = S.MONITORDEMAND) MONITORDEMAND,
       T.FEED_HEAT_NO,
 (SELECT L.STD_STYLE FROM SLM_ORDER_LINE L WHERE L.ORD_PK=S.ORD_PK AND L.ORD_LN_PK=S.ORD_LN_PK) STD_STYLE,T1.PLN_DIVIDE_ID
FROM PLN_ZY_ZG_M T, PLN_SALEORD S, PLN_ORDER_ZG_S T1
WHERE T.ORD_LN_DLY_PK = S.ORD_LN_DLY_PK
AND T.PRO_PLAN_ID=T1.PRO_PLAN_ID
AND T.GX_PLAN_NO =T1.GX_PLAN_NO

              ]]>
	</query>
	<query id="StoveHelper.getPlanZyZgC" desc="查询轧管实际炉计划">
            <![CDATA[
           SELECT 
       T.HEAT_PLAN_NO,
       T.HEAT_PLAN_SQE,
       T.JUGDE_APPLY_CODE,
       T.ZY_BATCH_ID,
       T.STOVE_NO,
       T.JUDGE_STOVE_NO,
       T.PRO_PLAN_ID,
       T.GX_PLAN_NO,
       T.PLINE_CODE,
       T.PLINE_NAME,
       T.DIAMETER,
       T.LEN_GP_SINGLE,
       T.WT_GP_SINGLE,
       T.CUT_NUM_GP,
       T.LENGTH_M,
       T.WEIGHT_M,
       T.PLAN_INDOUBLE_NUM,
       T.PLAN_INDOUBLE_WT,
       T.REAL_INDOUBLE_NUM,
       T.REAL_INDOUBLE_WT,
       T.FLAG_STOVE_NO,
       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.CUT_TARGET,
       NVL(T.CUT_LENGTH,0) CUT_LENGTH,
       NVL(T.CUT_WEIGHT,0) CUT_WEIGHT,
       T.FEED_HEAT_NO,T.LENGTH_M_OLD,nvl(T.PLAN_WEIGTH,0) PLAN_WEIGTH
 FROM PLN_ZY_ZG_C T
 WHERE T.HEAT_PLAN_NO = ?
              ]]>
	</query>
	<query id="StoveHelper.getPlanZyDzM" desc="查询锻造虚拟炉计划">
            <![CDATA[
             SELECT 
       T.HEAT_PLAN_NO,
       T.GX_PRO_SEQ,
       T.ZY_BATCH_ID,
       T.STOVE_NO,
       T.JUDGE_STOVE_NO,
       T.FLAG_STOVE_NO,
       T.UPPER_HEATPLAN_ID,
       T.PLANSTATUS,
       T.NODE_ESTATUS,
       T.UPPER_PROCESS_CODE,
       T.NEXT_PROCESS_CODE,
       T.ISENDGX,
       T.IF_MATCH_ODD,
       T.IF_DO_HEAT_PLAN,
       T.PRO_PLAN_ID,
       T.GX_PLAN_NO,
       T.CCM_PRO_PLAN_ID,
       T.CCM_GX_PLAN_NO,
       T.GOWHERE_CODE,
       T.GOWHERE_NAME,
       T.PLINE_CODE,
       T.PLINE_NAME,
       T.CASTINGTYPE,
       T.GRADECODE,
       T.GRADENAME,
       T.STEELCODE,
       T.STEELNAME,
       T.WLID_IN,
       T.WLDESC_IN,
       T.OUTWL_ID,
       T.OUTWL_DESC,
       T.PROD_STANDARD,
       T.OUTPUT_STANDARD,
       T.DIAMETER_IN,
       T.LENGTH_IN,
       T.WT_ONE_IN,
       T.LEN_GP_SINGLE,
       T.WT_GP_SINGLE,
       T.PLN_INSINGLE_NUM,
       T.PLN_INSINGLE_WT,
       T.CUT_NUM_GP,
       T.PLN_INDOUBLE_NUM,
       T.PLN_INDOUBLE_WT,
       T.DIAMETER_OUT,
       T.LENGTH_OUT,
       T.OUT_WT_ONE,
       T.PLN_OUTSINGLE_NUM,
       T.PLN_OUTSINGLE_W,
       T.CUT_NUM_OUT,
       T.PLN_OUTDOUBLE_NUM,
       T.PLN_OUTDOUBLE_W,
       T.LEN_CUTHEAD,
       T.LEN_CUTEND,
       T.ORDER_SOURCE,
       T.ORD_LN_DLY_PK,
       T.ORDER_NO,
       T.ORDER_SEQ,
       T.DELIVERY_NO,
       T.REQ_BL_ID,
       T.IF_EXPORT,
       T.PRIORITY,
       T.PRIORITY_MEMO,
       T.PRO_MONTH,
       T.IF_MONITOR,
       T.PRDCR_NO,
       T.MONITOR_POINT,
       T.BOM,
       T.INDEX_SEQ,
       T.WHOLE_BACKLOG,
       T.WHOLE_BACKLOG_DESC,
       T.CIC,
       T.PIC,
       T.SIC,
       T.DIC,
       T.CRAFT_FILE_NO,
       T.CRAFT_FILE_MAN,
       T.CRAFT_SEQ,
       T.SEC_CRAFT_FILE_NO,
       T.STATION_ROAD,
       T.PRO_DAY,
       T.BAL_YEAR_MONTH,
       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.SUBCONTRACT_FLAG
 FROM PLN_ZY_DZ_M T
 WHERE 1=1
             ]]>
	</query>
		<query id="StoveHelper.getPlanZyRclM" desc="查询热处理虚拟炉计划">
            <![CDATA[
             SELECT 
       T.HEAT_PLAN_NO,
       T.GX_PRO_SEQ,
       T.ZY_BATCH_ID,
       T.STOVE_NO,
       T.JUDGE_STOVE_NO,
       T.PLANSTATUS,
       T.PER_STATUS,
       T.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,
       T.ISENDGX,
       T.IF_MATCH_ODD,
       T.IF_DO_HEAT_PLAN,
       T.ORDER_SOURCE,
       T.ORD_LN_DLY_PK,
       T.ORDER_NO,
       T.ORDER_SEQ,
       T.DELIVERY_NO,
       T.REQ_BL_ID,
       T.IF_EXPORT,
       T.PRIORITY,
       T.PRIORITY_MEMO,
       T.PRO_MONTH,
       T.PRO_DAY,
       T.BAL_YEAR_MONTH,
       T.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.CRAFT_FILE_NO,
       T.CRAFT_FILE_MAN,
       T.CRAFT_SEQ,
       T.SEC_CRAFT_FILE_NO,
       T.STEELCODE,
       T.STEELNAME,
       T.GRADECODE,
       T.GRADENAME,
       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.OUTNUM_CUT,
       T.LENGTH_IN,
       T.LENGTHMAX_IN,
       T.LENGTHMIN_IN,
       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.BATCH_NO,
       T.INDEX_SEQ, T.PROCESS_SEQ
 FROM PLN_ZY_RCL_M T
 WHERE 1=1
             ]]>
	</query>
		<query id="StoveHelper.getPlanZyDbkM" desc="查询镦拔扩虚拟炉计划">
            <![CDATA[
           SELECT 
       T.HEAT_PLAN_NO,
       T.GX_PRO_SEQ,
       T.ZY_BATCH_ID,
       T.STOVE_NO,
       T.JUDGE_STOVE_NO,
       T.BATCH_NO,
       T.PLANSTATUS,
       T.PER_STATUS,
       T.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,
       T.ISENDGX,
       T.IF_MATCH_ODD,
       T.IF_DO_HEAT_PLAN,
       T.ORDER_SOURCE,
       T.ORD_LN_DLY_PK,
       T.ORDER_NO,
       T.ORDER_SEQ,
       T.DELIVERY_NO,
       T.REQ_BL_ID,
       T.IF_EXPORT,
       T.PRIORITY,
       T.PRIORITY_MEMO,
       T.PRO_MONTH,
       T.PRO_DAY,
       T.BAL_YEAR_MONTH,
       T.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.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.AIMOUTDIAMETER,
       T.AIMWALLTHICK,
       T.AIMLENGTH,
       T.AIMLENGTH_MAX,
       T.AIMLENGTH_MIN,
       T.LEN_CUTHEAD,
       T.LEN_CUTEND,
       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
 FROM PLN_ZY_DBK_M T
 WHERE 1=1  
             ]]>
	</query>
		<query id="StoveHelper.getPlanZyJgxM" desc="查询加工线虚拟炉计划">
            <![CDATA[
             SELECT 
       T.HEAT_PLAN_NO,
       T.ZY_BATCH_ID,
       T.STOVE_NO,
       T.JUDGE_STOVE_NO,
       T.BATCH_NO,
       T.PLANSTATUS,
       T.PER_STATUS,
       T.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,
       T.ISENDGX,
       T.IF_MATCH_ODD,
       T.IF_DO_HEAT_PLAN,
       T.ORDER_SOURCE,
       T.ORD_LN_DLY_PK,
       T.ORDER_NO,
       T.ORDER_SEQ,
       T.DELIVERY_NO,
       T.REQ_BL_ID,
       T.IF_EXPORT,
       T.PRIORITY,
       T.PRIORITY_MEMO,
       T.PRO_MONTH,
       T.PRO_DAY,
       T.BAL_YEAR_MONTH,
       T.IF_MONITOR,
       T.PRDCR_NO,
       T.MONITOR_POINT,
       T.MONITOR_MENT,
       T.MONITOR_MAN,
       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_SEQ,
       T.CRAFT_FILE_MAN,
       T.SEC_CRAFT_FILE_NO,
       T.INWL_ID,
       T.INWL_DESC,
       T.OUTWL_ID,
       T.OUTWL_DESC,
       T.STEELCODE,
       T.STEELNAME,
       T.GRADECODE,
       T.GRADENAME,
       T.PRODUCCODE,
       T.PRODUCNAME,
       T.MODEL_CODE,
       T.MODEL_DESC,
       T.OUTDIAMETER,
       T.WALLTHICK,
       T.LENGTHMIN,
       T.LENGTHMAX,
       T.OUTDIAMETER_IN,
       T.WALLTHICK_IN,
       T.OUTNUM_CUT,
       T.LENGTH_IN,
       T.LENGTHMAX_IN,
       T.LENGTHMIN_IN,
       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
 FROM PLN_ZY_JGX_M T
 WHERE 1=1
             ]]>
	</query>
		<query id="StoveHelper.getPlanZyJgM" desc="查询锻造虚拟炉计划">
            <![CDATA[
             ]]>
	</query>
		<query id="StoveHelper.updatePlanZyZgM" desc="修改轧管虚拟炉计划">
            <![CDATA[
            UPDATE PLN_ZY_ZG_M T
   SET T.GX_PRO_SEQ = '#GX_PRO_SEQ#'
 WHERE T.HEAT_PLAN_NO = '#HEAT_PLAN_NO#'
             ]]>
	</query>
	<query id="StoveHelper.getPlanZyMD" desc="查询轧管虚拟炉计划">
            <![CDATA[
             SELECT 
       T.HEAT_PLAN_NO,
       T.GX_PRO_SEQ,
       T.ZY_BATCH_ID,
       T.STOVE_NO,
       T.JUDGE_STOVE_NO,
       T.PLANSTATUS,
       T.UPPER_HEATPLAN_ID,
       T.PRO_PLAN_ID,
       T.GX_PLAN_NO,
       T.CCM_PRO_PLAN_ID,
       T.CCM_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.ISENDGX,
       T.IF_MATCH_ODD,
       T.IF_DO_HEAT_PLAN,
       T.ORDER_SOURCE,
       T.ORD_LN_DLY_PK,
       T.ORDER_NO,
       T.ORDER_SEQ,
       T.DELIVERY_NO,
       T.REQ_BL_ID,
       T.IF_EXPORT,
       T.PRIORITY,
       T.PRIORITY_MEMO,
       T.PRO_MONTH,
       T.IF_LEN_CONTROL,
       T.IF_MINUS_SIC_ROLL,
       T.PROD_STANDARD,
       T.OUTPUT_STANDARD,
       T.DECISION,
       T.PROGY_MEMO,
       T.GOWHERE_CODE,
       T.GOWHERE_NAME,
       T.OUTS_BILLET_FL,
       T.GPTYPE,
       T.INWL_ID,
       T.INWL_DESC,
       T.OUTWL_ID,
       T.OUTWL_DESC,
       T.GRADECODE,
       T.GRADENAME,
       T.STEELCODE,
       T.STEELNAME,
       T.PRODUCCODE,
       T.PRODUCNAME,
       T.MODEL_CODE,
       T.MODEL_DESC,
       T.DIAMETER,
       T.LEN_GP_SINGLE,
       T.WT_GP_SINGLE,
       T.PLN_INSINGLE_NUM,
       T.PLN_INSINGLE_WT,
       T.PLN_OUTSINGLE_NUM,
       T.PLN_OUTSINGLE_W,
       T.OUTDIAMETER,
       T.WALLTHICK,
       T.OUTDIAMETER_ZG,
       T.WALLTHICK_ZG,
       T.AIMOUTDIAMETER,
       T.AIMWALLTHICK,
       T.THICKNESS_WALL,
       T.LEN_ROLL_MAX,
       T.LEN_ROLL_MIN,
       T.AIMLENGTH,
       T.ROLL_LENGTH,
       T.OUTNUM_CUT,
       T.CUT_TYPE,
       T.LEN_CUTEND,
       T.LEN_CUTHEAD,
       T.DIAMETER_MANDREL,
       T.PASS_CODE,
       T.PASS_NAME,
       T.IF_MONITOR,
       T.PRDCR_NO,
       T.MONITOR_POINT,
       T.BOM,
       T.WHOLE_BACKLOG,
       T.WHOLE_BACKLOG_DESC,
       T.CIC,
       T.PIC,
       T.SIC,
       T.DIC,
       T.CRAFT_FILE_NO,
       T.CRAFT_FILE_MAN,
       T.CRAFT_SEQ,
       T.SEC_CRAFT_FILE_NO,
       T.STATION_ROAD,
       T.PRO_DAY,
       T.BAL_YEAR_MONTH,
       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.IS_LOAD,
       T.PLN_TYPE,
       T.FLAG_STOVE_NO,
       T.INDEX_SEQ,
       T1.CUT_NUM_GP,
       T1.LENGTH_M,T1.HEAT_PLAN_SQE, T1.PLAN_INDOUBLE_NUM,
       T1.LENGTH_M_OLD,
       T1.PLAN_INDOUBLE_WT,NVL(T1.CUT_LENGTH,0) CUT_LENGTH,
       NVL(T1.PLAN_WEIGTH,0) PLAN_WEIGTH,
       T1.JUGDE_APPLY_CODE
 FROM PLN_ZY_ZG_M T,PLN_ZY_ZG_C T1
 WHERE T.HEAT_PLAN_NO = T1.HEAT_PLAN_NO(+)
              ]]>
	</query>
	<query id="StoveHelper.getPlanZyMC" desc="查询轧管实际炉计划">
            <![CDATA[
            SELECT T.HEAT_PLAN_NO,
       T.GX_PRO_SEQ,
       T.ZY_BATCH_ID,
      CASE
         WHEN T.STOVE_NO IS NULL AND T.UPPER_PROCESS_CODE = 'B' THEN
          (SELECT O.STOVE_NO
             FROM PLN_STEELFOR_ORD O
            WHERE O.FURNACENO || '/' || O.SEQUENCENO = T.UPPER_HEATPLAN_ID)  
         ELSE
          T.STOVE_NO
       END STOVE_NO,
         CASE
         WHEN T.JUDGE_STOVE_NO IS NULL AND T.UPPER_PROCESS_CODE = 'B' THEN
          (SELECT O.JUDGE_STOVE_NO
             FROM PLN_STEELFOR_ORD O
            WHERE O.FURNACENO || '/' || O.SEQUENCENO = T.UPPER_HEATPLAN_ID)
         ELSE
          T.JUDGE_STOVE_NO
       END JUDGE_STOVE_NO,
        CASE
         WHEN T.FLAG_STOVE_NO IS NULL AND T.UPPER_PROCESS_CODE = 'B' THEN
          (SELECT O.FLAG_STOVE_NO
             FROM PLN_STEELFOR_ORD O
            WHERE O.FURNACENO || '/' || O.SEQUENCENO = T.UPPER_HEATPLAN_ID)
         ELSE
          T.FLAG_STOVE_NO
       END FLAG_STOVE_NO,
       T.PLANSTATUS,
       T.UPPER_HEATPLAN_ID,
       T.PRO_PLAN_ID,
       T.GX_PLAN_NO,
       T.CCM_PRO_PLAN_ID,
       T.CCM_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.ISENDGX,
       T.IF_MATCH_ODD,
       T.IF_DO_HEAT_PLAN,
       T.ORDER_SOURCE,
       T.ORD_LN_DLY_PK,
       T.ORDER_NO,
       T.ORDER_SEQ,
       T.DELIVERY_NO,
       T.REQ_BL_ID,
       T.IF_EXPORT,
       T.PRIORITY,
       T.PRIORITY_MEMO,
       T.PRO_MONTH,
       T.IF_LEN_CONTROL,
       T.IF_MINUS_SIC_ROLL,
       T.PROD_STANDARD,
       T.OUTPUT_STANDARD,
       T.DECISION,
       T.PROGY_MEMO,
       T.GOWHERE_CODE,
       T.GOWHERE_NAME,
       T.OUTS_BILLET_FL,
       T.GPTYPE,
       T.INWL_ID,
       T.INWL_DESC,
       T.OUTWL_ID,
       T.OUTWL_DESC,
       T.GRADECODE,
       T.GRADENAME,
       T.STEELCODE,
       T.STEELNAME,
       T.PRODUCCODE,
       T.PRODUCNAME,
       T.MODEL_CODE,
       T.MODEL_DESC,
       T.OUTDIAMETER,
       T.WALLTHICK,
       T.OUTDIAMETER_ZG,
       T.WALLTHICK_ZG,
       T.AIMOUTDIAMETER,
       T.AIMWALLTHICK,
       T.THICKNESS_WALL,
       T.LEN_ROLL_MAX,
       T.LEN_ROLL_MIN,
       T.AIMLENGTH,
       T.ROLL_LENGTH,
       T.OUTNUM_CUT,
       T.CUT_TYPE,
       T.LEN_CUTEND,
       T.LEN_CUTHEAD,
       T.DIAMETER_MANDREL,
       T.PASS_CODE,
       T.PASS_NAME,
       T.IF_MONITOR,
       T.PRDCR_NO,
       T.MONITOR_POINT,
       T.BOM,
       T.WHOLE_BACKLOG,
       T.WHOLE_BACKLOG_DESC,
       T.CIC,
       T.PIC,
       T.SIC,
       T.DIC,
       T.CRAFT_FILE_NO,
       T.CRAFT_FILE_MAN,
       T.CRAFT_SEQ,
       T.SEC_CRAFT_FILE_NO,
       T.STATION_ROAD,
       T.PRO_DAY,
       T.BAL_YEAR_MONTH,
       T.IS_LOAD,
       T.PLN_TYPE,
       T.INDEX_SEQ,
       T.PLN_INSINGLE_NUM,
       T.PLN_INSINGLE_WT,
       T.DIAMETER,
       T.LEN_GP_SINGLE,
       T.WT_GP_SINGLE,
       (SELECT Y.ABRVITION
          FROM SLM_BASE_CUSTOMER Y
         WHERE Y.CUSTOMER_NO = S.FINAL_USER) FINAL_USER_DESC,
       S.FINAL_USER,
       S.SPEC_CODE,
       REPLACE(UPPER(S.SPEC_NAME), 'X', '*') SPEC_NAME,
       S.LENGTHDISC,
       S.STD_STYLE_DESC,
       S.STD_CODE,
       S.STD_NAME,
       (SELECT '【' || BASENAME || '】'
          FROM COM_BASE_INFO
         WHERE BASECODE = S.MONITORDEMAND) MONITORDEMAND,
       T.FEED_HEAT_NO,
       T2.PLN_DIVIDE_ID,
       (SELECT L.STD_STYLE
          FROM SLM_ORDER_LINE L
         WHERE L.ORD_PK = S.ORD_PK
           AND L.ORD_LN_PK = S.ORD_LN_PK) STD_STYLE
  FROM PLN_ZY_ZG_M T, PLN_SALEORD S, PLN_ORDER_ZG_S T2
 WHERE T.ORD_LN_DLY_PK = S.ORD_LN_DLY_PK
   AND T.PRO_PLAN_ID = T2.PRO_PLAN_ID
   AND T.GX_PLAN_NO = T2.GX_PLAN_NO
   AND T.HEAT_PLAN_NO = ?           
            ]]>
	</query>
	<query id="StoveHelper.getSalgPermissions" desc="获取组织权限">
		<![CDATA[
select t.departid,t.departname from core_app_department t where t.depttype = '3'   
		]]>
	</query>
		<query id="StoveHelper.queryPlnSteProPlan" desc="根据浇次集合获取连铸订单">
		<![CDATA[
SELECT 
       T2.PRO_PLAN_ID,
       T2.GX_PLAN_NO
  FROM (SELECT   CASE
                 WHEN T.MERGE_NO IS NULL THEN
                  T.PRO_PLAN_ID
                 ELSE
                  T1.PRO_PLAN_ID
               END PRO_PLAN_ID,
               CASE
                 WHEN T.MERGE_NO IS NULL THEN
                  T.GX_PLAN_NO
                 ELSE
                  T1.GX_PLAN_NO
               END GX_PLAN_NO
          FROM PLN_STEELFOR_ORD T, PLN_STEELFOR_MERGE T1
         WHERE T.MERGE_NO = T1.MERGE_NO(+)
           AND T.SURPLUSFLAG = '0'   
		]]>
	</query>
	<query id="StoveHelper.queryMrialBom" desc="查询投入产出Bom">
		<![CDATA[
		 SELECT B.D_IN_MATERIAL_NO,
          B.D_IN_MATERIAL_DESC,
          B.D_OUT_MATERIAL_NO,
          B.D_OUT_MATERIAL_DESC,
          B.BOM,
          B.MSC,
          B.MSC_PLINE,
          B.SPEC_CODE_R,
          B.SPEC_NAME_R
     FROM SLM_ORD_DESIGN_BOM B,
          CRAFT_ORD_LINE_BOM B1,
          CRAFT_ORD_DESIGN   T,
          PLN_SALEORD        S,
          PLN_ORDER_ZG_S     T1
    WHERE T.ORD_LN_PK = S.ORD_LN_PK
      AND T.CRAFT_SEQ = T.CRAFT_SEQ
      AND S.ORD_LN_DLY_PK = T1.ORD_LN_DLY_PK
      AND B1.DESGIN_KEY = T.DESGIN_KEY
      AND B.BOM = B1.BOM
      AND B.GRADENAME = ?
      AND B.D_IN_MATERIAL_DESC=?
     AND (CASE
         WHEN B.SPEC_NAME_Z IS NOT NULL AND B.SPEC_NAME_Z NOT LIKE '%t%' THEN
          TO_NUMBER(B.SPEC_NAME_Z)
         ELSE
          TO_NUMBER(NVL(B.SPEC_NAME_D, '0'))
       END) = TO_NUMBER(?)
      AND T1.PRO_PLAN_ID = ?
      AND T1.GX_PLAN_NO = ?
		]]>
	</query>
	<query id="StoveHelper.queryStationD" desc="查询轧管成品成分点">
		<![CDATA[
		SELECT COUNT(*) COUNT
  FROM PLN_ORDER_ZG_S              T,
       PLN_SALEORD                 T1,
       CRAFT_ORD_DESIGN            M,
       CRAFT_ORD_DESIGN_MSC_PL_STI C
 WHERE T1.ORD_LN_DLY_PK = T.ORD_LN_DLY_PK
   AND M.ORD_LN_PK = T1.ORD_LN_PK
   AND M.CRAFT_SEQ = T.CRAFT_SEQ
   AND C.DESGIN_KEY = M.DESGIN_KEY
   AND C.MSC_PLINE = T.INDEX_SEQ
   AND C.STATION_TYPE = '403201'
   AND C.PROCESS_CODE = 'D' 
   AND T.PRO_PLAN_ID = ?
   AND T.GX_PLAN_NO = ?
			]]>
	</query>
	<query id="StoveHelper.queryStationE" desc="查询镦拔库成品成分点">
		<![CDATA[
		SELECT COUNT(*) COUNT
  FROM PLN_ORDER_DBK_S              T,
       PLN_SALEORD                 T1,
       CRAFT_ORD_DESIGN            M,
       CRAFT_ORD_DESIGN_MSC_PL_STI C
 WHERE T1.ORD_LN_DLY_PK = T.ORD_LN_DLY_PK
   AND M.ORD_LN_PK = T1.ORD_LN_PK
   AND M.CRAFT_SEQ = T.CRAFT_SEQ
   AND C.DESGIN_KEY = M.DESGIN_KEY
   AND C.MSC_PLINE = T.INDEX_SEQ
   AND C.STATION_TYPE = '403201'
   AND C.PROCESS_CODE = 'E'
   AND T.PRO_PLAN_ID = ?
   AND T.GX_PLAN_NO = ?
			]]>
	</query>
	<query id="StoveHelper.queryStationF" desc="查询热处理成品成分点">
		<![CDATA[
		SELECT COUNT(*) COUNT
  FROM PLN_ORDER_RCL_S              T,
       PLN_SALEORD                 T1,
       CRAFT_ORD_DESIGN            M,
       CRAFT_ORD_DESIGN_MSC_PL_STI C
 WHERE T1.ORD_LN_DLY_PK = T.ORD_LN_DLY_PK
   AND M.ORD_LN_PK = T1.ORD_LN_PK
   AND M.CRAFT_SEQ = T.CRAFT_SEQ
   AND C.DESGIN_KEY = M.DESGIN_KEY
   AND C.MSC_PLINE = T.INDEX_SEQ
   AND C.STATION_TYPE = '403201'
   AND C.PROCESS_CODE = 'F'
   AND T.PRO_PLAN_ID = ?
   AND T.GX_PLAN_NO = ?
			]]>
	</query>
	<query id="StoveHelper.queryStationG" desc="查询加工成品成分点">
		<![CDATA[
		SELECT COUNT(*) COUNT
  FROM PLN_ORDER_JGX_S              T,
       PLN_SALEORD                 T1,
       CRAFT_ORD_DESIGN            M,
       CRAFT_ORD_DESIGN_MSC_PL_STI C
 WHERE T1.ORD_LN_DLY_PK = T.ORD_LN_DLY_PK
   AND M.ORD_LN_PK = T1.ORD_LN_PK
   AND M.CRAFT_SEQ = T.CRAFT_SEQ
   AND C.DESGIN_KEY = M.DESGIN_KEY
   AND C.MSC_PLINE = T.INDEX_SEQ
   AND C.STATION_TYPE = '403201'
   AND C.PROCESS_CODE = 'G'
   AND T.PRO_PLAN_ID = ?
   AND T.GX_PLAN_NO = ?
			]]>
	</query>
		<query id="StoveHelper.queryCic" desc="查询工艺评审CIC">
		<![CDATA[
		SELECT DISTINCT C.CIC, D.GRADENAME,D.GRADECODE
  FROM PLN_SALEORD              T1,
       CRAFT_ORD_DESIGN         M,
       CRAFT_ORD_DESIGN_STD_CIC C,
       COM_MSC_STD_CIC          D
 WHERE M.ORD_LN_PK = T1.ORD_LN_PK    
   AND C.DESGIN_KEY = M.DESGIN_KEY    
   AND C.PROCESS_CODE IN ('A')
   AND C.CIC = D.CIC
   AND M.CRAFT_SEQ = ?
   AND T1.ORD_LN_DLY_PK = ?
   AND C.MSC_PLINE = ?	
			]]>
	</query>
	<query id="StoveHelper.queryZgCf" desc="查询轧管PIC,SIC,DIC">
		<![CDATA[
		SELECT C1.PIC, C1.SIC, C1.DIC, C1.WIC, C1.GIC
  FROM PLN_ORDER_ZG_S             T,
       PLN_SALEORD                 T1,
       CRAFT_ORD_DESIGN            C,
       CRAFT_ORD_DESIGN_MSC_PL_PRC C1
 WHERE T1.ORD_LN_DLY_PK = T.ORD_LN_DLY_PK
   AND C.ORD_LN_PK = T1.ORD_LN_PK
   AND C.CRAFT_SEQ = ?
   AND C1.DESGIN_KEY = ?
   AND C1.MSC_PLINE = T.INDEX_SEQ
   AND C1.PROCESS_CODE = 'D'
   AND T.PRO_PLAN_ID = ?
   AND T.GX_PLAN_NO = ?
			]]>
	</query>
	<query id="StoveHelper.queryDbkCf" desc="查询镦拔扩PIC,SIC,DIC">
		<![CDATA[
		SELECT C1.PIC, C1.SIC, C1.DIC, C1.WIC, C1.GIC
  FROM PLN_ORDER_DBK_S             T,
       PLN_SALEORD                 T1,
       CRAFT_ORD_DESIGN            C,
       CRAFT_ORD_DESIGN_MSC_PL_PRC C1
 WHERE T1.ORD_LN_DLY_PK = T.ORD_LN_DLY_PK
   AND C.ORD_LN_PK = T1.ORD_LN_PK
   AND C.CRAFT_SEQ = ?
   AND C1.DESGIN_KEY =?
   AND C1.MSC_PLINE = T.INDEX_SEQ
   AND C1.PROCESS_CODE = 'E'
   AND T.PRO_PLAN_ID = ?
   AND T.GX_PLAN_NO = ?
			]]>
	</query>
	<query id="StoveHelper.queryRclCf" desc="查询热处理PIC,SIC,DIC">
		<![CDATA[
		SELECT C1.PIC, C1.SIC, C1.DIC, C1.WIC, C1.GIC
  FROM PLN_ORDER_RCL_S             T,
       PLN_SALEORD                 T1,
       CRAFT_ORD_DESIGN            C,
       CRAFT_ORD_DESIGN_MSC_PL_PRC C1
 WHERE T1.ORD_LN_DLY_PK = T.ORD_LN_DLY_PK
   AND C.ORD_LN_PK = T1.ORD_LN_PK
   AND C.CRAFT_SEQ = ?
   AND C1.DESGIN_KEY = ?
   AND C1.MSC_PLINE = T.INDEX_SEQ
   AND C1.PROCESS_CODE = 'F'
   AND T.PRO_PLAN_ID = ?
   AND T.GX_PLAN_NO = ?
			]]>
	</query>
	<query id="StoveHelper.queryJgxCf" desc="查询加工线PIC,SIC,DIC">
		<![CDATA[
		SELECT C1.PIC, C1.SIC, C1.DIC, C1.WIC, C1.GIC
  FROM PLN_ORDER_JGX_S             T,
       PLN_SALEORD                 T1,
       CRAFT_ORD_DESIGN            C,
       CRAFT_ORD_DESIGN_MSC_PL_PRC C1
 WHERE T1.ORD_LN_DLY_PK = T.ORD_LN_DLY_PK
   AND C.ORD_LN_PK = T1.ORD_LN_PK
   AND C.CRAFT_SEQ = ?
   AND C1.DESGIN_KEY = ?
   AND C1.MSC_PLINE = T.INDEX_SEQ
   AND C1.PROCESS_CODE = 'G'
   AND T.PRO_PLAN_ID = ?
   AND T.GX_PLAN_NO = ?
			]]>
	</query>
		<query id="StoveHelper.updateQcmZc" desc="修改檢化驗">
		<![CDATA[
DECLARE
BEGIN
  FOR MYROW IN (SELECT T.*
                  FROM MIL_PLAN T
                 WHERE T.IMP_PROCESS = ?
                   AND T.CRAFT_SEQ = ?
                   AND (T.BACK_PLAN_FLAG = '5' OR T.BACK_SLAB_FLAG = '1')) LOOP
    UPDATE MIL_PLAN T
       SET T.IMP_PROCESS    = ?,
           T.CRAFT_SEQ      = ?,
           T.PIC            = ?,
           T.STEEL_STANDRAD = ?
     WHERE T.JUDGE_STOVE_NO = MYROW.JUDGE_STOVE_NO
       AND T.ID = MYROW.ID;
    UPDATE QCM_ZC_CHECKCONSIGN T
       SET T.CRAF_NO = ?, T.CRAFT_SEQ = ?, T.PIC = ?, T.STEEL_STANDRAD = ?
     WHERE T.PRO_ORDER_ID = MYROW.PRO_PLAN_ID
       AND T.GX_PLAN_NO = MYROW.GX_PLAN_NO
       AND T.JUDGE_STOVE_NO = REGEXP_REPLACE(MYROW.JUDGE_STOVE_NO, '-.*', '');
  END LOOP;
END;	
		]]>
	</query>
	<query id="StoveHelper.queryDesginKey" desc="查询热处理订单对应的DesginKey">
		<![CDATA[
		SELECT C.DESGIN_KEY, T.INDEX_SEQ
  FROM PLN_SALEORD S, PLN_ORDER_RCL_S T, CRAFT_ORD_DESIGN C
 WHERE S.ORD_LN_DLY_PK = T.ORD_LN_DLY_PK
   AND C.ORD_LN_PK = S.ORD_LN_PK
   AND C.CRAFT_SEQ = T.CRAFT_SEQ
   AND T.PRO_PLAN_ID = ?
   AND T.GX_PLAN_NO = ?
			]]>
	</query>
	<query id="StoveHelper.queryDesginKeyJgx" desc="查询加工线订单对应的DesginKey">
		<![CDATA[
		SELECT C.DESGIN_KEY, T.INDEX_SEQ
  FROM PLN_SALEORD S, PLN_ORDER_JGX_S T, CRAFT_ORD_DESIGN C
 WHERE S.ORD_LN_DLY_PK = T.ORD_LN_DLY_PK
   AND C.ORD_LN_PK = S.ORD_LN_PK
   AND C.CRAFT_SEQ = T.CRAFT_SEQ
   AND T.PRO_PLAN_ID = ?
   AND T.GX_PLAN_NO = ?
			]]>
	</query>
		<query id="StoveHelper.querySqlPic" desc="询是否生产批,前几炉及循环值">
		<![CDATA[
		SELECT T.RATE,
       T.DESC_RATE,
       NVL(T.TOP_STOVE, 0) TOP_STOVE,
       NVL(T.LOOP_VALUE, 0) LOOP_VALUE
  FROM CRAFT_ORD_DESIGN_STD_PIC_SMP T
 WHERE T.DESGIN_KEY = ?
   AND T.MSC_PLINE = ?
   AND T.PROCESS_CODE = ?
   AND T.PIC = ?
   AND T.RATE IN ('408601', '408608')
   AND (NVL(T.TOP_STOVE, 0) + NVL(T.LOOP_VALUE, 0)) =
       (SELECT MIN(NVL(T.TOP_STOVE, 0) + NVL(T.LOOP_VALUE, 0))
          FROM CRAFT_ORD_DESIGN_STD_PIC_SMP T2
         WHERE T2.DESGIN_KEY = T.DESGIN_KEY
           AND T2.MSC_PLINE = T.MSC_PLINE
           AND T2.PROCESS_CODE = T.PROCESS_CODE
           AND T2.PIC = T.PIC
           AND T2.RATE = T.RATE)
			]]>
	</query>
		<query id="StoveHelper.queryZuluPlnRcl" desc="修改组炉炉归组">
		<![CDATA[
		UPDATE PLN_ZY_RCL_M T
   SET T.LOT_NO_GROUP =
       (SELECT T1.LOT_NO_GROUP
          FROM PLN_ZY_RCL_M T1
         WHERE T1.HEAT_PLAN_NO IN
               (SELECT ZY_BATCH_ID1
                  FROM HTT_OFFLINE_RESULT
                 WHERE HEAT_PLAN_NO IN
                       (SELECT T2.HEAT_PLAN_NO
                          FROM PLN_ZY_RCL_M T2
                         WHERE T2.HEAT_PLAN_NO = T.HEAT_PLAN_NO)
                   AND GROUP_LOG = 1))
 WHERE T.IF_MATCH_ODD = '2'
   AND T.PRO_PLAN_ID = ?
   AND T.GX_PLAN_NO = ?
		]]>
	</query>
	<query id="StoveHelper.queryZuluPlnJgx" desc="修改加工线组炉炉归组">
		<![CDATA[
		UPDATE PLN_ZY_JGX_M T
   SET T.LOT_NO_GROUP =
       (SELECT T1.LOT_NO_GROUP
          FROM PLN_ZY_JGX_M T1
         WHERE T1.HEAT_PLAN_NO IN
               (SELECT ZY_BATCH_ID1
                  FROM MCH_OFFLINE_RESULT
                 WHERE HEAT_PLAN_NO IN
                       (SELECT T2.HEAT_PLAN_NO
                          FROM PLN_ZY_JGX_M T2
                         WHERE T2.HEAT_PLAN_NO = T.HEAT_PLAN_NO)
                   AND GROUP_LOG = 1))
 WHERE T.IF_MATCH_ODD = '2'
   AND T.PRO_PLAN_ID = ?
   AND T.GX_PLAN_NO = ?
		]]>
	</query>
	<query id="StoveHelper.queryOrderProc" desc="查询排产下发销售合同">
		<![CDATA[
		SELECT T.ORD_LN_DLY_PK,
       T.PLN_DIVIDE_ID,
       T.ORDER_SOURCE,
       T.ORDER_NO,
       T.ORDER_SEQ,
       T.DELIVERY_NO,
       T.R_NUM_ID,
       T.PSC,
       T.CRAFT_FILE_NO,
       T.CRAFT_FILE_MAN,
       T.MSC,
       T.INDEX_SEQ,
       T.PROCESS_SEQ,
       T.BOM,
       T.GRADECODE_ALL,
       T.GRADECODE,
       T.G_IS_OK,
       T.GROUP_JGX,
       T.F_IS_OK,
       T.GROUP_RCL,
       T.GROUP_ROLL_ALL,
       T.GROUP_ROLL,
       T.BJ_TYPE,
       T.E_IN_MATERIAL_NO,
       T.E_IN_MATERIAL_DESC,
       T.DIMATER_YLG,
       T.HEIGHT_YLG,
       T.MATERIAL_NO,
       T.MATERIAL_DESC,
       T.STUFF_PROPERTY,
       T.GRADECODE_IS_OK,
       T.D_IS_OK,
       T.E_IS_OK,
       T.WEIGHT_PER_M,
       T.PLAN_WT_D,
       T.PLAN_NUM_D,
       T.PLAN_TOT_LEN_D,
       T.FINISH_WT,
       T.IF_CHANGE,
       T.PLAN_WT_BEGIN,
       T.PLAN_NUM_BEGIN,
       T.PLANSTATUS,
       T.IF_ALLOW_ISSUE,
       TO_CHAR(T.ISSUED_TIME, 'YYYY-MM-DD HH24:MI:SS') ISSUED_TIME,
       T.ISSUED_MAN,
       T.HEIGHT_NK_MIN,
       T.HEIGHT_NK_MAX,
       T.ORDER_QTY_D,
       T.ORDER_UNIT,
       T.AIM_LEN_ROLL,
       T.AIM_LEN_END,
       T.PLAN_P_MAIN,
       T.TOT_LEN_ONE_P,
       T.CUT_NUM_P,
       T.CRAFT_SEQ,
       T.CRAFT_NO_V,
       T.AIM_WALLTHICK,
       T.ROLL_LENGTH,
       T.CRAFT_RENEW_ST,
       T.CRAFT_NO_NEW,
       T.CRAFT_NO_V_NEW,
       T.GROUP_ROLL_NAME,
       T.PLAN_IS_OK,
       T.ABC,
       T.ROLL_MONTH,
       T.PRIORITY,
       T.PRIORITY_MEMO,
       T.PRDCRPRO,
       T.LEN_ROLL_MAX,
       T.LEN_ROLL_MIN,
       T.IF_EXPORT,
       T.VERSION_NO,
       TO_CHAR(T.LAST_UNDOWN_TIME, 'YYYY-MM-DD HH24:MI:SS') LAST_UNDOWN_TIME,
       T.LAST_UNDOWN_MAN,
       T.ADJUST_PRICE_NUM,
       T.TOTAL_COST,
       T.OUT_MULT_D,
       T.PROC_DESC_C_RCL,
       T.AIM_OUTDIAMETER,
       T.AIM_WALLTHICK_IS_OK,
       T.FEED_RATE,
       T.COEFFICIENT,
       T.COEFFICIENT_MIN,
       T.PLAN_P_MAIN_MIN,
       T.AIM_WT_END,
       T.WEIGHT_KZ_M,
       T.LEN_CUTHEAD_DBK,
       T.LEN_CUTEND_DBK,
       T.LEN_LONGER_DBK,
       T.RATIO_DBK,
       T.LEN_SCOPE
  FROM PLN_SALEORD_PROC T
 WHERE T.ORD_LN_DLY_PK = ?
   AND T.PLN_DIVIDE_ID =?
		
		]]>
	</query>
	<query id="StoveHelper.AddPlnProc" desc="合同补量写入下发工序表">
		<![CDATA[
			INSERT INTO PLN_SALEORD_PROC
  (ORD_LN_DLY_PK,
   PLN_DIVIDE_ID,
   ORDER_SOURCE,
   ROLL_MONTH,
   ORDER_NO,
   ORDER_SEQ,
   DELIVERY_NO,
   PSC,
   CRAFT_SEQ,
   CRAFT_NO_V,
   CRAFT_FILE_NO,
   CRAFT_FILE_MAN,
   MSC,
   INDEX_SEQ,
   PROCESS_SEQ,
   BOM,
   GRADECODE_ALL,
   GRADECODE,
   G_IS_OK,
   GROUP_JGX,
   F_IS_OK,
   GROUP_RCL,
   GROUP_ROLL_ALL,
   GROUP_ROLL,
   GROUP_ROLL_NAME,
   BJ_TYPE,
   ABC,
   E_IN_MATERIAL_NO,
   E_IN_MATERIAL_DESC,
   DIMATER_YLG,
   HEIGHT_YLG,
   MATERIAL_NO,
   MATERIAL_DESC,
   STUFF_PROPERTY,
   GRADECODE_IS_OK,
   D_IS_OK,
   E_IS_OK,
   WEIGHT_PER_M,
   PLAN_WT_D,
   PLAN_NUM_D,
   FINISH_WT,
   PLANSTATUS,
   IF_ALLOW_ISSUE,
   HEIGHT_NK_MIN,
   HEIGHT_NK_MAX,
   ORDER_QTY_D,
   ORDER_UNIT,
   AIM_LEN_ROLL,
   AIM_LEN_END,
   PLAN_P_MAIN,
   PLAN_TOT_LEN_D,
   TOT_LEN_ONE_P,
   CUT_NUM_P,
   AIM_WALLTHICK,
   ROLL_LENGTH,
   LEN_ROLL_MAX,
   LEN_ROLL_MIN,
   PRDCRPRO,
   IF_EXPORT,
   PROC_DESC_C_RCL,
   OUT_MULT_D,
   AIM_OUTDIAMETER,
   FEED_RATE,
   COEFFICIENT,
   COEFFICIENT_MIN,
   PLAN_P_MAIN_MIN,
   AIM_WT_END,
   WEIGHT_KZ_M)
values
  ('#ORD_LN_DLY_PK#',
   (SELECT LPAD(NVL(MAX(TO_NUMBER(B.PLN_DIVIDE_ID) + 1), 1), 2, '0')
      FROM PLN_SALEORD_PROC B
     WHERE B.ORD_LN_DLY_PK = '#ORD_LN_DLY_PK#'),
   '补量需求A',
   TO_CHAR(SYSDATE, 'YYYY-MM'),
   '#ORDER_NO#',
   '#ORDER_SEQ#',
   '#DELIVERY_NO#',
   '#PSC#',
   '#CRAFT_SEQ#',
   '#CRAFT_NO_V#',
   '#CRAFT_FILE_NO#',
   '#CRAFT_FILE_MAN#',
   '#MSC#',
   '#INDEX_SEQ#',
   '#PROCESS_SEQ#',
   '#BOM#',
   '#GRADECODE_ALL#',
   '#GRADECODE#',
   '#G_IS_OK#',
   '#GROUP_JGX#',
   '#F_IS_OK#',
   '#GROUP_RCL#',
   '#GROUP_ROLL_ALL#',
   '#GROUP_ROLL#',
   '#GROUP_ROLL_NAME#',
   '#BJ_TYPE#',
   '#ABC#',
   '#E_IN_MATERIAL_NO#',
   '#E_IN_MATERIAL_DESC#',
   '#DIMATER_YLG#',
   '#HEIGHT_YLG#',
   '#MATERIAL_NO#',
   '#MATERIAL_DESC#',
   '#STUFF_PROPERTY#',
   '0',
   '#D_IS_OK#',
   '#E_IS_OK#',
   '#WEIGHT_PER_M#',
   '#PLAN_WT_D#',
   '#PLAN_NUM_D#',
   '0',
   '1',
   '0',
   '#HEIGHT_NK_MIN#',
    '#HEIGHT_NK_MAX#',
   '#ORDER_QTY_D#',
   '#ORDER_UNIT#',
   '#AIM_LEN_ROLL#',
   '#AIM_LEN_END#',
   '#PLAN_P_MAIN#',
   '#PLAN_TOT_LEN_D#',
   '#TOT_LEN_ONE_P#',
   '#CUT_NUM_P#',
   '#AIM_WALLTHICK#',
   '#ROLL_LENGTH#',
   '#LEN_ROLL_MAX#',
   '#LEN_ROLL_MIN#',
   '#PRDCRPRO#',
   '#IF_EXPORT#',
   '#PROC_DESC_C_RCL#',
   '#OUT_MULT_D#',
   '#AIM_OUTDIAMETER#',
   '#FEED_RATE#',
   '#COEFFICIENT#',
   '#COEFFICIENT_MIN#',
   '#PLAN_P_MAIN_MIN#',
   '#AIM_WT_END#',
   '#WEIGHT_KZ_M#')
		]]>
	</query>
	<query id="StoveHelper.queryIsConfrimProc" desc="查询补量需求是否已经写入下发工序表">
		<![CDATA[
			SELECT T.PLANSTATUS,
			       T.AIM_LEN_END,
			       T.WEIGHT_PER_M,
			       T1.DELVRY_RANGE_MIN,
			       T1.DELVRY_RANGE_MAX,
			       T1.DELVRY_RANGE_TPE,
			       J.WEIGHT_JG,
			       J.CHECK_J_VAL
			  FROM PLN_SALEORD_PROC T, PLN_SALEORD T1
			  left join COM_MSC_JG J
			    ON J.CODE_JG = T1.CODE_JG
			   AND J.VALIDFLAG = '1'
			 WHERE t1.ORD_LN_DLY_PK = t.ORD_LN_DLY_PK
			   and t.ORD_LN_DLY_PK = ?
			   AND T.PLN_DIVIDE_ID='01'
		]]>
	</query>
	<query id = "StoveHelper.sortOrderJgx" desc = "排序">
		<![CDATA[
    DECLARE
    V_COUNT NUMBER := 1;
    BEGIN
    SELECT MAX(T.GX_PRO_SEQ)INTO V_COUNT FROM PLN_ORDER_JGX_S T WHERE T.PLINE_CODE = '#PLINE_CODE#';
    IF(V_COUNT <0)THEN
    V_COUNT := 1;
    END IF;
    FOR MYROW IN (SELECT *
    FROM (SELECT T.EXE_STATUS,
    T.PLAN_TIME_B,
    T.GX_PRO_SEQ,
    T.PRO_PLAN_ID,
    T.GX_PLAN_NO
    FROM PLN_ORDER_JGX_S T
    WHERE T.PLINE_CODE = '#PLINE_CODE#'
    AND T.EXE_STATUS IN ('0', '1')
    ORDER BY T.EXE_STATUS DESC) T1
    ORDER BY T1.PLAN_TIME_B ASC) LOOP
    UPDATE PLN_ORDER_JGX_S T
    SET T.GX_PRO_SEQ = V_COUNT
    WHERE T.PRO_PLAN_ID = MYROW.PRO_PLAN_ID
    AND T.GX_PLAN_NO = MYROW.GX_PLAN_NO;
    V_COUNT := V_COUNT + 1;
    END LOOP;
    END;
    ]]>
	</query>
	<query id = "StoveHelper.sortOrderRcl" desc = "热处理订单排序">
		<![CDATA[
		DECLARE
		V_COUNT NUMBER := 1;
		BEGIN
		SELECT MAX(T.GX_PRO_SEQ)INTO V_COUNT FROM PLN_ORDER_RCL_S T WHERE T.PLINE_CODE = '#PLINE_CODE#';
		IF(V_COUNT <0)THEN
		V_COUNT := 1;
		END IF;
		FOR MYROW IN (SELECT *
		FROM (SELECT T.EXE_STATUS,
		T.PLAN_TIME_B,
		T.GX_PRO_SEQ,
		T.PRO_PLAN_ID,
		T.GX_PLAN_NO
		FROM PLN_ORDER_RCL_S T
		WHERE T.PLINE_CODE = '#PLINE_CODE#'
		AND T.EXE_STATUS IN ('0', '1')
		ORDER BY T.EXE_STATUS DESC) T1
		ORDER BY T1.PLAN_TIME_B ASC) LOOP
		UPDATE PLN_ORDER_RCL_S T
		SET T.GX_PRO_SEQ = V_COUNT
		WHERE T.PRO_PLAN_ID = MYROW.PRO_PLAN_ID
		AND T.GX_PLAN_NO = MYROW.GX_PLAN_NO;
		V_COUNT := V_COUNT + 1;
		END LOOP;
		END;
		]]>
	</query>
	<query id = "StoveHelper.sortOrderZg" desc = "轧线订单重新排序">
		<![CDATA[
		DECLARE
  V_COUNT NUMBER := 1;
BEGIN
  SELECT MAX(TO_NUMBER(T.GX_PRO_SEQ))
    INTO V_COUNT
    FROM PLN_ORDER_ZG_S T
   WHERE T.PLINE_CODE = '#PLINE_CODE#'
     AND T.EXE_STATUS IN ('0', '1');
  IF (V_COUNT < 0) THEN
    V_COUNT := 1;
  END IF;
  FOR MYROW IN (SELECT *
                  FROM (SELECT T.EXE_STATUS,
                               T.PLAN_TIME_B,
                               T.GX_PRO_SEQ,
                               T.PRO_PLAN_ID,
                               T.GX_PLAN_NO
                          FROM PLN_ORDER_ZG_S T
                         WHERE T.PLINE_CODE = '#PLINE_CODE#'
                           AND T.EXE_STATUS IN ('0', '1')
                         ORDER BY T.EXE_STATUS DESC) T1
                 ORDER BY T1.PLAN_TIME_B ASC) LOOP
    UPDATE PLN_ORDER_ZG_S T
       SET T.GX_PRO_SEQ = V_COUNT
     WHERE T.PRO_PLAN_ID = MYROW.PRO_PLAN_ID
       AND T.GX_PLAN_NO = MYROW.GX_PLAN_NO;
    V_COUNT := V_COUNT + 1;
  END LOOP;
END;
		]]>
	</query>
	<query id = "StoveHelper.sortOrderDbk" desc = "镦拔扩订单重新排序">
		<![CDATA[
		DECLARE
  V_COUNT NUMBER := 1;
BEGIN
  SELECT MAX(TO_NUMBER(T.GX_PRO_SEQ))
    INTO V_COUNT
    FROM PLN_ORDER_DBK_S T
   WHERE T.PLINE_CODE = '#PLINE_CODE#'
     AND T.EXE_STATUS IN ('0', '1');
  IF (V_COUNT < 0) THEN
    V_COUNT := 1;
  END IF;
  FOR MYROW IN (SELECT *
                  FROM (SELECT T.EXE_STATUS,
                               T.PLAN_TIME_B,
                               T.GX_PRO_SEQ,
                               T.PRO_PLAN_ID,
                               T.GX_PLAN_NO
                          FROM PLN_ORDER_DBK_S T
                         WHERE T.PLINE_CODE = '#PLINE_CODE#'
                           AND T.EXE_STATUS IN ('0', '1')
                         ORDER BY T.EXE_STATUS DESC) T1
                 ORDER BY T1.PLAN_TIME_B ASC) LOOP
    UPDATE PLN_ORDER_DBK_S T
       SET T.GX_PRO_SEQ = V_COUNT
     WHERE T.PRO_PLAN_ID = MYROW.PRO_PLAN_ID
       AND T.GX_PLAN_NO = MYROW.GX_PLAN_NO;
    V_COUNT := V_COUNT + 1;
  END LOOP;
END;
		]]>
	</query>
	<query id = "StoveHelper.selectMaxjudgeNo" desc="生成热处理外购最大炉号">
		<![CDATA[
		SELECT MAX(JUDGE_STOVE_NO) + 1 JUDGE_STOVE_NO
  FROM (SELECT TO_NUMBER(MAX(T.JUDGE_STOVE_NO)) JUDGE_STOVE_NO
          FROM PLN_ZY_DBK_M T
         WHERE T.JUDGE_STOVE_NO >=
               (SELECT T1.BASENAME
                  FROM COM_BASE_INFO T1
                 WHERE T1.BASECODE = '200701')
           AND T.JUDGE_STOVE_NO <=
               (SELECT T1.BASENAME
                  FROM COM_BASE_INFO T1
                 WHERE T1.BASECODE = '200702')
        UNION ALL
        SELECT TO_NUMBER(MAX(T.JUDGE_STOVE_NO)) JUDGE_STOVE_NO
          FROM PLN_ZY_RCL_M T
         WHERE T.JUDGE_STOVE_NO >=
               (SELECT T1.BASENAME
                  FROM COM_BASE_INFO T1
                 WHERE T1.BASECODE = '200701')
           AND T.JUDGE_STOVE_NO <=
               (SELECT T1.BASENAME
                  FROM COM_BASE_INFO T1
                 WHERE T1.BASECODE = '200702')
        UNION ALL
        SELECT TO_NUMBER(MAX(T.JUDGE_STOVE_NO)) JUDGE_STOVE_NO
          FROM PLN_ZY_JGX_M T
         WHERE T.JUDGE_STOVE_NO >=
               (SELECT T1.BASENAME
                  FROM COM_BASE_INFO T1
                 WHERE T1.BASECODE = '200701')
           AND T.JUDGE_STOVE_NO <=
               (SELECT T1.BASENAME
                  FROM COM_BASE_INFO T1
                 WHERE T1.BASECODE = '200702')
        UNION ALL
        SELECT TO_NUMBER(MAX(T.JUDGE_STOVE_NO)) JUDGE_STOVE_NO
          FROM PLN_ZY_JG_M T
         WHERE T.JUDGE_STOVE_NO >=
               (SELECT T1.BASENAME
                  FROM COM_BASE_INFO T1
                 WHERE T1.BASECODE = '200701')
           AND T.JUDGE_STOVE_NO <=
               (SELECT T1.BASENAME
                  FROM COM_BASE_INFO T1
                 WHERE T1.BASECODE = '200702')
        UNION ALL
		SELECT TO_NUMBER(MAX(T.JUDGE_STOVE_NO)) JUDGE_STOVE_NO
          FROM MAT_BC_M T
         WHERE T.JUDGE_STOVE_NO >=
               (SELECT T1.BASENAME
                  FROM COM_BASE_INFO T1
                 WHERE T1.BASECODE = '200701')
           AND T.JUDGE_STOVE_NO <=
               (SELECT T1.BASENAME
                  FROM COM_BASE_INFO T1
                 WHERE T1.BASECODE = '200702')
        UNION ALL
		SELECT TO_NUMBER(MAX(T.JUDGE_STOVE_NO)) JUDGE_STOVE_NO
          FROM MAT_BC_BACKUP T
         WHERE T.JUDGE_STOVE_NO >=
               (SELECT T1.BASENAME
                  FROM COM_BASE_INFO T1
                 WHERE T1.BASECODE = '200701')
           AND T.JUDGE_STOVE_NO <=
               (SELECT T1.BASENAME
                  FROM COM_BASE_INFO T1
                 WHERE T1.BASECODE = '200702')
        UNION ALL
        --天淮给本部生产用
        SELECT TO_NUMBER(MAX(T.FLAG_HEAT_NO)) JUDGE_STOVE_NO
          FROM PLN_ZY_ZG_M T
         WHERE T.FLAG_HEAT_NO >=
               (SELECT T1.BASENAME
                  FROM COM_BASE_INFO T1
                 WHERE T1.BASECODE = '200701')
           AND T.FLAG_HEAT_NO <=
               (SELECT T1.BASENAME
                  FROM COM_BASE_INFO T1
                 WHERE T1.BASECODE = '200702')
        UNION ALL
        SELECT TO_NUMBER(T1.BASENAME) - 1 JUDGE_STOVE_NO
          FROM COM_BASE_INFO T1
         WHERE T1.BASECODE = '200701')
		]]>
	</query>
	<query id = "StoveHelper.selectMatNo" desc = "查询库存材料信息">
		SELECT *
		FROM MAT_GP_M T
		WHERE NVL(T.JUGDE_APPLY_CODE,'/') = NVL('#JUGDE_APPLY_CODE#','/')
		AND T.JUDGE_STOVE_NO = '#JUDGE_STOVE_NO#'
		AND T.STOVE_NO = '#STOVE_NO#'
		AND T.PRO_PLAN_ID_ZG = '#PRO_PLAN_ID#'
		AND T.GX_PLAN_NO_ZG = '#GX_PLAN_NO#'
		AND T.HEAT_PLAN_NO_NEXT = '#HEAT_PLAN_NO#'
		AND T.ACT_LEN = '#LENGTH_M_OLD#'
		ORDER BY T.MAT_NO ASC
	</query>
	<query id = "StoveHelper.selecMatPlanStaus" desc = "查询套尺坯前面套尺炉计划状态">
		<![CDATA[
		SELECT T.IS_SETFOOT, T1.PLANSTATUS
		FROM MAT_GP_M T, PLN_ZY_ZG_M T1
		WHERE T.HEAT_PLAN_NO_NEXT = T1.HEAT_PLAN_NO
		AND T.PRO_PLAN_ID_ZG = T1.PRO_PLAN_ID
		AND T.GX_PLAN_NO_ZG = T1.GX_PLAN_NO
		AND (T.MAT_NO = '#MAT_NO_OLD#' )
		AND T.SETFOOT_SEQ < #SETFOOT_SEQ#
		]]>
	</query>
	<query id = "StoveHelper.selecMatPlanStausCancel" desc = "查询套尺坯前面套尺炉计划状态">
		<![CDATA[
		SELECT T.IS_SETFOOT, T1.PLANSTATUS
		FROM MAT_GP_M T, PLN_ZY_ZG_M T1
		WHERE T.HEAT_PLAN_NO_NEXT = T1.HEAT_PLAN_NO
		AND T.PRO_PLAN_ID_ZG = T1.PRO_PLAN_ID
		AND T.GX_PLAN_NO_ZG = T1.GX_PLAN_NO
		AND T.MAT_NO_OLD = '#MAT_NO_OLD#'
		AND T.SETFOOT_SEQ > #SETFOOT_SEQ#
		]]>
	</query>
	<query id = "StoveHelper.selectPlineAearF" desc = "查询产线所属区域">
		SELECT S.SUPPLY_UNIT_CODE
		FROM PLN_ORDER_RCL_S T, COM_BASE_PLINE S
		WHERE T.PLINE_CODE = S.PLINE_CODE
		AND T.PRO_PLAN_ID = ?
		AND T.GX_PLAN_NO = ?
	</query>
	<query id = "StoveHelper.selectPlineAearFNew" desc = "查询新产线所属区域">
		SELECT T.SUPPLY_UNIT_CODE FROM COM_BASE_PLINE T WHERE T.PLINE_CODE = ?
	</query>
</queryMap>