<?xml version="1.0" encoding="UTF-8"?>
<queryMap desc="加工分切实绩">
	<query id="FrmCutResult.getQueryExpandResult" desc="查分切实绩">
        <![CDATA[
    SELECT *
  FROM MCH_CUT_RESULT T
 WHERE T.HEAT_PLAN_NO = ? AND BATCH_NO = ?
        ]]>
	</query>
	
	<query id="FrmCutResult.getQueryExpandResultStuts" desc="查询相同炉计划ID下分切实绩状态">
        <![CDATA[
   SELECT B.STATION_STATUS
  FROM MCH_CUT_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="FrmCutResult.getQueryExpandResult1" desc="查询分切实绩合格支数的和">
        <![CDATA[
   SELECT NVL(SUM(T.PRO_NUM), 0) PRO_NUM FROM MCH_CUT_RESULT T
   WHERE T.HEAT_PLAN_NO = ?
        ]]>
	</query>
	<query id="FrmCutResult.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="FrmCutResult.detelefailnum" desc="删除废品缺陷">
		<![CDATA[
DELETE MCH_BUG_D WHERE RESULT_NO = ? and HEAT_PLAN_NO = ? and PLINE_CODE = ?	
		]]>
	</query>
	<query id="FrmCutResult.getquerynum" desc="查询实绩里不同分切数的加工支数">
        <![CDATA[
   SELECT NVL(SUM(T.INP_NUM), 0) INP_NUM,NVL(SUM(T.FAIL_NUM), 0) FAIL_NUM FROM MCH_CUT_RESULT T
   WHERE T.HEAT_PLAN_NO = ? and t.OUTNUM_CUT = ?
        ]]>
	</query>
		<query id="FrmCutResult.getQueryMatNo" desc="查询管号队列对应的材料号">
        <![CDATA[
SELECT MAX(T.MAT_NO) MAT_NO
  FROM PORT_MCH_BATCH_SAMPLE_RESULT T
 WHERE T.HEAT_PLAN_NO = ?
   AND T.JUDGE_STOVE_NO = ?
   AND T.BATCH_NO = ?

        ]]>
	</query>
	
				<query id="FrmCutResult.querymaxsqe" desc="查询最大的离线序号">
	 <![CDATA[ 
SELECT ? ||
       LPAD(SUBSTR(NVL(MAX(T.RESULT_SQE), '00'), -2, 2) + 1, 2, '0') AS RESULT_SQE
  FROM MCH_OFFLINE_RESULT_D T
 WHERE  T.HEAT_PLAN_NO = ? and t.PLINE_CODE =?
	  ]]>
	</query>
		<query id="FrmCutResult.getQuerymatzcm" desc="查询对应材料号材料表数据">
        <![CDATA[
 SELECT T.* FROM MAT_BC_M T
   WHERE T.MAT_NO=?

        ]]>
	</query>
	
	<query id="FrmCutResult.queryFailNUM" desc="查询废品支数">
        <![CDATA[
   SELECT NVL(SUM(T.ACT_COUNT),0) ACT_COUNT
  FROM PORT_MCH_BATCH_SAMPLE_RESULT T
 WHERE T.MAT_STATUS = '15'
   AND T.HEAT_PLAN_NO = ?
   AND T.PLINE_CODE = ?
   AND T.GROUP_NO = ?
        ]]>
	</query>
	
	<query id="FrmCutResult.deleteport" desc="删除分切新增的管号队列">
        <![CDATA[
   DELETE PORT_MCH_BATCH_SAMPLE_RESULT T
  WHERE T.HEAT_PLAN_NO = ?
  and t.PLINE_CODE = ?
  and t.OUTNUM_CUT = ?
  and t.OP_PROCESS = ?
  and t.RETURN_PROCESS = ''
        ]]>
	</query>
	
	<query id="FrmCutResult.AddExpandResult" desc="新增分切实绩">
		<![CDATA[
		INSERT INTO MCH_CUT_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, 
 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,INP_NUM,INP_WT,ACT_LEN,ACT_LEN_MIN,ACT_LEN_MAX,CREATET_USER,OUTNUM_CUT,LEN,LEN_MAX,LEN_MIN) 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="FrmCutResult.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=? and t.OUTNUM_CUT = ?
			]]>
	</query>
	<query id="FrmCutResult.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="FrmCutResult.qureyGxComInfo" desc="查询工序是否是结炉状态">
		<![CDATA[
SELECT DISTINCT STATION_STATUS
  FROM MCH_COM_INFO
 WHERE HEAT_PLAN_NO = ?
   AND PLINE_CODE = ?
   AND STATION_CODE = ?
			]]>
	</query>
	<query id="FrmCutResult.UpdatePln1" desc="撤销修改计划表状态">
		<![CDATA[
 UPDATE PLN_ZY_JGX_M
    SET  PER_STATUS = ?
  WHERE HEAT_PLAN_NO = ?
			]]>
	</query>
	<query id="FrmCutResult.queryExpandMaxRESULT" desc="查询最大实绩编号">
		<![CDATA[
SELECT ? ||
       LPAD(SUBSTR(NVL(MAX(T.RESULT_NO), '000000'), -6, 6) + 1, 6, '0') AS RESULT_NO
  FROM MCH_CUT_RESULT T
 WHERE TO_CHAR(T.CREATE_TIME, 'YYYY-MM-DD') = ?
   AND T.PLINE_CODE = ?
		]]>
	</query>
	<query id="FrmCutResult.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 = ?
           AND T.OUTNUM_CUT = ?
         ORDER BY T.MAT_NO ASC) T1
 WHERE ROWNUM<?
			]]>
	</query>
	<query id="FrmCutResult.deleteComInfoResult" desc="删除公共信息">
		<![CDATA[
		DELETE MCH_COM_INFO WHERE RESULT_NO = ?		
		]]>
	</query>
	<query id="FrmCutResult.deleteVrpExpandResult" desc="删除分切实绩">
		<![CDATA[
		DELETE MCH_CUT_RESULT WHERE RESULT_NO = ?		
		]]>
	</query>

	<query id="FrmCutResult.UpdatePln" desc="新增修改计划表状态">
		<![CDATA[
 UPDATE PLN_ZY_JGX_M
    SET  PER_STATUS = '20'
  WHERE HEAT_PLAN_NO = ?
			]]>
	</query>
	
	<query id="FrmCutResult.queryExpandFailNUM1" desc="查询工序废品数量">
		<![CDATA[
		SELECT NVL(SUM(T.FAIL_NUM),0) FAIL_NUM FROM MCH_CUT_RESULT T
WHERE  T.HEAT_PLAN_NO=? 
			]]>
	</query>
	<query id="FrmCutResult.queryExpandNUM2" 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=?
             AND T.OUTNUM_CUT = ?
         ORDER BY T.MAT_NO ASC) T1
 WHERE ROWNUM<?
			]]>
	</query>
	<query id="FrmCutResult.updateVrpExpandResult" desc="修改分切实绩">
		<![CDATA[		
	UPDATE MCH_CUT_RESULT
   SET PRO_NUM        = ?,
       PRO_WT         = ?,
       FAIL_NUM       = ?,
       FAIL_WT        = ?,
       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    = ?,
       INP_NUM        = ?,
       INP_WT         = ?,
       ACT_LEN        = ?,
       ACT_LEN_MIN    = ?,
       ACT_LEN_MAX    = ?
 WHERE RESULT_NO = ?  
			]]>
	</query>
	<query id="FrmCutResult.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="FrmCutResult.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="FrmCutResult.getQueryJGPortVrp3" desc="查询计划ID下管号队列的材料号">
		<![CDATA[
		SELECT T.HEAT_PLAN_NO,
       T.MAT_NO,
       T.M_MAT_NO,
       T.M_M_MAT_NO,
       T.LOT_NO,
       T.LOT_NO_SQE,
       T.PLINE_CODE,
       T.PLINE_NAME,
       T.JUDGE_STOVE_NO,
       T.BATCH_NO,
       T.GROUP_NO,
       T.STOVE_NO,
       T.FLAG_STOVE_NO,
       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,
       DECODE(T.IS_SAMPLE_PIPE, '0', '否', '1', '是') IS_SAMPLE_PIPE,
       T.SAMPLE_PIPE_LEN,
       T.GET_SAMPLE_SHIFT,
       T.GET_SAMPLE_CLASS,
       T.GET_SAMPLE_NAME,
       TO_CHAR(T.GET_SAMPLE_TIME, 'YYYY-MM-DD HH24:MI:SS') GET_SAMPLE_TIME,
       T.OLD_JUDGE_STOVE_NO,
       DECODE(T.GROUP_FLAG, '0', '未组炉', '1', '组炉') GROUP_FLAG,
       (SELECT T1.BASENAME
          FROM COM_BASE_INFO T1
         WHERE T1.BASECODE = T.OP_PROCESS
           AND T1.VALIDFLAG = '1') OP_PROCESS,
       DECODE(T.MAT_STATUS, '00', '合格', '10', '剔除', '20', '待处理') MAT_STATUS,
       DECODE(T.LEVE_LOG, '00', '无', '10', '离线', '20', '返线') LEVE_LOG,
       DECODE(T.INSTORE_FLAG, '0', '未入库', '1', '已入库') INSTORE_FLAG,
       T.PRO_USER,
       DECODE(T.PRO_SHIFT, 1, '早', 2, '中', 3, '夜', 0, '常白') PRO_SHIFT,
       DECODE(T.PRO_GROUP, 1, '甲', 2, '乙', 3, '丙', 4, '丁') PRO_GROUP,
       TO_CHAR(T.PRO_TIME, 'YYYY-MM-DD HH24:MI:SS') PRO_TIME,
       T.REMARK,
      T.PRC_TECHNOLOGY_PATH
  FROM port_mch_batch_sample_result T
 WHERE T.HEAT_PLAN_NO = ?	and ROWNUM < ?
 ORDER BY T.MAT_NO ASC
			]]>
	</query>
	<query id="FrmCutResult.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="FrmCutResult.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_CUT_RESULT
   WHERE RESULT_NO LIKE ? || TO_CHAR(SYSDATE, 'yyyyMMDD') || '______'
			]]>
	</query>

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

   INSERT INTO MCH_CUT_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)
   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#')
			]]>
	</query>


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

			]]>
	</query>


	<query id="FrmCutResult.QueryCanCut" desc="查找可以分切的队列">
		<![CDATA[
SELECT *
  FROM (SELECT *
          FROM PORT_MCH_BATCH_SAMPLE_RESULT
         WHERE  HEAT_PLAN_NO =?
            AND BATCH_NO = ?
           AND VALIDFLAG = '1'
           AND INSTORE_FLAG ='0'
           AND MAT_STATUS = '00'
           AND OUTNUM_CUT > 1
         ORDER BY MAT_NO)
 WHERE ROWNUM <= ?
			]]>
	</query>

	<query id="FrmCutResult.QueryCanCut2" desc="查找撤销分切的队列">
		<![CDATA[
SELECT *
  FROM (SELECT *
          FROM PORT_MCH_BATCH_SAMPLE_RESULT
         WHERE  HEAT_PLAN_NO =?
            AND BATCH_NO = ?
           AND VALIDFLAG = '0'
           AND OUTNUM_CUT > 1
         ORDER BY MAT_NO DESC)
 WHERE ROWNUM <= ?
			]]>
	</query>

	<query id="FrmCutResult.QueryChildPortMch" desc="查找子管的队列">
		<![CDATA[
SELECT *
          FROM PORT_MCH_BATCH_SAMPLE_RESULT
         WHERE  HEAT_PLAN_NO =?
            AND BATCH_NO = ?
           AND M_MAT_NO = ?
			]]>
	</query>

	<query id="FrmCutResult.MarkPortMch" desc="标记母管">
		<![CDATA[
          UPDATE  PORT_MCH_BATCH_SAMPLE_RESULT SET VALIDFLAG = ?
          WHERE RESULT_NO = ? AND MAT_NO = ?
			]]>
	</query>


	<query id="FrmCutResult.MarkPortMch1" desc="标记母管">
		<![CDATA[
          UPDATE  PORT_MCH_BATCH_SAMPLE_RESULT SET VALIDFLAG = ?
          WHERE HEAT_PLAN_NO = ? AND MAT_NO = ?
			]]>
	</query>

	<query id="FrmCutResult.DeletePortMch" desc="删除子管队列">
		<![CDATA[
DELETE FROM PORT_MCH_BATCH_SAMPLE_RESULT  WHERE HEAT_PLAN_NO =? AND MAT_NO = ?
			]]>
	</query>


	<query id="FrmCutResult.AddPortMch" desc="增加子管队列">
		<![CDATA[

INSERT INTO PORT_MCH_BATCH_SAMPLE_RESULT
  (HEAT_PLAN_NO,
   MAT_NO,
   M_MAT_NO,
   M_M_MAT_NO,
   LOT_NO,
   LOT_NO_SQE,
   PRO_PLAN_ID,
   GX_PLAN_NO,
   PLINE_CODE,
   PLINE_NAME,
   JUDGE_STOVE_NO,
   BATCH_NO,
   GROUP_NO,
   STOVE_NO,
   FLAG_STOVE_NO,
   ACT_DIMATER,
   ACT_HEIGHT,
   OUTNUM_CUT,
   ACT_LEN,
   ACT_LEN_MIN,
   ACT_LEN_MAX,
   ACT_COUNT,
   ACT_WEIGHT,
   ACT_THEORY_WEIGHT,
   IS_SAMPLE_PIPE,
   SAMPLE_PIPE_LEN,
   GET_SAMPLE_SHIFT,
   GET_SAMPLE_CLASS,
   GET_SAMPLE_NAME,
   GET_SAMPLE_TIME,
   OLD_JUDGE_STOVE_NO,
   GROUP_FLAG,
   OP_PROCESS,
   MAT_STATUS,
   LEVE_LOG,
   INSTORE_FLAG,
   PRC_TECHNOLOGY_PATH,
   VM_INSTORE_FLAG,
   RETURN_PROCESS,
   PHY_BATCH_NO,
   PRO_YEAR_MONTH_DAY,
   BAL_YEAR_MONTH,
   JUGDE_APPLY_CODE,
   JUGDE_APPLY,
   VALIDFLAG,
   PRO_USER,
   PRO_SHIFT,
   PRO_GROUP,
   PRO_TIME,
   REMARK,
   TR_FLAG,
   PHY_CODE_GROUP,
   PHY_CODE_GROUPB,
   FEED_HEAT_NO,
   BAR_CODE,
   RESULT_NO)
  SELECT HEAT_PLAN_NO,
         MAT_NO || LPAD(?,2,'0'),
         MAT_NO,
         M_M_MAT_NO,
         LOT_NO,
         LOT_NO_SQE,
         PRO_PLAN_ID,
         GX_PLAN_NO,
         PLINE_CODE,
         PLINE_NAME,
         JUDGE_STOVE_NO,
         BATCH_NO,
         GROUP_NO,
         STOVE_NO,
         FLAG_STOVE_NO,
         ACT_DIMATER,
         ACT_HEIGHT,
         1,
         ACT_LEN/OUTNUM_CUT,
         ACT_LEN_MIN,
         ACT_LEN_MAX,
         ACT_COUNT,
         ROUND(ACT_WEIGHT/OUTNUM_CUT,3),
         ROUND(ACT_THEORY_WEIGHT/OUTNUM_CUT,3),
         IS_SAMPLE_PIPE,
         SAMPLE_PIPE_LEN,
         GET_SAMPLE_SHIFT,
         GET_SAMPLE_CLASS,
         GET_SAMPLE_NAME,
         GET_SAMPLE_TIME,
         OLD_JUDGE_STOVE_NO,
         GROUP_FLAG,
         OP_PROCESS,
         MAT_STATUS,
         LEVE_LOG,
         '0',
         PRC_TECHNOLOGY_PATH,
         '',
         '',
         PHY_BATCH_NO,
         PRO_YEAR_MONTH_DAY,
         BAL_YEAR_MONTH,
         JUGDE_APPLY_CODE,
         JUGDE_APPLY,
         1,
         PRO_USER,
         PRO_SHIFT,
         PRO_GROUP,
         PRO_TIME,
         REMARK,
         TR_FLAG,
         PHY_CODE_GROUP,
         PHY_CODE_GROUPB,
         FEED_HEAT_NO,
         DECODE(BAR_CODE,NULL,NULL,BAR_CODE || '-' || LPAD(?,2,'0')) ,
         RESULT_NO
    FROM PORT_MCH_BATCH_SAMPLE_RESULT
    WHERE HEAT_PLAN_NO =? AND MAT_NO = ?
			]]>
	</query>


	<query id="FrmCutResult.AddPortMch2" desc="增加子管队列">
		<![CDATA[

INSERT INTO PORT_MCH_BATCH_SAMPLE_RESULT
  (HEAT_PLAN_NO,
   MAT_NO,
   M_MAT_NO,
   M_M_MAT_NO,
   LOT_NO,
   LOT_NO_SQE,
   PRO_PLAN_ID,
   GX_PLAN_NO,
   PLINE_CODE,
   PLINE_NAME,
   JUDGE_STOVE_NO,
   BATCH_NO,
   GROUP_NO,
   STOVE_NO,
   FLAG_STOVE_NO,
   ACT_DIMATER,
   ACT_HEIGHT,
   OUTNUM_CUT,
   ACT_LEN,
   ACT_LEN_MIN,
   ACT_LEN_MAX,
   ACT_COUNT,
   ACT_WEIGHT,
   ACT_THEORY_WEIGHT,
   IS_SAMPLE_PIPE,
   SAMPLE_PIPE_LEN,
   GET_SAMPLE_SHIFT,
   GET_SAMPLE_CLASS,
   GET_SAMPLE_NAME,
   GET_SAMPLE_TIME,
   OLD_JUDGE_STOVE_NO,
   GROUP_FLAG,
   OP_PROCESS,
   MAT_STATUS,
   LEVE_LOG,
   INSTORE_FLAG,
   PRC_TECHNOLOGY_PATH,
   VM_INSTORE_FLAG,
   RETURN_PROCESS,
   PHY_BATCH_NO,
   PRO_YEAR_MONTH_DAY,
   BAL_YEAR_MONTH,
   JUGDE_APPLY_CODE,
   JUGDE_APPLY,
   VALIDFLAG,
   PRO_USER,
   PRO_SHIFT,
   PRO_GROUP,
   PRO_TIME,
   REMARK,
   TR_FLAG,
   PHY_CODE_GROUP,
   PHY_CODE_GROUPB,
   FEED_HEAT_NO,
   BAR_CODE,
   RESULT_NO)
  SELECT HEAT_PLAN_NO,
         MAT_NO || LPAD(?,2,'0'),
         MAT_NO,
         M_M_MAT_NO,
         LOT_NO,
         LOT_NO_SQE,
         PRO_PLAN_ID,
         GX_PLAN_NO,
         PLINE_CODE,
         PLINE_NAME,
         JUDGE_STOVE_NO,
         BATCH_NO,
         GROUP_NO,
         STOVE_NO,
         FLAG_STOVE_NO,
         ACT_DIMATER,
         ACT_HEIGHT,
         1,
         ACT_LEN/OUTNUM_CUT,
         ACT_LEN_MIN,
         ACT_LEN_MAX,
         ACT_COUNT,
         ACT_WEIGHT- (OUTNUM_CUT-1) *  ROUND(ACT_WEIGHT/OUTNUM_CUT,3),
        ACT_THEORY_WEIGHT -   (OUTNUM_CUT-1) *  ROUND(ACT_THEORY_WEIGHT/OUTNUM_CUT,3),
         IS_SAMPLE_PIPE,
         SAMPLE_PIPE_LEN,
         GET_SAMPLE_SHIFT,
         GET_SAMPLE_CLASS,
         GET_SAMPLE_NAME,
         GET_SAMPLE_TIME,
         OLD_JUDGE_STOVE_NO,
         GROUP_FLAG,
         OP_PROCESS,
         MAT_STATUS,
         LEVE_LOG,
         '0',
         PRC_TECHNOLOGY_PATH,
         '',
         '',
         PHY_BATCH_NO,
         PRO_YEAR_MONTH_DAY,
         BAL_YEAR_MONTH,
         JUGDE_APPLY_CODE,
         JUGDE_APPLY,
         1,
         PRO_USER,
         PRO_SHIFT,
         PRO_GROUP,
         PRO_TIME,
         REMARK,
         TR_FLAG,
         PHY_CODE_GROUP,
         PHY_CODE_GROUPB,
         FEED_HEAT_NO,
         DECODE(BAR_CODE,NULL,NULL,BAR_CODE||'-' || LPAD(?,2,'0')) ,
         RESULT_NO
    FROM PORT_MCH_BATCH_SAMPLE_RESULT
    WHERE HEAT_PLAN_NO =? AND MAT_NO = ?
			]]>
	</query>
</queryMap>