<?xml version="1.0" encoding="UTF-8"?>
<queryMap desc="废品缺陷项">

		<query id="FrmHttWasteResult.queryExpandMaxRESULT1" desc="查询最大实绩编号">
	 <![CDATA[ 
SELECT ? ||
       LPAD(SUBSTR(NVL(MAX(T.RESULT_NO), '000000'), -6, 6) + 1, 6, '0') AS RESULT_NO
  FROM HTT_LOADING_RESULT T
 WHERE T.PLINE_CODE = ?
	  ]]>
	</query>
	
		<query id="FrmHttWasteResult.queryExpandMaxRESULT2" desc="查询最大实绩编号">
	 <![CDATA[ 
SELECT ? ||
       LPAD(SUBSTR(NVL(MAX(T.RESULT_NO), '000000'), -6, 6) + 1, 6, '0') AS RESULT_NO
  FROM HTT_HHEAT_RESULT T
 WHERE T.PLINE_CODE = ?
	  ]]>
	</query>
	
		<query id="FrmHttWasteResult.queryExpandMaxRESULT3" desc="查询最大实绩编号">
	 <![CDATA[ 
SELECT ? ||
       LPAD(SUBSTR(NVL(MAX(T.RESULT_NO), '000000'), -6, 6) + 1, 6, '0') AS RESULT_NO
  FROM HTT_QUENCHING_RESULT T
 WHERE T.PLINE_CODE = ?
	  ]]>
	</query>
	
		<query id="FrmHttWasteResult.queryExpandMaxRESULT4" desc="查询最大实绩编号">
	 <![CDATA[ 
SELECT ? ||
       LPAD(SUBSTR(NVL(MAX(T.RESULT_NO), '000000'), -6, 6) + 1, 6, '0') AS RESULT_NO
  FROM HTT_LHEAT_RESULT T
 WHERE T.PLINE_CODE = ?
	  ]]>
	</query>
	
	<query id="FrmHttWasteResult.queryExpandMaxRESULT5" desc="查询最大实绩编号">
	 <![CDATA[ 
SELECT ? ||
       LPAD(SUBSTR(NVL(MAX(T.RESULT_NO), '000000'), -6, 6) + 1, 6, '0') AS RESULT_NO
  FROM HTT_SIZING_RESULT T
 WHERE T.PLINE_CODE = ?
	  ]]>
	</query>
	
	<query id="FrmHttWasteResult.queryExpandMaxRESULT6" desc="查询最大实绩编号">
	 <![CDATA[ 
SELECT ? ||
       LPAD(SUBSTR(NVL(MAX(T.RESULT_NO), '000000'), -6, 6) + 1, 6, '0') AS RESULT_NO
  FROM HTT_HLSTRAIGHTEN_RESULT T
 WHERE T.PLINE_CODE = ?
	  ]]>
	</query>
	
		<query id="FrmHttWasteResult.queryExpandMaxRESULT7" desc="查询最大实绩编号">
	 <![CDATA[ 
SELECT ? ||
       LPAD(SUBSTR(NVL(MAX(T.RESULT_NO), '000000'), -6, 6) + 1, 6, '0') AS RESULT_NO
  FROM HTT_CLSTRAIGHTEN_RESULT T
 WHERE T.PLINE_CODE = ?
	  ]]>
	</query>
	
		<query id="FrmHttWasteResult.queryExpandMaxRESULT8" desc="查询最大实绩编号">
	 <![CDATA[ 
SELECT ? ||
       LPAD(SUBSTR(NVL(MAX(T.RESULT_NO), '000000'), -6, 6) + 1, 6, '0') AS RESULT_NO
  FROM HTT_APPEARANCECHECK_RESULT T
 WHERE T.PLINE_CODE = ?
	  ]]>
	</query>
	
		<query id="FrmHttWasteResult.queryExpandMaxRESULT9" desc="查询最大实绩编号">
	 <![CDATA[ 
SELECT ? ||
       LPAD(SUBSTR(NVL(MAX(T.RESULT_NO), '000000'), -6, 6) + 1, 6, '0') AS RESULT_NO
  FROM HTT_CRACK_DETECTION_ET T
 WHERE T.PLINE_CODE = ?
	  ]]>
	</query>
	
		<query id="FrmHttWasteResult.AddExpandDResult" desc="新增可疑从表实绩">
		<![CDATA[
		INSERT INTO HTT_WASTE_RESULT
  (DEF_SERIAL_ITEM,
   DEF_SERIAL_NO,
   HEAT_PLAN_NO,
   DEF_FILL_NO,
   DEF_FILL_NAME,
   FAIL_NUM,
   FAIL_WT,
   PLINE_CODE)
VALUES
  (?, ?, ?, '1', ?, ?,?,?)

		]]>
	</query>	
	
	
		<query id="FrmHttWasteResult.AddExpandDResult1" desc="新增废品从表实绩">
		<![CDATA[
		INSERT INTO HTT_WASTE_RESULT
  (FAIL_BILL,
   FAIL_BILL_SQE,
   RESULT_NO,
   HEAT_PLAN_NO,
   FAIL_TYPE_CODE,
   FAIL_TYPE_NAME,
   FAIL_NUM,
   FAIL_WT,
   PLINE_CODE)
VALUES
  (?, ?, ?, ?, '2', ?, ?,?,?)

		]]>
	</query>
	
	<query id="FrmHttWasteResult.queryMaxfailBill" desc="生成废品缺陷编号">
	 <![CDATA[ 
   SELECT ? ||
       LPAD(SUBSTR(NVL(MAX(T.DEF_SERIAL_ITEM), '000'), -3, 3) + 1, 3, '0') AS DEF_SERIAL_ITEM
  FROM HTT_WASTE_RESULT T
 WHERE T.HEAT_PLAN_NO = ? and t.DEF_FILL_NO =?
	  ]]>
	</query>
	
		
	<query id="FrmHttWasteResult.queryJumpDRESULT" desc="查询从表最大实绩编号">
		<![CDATA[
SELECT  LPAD(SUBSTR(NVL(MAX(T.DEF_SERIAL_NO), '00000000'), -8, 8) + 1, 8, '0') AS DEF_SERIAL_NO
  FROM HTT_WASTE_RESULT T
 WHERE T.HEAT_PLAN_NO = ?
		]]>
	</query>
</queryMap>
