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

	<query id="ControlFurNacePlan.getFurnace" desc="查询炉计划">
             <![CDATA[
              SELECT T.FURNACENO,
       T.FURNACENO_SEQ,
       T.CAST_NO,
       T.CAST_SEQ,
       T.CAST_STOVE_SEQ,
       T.STOVE_NO,
       DECODE(T.BOF_TYPE,
              '00',
              '正常',
              '10',
              '重炼',
              '20',
              '补炉',
              '30',
              '转交','40','整炉废','50','浇次中断','05','质量封锁') BOF_TYPE,
       DECODE(T.STATUS,
              '00',
              '编制中',
              '10',
              '已下发',
              '20',
              '生产中',
              '30',
              '已生产',
              '40',
              '关闭') STATUS,
       DECODE(T.HEAT_STATE,
              '00',
              '初始状态',
              '10',
              '转炉/电炉执行',
              '20',
              'LF精炼执行',
              '30',
              'RH炉执行',
              '40',
              'VD炉执行',
              '50',
              '连铸执行')HEAT_STATE,
       DECODE(T.CASTINGTYPE, '1', '连铸', '2', '模铸') CASTINGTYPE,
       T.EF_PLINE_CODE,
       T.EF_PLINE_NAME,
       T.EF_AGE,
       T.PLINE_CODE,
       T.PLINE_NAME,
       T.CCMID,
       T.WLID_IN,
       T.WLDESC_IN,
       T.MATERIAL_NO,
       T.MATERIAL_NAME,
       T.GRADECODE,
       T.GRADENAME,
       T.CIC,
       TO_CHAR(T.PLN_STARTTIME, 'YYYY-MM-DD HH24:MI:SS') PLN_STARTTIME,
       TO_CHAR(T.PLN_ENDTIME, 'YYYY-MM-DD HH24:MI:SS') PLN_ENDTIME,
       T.AIM_STEEL_QTY,
       T.QUANTITY,
       T.WEIGHT,
       T.OLD_FURNACENO,
       T.OLD_STOVE_NO,
       T.PLAN_ROUTE,
       T.FACT_ROUTE,
       TO_CHAR(T.STARTTIME, 'YYYY-MM-DD HH24:MI:SS') STARTTIME,
       TO_CHAR(T.ENDTIME, 'YYYY-MM-DD HH24:MI:SS') ENDTIME,
       TO_CHAR(T.BOF_STARTTIME, 'YYYY-MM-DD HH24:MI:SS') BOF_STARTTIME,
       TO_CHAR(T.BOF_ENDTIME, 'YYYY-MM-DD HH24:MI:SS') BOF_ENDTIME,
       TO_CHAR(T.CAS_STARTTIME, 'YYYY-MM-DD HH24:MI:SS') CAS_STARTTIME,
       TO_CHAR(T.CAS_ENDTIME, 'YYYY-MM-DD HH24:MI:SS') CAS_ENDTIME,
       TO_CHAR(T.VD_STARTTIME, 'YYYY-MM-DD HH24:MI:SS') VD_STARTTIME,
       TO_CHAR(T.VD_ENDTIME, 'YYYY-MM-DD HH24:MI:SS') VD_ENDTIME,
       TO_CHAR(T.RH_STARTTIME, 'YYYY-MM-DD HH24:MI:SS') RH_STARTTIME,
       TO_CHAR(T.RH_ENDTIME, 'YYYY-MM-DD HH24:MI:SS') RH_ENDTIME,
       TO_CHAR(T.LFS_STARTTIME, 'YYYY-MM-DD HH24:MI:SS') LFS_STARTTIME,
       TO_CHAR(T.LFS_ENDTIME, 'YYYY-MM-DD HH24:MI:SS') LFS_ENDTIME,
       TO_CHAR(T.CCM_STARTTIME, 'YYYY-MM-DD HH24:MI:SS') CCM_STARTTIME,
       TO_CHAR(T.CCM_ENDTIME, 'YYYY-MM-DD HH24:MI:SS') CCM_ENDTIME,
       DECODE(T.SURPLUSFLAG, '1', '是', '/') SURPLUSFLAG,
       DECODE(T.IF_MONITOR_LG, '1', '是', '/') IF_MONITOR_LG,
       T.PRDCR_NO,
       T.CHEM_JUDGE_ID,
       T.PLANREMARK,
       T.REMARK,
       T.MAKEMAN,
       TO_CHAR(T.MAKETIME, 'YYYY-MM-DD HH24:MI:SS') MAKETIME,
       T.DOWNMAN,
       TO_CHAR(T.DOWNTIME, 'YYYY-MM-DD HH24:MI:SS') DOWNTIME,TO_CHAR(TO_DATE(T.PRO_MONTH,'YYYY-MM-DD'),'YYYY-MM-DD')PRO_MONTH,T.CRAFT_NO,T.CRAFT_PATH,DECODE(T.IF_CONFIRM,'1','是','/') IF_CONFIRM,
       (SELECT SUM(O.TOT_WEIGHT_M) FROM PLN_STEELFOR_ORD O WHERE O.FURNACENO=T.FURNACENO AND O.SURPLUSFLAG='0' AND O.CCM_PLN_TYPE ='00') CON_AMOUNT,
       (SELECT SUM(O.TOT_MUM_M) FROM PLN_STEELFOR_ORD O WHERE O.FURNACENO=T.FURNACENO AND O.SURPLUSFLAG='0' AND O.CCM_PLN_TYPE ='00') CON_AMOUNT_NUM,
      (SELECT SUM(O.TOT_WEIGHT_M) FROM PLN_STEELFOR_ORD O WHERE O.FURNACENO=T.FURNACENO AND O.SURPLUSFLAG='1' AND O.SURPLUS_TYPE='1' AND O.CCM_PLN_TYPE ='00') RES_AMOUNT,
      (SELECT SUM(O.TOT_WEIGHT_M) FROM PLN_STEELFOR_ORD O WHERE O.FURNACENO=T.FURNACENO AND O.SURPLUSFLAG='1' AND O.SURPLUS_TYPE='2' AND O.CCM_PLN_TYPE ='00') FIRST_AMOUNT, 
      (SELECT SUM(O.TOT_WEIGHT_M) FROM PLN_STEELFOR_ORD O WHERE O.FURNACENO=T.FURNACENO AND O.SURPLUSFLAG='1' AND O.SURPLUS_TYPE='3' AND O.CCM_PLN_TYPE ='00') END_AMOUNT,
       T.BATCHING_CODE,T.BATCHING_NAME,T.HOTMETAL_NUM,T.IRON_NUM,T.STEELSCRAP_NUM,T1.MEMO_NUM,
       (SELECT GET_ZG_STATE(T.FURNACENO) FROM DUAL) PLANSTATUS_ZG,
       DECODE(T1.IF_CONFIRM, '1', '是', '/') IF_CONFIRM_CAST
  FROM PLN_STEELFORFURNACE T,PLN_STEELFORCAST T1
 WHERE  T1.CAST_NO=T.CAST_NO AND 1 = 1
                 ]]>
	</query>

	<query id="ControlFurNacePlan.getSteelOrder" desc="查询炉次订单">
             <![CDATA[
      SELECT T.FURNACENO,
       T.SEQUENCENO,
       T.FURNACENO_SEQ,
       T.PRO_PLAN_ID,
       T.GX_PLAN_NO,
       T.CAST_NO,
       T.CAST_SEQ,
       T.CAST_STOVE_SEQ,
       T.CCM_SEQ,
       T.STOVE_NO,
       T.JUDGE_STOVE_NO,
       T.JUDGE_STOVE_NO_SEQ,
       T.FLAG_STOVE_NO,
       DECODE(T.STATUS,
              '00',
              '编制中',
              '10',
              '已下发',
              '20',
              '生产中',
              '30',
              '已生产',
              '40',
              '关闭') STATUS,
       DECODE(T.CCM_STATE,
              '00',
              '初始状态',
              '10',
              '切割完成',
              '20',
              '表检完成',
              '30',
              '下线') CCM_STATE,
       DECODE(T.CCM_PLN_TYPE,
              '00',
              '正常',
              '10',
              '表检返线',
              '20',
              '下线返线') CCM_PLN_TYPE,
       DECODE(T.GPTYPE, '1', '铸坯', '2', '锻坯', '') GPTYPE,
       DECODE(T.CASTINGTYPE, '1', '连铸', '2', '模铸', '') CASTINGTYPE,
       T.PLINE_CODE,
       T.PLINE_NAME,
       T.CCMID,
       T.FLOWNO,
       T.EF_PLINE_CODE,
       T.EF_PLINE_NAME,
       T.WLID_IN,
       T.WLDESC_IN,
       T.MATERIAL_NO,
       T.MATERIAL_NAME,
       T.GRADECODE,
       T.GRADENAME,
       T.DIAMETER,
       T.LEN_GP_SINGLE,
       T.CUT_NUM_GP,
       T.LENGTH_M,
       T.WEIGHT_GP_ONE,
       T.WEIGHT_M,
       T.TOT_MUM_M,
       T.TOT_WEIGHT_M,
       T.ACT_WEIGHT_M,
       T.ACT_MUM_M,
       DECODE(T.SURPLUSFLAG, '0', '订单材', '1', '余材', '') SURPLUSFLAG,
       DECODE(T.SURPLUS_TYPE,
              '1',
              '生产超量',
              '2',
              '首炉加量',
              '3',
              '尾炉加量',
              '4',
              '连浇前炉加量',
              '5',
              '连浇后炉加量',
              '6','补炉','7','改判') SURPLUS_TYPE,
       DECODE(T.IF_SURPLUS_ALLOTED, '1', '是', '/') IF_SURPLUS_ALLOTED,
       T.CIC,
       T.PIC,
       T.SIC,
       T.DIC,
       T.MEMO,
       T.MAKEMAN,
       TO_CHAR(T.MAKETIME, 'YYYY-MM-DD HH24:MI:SS') MAKETIME,
       T.DOWNMAN,
       TO_CHAR(T.DOWNTIME, 'YYYY-MM-DD HH24:MI:SS') DOWNTIME,
       T.CHEM_JUDGE_ID,
       T.PHY_JUDGE_ID,
       T.COLLIGATE_JUDGE_ID,
       T.EXCESS_WT,
       T.EXCESS_NUM,
       T.TOT_WEIGHT_M AS EDIT_WT,
       T.TOT_MUM_M AS EDIT_NUM,
       TO_CHAR(TO_DATE(T.PRO_MONTH,'YYYY-MM-DD'),'YYYY-MM-DD')PRO_MONTH,
       DECODE(T.STATE_LK,'1','是','0','/','/') STATE_LK,
       T.PDEPT_NAME,
       T.PRDCR_MAN,
       T.FINAL_USER_DESC,
       T.ORDER_NO ORDER_SEQ_NO,
       T.STEELCODE,
       T.STEELNAME,
       T.PRODUCCODE,
       T.PRODUCNAME,
       T.GOWHERE_CODE,
       T.GOWHERE_NAME,
       DECODE(T.ISENDGX,'1','是','0','/','/') ISENDGX,
       T.IF_MONITOR_LG,
       T.PRDCR_NO,T.CUT_NUM,T.MERGE_NO, DECODE(T1.IF_CONFIRM, '1', '是', '/') IF_CONFIRM
  FROM PLN_STEELFOR_ORD T,PLN_STEELFORCAST T1
 WHERE T1.CAST_NO=T.CAST_NO 
 AND T.CCM_PLN_TYPE ='00'
            ]]>
	</query>
	<query id="ControlFurNacePlan.getSteelOrder1" desc="查询炉次订单">
             <![CDATA[
      SELECT T.FURNACENO,
       T.SEQUENCENO,
       T.FURNACENO_SEQ,
       T.PRO_PLAN_ID,
       T.GX_PLAN_NO,
       T.CAST_NO,
       T.CAST_SEQ,
       T.CAST_STOVE_SEQ,
       T.CCM_SEQ,
       T.STOVE_NO,
       T.JUDGE_STOVE_NO,
       T.JUDGE_STOVE_NO_SEQ,
       T.FLAG_STOVE_NO,
       DECODE(T.STATUS,
              '00',
              '编制中',
              '10',
              '已下发',
              '20',
              '生产中',
              '30',
              '已生产',
              '40',
              '关闭') STATUS,
       DECODE(T.CCM_STATE,
              '00',
              '初始状态',
              '10',
              '切割完成',
              '20',
              '表检完成',
              '30',
              '下线') CCM_STATE,
       DECODE(T.CCM_PLN_TYPE,
              '00',
              '正常',
              '10',
              '表检返线',
              '20',
              '下线返线') CCM_PLN_TYPE,
       DECODE(T.GPTYPE, '1', '铸坯', '2', '锻坯', '') GPTYPE,
       DECODE(T.CASTINGTYPE, '1', '连铸', '2', '模铸', '') CASTINGTYPE,
       T.PLINE_CODE,
       T.PLINE_NAME,
       T.CCMID,
       T.FLOWNO,
       T.EF_PLINE_CODE,
       T.EF_PLINE_NAME,
       T.WLID_IN,
       T.WLDESC_IN,
       T.MATERIAL_NO,
       T.MATERIAL_NAME,
       T.GRADECODE,
       T.GRADENAME,
       T.DIAMETER,
       T.LEN_GP_SINGLE,
       T.CUT_NUM_GP,
       T.LENGTH_M,
       T.WEIGHT_GP_ONE,
       T.WEIGHT_M,
       T.TOT_MUM_M,
       T.TOT_WEIGHT_M,
       T.ACT_WEIGHT_M,
       T.ACT_MUM_M,
       DECODE(T.SURPLUSFLAG, '0', '订单材', '1', '余材', '') SURPLUSFLAG,
       DECODE(T.SURPLUS_TYPE,
              '1',
              '生产超量',
              '2',
              '开浇加量',
              '3',
              '尾炉加量',
              '4',
              '连浇前炉加量',
              '5',
              '连浇后炉加量',
              '6','补炉','7','改判') SURPLUS_TYPE,
       DECODE(T.IF_SURPLUS_ALLOTED, '1', '是', '/') IF_SURPLUS_ALLOTED,
       T.CIC,
       T.PIC,
       T.SIC,
       T.DIC,
       T.MEMO,
       T.MAKEMAN,
       TO_CHAR(T.MAKETIME, 'YYYY-MM-DD HH24:MI:SS') MAKETIME,
       T.DOWNMAN,
       TO_CHAR(T.DOWNTIME, 'YYYY-MM-DD HH24:MI:SS') DOWNTIME,
       T.CHEM_JUDGE_ID,
       T.PHY_JUDGE_ID,
       T.COLLIGATE_JUDGE_ID,
       T.EXCESS_WT,
       T.EXCESS_NUM,
       T.TOT_WEIGHT_M AS EDIT_WT,
       T.TOT_MUM_M AS EDIT_NUM,
       T.PRO_MONTH,T.CUT_NUM,T.MERGE_NO,
 DECODE(T1.IF_CONFIRM, '1', '是', '/') IF_CONFIRM
  FROM PLN_STEELFOR_ORD T,PLN_STEELFORCAST T1
 WHERE T1.CAST_NO=T.CAST_NO 
 AND T.CCM_PLN_TYPE ='00'
 ]]>
	</query>
</queryMap>