<?xml version="1.0" encoding="UTF-8"?>
<queryMap desc="申请判定管理">
	<query id="FrmMchApply.doQueryLibrary" desc="查询炉计划信息">
	  <![CDATA[
		SELECT T3.*,
		TO_NUMBER(T3.OUT_NUM_REAL) - TO_NUMBER(T3.APPLY_COUNT) UNAPPLY_COUNT
		FROM (SELECT 
		T.HEAT_PLAN_NO,
       T.ORDER_NO,
       T.ORDER_SEQ,
       T.DELIVERY_NO,
       T.ORDER_NO || '/' || T.ORDER_SEQ || '/' || T.DELIVERY_NO ORDER_NO_SEQ,
       T.JUDGE_STOVE_NO,
       T.BATCH_NO ZG_BATCH_NO,
       T.OUTWL_ID,
       T.OUTWL_DESC,
       T1.PRODUCCODE,
       T1.PRODUCNAME,
       T1.STD_CODE,
       T1.STD_NAME,
       T1.STEELCODE,
       T1.STEELNAME,
       T1.SPEC_CODE,
       T1.SPEC_NAME,
       T1.MODEL_CODE,
       T1.MODEL_DESC,
       T1.STD_STYLE_DESC,
       TO_CHAR(T1.LENGTHMIN, 'FM999990.00') AS LENGTHMIN,
       TO_CHAR(T1.LENGTHMAX, 'FM999990.00') AS LENGTHMAX,
       TO_CHAR(T1.LENGTHMIN, 'FM999990.00') || '-' ||
       TO_CHAR(T1.LENGTHMAX, 'FM999990.00') AS ACT_LEN_SCOPE,
       SUM(NVL(Th.REAL_OUTDOUBLE_WT, 0)) OUT_WT_REAL,
       SUM(NVL(Th.REAL_OUTDOUBLE_NUM, 0)) OUT_NUM_REAL,
       T.CRAFT_FILE_NO,
       T.ZY_BATCH_ID,
       NVL((SELECT SUM(T2.ACT_COUNT)
             FROM QCM_ZG_JUGDE_APPLY T2
            WHERE T2.JUDGE_STOVE_NO = T.JUDGE_STOVE_NO
              AND T2.BATCH_NO = T.BATCH_NO
              AND T2.PROCESS_CODE = 'G'),
           0) APPLY_COUNT,
           T.CREATE_NAME,
           TO_CHAR(T.CREATE_TIME,'YYYY-MM-DD') CREATE_TIME,
           T.PLINE_CODE,
           T.PLINE_NAME
  FROM PLN_ZY_JGX_M T, PLN_SALEORD T1,PLN_ZY_JGX_C th
 WHERE T.ORD_LN_DLY_PK = T1.ORD_LN_DLY_PK(+)
   AND T.PLANSTATUS = '30' AND TH.OUTNUM_CUT='1'
		  ]]>
	</query>

	<query id="FrmMchApply.doQueryVrpMatNo" desc="查询材料表实体类">
	  <![CDATA[
	  SELECT  T1.*
          FROM MAT_ZC_M T1,YDM_ZC_BUTTRESS S
         WHERE T1.MAT_NO = S.MAT_NO
           AND T1.JUDGE_STOVE_NO =?
           AND T1.BATCH_NO = ?
           AND T1.BATCH_GROUD_NO = ?
           AND T1.PRC_QCM_STAUS = '00'   
          ORDER BY T1.MAT_NO ASC   
	  ]]>
	</query>
	<query id="FrmMchApply.doQueryMatZcM" desc="查询炉批信息">
	  <![CDATA[
	SELECT T2.*,
       DECODE(T4.APPLY_FLAG, '0', '正常送判', '1', '退判', '未送判') APPLY_FLAG,
       T4.BACK_JUGDE_MEMO
  FROM (SELECT T1.JUDGE_STOVE_NO,
               T1.BATCH_NO,
               T1.BATCH_GROUD_NO,
               T1.PRODUCNAME,
               T1.STEELNAME,
               T1.SPEC_NAME,
               T1.MODEL_DESC,
               T1.STD_NAME,
               T1.ORDER_NO,
               T1.ORDER_SEQ,
               T1.ORDER_SEQ_NO,
               T1.ACT_DIMATER,
               T1.ACT_HEIGHT,
               T1.BELONG_NAME,
               T1.STD_STYLE_DESC,
               T1.GRADENAME,
               SUM(T1.ACT_COUNT) ACT_COUNT,
               TO_CHAR(SUM(T1.ACT_WEIGHT), 'FM999999990.000') ACT_WEIGHT,
               TO_CHAR(SUM(T1.ACT_THEORY_WEIGHT), 'FM999999990.000') ACT_THEORY_WEIGHT,
               SUM(NVL(T1.ACT_LEN, 0)) AS ACT_LEN,
               TO_CHAR(T1.ACT_LEN_MIN, 'FM999990.00') AS ACT_LEN_MIN,
               TO_CHAR(T1.ACT_LEN_MAX, 'FM999990.00') AS ACT_LEN_MAX,
               TO_CHAR(T1.ACT_LEN_MIN, 'FM999990.00') || '-' ||
               TO_CHAR(T1.ACT_LEN_MAX, 'FM999990.00') AS LEN,
               MAX(TO_CHAR(T1.CREATE_TIME, 'YYYY-MM-DD HH24:MI:SS')) CREATE_TIME,
               MAX(TO_CHAR(T1.INSTOCK_TIME, 'YYYY-MM-DD')) INSTOCK_TIME,
               T1.MATERIAL_NAME,
               T1.JUDGE_STD_NAME,
               T1.PLINE_CODE,
               T1.PLINE_NAME,
               T1.MAT_STATUS,
               P.HEAT_PLAN_NO,
               TO_CHAR(TO_DATE(P.BAL_YEAR_MONTH, 'YYYY-MM'), 'YYYY-MM') AS BAL_YEAR_MONTH,
               T1.PRODUCT_FLAG,
               T1.PRC_JUGDE_APPLY_CODE VRP_JUGDE_APPLY_CODE,
               DECODE(T1.PRC_QCM_STAUS,
                      '00',
                      '合格',
                      '11',
                      '待处理',
                      '22',
                      '判废',
                      '10',
                      '处理合格',
                      '12',
                      '处理判废') VRP_QCM_STAUS,
               T1.PRC_PHY_RESULT_CODE VRP_PHY_RESULT_CODE,
               T1.PRC_FACE_RESULT_CODE VRP_FACE_RESULT_CODE,
               T1.PRC_JUDGE_RESULT_CODE VRP_JUDGE_RESULT_CODE,
               T1.PRC_CHEM_RESULT_CODE VRP_CHEM_RESULT_CODE
          FROM MAT_ZC_M                     T1,
               YDM_ZC_BUTTRESS              T,
               PORT_MCH_BATCH_SAMPLE_RESULT P
         WHERE T1.MAT_NO = T.MAT_NO
           AND T1.MAT_NO = P.MAT_NO
           AND P.MAT_STATUS = '00'
           AND T1.JUDGE_STOVE_NO = ?
           AND NVL(T1.BATCH_NO, '/') = NVL(?, '/')
           AND T1.PRC_QCM_STAUS IN ('00', '10')
           AND P.PLINE_CODE = ?
            #VRP_JUGDE_APPLY_CODE#
         GROUP BY T1.JUDGE_STOVE_NO,
                  T1.BATCH_NO,
                  T1.BATCH_GROUD_NO,
                  T1.PRODUCNAME,
                  T1.STEELNAME,
                  T1.SPEC_NAME,
                  T1.GRADENAME,
                  T1.STD_STYLE_DESC,
                  T1.MAT_STATUS,
                  T1.PRC_JUGDE_APPLY_CODE,
                  T1.PRC_QCM_STAUS,
                  T1.MODEL_DESC,
                  T1.STD_NAME,
                  T1.ORDER_NO,
                  T1.ORDER_SEQ,
                  T1.ORDER_SEQ_NO,
                  T1.ACT_DIMATER,
                  T1.ACT_HEIGHT,
                  T1.BELONG_NAME,
                  T1.PLINE_CODE,
                  T1.PLINE_NAME,
                  P.BAL_YEAR_MONTH,
                  T1.MATERIAL_NAME,
                  T1.ACT_LEN_MIN,
                  T1.ACT_LEN_MAX,
                  T1.PRODUCT_FLAG,
                  T1.JUDGE_STD_NAME,
                  T1.PRC_PHY_RESULT_CODE,
                  T1.PRC_FACE_RESULT_CODE,
                  T1.PRC_JUDGE_RESULT_CODE,
                  T1.PRC_CHEM_RESULT_CODE,
                  P.HEAT_PLAN_NO) T2
  LEFT JOIN (SELECT T3.JUGDE_APPLY_CODE, T3.APPLY_FLAG, T3.BACK_JUGDE_MEMO
               FROM QCM_ZG_JUGDE_APPLY T3
              GROUP BY T3.JUGDE_APPLY_CODE,
                       T3.APPLY_FLAG,
                       T3.BACK_JUGDE_MEMO) T4
    ON T2.VRP_JUGDE_APPLY_CODE = T4.JUGDE_APPLY_CODE
 ORDER BY T2.BAL_YEAR_MONTH DESC

	  ]]>
	</query>
	<query id="FrmMchApply.getProductflag" desc="查询材料类别">
	 <![CDATA[
SELECT  T.BASENAME,T.BASECODE
  FROM COM_BASE_INFO T
 WHERE T.SORTCODE = ?
    AND T.VALIDFLAG = '1'
	 ]]>
	</query>
	<query id="FrmMchApply.jugdeApplyNo" desc="生产判定单号">
	 <![CDATA[
		SELECT ?|| ? || TO_CHAR(SYSDATE, 'YYYYMMDD') ||
       LPAD(NVL(MAX(SUBSTR(T.JUGDE_APPLY_CODE, 19)), 0) + 1, 5, 0) JUGDE_APPLY_CODE
  FROM QCM_ZG_JUGDE_APPLY T
 WHERE T.PLINE_CODE = ?
   AND T.PROCESS_CODE = ?
		 ]]>
	</query>
	<query id="FrmMchApply.insertJugeApply" desc="生产判定单号">
	 <![CDATA[
	DECLARE
  V_COUNT MAT_ZC_M.PRC_QUALITY_GROUP_ZG%TYPE := 1;
BEGIN
  FOR MYROW IN (SELECT SUM(T.ACT_COUNT) ACT_COUNT,
                       SUM(T.ACT_WEIGHT) ACT_THEORY_WEIGHT,
                       SUM(T.PONDER_GROSS_WT) ACT_WEIGHT,
                       T.JUDGE_STOVE_NO,
                       T.BATCH_NO,
                       T.BATCH_GROUD_NO,
                       T.PRC_JUDGE_RESULT_CODE,
                       T.PRC_FACE_RESULT_CODE,
                       T.PRC_CHEM_RESULT_CODE,
                       T.PRC_PHY_RESULT_CODE,
                       T.PRC_SPEC_RESULT_CODE,
                       T.PLINE_CODE,
                       T.PRO_ORDER_ID,
                       
                       T.LOT_NO,
                       T.PLINE_NAME,
                       T.PRO_ORDER_NO,
                       T.TARGET,
                       T.PROCESS_STATUS,
                       --T.MAT_GOWHERE_CODE,
                       --T.MAT_GOWHERE_NAME,
                       T.ACT_DIMATER,
                       T.ACT_HEIGHT,
                       T.ACT_LEN_MIN,
                       T.ACT_LEN_MAX,
                       T.CRAF_NO,
                       T.MATERIAL_NO,
                       T.MATERIAL_NAME,
                       T.PRODUCCODE,
                       T.PRODUCNAME,
                       T.SPEC_CODE,
                       T.SPEC_NAME,
                       T.STEELCODE,
                       T.STEELNAME,
                       T.MODEL_CODE,
                       T.MODEL_DESC,
                       T.STD_CODE,
                       T.STD_NAME,
                       T.STD_STYLE,
                       T.STD_STYLE_DESC,
                       T.GRADECODE,
                       T.GRADENAME
                  FROM MAT_ZC_M T
                 WHERE T.JUDGE_STOVE_NO = ?
                   AND T.BATCH_NO = ?
                   AND T.BATCH_GROUD_NO = ?
                   AND T.PLINE_CODE = ?
                   AND T.PRC_HEAT_PLAN_NO IS NOT NULL
                   AND T.PRC_QCM_STAUS IN ('00', '10')
                 GROUP BY T.JUDGE_STOVE_NO,
                          T.BATCH_NO,
                          T.BATCH_GROUD_NO,
                          T.PRC_JUDGE_RESULT_CODE,
                          T.PRC_FACE_RESULT_CODE,
                          T.PRC_CHEM_RESULT_CODE,
                          T.PRC_PHY_RESULT_CODE,
                          T.PRC_SPEC_RESULT_CODE,
                          T.PLINE_CODE,
                          T.PRO_ORDER_ID,
                          T.LOT_NO,
                          T.PLINE_NAME,
                          T.PRO_ORDER_NO,
                          T.TARGET,
                          T.PROCESS_STATUS,
                          --T.MAT_GOWHERE_CODE,
                          --T.MAT_GOWHERE_NAME,
                          T.ACT_DIMATER,
                          T.ACT_HEIGHT,
                          T.ACT_LEN_MIN,
                          T.ACT_LEN_MAX,
                          T.CRAF_NO,
                          T.MATERIAL_NO,
                          T.MATERIAL_NAME,
                          T.PRODUCCODE,
                          T.PRODUCNAME,
                          T.SPEC_CODE,
                          T.SPEC_NAME,
                          T.STEELCODE,
                          T.STEELNAME,
                          T.MODEL_CODE,
                          T.MODEL_DESC,
                          T.STD_CODE,
                          T.STD_NAME,
                          T.STD_STYLE,
                          T.STD_STYLE_DESC,
                          T.GRADECODE,
                          T.GRADENAME) LOOP
    FOR MYROW IN (SELECT SUM(T.ACT_COUNT) ACT_COUNT,
                         SUM(T.ACT_WEIGHT) ACT_THEORY_WEIGHT,
                         SUM(T.PONDER_GROSS_WT) ACT_WEIGHT,
                         T.JUDGE_STOVE_NO,
                         T.BATCH_NO,
                         T.BATCH_GROUD_NO,
                         T.PRC_JUDGE_RESULT_CODE,
                         T.PRC_FACE_RESULT_CODE,
                         T.PRC_CHEM_RESULT_CODE,
                         T.PRC_PHY_RESULT_CODE,
                         T.PRC_SPEC_RESULT_CODE,
                         T.PLINE_CODE,
                         T.PRO_ORDER_ID,
                         
                         T.LOT_NO,
                         T.PLINE_NAME,
                         T.PRO_ORDER_NO,
                         T.TARGET,
                         T.PROCESS_STATUS,
                         T.MAT_GOWHERE_CODE,
                         T.MAT_GOWHERE_NAME,
                         T.ACT_DIMATER,
                         T.ACT_HEIGHT,
                         T.ACT_LEN_MIN,
                         T.ACT_LEN_MAX,
                         T.CRAF_NO,
                         T.MATERIAL_NO,
                         T.MATERIAL_NAME,
                         T.PRODUCCODE,
                         T.PRODUCNAME,
                         T.SPEC_CODE,
                         T.SPEC_NAME,
                         T.STEELCODE,
                         T.STEELNAME,
                         T.MODEL_CODE,
                         T.MODEL_DESC,
                         T.STD_CODE,
                         T.STD_NAME,
                         T.STD_STYLE,
                         T.STD_STYLE_DESC,
                         T.GRADECODE,
                         T.GRADENAME,
                         T.TESTING_GRADE,
                         T.TESTING_TYPE,
                         T.TESTING_GRADE1,
                         T.TESTING_TYPE1,
                         T.ORD_LN_DLY_PK
                    FROM MAT_ZC_M T
                   WHERE T.JUDGE_STOVE_NO = ?
                     AND T.BATCH_NO = ?
                     AND T.BATCH_GROUD_NO = ?
                     AND T.PLINE_CODE = ?
                     AND T.PRC_HEAT_PLAN_NO IS NOT NULL
                     AND T.PRC_QCM_STAUS IN ('00', '10')
                   GROUP BY T.JUDGE_STOVE_NO,
                            T.BATCH_NO,
                            T.BATCH_GROUD_NO,
                            T.PRC_JUDGE_RESULT_CODE,
                            T.PRC_FACE_RESULT_CODE,
                            T.PRC_CHEM_RESULT_CODE,
                            T.PRC_PHY_RESULT_CODE,
                            T.PRC_SPEC_RESULT_CODE,
                            T.PLINE_CODE,
                            T.PRO_ORDER_ID,
                            T.LOT_NO,
                            T.PLINE_NAME,
                            T.PRO_ORDER_NO,
                            T.TARGET,
                            T.PROCESS_STATUS,
                            T.MAT_GOWHERE_CODE,
                            T.MAT_GOWHERE_NAME,
                            T.ACT_DIMATER,
                            T.ACT_HEIGHT,
                            T.ACT_LEN_MIN,
                            T.ACT_LEN_MAX,
                            T.CRAF_NO,
                            T.MATERIAL_NO,
                            T.MATERIAL_NAME,
                            T.PRODUCCODE,
                            T.PRODUCNAME,
                            T.SPEC_CODE,
                            T.SPEC_NAME,
                            T.STEELCODE,
                            T.STEELNAME,
                            T.MODEL_CODE,
                            T.MODEL_DESC,
                            T.STD_CODE,
                            T.STD_NAME,
                            T.STD_STYLE,
                            T.STD_STYLE_DESC,
                            T.GRADECODE,
                            T.GRADENAME,
                            T.TESTING_GRADE,
                            T.TESTING_TYPE,
                            T.TESTING_GRADE1,
                            T.TESTING_TYPE1,
                            T.ORD_LN_DLY_PK) LOOP
      INSERT INTO QCM_ZG_JUGDE_APPLY
        (JUGDE_APPLY_CODE,
         JUDGE_STOVE_NO,
         BATCH_NO,
         BATCH_GROUD_NO,
         PROCESS_CODE,
         PLINE_CODE,
         ACT_COUNT,
         ACT_WEIGHT,
         ACT_THEORY_WEIGHT,
         PRO_ORDER_ID,
         FACE_RESULT_CODE,
         SPEC_RESULT_CODE,
         CHEM_RESULT_CODE,
         PHY_RESULT_CODE,
         DETECT_RESULT_CODE,
         WPRESSURE_RESULT_CODE,
         PROCESS_RESULT_CODE,
         APPLY_NAME,
         APPLY_TIME,
         MEMO,
         QUALITY_GROUP,
         LOT_NO,
         PLINE_NAME,
         PRO_ORDER_NO,
         TARGET,
         PROCESS_STATUS,
         MAT_GOWHERE_CODE,
         MAT_GOWHERE_NAME,
         ACT_DIMATER,
         ACT_HEIGHT,
         ACT_LEN_MIN,
         ACT_LEN_MAX,
         CRAF_NO,
         MATERIAL_NO,
         MATERIAL_NAME,
         PRODUCCODE,
         PRODUCNAME,
         SPEC_CODE,
         SPEC_NAME,
         STEELCODE,
         STEELNAME,
         MODEL_CODE,
         MODEL_DESC,
         STD_CODE,
         STD_NAME,
         STD_STYLE,
         STD_STYLE_DESC,
         GRADECODE,
         GRADENAME,
         TESTING_GRADE,
         TESTING_TYPE,
         TESTING_GRADE1,
         TESTING_TYPE1,
         ORD_LN_DLY_PK,
         BELONG_CODE,
         BELONG_NAME,
         ISENDGX)
      VALUES
        (?,
         MYROW.JUDGE_STOVE_NO,
         MYROW.BATCH_NO,
         MYROW.BATCH_GROUD_NO,
         'G',
         MYROW.PLINE_CODE,
         MYROW.ACT_COUNT,
         MYROW.ACT_WEIGHT,
         MYROW.ACT_THEORY_WEIGHT,
         MYROW.PRO_ORDER_ID,
         MYROW.PRC_FACE_RESULT_CODE,
         MYROW.PRC_SPEC_RESULT_CODE,
         MYROW.PRC_CHEM_RESULT_CODE,
         MYROW.PRC_PHY_RESULT_CODE,
         '',
         '',
         '',
         ?,
         TO_DATE(?, 'YYYY-MM-DD HH24:MI:SS'),
         '',
         V_COUNT,
         ?,
         MYROW.PLINE_NAME,
         MYROW.PRO_ORDER_NO,
         MYROW.TARGET,
         MYROW.PROCESS_STATUS,
         MYROW.MAT_GOWHERE_CODE,
         MYROW.MAT_GOWHERE_NAME,
         MYROW.ACT_DIMATER,
         MYROW.ACT_HEIGHT,
         MYROW.ACT_LEN_MIN,
         MYROW.ACT_LEN_MAX,
         ?,
         MYROW.MATERIAL_NO,
         MYROW.MATERIAL_NAME,
         MYROW.PRODUCCODE,
         MYROW.PRODUCNAME,
         MYROW.SPEC_CODE,
         MYROW.SPEC_NAME,
         MYROW.STEELCODE,
         MYROW.STEELNAME,
         MYROW.MODEL_CODE,
         MYROW.MODEL_DESC,
         MYROW.STD_CODE,
         MYROW.STD_NAME,
         MYROW.STD_STYLE,
         MYROW.STD_STYLE_DESC,
         MYROW.GRADECODE,
         MYROW.GRADENAME,
         MYROW.TESTING_GRADE,
         MYROW.TESTING_TYPE,
         MYROW.TESTING_GRADE1,
         MYROW.TESTING_TYPE1,
         SUBSTR(MYROW.ORD_LN_DLY_PK, 0, INSTR(MYROW.ORD_LN_DLY_PK, '-') - 1),
         ?,
         ?,
         ?);
    END LOOP;
    FOR MYROW1 IN (SELECT *
                     FROM MAT_ZC_M T
                    WHERE T.JUDGE_STOVE_NO = MYROW.JUDGE_STOVE_NO
                      AND T.BATCH_NO = MYROW.BATCH_NO
                      AND T.BATCH_GROUD_NO = MYROW.BATCH_GROUD_NO
                      AND NVL(T.PRC_CHEM_RESULT_CODE, '/') =
                          NVL(MYROW.PRC_CHEM_RESULT_CODE, '/')
                      AND NVL(T.PRC_FACE_RESULT_CODE, '/') =
                          NVL(MYROW.PRC_FACE_RESULT_CODE, '/')
                      AND NVL(T.PRC_JUDGE_RESULT_CODE, '/') =
                          NVL(MYROW.PRC_JUDGE_RESULT_CODE, '/')
                      AND NVL(T.PRC_PHY_RESULT_CODE, '/') =
                          NVL(MYROW.PRC_PHY_RESULT_CODE, '/')) LOOP
      UPDATE MAT_ZC_M T
         SET T.PRC_QUALITY_GROUP_ZG = V_COUNT
       WHERE T.MAT_NO = MYROW1.MAT_NO;
    END LOOP;
    V_COUNT := V_COUNT + 1;
  END LOOP;
END;

		 ]]>
	</query>
	<query id="FrmMchApply.doDecision" desc="申请判定">
	 <![CDATA[
     UPDATE MAT_ZC_M T
   SET T.PRC_JUGDE_APPLY_CODE = ?, T.PRC_JUGDE_APPLY_TIME =TO_DATE(?,'YYYY-MM-DD HH24:MI:SS')
 WHERE T.JUDGE_STOVE_NO = ?
   AND T.BATCH_NO = ?
   --AND T.BATCH_GROUD_NO =?
   AND T.PRC_HEAT_PLAN_NO=?
      ]]>
	</query>
	<query id="FrmMchApply.doQuery" desc="查询是否有已进行判定支数">
	<![CDATA[
	SELECT COUNT(1)ACOUNT
        FROM QCM_ZG_JUGDE_APPLY T
       WHERE T.JUGDE_APPLY_CODE = ? 
         AND T.JUDGE_STOVE_NO = ?
         AND T.BATCH_NO = ?
         AND T.BATCH_GROUD_NO = ?
         AND T.VALIDFLAG <> '00'
         ]]>
	</query>
	<query id="FrmMchApply.ReciveZB" desc="查询质保系统是否已接收">
	 <![CDATA[
		SELECT COUNT(1) ACOUNT
  FROM QCM_ZG_JUGDE_APPLY T
 WHERE T.JUGDE_APPLY_CODE = ?
   AND T.JUDGE_STOVE_NO = ?
   AND T.BATCH_NO = ?
   AND T.BATCH_GROUD_NO = ?
   AND T.VALIDFLAG = '10'
		 ]]>
	</query>
	<query id="FrmMchApply.cancelDoDecision" desc="撤销申请修改材料状态">
	 <![CDATA[
		DECLARE
BEGIN
  DELETE FROM QCM_ZG_JUGDE_APPLY T
   WHERE T.JUGDE_APPLY_CODE = ?
     AND T.JUDGE_STOVE_NO = ?
     AND T.BATCH_NO = ?;
     --AND T.BATCH_GROUD_NO = ?;
  UPDATE MAT_ZC_M T
     SET T.PRC_JUGDE_APPLY_CODE = '', T.PRC_JUGDE_APPLY_TIME = ''
   WHERE T.PRC_JUGDE_APPLY_CODE = ?
     AND T.JUDGE_STOVE_NO = ?
     AND T.BATCH_NO = ?
     --AND T.BATCH_GROUD_NO = ?
     AND T.PRC_QCM_STAUS IN('00','10');
END;
		
		 ]]>
	</query>
	<query id="FrmMchApply.updatePossWt" desc="修改过磅重量">
	 <![CDATA[
	UPDATE MAT_ZC_M T
   SET T.PONDER_GROSS_WT = ?
 WHERE T.MAT_NO = ?
   AND T.JUDGE_STOVE_NO = ?

		 ]]>
	</query>
	<query id="FrmMchApply.updateVrpInfo" desc="修改公共实绩表过磅重量">
	 <![CDATA[
	UPDATE MCH_COM_INFO T
   SET T.PONDER_GROSS_WT = ?
 WHERE T.HEAT_PLAN_NO = ?
   AND T.STATION_DESC = '交库'
	
		 ]]>
	</query>
	<query id="FrmMchApply.selectMatNo" desc="查询所有材料号">
		 <![CDATA[
		SELECT T.MAT_NO
  FROM MAT_ZC_M T
 WHERE T.JUDGE_STOVE_NO = ?
   AND T.BATCH_NO = ?
  -- AND T.BATCH_GROUD_NO = ?
    AND T.PRC_QCM_STAUS = '00'
		 ]]>
	</query>
	<query id="FrmMchApply.selectCount" desc="查询该炉总支数">
	 <![CDATA[
	SELECT NVL(SUM(T.ACT_COUNT), 0) ACOUNT
  FROM MAT_ZC_M T
 WHERE T.JUDGE_STOVE_NO = ?
   AND T.BATCH_NO = ?
   --AND T.BATCH_GROUD_NO = ?
   AND T.PRC_QCM_STAUS = '00'
	 ]]>
	</query>
	<query id="FrmMchApply.doQueryApplyCodeNull" desc="查询该炉是否有未送判数据">
	 <![CDATA[
SELECT NVL(SUM(T.ACT_COUNT), 0) ACT_COUNT
  FROM MAT_ZC_M T
 WHERE T.JUDGE_STOVE_NO = ?
   AND T.BATCH_NO = ?
   AND T.PRC_QCM_STAUS = '00'
   AND T.PRC_JUGDE_APPLY_CODE IS NULL
		 ]]>
	</query>
	<query id="FrmMchApply.doUpdateProt" desc="修改管号队列判定单号">
	 <![CDATA[
UPDATE PORT_MCH_BATCH_SAMPLE_RESULT
   SET JUGDE_APPLY_CODE = ?, JUGDE_APPLY = ?
 WHERE HEAT_PLAN_NO = ?
   AND MAT_STATUS != '20'
		 ]]>
	</query>
</queryMap>