<?xml version="1.0" encoding="UTF-8"?>
<queryMap desc="镦拔扩冷轧冷拔实绩">
	<query id="FrmVrpColding.AddVrplengzha" desc="新增冷轧实绩">
        <![CDATA[      
INSERT INTO VRP_COLDROLL_RESULT
  (RESULT_NO,
   HEAT_PLAN_NO,
   ZY_BATCH_ID,
   PRO_PLAN_ID,
   GX_PLAN_NO,
   PLINE_CODE,
   PLINE_NAME,
   ROLL_FAC_NO,
   DIMATER,
   HEIGHT,
   SIZ_DIMATER,
   SIZ_HEIGHT,
   TEC_TIM,
   W_DIMATER,
   W_HEIGHT,
   N_DIMATER,
   N_HEIGHT,
   ROLL_SPEED,
   ACT_LEN,
   SPE_MANDREL,
   SPE_ROLL,
   ROLL_GAP,
   SEND_NUM,
   TRIM_NUM,
   UP_POLE,
   P_POLE,
   PRO_NUM,
   PRO_WT,
   ACC_NUM,
   ACC_WT,
   ACC_LEN,
   FAIL_NUM,
   FAIL_WT,
   FAIL_REASON,
   OFFLINE_NUM,
   OFFLINE_WT,
   RE_NUM,
   RE_WT,
   MONITORDEMAND,
   IF_MONITOR_DBK,
   PRODUCER,
   PRDCR_NO,
   PRODUCER_TIME,
   LOAD_TIME,
   LOAD_SHIFT,
   LOAD_GROUP,
   LOAD_USER,
   COL_MODE,
   CREATE_TIME)
VALUES
  (?,
   ?,
   ?,
   ?,
   ?,
   ?,
   ?,
   ?,
   ?,
   ?,
   ?,
   ?,
   ?,
   ?,
   ?,
   ?,
   ?,
   ?,
   ?,
   ?,
   ?,
   ?,
   ?,
   ?,
   ?,
   ?,
   ?,
   ?,
   ?,
   ?,
   ?,
   ?,
   ?,
   ?,
   ?,
   ?,
   ?,
   ?,
   ?,
   ?,
   ?,
   ?,
   TO_DATE(?, 'YYYY-MM-DD HH24:MI:SS'),
   TO_DATE(?, 'YYYY-MM-DD HH24:MI:SS'),
   ?,
   ?,
   ?,
   ?,
   TO_DATE(?, 'YYYY-MM-DD HH24:MI:SS'))

        ]]>
	</query>
<query id="FrmVrpColding.addMatBc" desc="新增材料表">
        <![CDATA[      
INSERT INTO MAT_BC_M
  SELECT *
    FROM MAT_BC_BACKUP T
   WHERE T.Mat_No = ?
     AND T.NEXT_PROCESS_CDOE = 'E'
        ]]>
	</query>
	<query id="FrmVrpColding.updateMatBc" desc="修改材料表状态22">
        <![CDATA[      
  UPDATE MAT_BC_M T
    SET T.QCM_STAUS = '22', T.PROCESS_CDOE = ?, T.PROCESS_DESC =  (SELECT BASENAME FROM COM_BASE_INFO  WHERE BASECODE=? )
  WHERE T.MAT_NO = ?
        ]]>
	</query>
	<query id="FrmVrpColding.updateMatBcOffline" desc="修改材料表状态11">
        <![CDATA[      
   UPDATE MAT_BC_M T
    SET T.QCM_STAUS = '11', T.PROCESS_CDOE = ?, T.PROCESS_DESC = (SELECT BASENAME FROM COM_BASE_INFO  WHERE BASECODE=? )
  WHERE T.MAT_NO = ?

        ]]>
	</query>
	


	<query id="FrmVrpColding.ReturnVrpColdDResult" desc="删除冷拔从表实绩">
		<![CDATA[	
DELETE VRP_COLDROLL_RESULT_D WHERE RESULT_NO = ?
		]]>
	</query>

	<query id="FrmVrpColding.ReturnVrpColdingD1Result" desc="删除抽检记录实绩">
		<![CDATA[	
DELETE VRP_COLDROLL_RESULT_D
 WHERE RESULT_NO = ?  AND  M_RESULT_NO=?	
		]]>
	</query>

	<query id="FrmVrpColding.queryColdingD" desc="查询是否还有抽检记录">
		<![CDATA[	
		SELECT COUNT(*) COUNT FROM VRP_COLDROLL_RESULT_D  WHERE RESULT_NO=?
			]]>
	</query>

	<query id="FrmVrpColding.UpdatePln" desc="新增修改计划表状态">
		<![CDATA[
 UPDATE PLN_ZY_DBK_M
    SET  PER_STATUS = '40'
  WHERE HEAT_PLAN_NO = ?
			]]>
	</query>

	<query id="FrmVrpColding.UpdatePln1" desc="撤销修改计划表状态">
		<![CDATA[
 UPDATE PLN_ZY_DBK_M
    SET  PER_STATUS = '50'
  WHERE HEAT_PLAN_NO = ?
			]]>
	</query>

	<query id="FrmVrpColding.plnupdate" desc="结炉修改计划表状态">
		<![CDATA[
 UPDATE PLN_ZY_DBK_M
    SET  BESIDE_STATUS = '40'
  WHERE HEAT_PLAN_NO = ?
			]]>
	</query>
	
		<query id="FrmVrpColding.plnupdateStuts" desc="结炉修改计划表状态为生产完成">
		<![CDATA[
 UPDATE PLN_ZY_DBK_M
    SET  PLANSTATUS = '40'
  WHERE HEAT_PLAN_NO = ?
			]]>
	</query>


