<?xml version="1.0" encoding="UTF-8"?>
<queryMap desc="DBK公共信息">
	<query id="FrmDBKPerformance.doQuery" desc="查询DBK实绩">		
        <![CDATA[
SELECT M.HEAT_PLAN_NO,
       M.PLINE_NAME,
       M.ZY_BATCH_ID,  
       M.PRO_PLAN_ID,
       M.FEED_HEAT_NO,
       M.GX_PLAN_NO,
       M.CRAFT_FILE_NO,
       M.CRAFT_FILE_MAN,
       M.CRAFT_SEQ,
       M.JUDGE_STOVE_NO JUDGE_STOVE_NO,
       C.BATCH_NO,
       C.BATCH_GROUD_NO,
       M.GRADENAME,
       MIN(T.BAL_YEAR_MONTH) BAL_YEAR_MONTH,       
       M.ORDER_NO || '/' || M.ORDER_SEQ || '/' || M.DELIVERY_NO ORDER_NO,
       M.OUTWL_DESC,
       M1.SPEC_NAME,
       M1.STD_NAME,
       M1.PRODUCNAME,
       M1.MODEL_DESC,
       M1.STEELNAME,
       C.PLAN_INDOUBLE_NUM,
       C.PLAN_INDOUBLE_WT,
        NVL((SELECT SUM(V.ACT_COUNT)
             FROM port_vrp_batch_sample_result V
            WHERE V.HEAT_PLAN_NO = M.HEAT_PLAN_NO
            AND V.PLINE_CODE = M.PLINE_CODE
            AND V.MAT_STATUS = '10'),
           0) FAIL_NUM,
       NVL((SELECT SUM(V.ACT_WEIGHT)
             FROM port_vrp_batch_sample_result V
            WHERE V.HEAT_PLAN_NO = M.HEAT_PLAN_NO
            AND V.MAT_STATUS = '10'
            AND V.PLINE_CODE = M.PLINE_CODE),
           0) FAIL_WT,
       NVL((SELECT SUM(V.ACT_COUNT)
             FROM PORT_VRP_BATCH_SAMPLE_RESULT V
            WHERE V.HEAT_PLAN_NO = M.HEAT_PLAN_NO
            AND V.PLINE_CODE = M.PLINE_CODE
            AND V.INSTORE_FLAG = '1'),
           0) PRO_NUM,
       NVL((SELECT SUM(V.ACT_WEIGHT)
             FROM PORT_VRP_BATCH_SAMPLE_RESULT V
            WHERE V.HEAT_PLAN_NO = M.HEAT_PLAN_NO
            AND V.PLINE_CODE = M.PLINE_CODE
              AND V.INSTORE_FLAG = '1'),
           0) PRO_WT,
       NVL((SELECT SUM(V.OFFLINE_NUM)
             FROM VRP_OFFLINE_RESULT V
            WHERE V.HEAT_PLAN_NO = M.HEAT_PLAN_NO
            AND V.PLINE_CODE = M.PLINE_CODE),
           0) OFFLINE_NUM,
       NVL((SELECT SUM(V.OFFLINE_WT)
             FROM VRP_OFFLINE_RESULT V
            WHERE V.HEAT_PLAN_NO = M.HEAT_PLAN_NO
            AND V.PLINE_CODE = M.PLINE_CODE),
           0) OFFLINE_WT,
       NVL((SELECT SUM(V.RE_NUM)
             FROM VRP_OFFLINE_RESULT V
            WHERE V.HEAT_PLAN_NO = M.HEAT_PLAN_NO
            AND V.PLINE_CODE = M.PLINE_CODE),
           0) RE_NUM,
       NVL((SELECT SUM(V.RE_WT)
             FROM VRP_OFFLINE_RESULT V
            WHERE V.HEAT_PLAN_NO = M.HEAT_PLAN_NO
            AND V.PLINE_CODE = M.PLINE_CODE),
           0) RE_WT,
       
       NVL((SELECT SUM(V.PRO_NUM)
             FROM VRP_LOADING_RESULT V
            WHERE V.HEAT_PLAN_NO = M.HEAT_PLAN_NO
            AND V.PLINE_CODE = M.PLINE_CODE),
           0) LOAD_PRO_NUM,
       NVL((SELECT SUM(V.PRO_WT)
             FROM VRP_LOADING_RESULT V
            WHERE V.HEAT_PLAN_NO = M.HEAT_PLAN_NO
            AND V.PLINE_CODE = M.PLINE_CODE),
           0) LOAD_PRO_WT,        NVL((SELECT SUM(V1.PRO_NUM)
             FROM VRP_EXPAND_RESULT V1
            WHERE V1.HEAT_PLAN_NO = M.HEAT_PLAN_NO
            AND V1.PLINE_CODE = M.PLINE_CODE),
           0) EXP_PRO_NUM,
       NVL((SELECT SUM(V1.PRO_WT)
             FROM VRP_EXPAND_RESULT V1
            WHERE V1.HEAT_PLAN_NO = M.HEAT_PLAN_NO
            AND V1.PLINE_CODE = M.PLINE_CODE),
           0) EXP_PRO_WT,
       NVL((SELECT SUM(V1.FAIL_NUM)
             FROM VRP_EXPAND_RESULT V1
            WHERE V1.HEAT_PLAN_NO = M.HEAT_PLAN_NO
            AND V1.PLINE_CODE = M.PLINE_CODE),
           0) EXP_FAIL_NUM,        NVL((SELECT SUM(V1.ACC_NUM)
             FROM VRP_MEASURING_RESULT V1
            WHERE V1.HEAT_PLAN_NO = M.HEAT_PLAN_NO
            AND V1.PLINE_CODE = M.PLINE_CODE),
           0) MEA_ACC_NUM,
       NVL((SELECT SUM(V1.ACC_WT)
             FROM VRP_MEASURING_RESULT V1
            WHERE V1.HEAT_PLAN_NO = M.HEAT_PLAN_NO
            AND V1.PLINE_CODE = M.PLINE_CODE),
           0) MEA_ACC_WT,
       NVL((SELECT SUM(V1.FAIL_NUM)
             FROM VRP_MEASURING_RESULT V1
            WHERE V1.HEAT_PLAN_NO = M.HEAT_PLAN_NO
            AND V1.PLINE_CODE = M.PLINE_CODE),
           0) MEA_FAIL_NUM,        NVL((SELECT SUM(V1.PRO_NUM)
             FROM VRP_REELER_RESULT V1
            WHERE V1.HEAT_PLAN_NO = M.HEAT_PLAN_NO
            AND V1.PLINE_CODE = M.PLINE_CODE),
           0) REE_PRO_NUM,
       NVL((SELECT SUM(V1.PRO_WT)
             FROM VRP_REELER_RESULT V1
            WHERE V1.HEAT_PLAN_NO = M.HEAT_PLAN_NO
            AND V1.PLINE_CODE = M.PLINE_CODE),
           0) REE_PRO_WT,
       NVL((SELECT SUM(V1.FAIL_NUM)
             FROM VRP_REELER_RESULT V1
            WHERE V1.HEAT_PLAN_NO = M.HEAT_PLAN_NO
            AND V1.PLINE_CODE = M.PLINE_CODE),
           0) REE_FAIL_NUM,        NVL((SELECT SUM(V1.PRO_NUM)
             FROM VRP_SIZING_RESULT V1
            WHERE V1.HEAT_PLAN_NO = M.HEAT_PLAN_NO
            AND V1.PLINE_CODE = M.PLINE_CODE),
           0) SIZ_PRO_NUM,
       NVL((SELECT SUM(V1.PRO_WT)
             FROM VRP_SIZING_RESULT V1
            WHERE V1.HEAT_PLAN_NO = M.HEAT_PLAN_NO
            AND V1.PLINE_CODE = M.PLINE_CODE),
           0) SIZ_PRO_WT,
       NVL((SELECT SUM(V1.FAIL_NUM)
             FROM VRP_SIZING_RESULT V1
            WHERE V1.HEAT_PLAN_NO = M.HEAT_PLAN_NO
            AND V1.PLINE_CODE = M.PLINE_CODE),
           0) SIZ_FAIL_NUM,        NVL((SELECT SUM(V1.ACC_NUM)
             FROM VRP_ROTEXP_FACE_M V1
            WHERE V1.HEAT_PLAN_NO = M.HEAT_PLAN_NO
            AND V1.PLINE_CODE = M.PLINE_CODE),
           0) ROT_ACC_NUM,
       NVL((SELECT SUM(V1.ACC_WT)
             FROM VRP_ROTEXP_FACE_M V1
            WHERE V1.HEAT_PLAN_NO = M.HEAT_PLAN_NO
            AND V1.PLINE_CODE = M.PLINE_CODE),
           0) ROT_ACC_WT,
       NVL((SELECT SUM(V1.FAIL_NUM)
             FROM VRP_ROTEXP_FACE_M V1
            WHERE V1.HEAT_PLAN_NO = M.HEAT_PLAN_NO
            AND V1.PLINE_CODE = M.PLINE_CODE),
           0) ROT_FAIL_NUM,        NVL((SELECT SUM(V1.ACC_NUM)
             FROM VRP_JUMPINGUP_FACE_M V1
            WHERE V1.HEAT_PLAN_NO = M.HEAT_PLAN_NO
            AND V1.PLINE_CODE = M.PLINE_CODE),
           0) JUM_ACC_NUM,
       NVL((SELECT SUM(V1.ACC_WT)
             FROM VRP_JUMPINGUP_FACE_M V1
            WHERE V1.HEAT_PLAN_NO = M.HEAT_PLAN_NO
            AND V1.PLINE_CODE = M.PLINE_CODE),
           0) JUM_ACC_WT,
       NVL((SELECT SUM(V1.FAIL_NUM)
             FROM VRP_JUMPINGUP_FACE_M V1
            WHERE V1.HEAT_PLAN_NO = M.HEAT_PLAN_NO
            AND V1.PLINE_CODE = M.PLINE_CODE),
           0) JUM_FAIL_NUM,        NVL((SELECT SUM(V1.ACC_NUM)
             FROM VRP_HOTEXP_FACE_M V1
            WHERE V1.HEAT_PLAN_NO = M.HEAT_PLAN_NO
            AND V1.PLINE_CODE = M.PLINE_CODE),
           0) HOT_ACC_NUM,
       NVL((SELECT SUM(V1.ACC_WT)
             FROM VRP_HOTEXP_FACE_M V1
            WHERE V1.HEAT_PLAN_NO = M.HEAT_PLAN_NO
            AND V1.PLINE_CODE = M.PLINE_CODE),
           0) HOT_ACC_WT,
       NVL((SELECT SUM(V1.FAIL_NUM)
             FROM VRP_HOTEXP_FACE_M V1
            WHERE V1.HEAT_PLAN_NO = M.HEAT_PLAN_NO
            AND V1.PLINE_CODE = M.PLINE_CODE),
           0) HOT_FAIL_NUM,        NVL((SELECT SUM(V1.ACC_NUM)
             FROM VRP_COLDROLL_RESULT V1
            WHERE V1.HEAT_PLAN_NO = M.HEAT_PLAN_NO
            AND V1.PLINE_CODE = M.PLINE_CODE),
           0) HEA_ACC_NUM,
       NVL((SELECT SUM(V1.ACC_WT)
             FROM VRP_COLDROLL_RESULT V1
            WHERE V1.HEAT_PLAN_NO = M.HEAT_PLAN_NO
            AND V1.PLINE_CODE = M.PLINE_CODE),
           0) HEA_ACC_WT,
       NVL((SELECT SUM(V1.FAIL_NUM)
             FROM VRP_COLDROLL_RESULT V1
            WHERE V1.HEAT_PLAN_NO = M.HEAT_PLAN_NO
            AND V1.PLINE_CODE = M.PLINE_CODE),
           0) HEA_FAIL_NUM,         
       NVL((SELECT SUM(MAT.ACT_COUNT)
             FROM QCM_ZG_JUGDE_APPLY MAT
            WHERE MAT.JUDGE_STOVE_NO = M.JUDGE_STOVE_NO
            AND MAT.PLINE_CODE = M.PLINE_CODE
            AND MAT.VALIDFLAG != '50' and mat.apply_flag='0'),
           0) MAT_NUM,      
       NVL((SELECT SUM(MAT.ACT_WEIGHT)
             FROM QCM_ZG_JUGDE_APPLY MAT
            WHERE MAT.JUDGE_STOVE_NO = M.JUDGE_STOVE_NO
            AND MAT.PLINE_CODE = M.PLINE_CODE
            AND MAT.VALIDFLAG != '50' and mat.apply_flag='0'),
           0) MAT_WEIGHT,
            NVL((SELECT SUM(QCM.ACT_THEORY_WEIGHT)
             FROM QCM_ZG_JUGDE_APPLY QCM
            WHERE QCM.JUDGE_STOVE_NO = M.JUDGE_STOVE_NO
            AND QCM.PLINE_CODE = M.PLINE_CODE
            AND QCM.VALIDFLAG != '50' and qcm.apply_flag='0'),
           0) QCM_THEORY_WEIGHT,
       NVL((SELECT SUM(QCM.ACT_COUNT)
             FROM QCM_ZG_JUGDE_APPLY QCM
            WHERE QCM.JUDGE_STOVE_NO = M.JUDGE_STOVE_NO
            AND QCM.PLINE_CODE = M.PLINE_CODE
            AND QCM.VALIDFLAG = '20'),
           0) QCM_NUM,      
       NVL((SELECT SUM(QCM.ACT_WEIGHT)
             FROM QCM_ZG_JUGDE_APPLY QCM
            WHERE QCM.JUDGE_STOVE_NO = M.JUDGE_STOVE_NO
            AND QCM.PLINE_CODE = M.PLINE_CODE
            AND QCM.VALIDFLAG = '20'),
           0) QCM_WEIGHT,   
             NVL((SELECT SUM(QCM.ACT_THEORY_WEIGHT)
             FROM QCM_ZG_JUGDE_APPLY QCM
            WHERE QCM.JUDGE_STOVE_NO = M.JUDGE_STOVE_NO
            AND QCM.PLINE_CODE = M.PLINE_CODE
            AND QCM.VALIDFLAG = '20'),
           0) THEORY_WEIGHT,
       MIN(TO_CHAR(T1.LOAD_TIME, 'YYYY-MM-DD HH24:MI:SS')) LOAD_TIME   
  FROM VRP_COM_INFO       T,
       PLN_ZY_DBK_M       M,
       PLN_ZY_DBK_C    C,
       PLN_SALEORD      M1,
       vrp_loading_result T1
 WHERE M.HEAT_PLAN_NO = T.HEAT_PLAN_NO
 and M.HEAT_PLAN_NO = C.HEAT_PLAN_NO
   AND M.HEAT_PLAN_NO = T1.HEAT_PLAN_NO(+)
   AND M.ORD_LN_DLY_PK = M1.ORD_LN_DLY_PK(+)
          ]]>
	</query>
	<query id="FrmDBKPerformance.doQueryPort" desc="查询DBK进程">		
        <![CDATA[
SELECT M.HEAT_PLAN_NO,
       M.PLINE_NAME,
       M.ZY_BATCH_ID,
       M.PRO_PLAN_ID,
       M.GX_PLAN_NO,
       M.FEED_HEAT_NO,
       M.CRAFT_FILE_NO,
       M.CRAFT_FILE_MAN,
       M.CRAFT_SEQ,
       M.JUDGE_STOVE_NO JUDGE_STOVE_NO,
       C.BATCH_NO,
       C.BATCH_GROUD_NO,
       M.GRADENAME,
       DECODE(M.IF_MATCH_ODD,'0','正常计划','1','利库计划','2','组炉计划') IF_MATCH_ODD,
	   MIN(T.BAL_YEAR_MONTH) BAL_YEAR_MONTH,  
       C.PLAN_INDOUBLE_NUM,
       C.PLAN_INDOUBLE_WT,
       M.ORDER_NO || '/' || M.ORDER_SEQ || '/' || M.DELIVERY_NO ORDER_NO,
       M.OUTWL_DESC,
       M1.SPEC_NAME,
       M1.STD_NAME,
       M1.PRODUCNAME,
       M1.MODEL_DESC,
       M1.STEELNAME,
         NVL((SELECT SUM(V.ACT_COUNT)
             FROM PORT_VRP_BATCH_SAMPLE_RESULT V
            WHERE V.HEAT_PLAN_NO = M.HEAT_PLAN_NO
             AND V.PLINE_CODE = M.PLINE_CODE
              AND (V.MAT_STATUS = '10' or V.MAT_STATUS = '40')),
           0) FAIL_NUM,
       NVL((SELECT SUM(V.ACT_WEIGHT)
             FROM PORT_VRP_BATCH_SAMPLE_RESULT V
            WHERE V.HEAT_PLAN_NO = M.HEAT_PLAN_NO
             AND V.PLINE_CODE = M.PLINE_CODE
              AND (V.MAT_STATUS = '10' or V.MAT_STATUS = '40')),
           0) FAIL_WT,
       NVL((SELECT SUM(V.ACT_COUNT)
             FROM PORT_VRP_BATCH_SAMPLE_RESULT V
            WHERE V.HEAT_PLAN_NO = M.HEAT_PLAN_NO
             AND V.PLINE_CODE = M.PLINE_CODE
              AND V.INSTORE_FLAG = '1'),
           0) PRO_NUM,
       NVL((SELECT SUM(V.ACT_WEIGHT)
             FROM PORT_VRP_BATCH_SAMPLE_RESULT V
            WHERE V.HEAT_PLAN_NO = M.HEAT_PLAN_NO
             AND V.PLINE_CODE = M.PLINE_CODE
              AND V.INSTORE_FLAG = '1'),
           0) PRO_WT,
       NVL((SELECT SUM(V.OFFLINE_NUM)
             FROM VRP_OFFLINE_RESULT V
            WHERE V.HEAT_PLAN_NO = M.HEAT_PLAN_NO
             AND V.PLINE_CODE = M.PLINE_CODE),
           0) OFFLINE_NUM,
       NVL((SELECT SUM(V.OFFLINE_WT)
             FROM VRP_OFFLINE_RESULT V
            WHERE V.HEAT_PLAN_NO = M.HEAT_PLAN_NO
             AND V.PLINE_CODE = M.PLINE_CODE),
           0) OFFLINE_WT,
       NVL((SELECT SUM(V.RE_NUM)
             FROM VRP_OFFLINE_RESULT V
            WHERE V.HEAT_PLAN_NO = M.HEAT_PLAN_NO
             AND V.PLINE_CODE = M.PLINE_CODE),
           0) RE_NUM,
       NVL((SELECT SUM(V.RE_WT)
             FROM VRP_OFFLINE_RESULT V
            WHERE V.HEAT_PLAN_NO = M.HEAT_PLAN_NO
             AND V.PLINE_CODE = M.PLINE_CODE),
           0) RE_WT,
       NVL((SELECT SUM(V.ACT_COUNT)
             FROM PORT_VRP_BATCH_SAMPLE_RESULT V
            WHERE V.HEAT_PLAN_NO = M.HEAT_PLAN_NO
            AND V.PLINE_CODE = M.PLINE_CODE
              AND V.MAT_STATUS = '30'),
           0) ZL_ACT_COUNT,
       NVL((SELECT SUM(V.ACT_WEIGHT)
             FROM PORT_VRP_BATCH_SAMPLE_RESULT V
            WHERE V.HEAT_PLAN_NO = M.HEAT_PLAN_NO
            AND V.PLINE_CODE = M.PLINE_CODE
              AND V.MAT_STATUS = '30'),
           0) ZL_ACT_WEIGHT,             

   NVL((SELECT SUM(V.ACT_COUNT)
             FROM PORT_VRP_BATCH_SAMPLE_RESULT V
            WHERE V.HEAT_PLAN_NO = M.HEAT_PLAN_NO
            AND V.PLINE_CODE = M.PLINE_CODE),
           0) LOAD_PRO_NUM,
       NVL((SELECT SUM(V.ACT_WEIGHT)
             FROM PORT_VRP_BATCH_SAMPLE_RESULT V
            WHERE V.HEAT_PLAN_NO = M.HEAT_PLAN_NO
            AND V.PLINE_CODE = M.PLINE_CODE),
           0) LOAD_PRO_WT, 
           
                 /*   NVL((SELECT SUM(V.PRO_NUM)
             FROM VRP_LOADING_RESULT V
            WHERE V.HEAT_PLAN_NO = M.HEAT_PLAN_NO
            AND V.PLINE_CODE = M.PLINE_CODE),
           0) LOAD_PRO_NUM,*/
/*       NVL((SELECT SUM(V.PRO_WT)
             FROM VRP_LOADING_RESULT V
            WHERE V.HEAT_PLAN_NO = M.HEAT_PLAN_NO
            AND V.PLINE_CODE = M.PLINE_CODE),
           0) LOAD_PRO_WT,
*/

       NVL((SELECT SUM(V1.PRO_NUM)
             FROM VRP_EXPAND_RESULT V1
            WHERE V1.HEAT_PLAN_NO = M.HEAT_PLAN_NO
            AND V1.PLINE_CODE = M.PLINE_CODE),
           0) EXP_PRO_NUM,
       NVL((SELECT SUM(V1.PRO_WT)
             FROM VRP_EXPAND_RESULT V1
            WHERE V1.HEAT_PLAN_NO = M.HEAT_PLAN_NO
            AND V1.PLINE_CODE = M.PLINE_CODE),
           0) EXP_PRO_WT,
       NVL((SELECT SUM(V1.FAIL_NUM)
             FROM VRP_EXPAND_RESULT V1
            WHERE V1.HEAT_PLAN_NO = M.HEAT_PLAN_NO
            AND V1.PLINE_CODE = M.PLINE_CODE),
           0) EXP_FAIL_NUM,        NVL((SELECT SUM(V1.ACC_NUM)
             FROM VRP_MEASURING_RESULT V1
            WHERE V1.HEAT_PLAN_NO = M.HEAT_PLAN_NO
            AND V1.PLINE_CODE = M.PLINE_CODE),
           0) MEA_ACC_NUM,
       NVL((SELECT SUM(V1.ACC_WT)
             FROM VRP_MEASURING_RESULT V1
            WHERE V1.HEAT_PLAN_NO = M.HEAT_PLAN_NO
            AND V1.PLINE_CODE = M.PLINE_CODE),
           0) MEA_ACC_WT,
       NVL((SELECT SUM(V1.FAIL_NUM)
             FROM VRP_MEASURING_RESULT V1
            WHERE V1.HEAT_PLAN_NO = M.HEAT_PLAN_NO
            AND V1.PLINE_CODE = M.PLINE_CODE),
           0) MEA_FAIL_NUM,        NVL((SELECT SUM(V1.PRO_NUM)
             FROM VRP_REELER_RESULT V1
            WHERE V1.HEAT_PLAN_NO = M.HEAT_PLAN_NO
            AND V1.PLINE_CODE = M.PLINE_CODE),
           0) REE_PRO_NUM,
       NVL((SELECT SUM(V1.PRO_WT)
             FROM VRP_REELER_RESULT V1
            WHERE V1.HEAT_PLAN_NO = M.HEAT_PLAN_NO
            AND V1.PLINE_CODE = M.PLINE_CODE),
           0) REE_PRO_WT,
       NVL((SELECT SUM(V1.FAIL_NUM)
             FROM VRP_REELER_RESULT V1
            WHERE V1.HEAT_PLAN_NO = M.HEAT_PLAN_NO
            AND V1.PLINE_CODE = M.PLINE_CODE),
           0) REE_FAIL_NUM,        NVL((SELECT SUM(V1.PRO_NUM)
             FROM VRP_SIZING_RESULT V1
            WHERE V1.HEAT_PLAN_NO = M.HEAT_PLAN_NO
            AND V1.PLINE_CODE = M.PLINE_CODE),
           0) SIZ_PRO_NUM,
       NVL((SELECT SUM(V1.PRO_WT)
             FROM VRP_SIZING_RESULT V1
            WHERE V1.HEAT_PLAN_NO = M.HEAT_PLAN_NO
            AND V1.PLINE_CODE = M.PLINE_CODE),
           0) SIZ_PRO_WT,
       NVL((SELECT SUM(V1.FAIL_NUM)
             FROM VRP_SIZING_RESULT V1
            WHERE V1.HEAT_PLAN_NO = M.HEAT_PLAN_NO
            AND V1.PLINE_CODE = M.PLINE_CODE),
           0) SIZ_FAIL_NUM,        NVL((SELECT SUM(V1.ACC_NUM)
             FROM VRP_ROTEXP_FACE_M V1
            WHERE V1.HEAT_PLAN_NO = M.HEAT_PLAN_NO
            AND V1.PLINE_CODE = M.PLINE_CODE),
           0) ROT_ACC_NUM,
       NVL((SELECT SUM(V1.ACC_WT)
             FROM VRP_ROTEXP_FACE_M V1
            WHERE V1.HEAT_PLAN_NO = M.HEAT_PLAN_NO
            AND V1.PLINE_CODE = M.PLINE_CODE),
           0) ROT_ACC_WT,
       NVL((SELECT SUM(V1.FAIL_NUM)
             FROM VRP_ROTEXP_FACE_M V1
            WHERE V1.HEAT_PLAN_NO = M.HEAT_PLAN_NO
            AND V1.PLINE_CODE = M.PLINE_CODE),
           0) ROT_FAIL_NUM,        NVL((SELECT SUM(V1.ACC_NUM)
             FROM VRP_JUMPINGUP_FACE_M V1
            WHERE V1.HEAT_PLAN_NO = M.HEAT_PLAN_NO
            AND V1.PLINE_CODE = M.PLINE_CODE),
           0) JUM_ACC_NUM,
       NVL((SELECT SUM(V1.ACC_WT)
             FROM VRP_JUMPINGUP_FACE_M V1
            WHERE V1.HEAT_PLAN_NO = M.HEAT_PLAN_NO
            AND V1.PLINE_CODE = M.PLINE_CODE),
           0) JUM_ACC_WT,
       NVL((SELECT SUM(V1.FAIL_NUM)
             FROM VRP_JUMPINGUP_FACE_M V1
            WHERE V1.HEAT_PLAN_NO = M.HEAT_PLAN_NO
            AND V1.PLINE_CODE = M.PLINE_CODE),
           0) JUM_FAIL_NUM,        NVL((SELECT SUM(V1.ACC_NUM)
             FROM VRP_HOTEXP_FACE_M V1
            WHERE V1.HEAT_PLAN_NO = M.HEAT_PLAN_NO
            AND V1.PLINE_CODE = M.PLINE_CODE),
           0) HOT_ACC_NUM,
       NVL((SELECT SUM(V1.ACC_WT)
             FROM VRP_HOTEXP_FACE_M V1
            WHERE V1.HEAT_PLAN_NO = M.HEAT_PLAN_NO
            AND V1.PLINE_CODE = M.PLINE_CODE),
           0) HOT_ACC_WT,
       NVL((SELECT SUM(V1.FAIL_NUM)
             FROM VRP_HOTEXP_FACE_M V1
            WHERE V1.HEAT_PLAN_NO = M.HEAT_PLAN_NO
            AND V1.PLINE_CODE = M.PLINE_CODE),
           0) HOT_FAIL_NUM,        NVL((SELECT SUM(V1.ACC_NUM)
             FROM VRP_COLDROLL_RESULT V1
            WHERE V1.HEAT_PLAN_NO = M.HEAT_PLAN_NO
            AND V1.PLINE_CODE = M.PLINE_CODE),
           0) HEA_ACC_NUM,
       NVL((SELECT SUM(V1.ACC_WT)
             FROM VRP_COLDROLL_RESULT V1
            WHERE V1.HEAT_PLAN_NO = M.HEAT_PLAN_NO
            AND V1.PLINE_CODE = M.PLINE_CODE),
           0) HEA_ACC_WT,
       NVL((SELECT SUM(V1.FAIL_NUM)
             FROM VRP_COLDROLL_RESULT V1
            WHERE V1.HEAT_PLAN_NO = M.HEAT_PLAN_NO
            AND V1.PLINE_CODE = M.PLINE_CODE),
           0) HEA_FAIL_NUM,
           
              NVL((SELECT SUM(MAT.ACT_COUNT)
             FROM QCM_ZG_JUGDE_APPLY MAT
            WHERE MAT.JUDGE_STOVE_NO = M.JUDGE_STOVE_NO
            AND MAT.PLINE_CODE = M.PLINE_CODE
            AND MAT.VALIDFLAG != '50' and mat.apply_flag='0'),
           0) MAT_NUM,      
       NVL((SELECT SUM(MAT.ACT_WEIGHT)
             FROM QCM_ZG_JUGDE_APPLY MAT
            WHERE MAT.JUDGE_STOVE_NO = M.JUDGE_STOVE_NO
            AND MAT.PLINE_CODE = M.PLINE_CODE
            AND MAT.VALIDFLAG != '50' and mat.apply_flag='0'),
           0) MAT_WEIGHT,
            NVL((SELECT SUM(QCM.ACT_THEORY_WEIGHT)
             FROM QCM_ZG_JUGDE_APPLY QCM
            WHERE QCM.JUDGE_STOVE_NO = M.JUDGE_STOVE_NO
            AND QCM.PLINE_CODE = M.PLINE_CODE
            AND QCM.VALIDFLAG != '50' and qcm.apply_flag='0'),
           0) QCM_THEORY_WEIGHT,
       NVL((SELECT SUM(QCM.ACT_COUNT)
             FROM QCM_ZG_JUGDE_APPLY QCM
            WHERE QCM.JUDGE_STOVE_NO = M.JUDGE_STOVE_NO
            AND QCM.PLINE_CODE = M.PLINE_CODE
            AND QCM.VALIDFLAG = '20'),
           0) QCM_NUM,      
       NVL((SELECT SUM(QCM.ACT_WEIGHT)
             FROM QCM_ZG_JUGDE_APPLY QCM
            WHERE QCM.JUDGE_STOVE_NO = M.JUDGE_STOVE_NO
            AND QCM.PLINE_CODE = M.PLINE_CODE
            AND QCM.VALIDFLAG = '20'),
           0) QCM_WEIGHT,
        NVL((SELECT SUM(QCM.ACT_THEORY_WEIGHT)
             FROM QCM_ZG_JUGDE_APPLY QCM
            WHERE QCM.JUDGE_STOVE_NO = M.JUDGE_STOVE_NO
            AND QCM.PLINE_CODE = M.PLINE_CODE
            AND QCM.VALIDFLAG = '20'),
           0) THEORY_WEIGHT,
       MIN(TO_CHAR(T.PRO_TIME, 'YYYY-MM-DD HH24:MI:SS')) LOAD_TIME
       FROM PORT_VRP_BATCH_SAMPLE_RESULT T, PLN_ZY_DBK_M M, PLN_SALEORD M1,PLN_ZY_DBK_C C
 WHERE M.HEAT_PLAN_NO = T.HEAT_PLAN_NO and m.heat_plan_no = c.heat_plan_no
   AND M.ORD_LN_DLY_PK = M1.ORD_LN_DLY_PK(+)
        ]]>
	</query>
</queryMap>