<?xml version="1.0" encoding="UTF-8"?>
<queryMap desc="加工测量实绩">
	<query id="FrmMeasureResult.getQueryExpandResult" desc="查测量实绩">
        <![CDATA[
    SELECT *
  FROM MCH_MEASURE_RESULT T
 WHERE T.HEAT_PLAN_NO = ? AND BATCH_NO =?
        ]]>
	</query>
	<query id="FrmMeasureResult.QueryZgJugdeApply" desc="查询测量点数据">
        <![CDATA[
    select T.PLINE_CODE,
       T.PLINE_NAME,
       T.JUDGE_STOVE_NO,
       T.BATCH_NO,
       T.PRO_ORDER_NO
  from RTD_MEASURE_POSDATA t
 WHERE T.FLAG = '00'
   AND T.MAT_NO_CX IS NOT NULL
        ]]>
	</query>
	<query id="FrmMeasureResult.QueryBaleRecord" desc="查询测量点数据">
        <![CDATA[
   SELECT *
  FROM RTD_MEASURE_POSDATA T
 WHERE T.FLAG = '00'
   AND T.MAT_NO_CX IS NOT NULL
   AND T.JUDGE_STOVE_NO = ?
   AND T.BATCH_NO = ?
   AND T.PLINE_CODE = ?
   AND T.PRO_ORDER_NO = ?
 ORDER BY T.MAT_NO_CX
        ]]>
	</query>
	<query id="FrmMeasureResult.updateBale" desc="打捆">
        <![CDATA[
    UPDATE RTD_MEASURE_POSDATA T SET T.BALE_NO = ? WHERE T.KEY_ID = ?
        ]]>
	</query>
	<query id="FrmMeasureResult.getQueryExpandResultStuts" desc="查询相同炉计划ID下测量实绩状态">
		<![CDATA[
SELECT B.STATION_STATUS
  FROM MCH_MEASURE_RESULT T INNER JOIN MCH_COM_INFO B ON T.RESULT_NO=B.RESULT_NO
 WHERE T.HEAT_PLAN_NO = ? AND T.PLINE_CODE = ?
		]]>
	</query>

	<query id="FrmMeasureResult.geRtdMeasurePosdata" desc="">
		<![CDATA[
SELECT *
  FROM RTD_MEASURE_POSDATA T
 WHERE JUDGE_STOVE_NO = ?
  AND (BATCH_NO = ? OR PLINE_CODE= 'C092')
  AND FLAG = '00' AND (MAT_NO_CX IS NULL OR MAT_NO_CX IN (SELECT MAT_NO FROM PORT_MCH_BATCH_SAMPLE_RESULT WHERE HEAT_PLAN_NO =? AND BATCH_NO = ?)
  )
  ORDER BY TO_NUMBER (MAT_NO)
		]]>
	</query>

	<query id="FrmMeasureResult.geRtdMeasurePosdata2" desc="">
		<![CDATA[
SELECT T.*,   DENSE_RANK() OVER(PARTITION BY JUDGE_STOVE_NO, BATCH_NO, TO_NUMBER(MAT_NO) ORDER BY MAT_NO_CX ASC, MSAUER_DATE DESC, KEY_ID DESC) RK
  FROM RTD_MEASURE_POSDATA T
 WHERE 1=1
		]]>
	</query>

	<query id="FrmMeasureResult.geRtdMeasurePosdataByID" desc="">
		<![CDATA[
SELECT *
  FROM RTD_MEASURE_POSDATA T WHERE 1=1
		]]>
	</query>

	<query id="FrmMeasureResult.updateRtdMeasurePosdata" desc="">
		<![CDATA[
         UPDATE  RTD_MEASURE_POSDATA SET MAT_NO_CX = ? WHERE KEY_ID =?
		]]>
	</query>

	<query id="FrmMeasureResult.updatePortMchBatchSampleResult" desc="">
		<![CDATA[
         UPDATE  PORT_MCH_BATCH_SAMPLE_RESULT SET ACT_THEORY_WEIGHT = ? WHERE HEAT_PLAN_NO =? AND MAT_NO =?
		]]>
	</query>

		<query id="FrmMeasureResult.queryMatZc" desc="查询对应材料号的信息">
		<![CDATA[
SELECT T1.*
  FROM (SELECT T.MAT_NO,
               T.PRODUCT_FLAG,
               T.MAT_STATUS,
               T.JUDGE_STOVE_NO,
               T.BATCH_NO,
               T.BATCH_GROUD_NO,
               T.ORIGIN_MAT_NO,
               T.MATERIAL_NO,
               T.MATERIAL_NAME,
               T.PRODUCCODE,
               T.PRODUCNAME,
               T.STEELCODE,
               T.STEELNAME,
               T.GRADECODE,
               T.GRADENAME,
               T.SPEC_CODE,
               T.SPEC_NAME,
               T.MODEL_CODE,
               T.MODEL_DESC,
               T.STD_CODE,
               T.STD_NAME,
               T.STD_STYLE,
               T.STD_STYLE_DESC,
               T.ORDER_NO,
               T.ORDER_SEQ,
               T.ORDER_SEQ_NO,
               T.PROCESS_CDOE,
               T.PROCESS_DESC,
               T.PLINE_CODE,
               T.PLINE_NAME,
               T.MAT_ORIGIN_CODE,
               T.MAT_ORIGIN_NAME,
               T.ACT_DIMATER,
               T.ACT_HEIGHT,
               T.ACT_LEN,
               T.ACT_LEN_MIN,
               T.ACT_LEN_MAX,
               T.ACT_COUNT,
               T.ACT_WEIGHT,
               T.ACT_THEORY_WEIGHT,
               T.BELONG_CODE,
               T.BELONG_NAME,
               T.LOCK_FLAG,
               T.PRO_BC,
               T.PRO_BZ,
               T.RPO_TIME,
               T.ORD_PK,
               T.ORD_LN_PK,
               SUBSTR(T.ORD_LN_DLY_PK, 0, INSTR(T.ORD_LN_DLY_PK, '-') - 1) ORD_LN_DLY_PK,
               T.BAL_YEAR_MONTH,
               T.JUDGE_STD_NAME,
               T.JUDGE_STD_CODE,
               T.SOURE_CODE,
               T.SOURE_NAME,
               T.MNG_LOCK_FLAG,
               T.STOVE_NO
          FROM MAT_BC_M T
         WHERE  T.PRODUCT_FLAG = '801401'
           AND T.MAT_STATUS = '80150105'
           AND T.JUDGE_STOVE_NO = ?
           AND NVL(T.BATCH_NO, '/') = NVL(?, '/')
           AND NVL(T.BATCH_GROUD_NO, '/') = NVL(?, '/')
         ORDER BY T.MAT_NO ASC) T1
 WHERE ROWNUM < ?
		]]>
	</query>

	<query id="FrmMeasureResult.detelefailnum" desc="删除废品缺陷">
		<![CDATA[
DELETE MCH_BUG_D WHERE RESULT_NO = ? and HEAT_PLAN_NO = ? and PLINE_CODE = ?	
		]]>
	</query>
	
		<query id="FrmMeasureResult.queryGxPosition" desc="查询产线下工序的位置">
		<![CDATA[
SELECT LENGTH(SUBSTR(T.STATION_NAMES, 0, INSTR(STATION_NAMES, '测量点'))) -
       LENGTH(REPLACE(SUBSTR(T.STATION_NAMES,0,INSTR(STATION_NAMES, '测量点')), ';', '')) + 1  CNUM
  FROM MCH_COM_SETPLINE T
 WHERE T.PLINE_CODE = ?
			]]>
	</query>
	<query id="FrmMeasureResult.getQueryExpandResult2" desc="查询测量实绩合格支数的和">
        <![CDATA[
   SELECT NVL(SUM(T.PRO_NUM), 0) PRO_NUM FROM MCH_MEASURE_RESULT T
   WHERE T.HEAT_PLAN_NO = ?
        ]]>
	</query>
	<query id="FrmMeasureResult.getQueryExpandResult1" desc="查测量从表实绩">
        <![CDATA[
   SELECT T.RESULT_NO,
       T.JUDGE_STOVE_NO,
       T.BATCH_NO,
       T.BATCH_GROUD_NO,
       T.ACT_DIMATER,
       T.ACT_HEIGHT,
       T.ACT_LEN,
       T.ACT_LEN_MIN,
       T.ACT_LEN_MAX,
       T.ACT_NUM,
       T.ACT_WT
  FROM MCH_MEASURE_RESULT_D T
 WHERE T.RESULT_NO =?  
        ]]>
	</query>
	<query id="FrmMeasureResult.AddExpandDResult" desc="新增从表实绩">
		<![CDATA[
		INSERT INTO MCH_MEASURE_RESULT_D
  (RESULT_NO,
   JUDGE_STOVE_NO,
   BATCH_NO,
   BATCH_GROUD_NO,
   ACT_DIMATER,
   ACT_HEIGHT,
   ACT_LEN,
   ACT_LEN_MIN,
   ACT_LEN_MAX,
   ACT_NUM,
   ACT_WT)
VALUES
  (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)

		]]>
	</query>
	
	<query id="FrmMeasureResult.AddFailResult" desc="新增绝废实绩">
		<![CDATA[
		INSERT INTO MCH_BUG_D
  (FAIL_BILL,
   FAIL_BILL_SQE,
   RESULT_NO,
   HEAT_PLAN_NO,
   FAIL_TYPE_CODE,
   FAIL_TYPE_NAME,
   FAIL_NUM,
   FAIL_WT,
   PLINE_CODE,
   PLINE_NAME,
   FAIL_SORT,
   FAIL_DIRECT)
VALUES
  (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)

		]]>
	</query>
	<query id="FrmMeasureResult.AddExpandResult" desc="新增测量实绩">
		<![CDATA[
		INSERT INTO MCH_MEASURE_RESULT (RESULT_NO, HEAT_PLAN_NO, ZY_BATCH_ID, 
PRO_PLAN_ID, GX_PLAN_NO, PLINE_CODE, PLINE_NAME,  
 PRO_NUM, PRO_WT, FAIL_NUM, FAIL_WT,FAIL_BILL, 
 OFFLINE_NUM, OFFLINE_WT, RE_NUM, RE_WT, MONITORDEMAND, 
IF_MONITOR_RCL, PRODUCER, PRDCR_NO, PRODUCER_TIME, RRO_TIME, PRO_SHIFT, 
PRO_GROUP, COL_MODE, CREATE_TIME,TC_PROVIDER_COUP,TC_LOT_COUP,TC_PROVIDER_IN,TC_LOT_IN,TC_PROVIDER_OUT,
TC_LOT_OUT,PR_PROVIDER,PR_TYPE,USE_PC,USE_AR,AR_COUNT,SPECIAL_DRIFT,CC_COUNT,IS_PAINT,PAINT_TYPE,PAINT_LOT,CREATET_USER,
OUTNUM_CUT,LENGTH_IN,LENGTHMAX_IN,LENGTHMIN_IN) 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="FrmMeasureResult.AddComInfoResult1" desc="修改材料状态和工序编码">
		<![CDATA[
UPDATE PORT_MCH_BATCH_SAMPLE_RESULT T SET T.MAT_STATUS=?,T.OP_PROCESS=?
WHERE T.HEAT_PLAN_NO=? AND T.MAT_NO=?
			]]>
	</query>
	
		<query id="FrmMeasureResult.AddComInfoResult2" desc="修改管号队列绝废支数">
		<![CDATA[
UPDATE PORT_MCH_BATCH_SAMPLE_RESULT T SET T.MAT_STATUS=?,T.OP_PROCESS=?
WHERE T.HEAT_PLAN_NO=? AND T.MAT_NO=?
			]]>
	</query>

		<query id="FrmMeasureResult.UpdateMeaResult" desc="修改测量实绩">
		<![CDATA[
UPDATE MCH_MEASURE_RESULT T SET T.PRO_NUM=?,T.PRO_WT=?
WHERE T.RESULT_NO=?
			]]>
	</query>
	
			<query id="FrmMeasureResult.UpdateMeaInof" desc="修改公共信息支数">
		<![CDATA[
UPDATE MCH_COM_INFO T SET T.PRO_NUM=?,T.PRO_WT=?
WHERE T.RESULT_NO=?
			]]>
	</query>
	<query id="FrmMeasureResult.UpdatePath" desc="修改队列表工艺路径">
		<![CDATA[
UPDATE PORT_MCH_BATCH_SAMPLE_RESULT T
   SET T.PRC_TECHNOLOGY_PATH = SUBSTR(T.PRC_TECHNOLOGY_PATH, 1,?) || ? ||
                               SUBSTR(T.PRC_TECHNOLOGY_PATH,?, LENGTH(T.PRC_TECHNOLOGY_PATH))
 WHERE T.HEAT_PLAN_NO = ?
 AND MAT_STATUS='00'
			]]>
	</query>
	<query id="FrmMeasureResult.qureyGxComInfo" desc="查询工序是否是结炉状态">
		<![CDATA[
SELECT DISTINCT STATION_STATUS
  FROM MCH_COM_INFO
 WHERE HEAT_PLAN_NO = ?
   AND PLINE_CODE = ?
   AND STATION_CODE = ?
			]]>
	</query>
	<query id="FrmMeasureResult.UpdatePln1" desc="撤销修改计划表状态">
		<![CDATA[
 UPDATE PLN_ZY_JGX_M
    SET  PER_STATUS = ?
  WHERE HEAT_PLAN_NO = ?
			]]>
	</query>
	<query id="FrmMeasureResult.queryExpandMaxRESULT" desc="查询最大实绩编号">
		<![CDATA[
SELECT ? ||
       LPAD(SUBSTR(NVL(MAX(T.RESULT_NO), '000000'), -6, 6) + 1, 6, '0') AS RESULT_NO
  FROM MCH_MEASURE_RESULT T
 WHERE TO_CHAR(T.CREATE_TIME, 'YYYY-MM-DD') = ?
   AND T.PLINE_CODE = ?
		]]>
	</query>
	<query id="FrmMeasureResult.queryExpandNUM" desc="查询管号队列里合格的材料号">
		<![CDATA[
	SELECT T1.MAT_NO
  FROM (SELECT T.MAT_NO
          FROM PORT_MCH_BATCH_SAMPLE_RESULT T
         WHERE T.MAT_STATUS = '00'
           AND T.IS_SAMPLE_PIPE='0'
           AND T.HEAT_PLAN_NO = ?
         ORDER BY T.MAT_NO ASC) T1
 WHERE ROWNUM<?
			]]>
	</query>
	<query id="FrmMeasureResult.deleteComInfoResult" desc="删除公共信息">
		<![CDATA[
		DELETE MCH_COM_INFO WHERE RESULT_NO = ?		
		]]>
	</query>
	<query id="FrmMeasureResult.deleteVrpExpandResult" desc="删除测量实绩">
		<![CDATA[
		DELETE MCH_MEASURE_RESULT WHERE RESULT_NO = ?		
		]]>
	</query>
	<query id="FrmMeasureResult.deleteVrpExpandResultD" desc="删除测量从表实绩">
		<![CDATA[
		DELETE MCH_MEASURE_RESULT_D WHERE RESULT_NO = ?		
		]]>
	</query>
	<query id="FrmMeasureResult.updateVrpExpandResultD" desc="修改测量从表实绩">
		<![CDATA[
			
UPDATE MCH_MEASURE_RESULT_D
   SET ACT_DIMATER = ?,
   	   ACT_HEIGHT    = ?,
   	   ACT_LEN    = ?,
   	   ACT_LEN_MIN = ?,
   	   ACT_LEN_MAX   = ?,
   	   ACT_NUM   = ?,
   	   ACT_WT   = ?
 WHERE RESULT_NO = ?
			
		]]>
	</query>


	<query id="FrmMeasureResult.UpdatePln" desc="新增修改计划表状态">
		<![CDATA[
 UPDATE PLN_ZY_JGX_M
    SET  PER_STATUS = '90'
  WHERE HEAT_PLAN_NO = ?
			]]>
	</query>
	<query id="FrmMeasureResult.queryExpandFailNUM1" desc="查询工序废品数量">
		<![CDATA[
		SELECT NVL(SUM(T.FAIL_NUM),0) ACT_COUNT
  FROM MCH_MEASURE_RESULT T
 WHERE T.HEAT_PLAN_NO = ?
 AND T.PLINE_CODE = ?
			]]>
	</query>
	<query id="FrmMeasureResult.queryExpandFailNum" desc="查询废品材料信息">
		<![CDATA[
	SELECT T1.MAT_NO
  FROM (SELECT T.MAT_NO
          FROM PORT_MCH_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>
		<query id="FrmMeasureResult.queryExpandNUM2" desc="查询废品材料信息">
		<![CDATA[
	SELECT T1.MAT_NO
  FROM (SELECT T.MAT_NO
          FROM PORT_MCH_BATCH_SAMPLE_RESULT T
         WHERE T.MAT_STATUS = '15'
           AND T.HEAT_PLAN_NO = ?
             AND T.OP_PROCESS=?
         ORDER BY T.MAT_NO ASC) T1
 WHERE ROWNUM<?
			]]>
	</query>
	<query id="FrmMeasureResult.updateVrpExpandResult" desc="修改测量实绩">
		<![CDATA[		
	UPDATE MCH_MEASURE_RESULT
   SET PRO_NUM        = ?,
       PRO_WT         = ?,
       FAIL_NUM       = ?,
       FAIL_WT        = ?,
       FAIL_BILL    = ?,
       PRODUCER       = ?,
       PRODUCER_TIME  = TO_DATE(?, 'YYYY-MM-DD HH24:MI:SS'),
       RRO_TIME      = TO_DATE(?, 'YYYY-MM-DD HH24:MI:SS'),
       PRO_SHIFT     = ?,
       PRO_GROUP     = ?,
       UPDATE_TIME    = TO_DATE(?, 'YYYY-MM-DD HH24:MI:SS'),
       UPDATE_NAME    = ?,
       TC_PROVIDER_COUP = ?,
       TC_LOT_COUP   = ?,
       TC_PROVIDER_IN  = ?,
       TC_LOT_IN     =?,
       TC_PROVIDER_OUT = ?,
       TC_LOT_OUT   = ?,
       PR_PROVIDER   =?,
       PR_TYPE       =?,
       USE_PC      = ?,
       USE_AR       = ?,
       AR_COUNT     = ?,
       SPECIAL_DRIFT  = ?,
       CC_COUNT     = ?,
       IS_PAINT      = ?,
       PAINT_TYPE    = ?,
       PAINT_LOT     = ?
 WHERE RESULT_NO = ?  
			]]>
	</query>
	<query id="FrmMeasureResult.queryExpandFailNUM" desc="查询管号队列废品数量">
		<![CDATA[
		SELECT NVL(SUM(T.ACT_COUNT),0) ACT_COUNT
  FROM PORT_MCH_BATCH_SAMPLE_RESULT T
 WHERE T.MAT_STATUS = '10'
   AND T.HEAT_PLAN_NO = ?
   AND T.OP_PROCESS = ?
		
			]]>
	</query>
	<query id="FrmMeasureResult.updateComInfoResult" desc="修改公共信息">
		<![CDATA[
UPDATE MCH_COM_INFO
   SET PRODUCER      = ?,
       PRODUCER_TIME = TO_DATE(?, 'YYYY-MM-DD HH24:MI:SS'),
       PRO_NUM       = ?,
       PRO_WT        = ?,
       FAIL_NUM      = ?,
       FAIL_WT       = ?,
       RRO_TIME      = TO_DATE(?, 'YYYY-MM-DD HH24:MI:SS'),
       PRO_SHIFT     = ?,
       PRO_GROUP     = ?
 WHERE RESULT_NO = ?
		]]>
	</query>
	<query id="FrmMeasureResult.qureyGxLxCount" desc="查询是否离线">
		<![CDATA[
		SELECT COUNT(1) COUNT
  FROM PORT_MCH_BATCH_SAMPLE_RESULT T
 WHERE T.HEAT_PLAN_NO =?
   AND T.PLINE_CODE =?
   AND T.OP_PROCESS = ?
    AND T.MAT_STATUS='20'
   AND T.LEVE_LOG<>'00'
			]]>
	</query>

	<query id="FrmMeasureResult.queryResultNo" desc="查询实绩最大实绩编号">
		<![CDATA[
		  SELECT ? || TO_CHAR(SYSDATE, 'yyyyMMDD') ||
         LPAD(NVL(MAX(TO_NUMBER(SUBSTR(RESULT_NO, LENGTH(RESULT_NO) - 5))),
                  0) + 1,
              6,
              '0') RESULT_NO
    FROM  MCH_MEASURE_RESULT
   WHERE RESULT_NO LIKE ? || TO_CHAR(SYSDATE, 'yyyyMMDD') || '______'
			]]>
	</query>

	<query id="FrmMeasureResult.AddResult" desc="增加实绩">
		<![CDATA[

   INSERT INTO MCH_MEASURE_RESULT
     (RESULT_NO,
      HEAT_PLAN_NO,
      BATCH_NO,
      PLINE_CODE,
      PLINE_NAME,
      IF_MONITOR_RCL,
      PRDCR_NO,
      PRODUCER,
      PRODUCER_TIME,
      OUTNUM_CUT,
      PRO_NUM,
      PRO_WT,
      FAIL_NUM,
      FAIL_WT,
      PRO_SHIFT,
      PRO_GROUP,
      PRO_USER,
      PRO_TIME,
   JUDGE_STOVE_NO,
   TC_PROVIDER_COUP,
   TC_LOT_COUP,
   TC_PROVIDER_IN,
   TC_LOT_IN,
   TC_PROVIDER_OUT,
   TC_LOT_OUT,
   PR_PROVIDER,
   PR_TYPE,
   USE_PC,
   USE_AR,
   AR_COUNT,
   SPECIAL_DRIFT,
   CC_COUNT,
   IS_PAINT,
   PAINT_TYPE,
   PAINT_LOT,
   FLAG,
   PRO_END_TIME,MEMO)
   VALUES
     ('#RESULT_NO#',
      '#HEAT_PLAN_NO#',
      '#BATCH_NO#',
      '#PLINE_CODE#',
      '#PLINE_NAME#',
      '#IF_MONITOR_RCL#',
      '#PRDCR_NO#',
      '#PRODUCER#',
      '#PRODUCER_TIME#',
      '#OUTNUM_CUT#',
      '#PRO_NUM#',
      '#PRO_WT#',
      '#FAIL_NUM#',
      '#FAIL_WT#',
      '#PRO_SHIFT#',
      '#PRO_GROUP#',
      '#PRO_USER#',
      TO_DATE('#PRO_TIME#', 'YYYY-MM-DD HH24:MI:SS'),
         '#JUDGE_STOVE_NO#',
   '#TC_PROVIDER_COUP#',
   '#TC_LOT_COUP#',
   '#TC_PROVIDER_IN#',
   '#TC_LOT_IN#',
   '#TC_PROVIDER_OUT#',
   '#TC_LOT_OUT#',
   '#PR_PROVIDER#',
   '#PR_TYPE#',
   '#USE_PC#',
   '#USE_AR#',
   '#AR_COUNT#',
   '#SPECIAL_DRIFT#',
   '#CC_COUNT#',
   '#IS_PAINT#',
   '#PAINT_TYPE#',
   '#PAINT_LOT#',
   '#FLAG#',
   TO_DATE('#PRO_END_TIME#', 'YYYY-MM-DD HH24:MI:SS'),'#MEMO#')
			]]>
	</query>

	<query id="FrmMeasureResult.AddResultDdbk" desc="增加实绩子表">
		<![CDATA[



INSERT INTO MCH_MEASURE_RESULT_D
  (RESULT_NO,

   MAT_NO,
   MEASURING_SEQ,
   BAR_CODE,
   ACT_WEIGHT,
   MEASURING_COUNT,
   HEAT_PLAN_NO)
VALUES
  (?,
   ?,
   ?,
   ?,
   ?,
   (SELECT COUNT(1) +1  FROM MCH_MEASURE_RESULT_D WHERE HEAT_PLAN_NO = ? AND MAT_NO = ?),
   ?)


			]]>
	</query>
	<query id="FrmMeasureResult.AddResultD" desc="增加实绩子表">
		<![CDATA[


INSERT INTO MCH_MEASURE_RESULT_D
  (RESULT_NO,
   ACT_LEN,
   MAT_NO,
   MEASURING_SEQ,
   BAR_CODE,
   ACT_WEIGHT,
   MEASURING_COUNT,
   HEAT_PLAN_NO)
VALUES
  (?,
   ?,
   ?,
   ?,
   ?,
   ?,
   (SELECT COUNT(1) +1  FROM MCH_MEASURE_RESULT_D WHERE HEAT_PLAN_NO = ? AND MAT_NO = ?),
   ?)

			]]>
	</query>

	<query id="FrmMeasureResult.DeleteResult" desc="删除实绩">
		<![CDATA[
DELETE FROM MCH_MEASURE_RESULT WHERE RESULT_NO =?

			]]>
	</query>

	<query id="FrmMeasureResult.DeleteResultD" desc="删除实绩">
		<![CDATA[
DELETE FROM MCH_MEASURE_RESULT_D WHERE RESULT_NO =?

			]]>
	</query>

	<query id="FrmMeasureResult.CheckResult" desc="查找最新的一条实绩">
		<![CDATA[
SELECT *
  FROM MCH_MEASURE_RESULT
 WHERE HEAT_PLAN_NO = ?
   AND BATCH_NO = ?
 ORDER BY CREATE_TIME DESC
			]]>
	</query>

	<query id="FrmMeasureResult.GetResultD" desc="增加实绩子表">
		<![CDATA[

SELECT * FROM MCH_MEASURE_RESULT_D WHERE RESULT_NO =?
			]]>
	</query>

	<query id="FrmMeasureResult.getRtdMeasurePosdataEntity" desc="">
		<![CDATA[
SELECT *
  FROM (SELECT T.*,
               DENSE_RANK() OVER(ORDER BY JUDGE_STOVE_NO, DECODE(T.PLINE_CODE, 'C092', '72001', BATCH_NO), TO_NUMBER(MAT_NO)) RK1
          FROM (SELECT *
                  FROM (SELECT KEY_ID,
                               PLINE_CODE,
                               PLINE_NAME,
                               JUDGE_STOVE_NO,
                               BATCH_NO,
                               MAT_NO,
                               ACT_LEN / 1000 ACT_LEN,
                               ACT_WEIGHT / 1000 ACT_WEIGHT,
                               ORD_PK,
                               ORD_LN_PK,
                               ORD_LN_DLY_PK,
                               ORDER_NO,
                               ORDER_SEQ,
                               ORDER_SEQ_NO,
                               PRO_PLAN_ID,
                               GX_PLAN_NO,
                               PRO_BC,
                               PRO_BZ,
                               BAL_YEAR_MONTH,
                               MSAUER_DATE,
                               FLAG,
                               MAT_NO_CX,
                               DENSE_RANK() OVER(PARTITION BY JUDGE_STOVE_NO, DECODE(T.PLINE_CODE, 'C092', '72001', BATCH_NO), TO_NUMBER(MAT_NO) ORDER BY MAT_NO_CX ASC, MSAUER_DATE DESC, KEY_ID DESC) RK2
                          FROM RTD_MEASURE_POSDATA T
                         WHERE T.JUDGE_STOVE_NO = ?
                           AND (T.BATCH_NO = ? OR T.PLINE_CODE = 'C092')
                           AND (t.PLINE_CODE = ? OR
                               (SELECT MAX(M.PLINE_CODE) PLINE_CODE
                                   FROM PLN_ZY_JGX_M M
                                  WHERE M.JUDGE_STOVE_NO = ?) IN
                               ('C010',
                                 'C011',
                                 'C015',
                                 'C069',
                                 'C074',
                                 'C075'))
                           AND t.FLAG = '00')
                 WHERE RK2 = 1
                   AND MAT_NO_CX IS NULL) T)
 WHERE RK1 = ?
        ]]>
	</query>
	<query id="FrmMeasureResult.getUnmatchRtdMeasurePosdataEntitydbk" desc="">
		<![CDATA[
SELECT *
  FROM (SELECT T.*,
               DENSE_RANK() OVER(ORDER BY JUDGE_STOVE_NO,  TO_NUMBER(MAT_NO)) RK1
          FROM (SELECT *
                  FROM (SELECT KEY_ID,
                               PLINE_CODE,
                               PLINE_NAME,
                               JUDGE_STOVE_NO,
                               BATCH_NO,
                               MAT_NO,
                               ACT_LEN / 1000 ACT_LEN,
                               ACT_WEIGHT / 1000 ACT_WEIGHT,
                               ORD_PK,
                               ORD_LN_PK,
                               ORD_LN_DLY_PK,
                               ORDER_NO,
                               ORDER_SEQ,
                               ORDER_SEQ_NO,
                               PRO_PLAN_ID,
                               GX_PLAN_NO,
                               PRO_BC,
                               PRO_BZ,
                               BAL_YEAR_MONTH,
                               MSAUER_DATE,
                               FLAG,
                               MAT_NO_CX,
                               DENSE_RANK() OVER(PARTITION BY JUDGE_STOVE_NO, TO_NUMBER(MAT_NO) ORDER BY MAT_NO_CX ASC, MSAUER_DATE DESC,KEY_ID DESC) RK2
                          FROM RTD_MEASURE_POSDATA T
                         WHERE T.JUDGE_STOVE_NO = ?
                           AND T.BATCH_NO = ?
                              AND PLINE_CODE=?
                           AND FLAG ='00')
                 WHERE RK2 = 1
                   AND MAT_NO_CX IS NULL) T)
 WHERE RK1 = ?        ]]>
	</query>
	<query id="FrmMeasureResult.getUnmatchRtdMeasurePosdataEntity" desc="">
		<![CDATA[
SELECT T.*,
               DENSE_RANK() OVER(ORDER BY JUDGE_STOVE_NO, DECODE(T.PLINE_CODE, 'C092', '72001', BATCH_NO), TO_NUMBER(MAT_NO)) RK1
          FROM (SELECT *
                  FROM (SELECT KEY_ID,
                               PLINE_CODE,
                               PLINE_NAME,
                               JUDGE_STOVE_NO,
                               BATCH_NO,
                               MAT_NO,
                               ACT_LEN / 1000 ACT_LEN,
                               ACT_WEIGHT / 1000 ACT_WEIGHT,
                               ORD_PK,
                               ORD_LN_PK,
                               ORD_LN_DLY_PK,
                               ORDER_NO,
                               ORDER_SEQ,
                               ORDER_SEQ_NO,
                               PRO_PLAN_ID,
                               GX_PLAN_NO,
                               PRO_BC,
                               PRO_BZ,
                               BAL_YEAR_MONTH,
                               TO_CHAR(MSAUER_DATE,'YYYY-MM-DD HH24:MI')  MSAUER_DATE,
                               FLAG,
                               MAT_NO_CX,
                               DENSE_RANK() OVER(PARTITION BY JUDGE_STOVE_NO, DECODE(T.PLINE_CODE, 'C092', '72001', BATCH_NO), TO_NUMBER(MAT_NO) ORDER BY MAT_NO_CX ASC, MSAUER_DATE DESC,KEY_ID DESC) RK2
                          FROM RTD_MEASURE_POSDATA T
                         WHERE T.JUDGE_STOVE_NO = ?
                           AND (T.BATCH_NO = ? OR T.PLINE_CODE='C092')
                              AND PLINE_CODE=?
                           AND FLAG ='00')
                 WHERE RK2 = 1
                   AND MAT_NO_CX IS NULL) T
        ]]>
	</query>

	<query id="FrmMeasureResult.getRtdMeasurePosdataEntityByID" desc="">
		<![CDATA[
SELECT KEY_ID,
                               PLINE_CODE,
                               PLINE_NAME,
                               JUDGE_STOVE_NO,
                               BATCH_NO,
                               MAT_NO,
                               ACT_LEN / 1000 ACT_LEN,
                               ACT_WEIGHT / 1000 ACT_WEIGHT,
                               ORD_PK,
                               ORD_LN_PK,
                               ORD_LN_DLY_PK,
                               ORDER_NO,
                               ORDER_SEQ,
                               ORDER_SEQ_NO,
                               PRO_PLAN_ID,
                               GX_PLAN_NO,
                               PRO_BC,
                               PRO_BZ,
                               BAL_YEAR_MONTH,
                               MSAUER_DATE,
                               FLAG,
                               MAT_NO_CX
  FROM RTD_MEASURE_POSDATA WHERE KEY_ID = ?
        ]]>
	</query>

	<query id="FrmMeasureResult.getRtdMeasurePosdataEntityLastAll" desc="">
		<![CDATA[
SELECT T.*
  FROM (SELECT *
          FROM (SELECT KEY_ID,
                       PLINE_CODE,
                       PLINE_NAME,
                       JUDGE_STOVE_NO,
                       BATCH_NO,
                       MAT_NO,
                       ACT_LEN / 1000 ACT_LEN,
                       ACT_WEIGHT / 1000 ACT_WEIGHT,
                       ORD_PK,
                       ORD_LN_PK,
                       ORD_LN_DLY_PK,
                       ORDER_NO,
                       ORDER_SEQ,
                       ORDER_SEQ_NO,
                       PRO_PLAN_ID,
                       GX_PLAN_NO,
                       PRO_BC,
                       PRO_BZ,
                       BAL_YEAR_MONTH,
                       MSAUER_DATE,
                       FLAG,
                       MAT_NO_CX,
                       DENSE_RANK() OVER(PARTITION BY JUDGE_STOVE_NO, DECODE(T.PLINE_CODE, 'C092', '72001', BATCH_NO), TO_NUMBER(MAT_NO) ORDER BY MAT_NO_CX ASC, MSAUER_DATE DESC, KEY_ID DESC) RK2
                  FROM RTD_MEASURE_POSDATA T
                 WHERE T.JUDGE_STOVE_NO = ?
                   AND (T.BATCH_NO =? OR T.PLINE_CODE= 'C092')
                      AND PLINE_CODE=?
                   AND FLAG ='00')
         WHERE RK2 = 1 ) T
 WHERE TO_NUMBER(T.MAT_NO) > TO_NUMBER(?)
  ORDER BY TO_NUMBER(T.MAT_NO)
        ]]>
	</query>

	<query id="FrmMeasureResult.getRtdMeasurePosdataEntityAllMatNo" desc="">
		<![CDATA[
SELECT KEY_ID,
                       PLINE_CODE,
                       PLINE_NAME,
                       JUDGE_STOVE_NO,
                       BATCH_NO,
                       MAT_NO,
                       ACT_LEN / 1000 ACT_LEN,
                       ACT_WEIGHT / 1000 ACT_WEIGHT,
                       ORD_PK,
                       ORD_LN_PK,
                       ORD_LN_DLY_PK,
                       ORDER_NO,
                       ORDER_SEQ,
                       ORDER_SEQ_NO,
                       PRO_PLAN_ID,
                       GX_PLAN_NO,
                       PRO_BC,
                       PRO_BZ,
                       BAL_YEAR_MONTH,
                       MSAUER_DATE,
                       FLAG,
                       MAT_NO_CX
                        FROM RTD_MEASURE_POSDATA T
                 WHERE T.JUDGE_STOVE_NO = ?
                   AND (T.BATCH_NO =? OR T.PLINE_CODE= 'C092')
                   AND MAT_NO = ?
                    AND PLINE_CODE=?
                   AND FLAG ='00'
                   AND KEY_ID <> ?
                 ORDER BY MAT_NO_CX ASC, MSAUER_DATE DESC, KEY_ID DESC
        ]]>
	</query>

	<query id="FrmMeasureResult.getRtdMeasurePosdataEntity1" desc="">
		<![CDATA[
   SELECT KEY_ID,
       PLINE_CODE,
       PLINE_NAME,
       JUDGE_STOVE_NO,
       BATCH_NO,
       MAT_NO,
       ACT_LEN/1000 ACT_LEN,
       ACT_WEIGHT/1000 ACT_WEIGHT,
       ORD_PK,
       ORD_LN_PK,
       ORD_LN_DLY_PK,
       ORDER_NO,
       ORDER_SEQ,
       ORDER_SEQ_NO,
       PRO_PLAN_ID,
       GX_PLAN_NO,
       PRO_BC,
       PRO_BZ,
       BAL_YEAR_MONTH,
       MSAUER_DATE,
       FLAG,
       MAT_NO_CX FROM RTD_MEASURE_POSDATA  T
   WHERE T.JUDGE_STOVE_NO = ?
   AND (T.BATCH_NO = ? OR T.PLINE_CODE= 'C092')
   AND replace(T.MAT_NO_CX,' ','') = ?
   AND (PLINE_CODE=? OR T.PLINE_CODE IN('C010','C011','C015','C069','C074','C075'))
   AND FLAG ='00'
   ORDER BY    TO_NUMBER(MAT_NO) DESC
        ]]>
	</query>
	<query id="FrmMeasureResult.updatePortVrp" desc="">
		<![CDATA[
UPDATE PORT_VRP_BATCH_SAMPLE_RESULT
   SET TR_FLAG = '1' , MEASURING_SEQ = ? ,
                 ACT_WEIGHT = ?
 WHERE HEAT_PLAN_NO = ?
   AND MAT_NO = ?
        ]]>
	</query>
	<query id="FrmMeasureResult.updatePort" desc="">
		<![CDATA[
UPDATE PORT_MCH_BATCH_SAMPLE_RESULT
   SET TR_FLAG = '1' , MEASURING_SEQ = ? , ACT_LEN = ?,
                 ACT_WEIGHT = ?
 WHERE HEAT_PLAN_NO = ?
   AND MAT_NO = ?
        ]]>
	</query>
	<query id="FrmMeasureResult.checkPortDB" desc="">
		<![CDATA[
SELECT COUNT(1) COUNT FROM PORT_VRP_BATCH_SAMPLE_RESULT
 WHERE HEAT_PLAN_NO = ?
   AND PHY_BATCH_NO = ?
  AND MEASURING_SEQ = ?
        ]]>
	</query>
	<query id="FrmMeasureResult.checkPort" desc="">
		<![CDATA[
SELECT COUNT(1) COUNT FROM PORT_MCH_BATCH_SAMPLE_RESULT
 WHERE HEAT_PLAN_NO = ?
   AND PHY_BATCH_NO = ?
  AND MEASURING_SEQ = ?
        ]]>
	</query>

	<query id="FrmMeasureResult.updateMeasureData" desc="">
		<![CDATA[
UPDATE RTD_MEASURE_POSDATA
   SET FLAG = ?
 WHERE JUDGE_STOVE_NO = ?
   AND (BATCH_NO = ? OR PLINE_CODE= 'C092')
   AND MAT_NO_CX =?
        ]]>
	</query>

	<query id="FrmMeasureResult.updatePort1Dbk" desc="">
		<![CDATA[
UPDATE PORT_VRP_BATCH_SAMPLE_RESULT
   SET TR_FLAG = '0',
    MEASURING_SEQ = ''
 WHERE HEAT_PLAN_NO = ?
   AND MAT_NO = ?
        ]]>
	</query>
	<query id="FrmMeasureResult.updatePort1" desc="">
		<![CDATA[
UPDATE PORT_MCH_BATCH_SAMPLE_RESULT
   SET TR_FLAG = '0',
    MEASURING_SEQ = ''
 WHERE HEAT_PLAN_NO = ?
   AND MAT_NO = ?
        ]]>
	</query>


	<query id="FrmMeasureResult.updateRtdData" desc="">
		<![CDATA[
UPDATE RTD_MEASURE_POSDATA SET MAT_NO_CX = ? WHERE KEY_ID = ?
        ]]>
	</query>

	<query id="FrmMeasureResult.updateMatDatadbk" desc="">
		<![CDATA[
UPDATE mat_bc_m SET ACT_WEIGHT=?, PONDER_GROSS_WT=?  WHERE MAT_NO = ?
        ]]>
	</query>
	<query id="FrmMeasureResult.updateMatData" desc="">
		<![CDATA[
UPDATE mat_bc_m SET ACT_LEN = ?, ACT_WEIGHT=?, PONDER_GROSS_WT=?,BATCH_GROUD_NO=?, ACT_LEN_MIN=?,ACT_LEN_MAX=?  WHERE MAT_NO = ?
        ]]>
	</query>

	<query id="FrmMeasureResult.updateInListDataDB" desc="">
		<![CDATA[
UPDATE YDM_BC_INLIST T
   SET  ACT_WEIGHT=?
 WHERE MAT_NO = ?
   AND PLINE_CODE IN
       (SELECT PLINE_CODE FROM COM_BASE_PLINE C WHERE C.PROCESS_CODE = 'E')

        ]]>
	</query>
	<query id="FrmMeasureResult.updateInListData" desc="">
		<![CDATA[
UPDATE YDM_BC_INLIST T
   SET ACT_LEN = ?, ACT_WEIGHT=?, BATCH_GROUD_NO=?, ACT_LEN_MIN=?,ACT_LEN_MAX=?
 WHERE MAT_NO = ?
   AND PLINE_CODE IN
       (SELECT PLINE_CODE FROM COM_BASE_PLINE C WHERE C.PROCESS_CODE = 'G')

        ]]>
	</query>


	<query id="FrmMeasureResult.updateMatData1" desc="">
		<![CDATA[
UPDATE mat_bc_m SET PONDER_GROSS_WT='' WHERE MAT_NO = ?
        ]]>
	</query>

	<query id="FrmMeasureResult.updateResult" desc="">
		<![CDATA[
UPDATE MCH_MEASURE_RESULT SET FLAG = '0',PRO_WT=ROUND(?,3) WHERE RESULT_NO = ?

        ]]>
	</query>



	<query id="FrmMeasureResult.UpdateFlag" desc="">
		<![CDATA[
       UPDATE RTD_MEASURE_POSDATA SET FLAG =? , MAT_NO_CX = ?  WHERE KEY_ID = ?
        ]]>
	</query>


	<query id="FrmMeasureResult.GetExitsRtdData" desc="">
		<![CDATA[
      	SELECT * FROM RTD_MEASURE_POSDATA  WHERE mat_no_cx = ?  AND FLAG ='00'
        ]]>
	</query>


	<query id="FrmMeasureResult.DoAddMeasureData" desc="">
		<![CDATA[
     INSERT INTO RTD_MEASURE_POSDATA
  (KEY_ID,
   PLINE_CODE,
   PLINE_NAME,
   JUDGE_STOVE_NO,
   BATCH_NO,
   MAT_NO,
   ACT_LEN,
   ACT_WEIGHT,
   FLAG,
   MAT_INFO,
   PRO_ORDER_NO,
   CREATE_USER,PRO_BC,PRO_BZ)
VALUES
  ((SELECT 'M' || TO_CHAR(SYSDATE, 'yyyyMMDD') ||
          LPAD(NVL(MAX(TO_NUMBER(SUBSTR(KEY_ID, LENGTH(KEY_ID) - 5))), 0) + 1,
               6,
               '0') KEY_ID
     FROM RTD_MEASURE_POSDATA
    WHERE KEY_ID LIKE 'M' || TO_CHAR(SYSDATE, 'yyyyMMDD') || '______'),
   '#PLINE_CODE#',
   '#PLINE_NAME#',
   '#JUDGE_STOVE_NO#',
   '#BATCH_NO#',
   '#MAT_NO#',
   '#ACT_LEN#',
   '#ACT_WEIGHT#',
   '#FLAG#',
   '#MAT_INFO#',
   '#PRO_ORDER_NO#',
   '#CREATE_USER#','#PRO_BC#','#PRO_BZ#')
        ]]>
	</query>

	<query id="FrmMeasureResult.QueryResultNo" desc="">
		<![CDATA[
       SELECT * FROM MCH_MEASURE_RESULT  WHERE FAIL_NUM >0 AND  HEAT_PLAN_NO=? AND BATCH_NO =?
        ]]>
	</query>


	<query id="FrmMeasureResult.DoForceDelete1" desc="">
		<![CDATA[
    UPDATE PORT_MCH_BATCH_SAMPLE_RESULT SET TR_FLAG='0', MEASURING_SEQ='' WHERE HEAT_PLAN_NO=? AND BATCH_NO =?
        ]]>
	</query>

	<query id="FrmMeasureResult.DoForceDelete2" desc="">
		<![CDATA[
    UPDATE RTD_MEASURE_POSDATA
   SET MAT_NO_CX = ''
 WHERE JUDGE_STOVE_NO = ?
   AND (BATCH_NO = ? OR PLINE_CODE= 'C092')
   AND MAT_NO_CX IN (SELECT MAT_NO
                       FROM PORT_MCH_BATCH_SAMPLE_RESULT
                      WHERE HEAT_PLAN_NO = ?
                        AND BATCH_NO = ?)

        ]]>
	</query>

	<query id="FrmMeasureResult.DoForceDelete3" desc="">
		<![CDATA[
   DELETE FROM MCH_COM_INFO WHERE HEAT_PLAN_NO=? AND BATCH_NO = ? AND STATION_CODE='701310'
        ]]>
	</query>

	<query id="FrmMeasureResult.DoForceDelete4" desc="">
		<![CDATA[
 DELETE FROM MCH_MEASURE_RESULT  WHERE HEAT_PLAN_NO=? AND BATCH_NO = ?
        ]]>
	</query>


	<query id="FrmMeasureResult.DoForceDelete5" desc="">
		<![CDATA[
	DELETE FROM MCH_MEASURE_RESULT_D
	WHERE RESULT_NO IN (SELECT RESULT_NO
	FROM MCH_MEASURE_RESULT
	WHERE HEAT_PLAN_NO = ?
	AND BATCH_NO = ?)
        ]]>
	</query>


	<query id="FrmMeasureResult.addHttControlLog" desc="增加调度日志">
		<![CDATA[
		INSERT INTO HTT_CONTROL_LOG
  (LOGS_BEG,
   LOGS_END,
   PLINE_CODE,
   PLINE_NAME,
   RESULT_NO,
   NODE_FLAG,
   HEAT_PLAN_NO,
   LOT_NO,
   JUDGE_STOVE_NO,
   BATCH_NO,
   BATCH_GROUD_NO,
   CONTRACT_NO,
   CRAFT_FILE_NO,
   PRDCR_NO,
   PRODUCCODE,
   PRODUCNAME,
   GRADECODE,
   GRADENAME,
   STEELCODE,
   STEELNAME,
   MODEL_CODE,
   MODEL_DESC,
   STD_CODE,
   STD_NAME,
   STD_STYLE,
   STD_STYLE_DESC,
   ACT_DIMATER,
   ACT_HEIGHT,
   ACT_LEN,
   ACT_LEN_MIN,
   ACT_LEN_MAX,
   PRO_BC,
   PRO_BZ,
   QUALIFIED_NUM,
   QUALIFIED_WT,
   SCRAP_NUM,
   SCRAP_WT,
   PRO_TYPE,
   USER_DATE,
   USER_NAME,
   USER_ID,
   CONFIRM_TIME,
   CONFIRM_NAME,
   CONFIRM_FLAG,
   BAL_YEAR_MONTH,
   PROC_DATE,
   MEMO,
   SPEC_CODE,
   SPEC_NAME,
   PROCESS_CODE_C,
   PROCESS_DESC_C,
   STATION)

  SELECT ?,
         ?,
         ?,
         ?,
         ?,
         '0',
         HEAT_PLAN_NO,
         ZY_BATCH_ID,
         JUDGE_STOVE_NO,
         '',
         '',
         ORDER_NO || '/' || ORDER_SEQ,
         CRAFT_FILE_NO,
         PRDCR_NO,
         PRODUCCODE,
         PRODUCNAME,
         GRADECODE,
         GRADENAME,
         STEELCODE,
         STEELNAME,
         MODEL_CODE,
         MODEL_DESC,
         STD_CODE,
         STD_NAME,
         STD_STYLE,
         STD_STYLE_DESC,
         OUTDIAMETER,
         WALLTHICK,
         '',
         LENGTHMIN,
         LENGTHMAX,
         ?,
         ?,
         ?,
         ?,
         '',
         '',
         '1',
         TO_DATE(?, 'YYYY-MM-DD HH24:MI:SS'),
         ?,
         '',
         '',
         '',
         '0',
         ?,
         ?,
         '',
         SPEC_CODE,
         SPEC_NAME,
         PROCESS_CODE_C,
   PROCESS_DESC_C,
   ?
    FROM PLN_ZY_JGX_M
   WHERE HEAT_PLAN_NO = ?
			]]>
	</query>

	<query id="FrmMeasureResult.deleteHttControlLog" desc="">
		<![CDATA[
		DELETE HTT_CONTROL_LOG WHERE RESULT_NO = ?
			]]>
	</query>


	<query id="FrmMeasureResult.getQueryPhyResult" desc="">
		<![CDATA[
	SELECT PHY_NAME, CHECK_TEMP
  FROM QCM_BC_PHYRESULT
 WHERE PHY_RESULT_ID IN (SELECT PHY_RESULT_ID
                           FROM QCM_BC_PHYJUDGE
                          WHERE JUDGE_STOVE_NO = ?
                            AND BATCH_NO = ?
                            AND VALIDFLAG = '1')
   AND PHY_CODE_MAX = 'R0002'
			]]>
	</query>

	<query id="FrmMeasureResult.getQueryPhyResultStand" desc="">
		<![CDATA[
SELECT  PHY_NAME, ITEM_NAME_W CHECK_TEMP
  FROM (SELECT T.*,
               DENSE_RANK() OVER(PARTITION BY T.PHY_CODE ORDER BY T.SPECL_FL DESC) RK
          FROM CRAFT_ORD_DESIGN_STD_PIC T
         WHERE DESGIN_KEY = (SELECT DESGIN_KEY
                               FROM CRAFT_ORD_DESIGN
                              WHERE ORD_LN_PK =
                                    (SELECT ORD_LN_PK
                                       FROM PLN_SALEORD
                                      WHERE ORD_LN_DLY_PK =?)
                                AND CRAFT_SEQ = 1)
           AND MSC_PLINE = 'Y'
           AND PHY_CODE_MAX = 'R0002')
 WHERE RK = '1'
			]]>
	</query>

	<query id="FrmMeasureResult.Turn" desc="">
	<![CDATA[
UPDATE RTD_MEASURE_POSDATA
   SET ORA_ACT_WEIGHT = ACT_WEIGHT, ACT_WEIGHT = ROUND(ACT_LEN * ? / 1000) + ?
 WHERE JUDGE_STOVE_NO = ?
   AND (BATCH_NO = ? OR PLINE_CODE= 'C092')
   AND PLINE_CODE = ?
   AND MAT_NO_CX  IS NULL
   AND ORA_ACT_WEIGHT IS NULL
			]]>
</query>

	<query id="FrmMeasureResult.Revert" desc="">
		<![CDATA[
 UPDATE RTD_MEASURE_POSDATA
    SET ACT_WEIGHT = ORA_ACT_WEIGHT, ORA_ACT_WEIGHT = NULL
  WHERE JUDGE_STOVE_NO = ?
    AND (BATCH_NO = ? OR PLINE_CODE= 'C092')
    AND PLINE_CODE = ?
    AND MAT_NO_CX IS NULL
    AND ORA_ACT_WEIGHT IS NOT NULL
			]]>
	</query>
</queryMap>