<query id="FrmVrpColding.updateplnupdateStuts" desc="结炉修改计划表状态为生产完成">
		<![CDATA[
 UPDATE PLN_ZY_DBK_M
    SET  PLANSTATUS = '20'
  WHERE HEAT_PLAN_NO = ?
			]]>
	</query>
	
	<query id="FrmVrpColding.plnupdate1" desc="撤销结庐修改计划表状态">
		<![CDATA[
 UPDATE PLN_ZY_DBK_M
    SET  BESIDE_STATUS = '50'
  WHERE HEAT_PLAN_NO = ?
			]]>
	</query>
	<query id="FrmVrpColding.UpdatePath" desc="修改队列表工艺路径">
		<![CDATA[
		UPDATE PORT_VRP_BATCH_SAMPLE_RESULT T
   SET T.PRC_TECHNOLOGY_PATH = SUBSTR(T.PRC_TECHNOLOGY_PATH, 1,6) || ? ||
                               SUBSTR(T.PRC_TECHNOLOGY_PATH,8, LENGTH(T.PRC_TECHNOLOGY_PATH))
 WHERE T.HEAT_PLAN_NO = ? AND T.MAT_STATUS = '00'
		]]>
	</query>

	<query id="FrmVrpColding.AddAppearanceD" desc="新增抽检记录">
        <![CDATA[
       INSERT INTO VRP_COLDROLL_RESULT_D
  (RESULT_NO,
   M_RESULT_NO,
   TUBE_D1,
   TUBE_D2,
   TUBE_S1,
   TUBE_S2,
   TUBE_S3,
   TUBE_S4,
   END_D1,
   END_D2,
   END_S1,
   END_S2,
   END_S3,
   END_S4,
   CHK_L,
   CREATE_TIME,
   CREATE_NAME)
VALUES
  (?,
   ?,
   ?,
   ?,
   ?,
   ?,
   ?,
   ?,
   ?,
   ?,
   ?,
   ?,
   ?,
   ?,
   ?,
   TO_DATE(?, 'YYYY-MM-DD HH24:MI:SS'),
   ?)
           ]]>
	</query>


	<query id="FrmVrpColding.updatevrplengba" desc="修改计划表">
        <![CDATA[
    UPDATE PLN_ZY_DBK_M
    SET  PLANSTATUS = '1',
        IN_NUM_REAL  = TO_NUMBER(NVL(IN_NUM_REAL, 0)) + TO_NUMBER(?),
        IN_WT_REAL   = TO_NUMBER(NVL(IN_WT_REAL, 0)) + TO_NUMBER(?)
  WHERE HEAT_PLAN_NO = ?
        ]]>
	</query>

	<query id="FrmVrpColding.GetQuery" desc="查询冷轧冷拔实绩">
        <![CDATA[
   SELECT T.RESULT_NO,
       T.HEAT_PLAN_NO,
       T.ZY_BATCH_ID,
       T.PRO_PLAN_ID,
       T.GX_PLAN_NO,
       T.PLINE_CODE,
       T.PLINE_NAME,
       T.ROLL_FAC_NO,
       T.DIMATER,
       T.HEIGHT,
       T.SIZ_DIMATER,
       T.SIZ_HEIGHT,
       T.TEC_TIM,
       T.W_DIMATER,
       T.W_HEIGHT,
       T.N_DIMATER,
       T.N_HEIGHT,
       T.ROLL_SPEED,
       T.ACT_LEN,
       T.SPE_MANDREL,
       T.SPE_ROLL,
       T.ROLL_GAP,
       T.SEND_NUM,
       T.TRIM_NUM,
       T.UP_POLE,
       T.P_POLE,
       T.PRO_NUM,
       T.PRO_WT,
       T.ACC_NUM,
       T.ACC_WT,
       T.ACC_LEN,
       T.FAIL_NUM,
       T.FAIL_WT,
       T.FAIL_REASON,
       T.OFFLINE_NUM,
       T.OFFLINE_WT,
       T.RE_NUM,
       T.RE_WT,
       T.MONITORDEMAND,
       DECODE(T.IF_MONITOR_DBK, '1', '是', '0', '否') IF_MONITOR_DBK,
       T.PRODUCER,
       T.PRDCR_NO,
       TO_CHAR(T.PRODUCER_TIME, 'YYYY-MM-DD HH24:MI:SS') PRODUCER_TIME,
       TO_CHAR(T.LOAD_TIME, 'YYYY-MM-DD HH24:MI:SS') LOAD_TIME,
       T.LOAD_SHIFT,
       T.LOAD_GROUP,
       T.LOAD_USER,
       T.COL_MODE,
       TO_CHAR(T.CREATE_TIME, 'YYYY-MM-DD HH24:MI:SS') CREATE_TIME,
       TO_CHAR(T.UPDATE_TIME, 'YYYY-MM-DD HH24:MI:SS') UPDATE_TIME,
       T.UPDATE_NAME,
       DECODE(B.STATION_STATUS, '1', '生产中', '2', '生产完成') STATION_STATUS       
  FROM VRP_COLDROLL_RESULT T INNER JOIN VRP_COM_INFO B ON T.RESULT_NO=B.RESULT_NO
  WHERE T.HEAT_PLAN_NO = ?
        ]]>
	</query>

	<query id="FrmVrpColding.GetQuery1" desc="查询冷轧冷拔实绩合格支数的和">
        <![CDATA[
  SELECT NVL(SUM(T.ACC_NUM), 0) ACC_NUM FROM VRP_COLDROLL_RESULT T
   WHERE T.HEAT_PLAN_NO = ? AND T.ROLL_FAC_NO = 'LG'
        ]]>
	</query>
	
		<query id="FrmVrpColding.queryPortStuts" desc="查询管号队列废品">
        <![CDATA[
	SELECT NVL(SUM(T.ACT_COUNT),0) ACT_COUNT FROM PORT_VRP_BATCH_SAMPLE_RESULT T 
WHERE T.HEAT_PLAN_NO = ? AND T.PLINE_CODE = ?
 AND T.MAT_STATUS not in ('10','40','30') 
        ]]>
	</query>
	<query id="FrmVrpColding.GetQuery2" desc="查询冷轧冷拔实绩合格支数的和">
        <![CDATA[
  SELECT NVL(SUM(T.ACC_NUM), 0) ACC_NUM FROM VRP_COLDROLL_RESULT T
   WHERE T.HEAT_PLAN_NO = ? AND T.ROLL_FAC_NO = 'LB'
        ]]>
	</query>
	<query id="FrmVrpColding.GetQuery3" desc="查询冷轧冷拔实绩合格支数的和">
        <![CDATA[
  SELECT NVL(SUM(T.ACC_NUM), 0) ACC_NUM FROM VRP_COLDROLL_RESULT T
   WHERE T.HEAT_PLAN_NO = ? AND T.ROLL_FAC_NO = 'LD'
        ]]>
	</query>
	<query id="FrmVrpColding.AddComInfoResult" desc="新增公共信息">
		<![CDATA[
INSERT INTO VRP_COM_INFO (RESULT_NO, HEAT_PLAN_NO, STATION_CODE, STATION_DESC, 
PLINE_CODE, PLINE_NAME, ZY_BATCH_ID, PRO_PLAN_ID, GX_PLAN_NO, IF_MONITOR_DBK, 
PRDCR_NO, MONITORDEMAND, PRODUCER, PRODUCER_TIME, CRAFT_FILE_NO, CRAFT_FILE_MAN, 
CRAFT_SEQ, JUDGE_STOVE_NO, BATCH_NO, BATCH_GROUD_NO, GRADECODE, GRADENAME,  LEN, 
DIMATER, PLN_LEN,  HEIGHT, LEN_MIN, LEN_MAX, LEN_CUT_HEAD, LEN_CUT_END,PLN_DIMATER,
PLN_HEIGHT, ACT_MATERIAL_NO, 
ACT_MATERIAL_NAME, IN_WL_ID, IN_WL_DESC, PRO_NUM, PRO_WT, FAIL_NUM, FAIL_WT, 
OFFLINE_NUM, OFFLINE_WT, RE_NUM, RE_WT, STATION_STATUS, RRO_TIME, RRO_TIME_NU, 
PRO_USER, PRO_SHIFT, PRO_GROUP, CREATE_TIME, COL_OPERATOR,STEELCODE,STEELNAME,SPEC_CODE,SPEC_NAME) VALUES (?, ?, ?, ?, 
?, ?, ?, ?, ?, ?, ?, ?, ?, TO_DATE(?, 'YYYY-MM-DD HH24:MI:SS'), ?, ?, ?, ?, ?, 
?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?,  ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, 
?, TO_DATE(?, 'YYYY-MM-DD HH24:MI:SS'), ?, ?, ?, ?, TO_DATE(?, 'YYYY-MM-DD HH24:MI:SS'), ?, ?, ?, ?, ?)	
		]]>
	</query>
	<query id="FrmVrpColding.qureyGxComInfo" desc="查询工序点状态">
		<![CDATA[
SELECT DISTINCT STATION_STATUS
  FROM VRP_COM_INFO
 WHERE HEAT_PLAN_NO = ?
   AND PLINE_CODE = ?
   AND STATION_CODE = ?
			]]>
	</query>
	<query id="FrmVrpColding.GetColdingQuery" desc="查询冷轧冷拔抽检实绩表">
        <![CDATA[
   
SELECT T.RESULT_NO,
       T.M_RESULT_NO,
       T.TUBE_D1,
       T.TUBE_D2,
       T.TUBE_S1,
       T.TUBE_S2,
       T.TUBE_S3,
       T.TUBE_S4,
       T.END_D1,
       T.END_D2,
       T.END_S1,
       T.END_S2,
       T.END_S3,
       T.END_S4,
       T.CHK_L,
       TO_CHAR(T.CREATE_TIME, 'YYYY-MM-DD HH24:MI:SS') CREATE_TIME,
       T.CREATE_NAME,
       TO_CHAR(T.UPDATE_TIME, 'YYYY-MM-DD HH24:MI:SS') UPDATE_TIME,
       T.UPDATE_NAME
  FROM VRP_COLDROLL_RESULT_D T 
  WHERE T.RESULT_NO = ?
        ]]>
	</query>
	<query id="FrmVrpColding.DelectVrpColdingResult" desc="撤销冷拔主表实绩">
		<![CDATA[
		DELETE VRP_COLDROLL_RESULT WHERE RESULT_NO = ?
		]]>
	</query>




	<query id="FrmVrpColding.updateVrpLGColdingResult" desc="修改冷拔实绩">
		<![CDATA[
UPDATE VRP_COLDROLL_RESULT SET PRO_NUM     = ?,
       PRO_WT      = ?,
       SIZ_DIMATER = ?,
       SIZ_HEIGHT  = ?,
       ROLL_SPEED  = ?,
       SPE_MANDREL = ?,
       SPE_ROLL    = ?,
       ROLL_GAP    = ?,
       SEND_NUM    = ?,
       ACC_NUM     = ?,
       ACC_WT      = ?,
       ACC_LEN     = ?,
       FAIL_NUM    = ?,
       FAIL_WT     = ?,
       FAIL_REASON = ?,
       LOAD_TIME   = TO_DATE(?, 'YYYY-MM-DD HH24:MI:SS'),
       LOAD_SHIFT  = ?,
       LOAD_GROUP  = ?,
       LOAD_USER   = ?,
       PRODUCER    = ?,
       PRODUCER_TIME = TO_DATE(?, 'YYYY-MM-DD HH24:MI:SS')    
 WHERE RESULT_NO = ?
		]]>
	</query>
	<query id="FrmVrpColding.updateVrpLBColdingResult" desc="修改冷拔实绩">
		<![CDATA[
UPDATE VRP_COLDROLL_RESULT
   SET PRO_NUM     = ?,
       PRO_WT      = ?,
       SIZ_DIMATER = ?,
       SIZ_HEIGHT  = ?,
       ROLL_SPEED  = ?,
       TEC_TIM     = ?,
       W_DIMATER   = ?,
       W_HEIGHT    = ?,
       N_DIMATER   = ?,
       N_HEIGHT    = ?,
       ACT_LEN     = ?,
       ACC_NUM     = ?,
       ACC_WT      = ?,
       ACC_LEN     = ?,
       FAIL_NUM    = ?,
       FAIL_WT     = ?,
       FAIL_REASON = ?,
       LOAD_TIME   = TO_DATE(?, 'YYYY-MM-DD HH24:MI:SS'),
       LOAD_SHIFT  = ?,
       LOAD_GROUP  = ?,
       LOAD_USER   = ?,
       PRODUCER    = ?,
       PRODUCER_TIME = TO_DATE(?, 'YYYY-MM-DD HH24:MI:SS')    
 WHERE RESULT_NO = ?
		]]>
	</query>
	<query id="FrmVrpColding.updateVrpLDColdingResult" desc="修改冷拔实绩">
		<![CDATA[
UPDATE VRP_COLDROLL_RESULT
   SET PRO_NUM     = ?,
       PRO_WT      = ?,
       SIZ_DIMATER = ?,
       SIZ_HEIGHT  = ?,
       ROLL_SPEED  = ?,
       SPE_MANDREL = ?,
       SPE_ROLL    = ?,
       ROLL_GAP    = ?,
       SEND_NUM    = ?,
       TRIM_NUM    = ?,
       UP_POLE     = ?,
       P_POLE      = ?,
       ACC_NUM     = ?,
       ACC_WT      = ?,
       ACC_LEN     = ?,
       FAIL_NUM    = ?,
       FAIL_WT     = ?,
       FAIL_REASON = ?,
       LOAD_TIME   = TO_DATE(?, 'YYYY-MM-DD HH24:MI:SS'),
       LOAD_SHIFT  = ?,
       LOAD_GROUP  = ?,
       LOAD_USER   = ?,
       PRODUCER    = ?,
       PRODUCER_TIME = TO_DATE(?, 'YYYY-MM-DD HH24:MI:SS')    
 WHERE RESULT_NO = ?
		]]>
	</query>
	<query id="FrmVrpColding.deleteVrpResult" desc="撤销冷拔公共实绩">
		<![CDATA[
		DELETE VRP_COM_INFO WHERE RESULT_NO = ?
		]]>
	</query>

	<query id="FrmVrpColding.queryColdingDKEY" desc="查询检验表最大实绩编号">
		<![CDATA[
SELECT 
       LPAD(SUBSTR(NVL(MAX(T.M_RESULT_NO), '000000'), -6, 6) + 1, 6, '0') AS M_RESULT_NO
  FROM vrp_coldroll_result_d T
 WHERE T.RESULT_NO = ?
		]]>
	</query>
	<query id="FrmVrpColding.updateVrpColdingDResult" desc="查询最大实绩编号">
		<![CDATA[
	UPDATE VRP_COLDROLL_RESULT_D SET TUBE_D1     = ?,
       TUBE_D2     = ?,
       TUBE_S1     = ?,
       TUBE_S2     = ?,
       TUBE_S3     = ?,
       TUBE_S4     = ?,
       END_D1      = ?,
       END_D2      = ?,
       END_S1      = ?,
       END_S2      = ?,
       END_S3      = ?,
       END_S4      = ?,
       CHK_L       = ?,
       UPDATE_TIME = TO_DATE(?,'YYYY-MM-DD HH24:MI:SS'),
       UPDATE_NAME = ?
 WHERE RESULT_NO = ?
 	AND M_RESULT_NO = ?
	
		]]>
	</query>
	<query id="FrmVrpColding.queryColdKEY" desc="判断是否有过冷拔实绩">
        <![CDATA[
	SELECT ? ||
	LPAD(SUBSTR(NVL(MAX(T.RESULT_NO),'000000'),-6,6) + 1, 6, '0') AS RESULT_NO
	FROM VRP_COLDROLL_RESULT T
	WHERE TO_CHAR(T.CREATE_TIME,'YYYY-MM-DD') = ?
	AND T.PLINE_CODE= ?
        ]]>
	</query>

	<query id="FrmVrpColding.queryColdDKEY" desc="判断是否有过冷拔实绩">
        <![CDATA[
	SELECT ? ||
	LPAD(SUBSTR(NVL(MAX(T.M_RESULT_NO),'000000'),-6,6) + 1, 6, '0') AS M_RESULT_NO
	FROM VRP_COLDROLL_RESULT_D T
	WHERE TO_CHAR(T.CREATE_TIME,'YYYY-MM-DD') = ?
	AND T.HEAT_PLAN_NO= ?
        ]]>
	</query>


	<query id="FrmVrpColding.deleteDbkPlan" desc="删除时修改镦拔扩计划表">
		<![CDATA[
UPDATE PLN_zy_DBK_M
   SET IN_NUM_REAL = ?,
       IN_WT_REAL  = ?,
       PLANSTATUS  = ?
 WHERE HEAT_PLAN_NO = ?
		]]>
	</query>


	<query id="FrmVrpColding.queryVrpCount" desc="查询计划下剩余上料支、吨">
		<![CDATA[
SELECT COUNT(*) COUNT,NVL(SUM(T.PRO_NUM),0) PRO_NUM,NVL(SUM(T.PRO_WT),0) PRO_WT  FROM VRP_COLDROLL_RESULT T  WHERE HEAT_PLAN_NO=?
		]]>
	</query>


	<query id="FrmVrpColding.queryCountVrp" desc="查询计划下剩余上料支、吨">
		<![CDATA[
SELECT COUNT(*) COUNT,NVL(SUM(T.PRO_NUM),0) PRO_NUM,NVL(SUM(T.PRO_WT),0) PRO_WT  FROM VRP_COLDROLL_RESULT T  WHERE HEAT_PLAN_NO=?
		]]>
	</query>

	<query id="FrmVrpColding.AddComInfoResult1" desc="修改材料状态和工序编码">
		<![CDATA[
UPDATE PORT_VRP_BATCH_SAMPLE_RESULT T SET T.MAT_STATUS=?,T.OP_PROCESS=?
WHERE T.HEAT_PLAN_NO=? AND T.MAT_NO=?
			]]>
	</query>

	<query id="FrmVrpColding.queryExpandNUM" desc="查询管号队列里合格的材料号">
		<![CDATA[
	SELECT T1.MAT_NO
  FROM (SELECT T.MAT_NO
          FROM PORT_VRP_BATCH_SAMPLE_RESULT T
         WHERE T.MAT_STATUS = '00'
         AND T.IS_SAMPLE_PIPE != '1'
         AND T.INSTORE_FLAG ='0'
           AND T.HEAT_PLAN_NO = ?
         ORDER BY T.MAT_NO ASC) T1
 WHERE ROWNUM<?
			]]>
	</query>
	<query id="FrmVrpColding.queryFAILNUM" desc="查询管号队列里废品的材料号">
		<![CDATA[
	SELECT T1.MAT_NO
  FROM (SELECT T.MAT_NO
          FROM PORT_VRP_BATCH_SAMPLE_RESULT T
         WHERE T.MAT_STATUS = '10'
         AND T.IS_SAMPLE_PIPE != '1'
           AND T.HEAT_PLAN_NO = ?
         ORDER BY T.MAT_NO ASC) T1
 WHERE ROWNUM<?
			]]>
	</query>

	<query id="FrmVrpColding.queryExpandFailNUM" desc="查询管号队列废品数量">
		<![CDATA[
		SELECT NVL(SUM(T.ACT_COUNT),0) ACT_COUNT
  FROM PORT_VRP_BATCH_SAMPLE_RESULT T
 WHERE T.MAT_STATUS = '10'
   AND T.HEAT_PLAN_NO = ?
   AND T.OP_PROCESS = ?
		
			]]>
	</query>

	<query id="FrmVrpColding.queryExpandFailNUM1" desc="查询工序废品数量">
		<![CDATA[
		SELECT NVL(SUM(T.FAIL_NUM),0) FAIL_NUM FROM VRP_COLDROLL_RESULT T
WHERE  T.HEAT_PLAN_NO=? 
			]]>
	</query>

	<query id="FrmVrpColding.queryExpandNUM2" desc="查询废品材料信息">
		<![CDATA[
	SELECT T1.MAT_NO
  FROM (SELECT T.MAT_NO
          FROM PORT_VRP_BATCH_SAMPLE_RESULT T
         WHERE T.MAT_STATUS = '10'
           AND T.HEAT_PLAN_NO = ?
             AND T.OP_PROCESS=?
         ORDER BY T.MAT_NO ASC) T1
 WHERE ROWNUM<?
			]]>
	</query>
</queryMap>