<?xml version="1.0" encoding="UTF-8"?>
<queryMap desc="委外审批管理">
	<query id="FrmHttOutSourcApp.doQueryOutSourc" desc="委外实绩查询">
	 <![CDATA[ 
SELECT T.SUBCONTRACT_NO,
       T.SUBCONTRACT_NO_SEQ,
       T.PLINE_CODE,
       T.PLINE_NAME,
       T.STATION_CODE,
       T.STATION_DESC,
       T.HEAT_PLAN_NO,
       T.ZY_BATCH_ID,
       T.PRO_PLAN_ID,
       T.GX_PLAN_NO,
       T.JUDGE_STOVE_NO,
       T.BATCH_NO,
       T.PRODUCCODE,
       T.PRODUCNAME,
       T.STEELCODE,
       T.STEELNAME,
       T.GRADECODE,
       T.GRADENAME,
       T.MODEL_CODE,
       T.MODEL_DESC,
       T.STD_CODE,
       T.STD_NAME,
       T.STD_STYLE,
       T.STD_STYLE_DESC,
       T.ACT_DIMATER,
       T.ACT_HEIGHT,
       T.ACT_LEN,
       T.ACT_LEN_MIN,
       T.ACT_LEN_MAX,
       T.CRAFT_FILE_NO,
       NVL(T.SUBCONTRACT_NUM,0) SUBCONTRACT_NUM,
       NVL(T.SUBCONTRACT_WT,0) SUBCONTRACT_WT,
       NVL(T.HB_COMPLETE_NUM,0) HB_COMPLETE_NUM,
       NVL(T.HB_COMPLETE_WT,0) HB_COMPLETE_WT,
       T.SUBCONTRACT_USER,
       DECODE(T.SUBCONTRACT_SHIFT, '1', '早', '2', '中', '3', '夜') SUBCONTRACT_SHIFT,
       DECODE(T.SUBCONTRACT_GROUP,
              '1',
              '甲',
              '2',
              '乙',
              '3',
              '丙',
              '4',
              '丁') SUBCONTRACT_GROUP,
       TO_CHAR(T.SUBCONTRACT_TIME, 'YYYY-MM-DD HH24:MI:SS') SUBCONTRACT_TIME,
       T.SP_USER,
       TO_CHAR(T.SP_TIME, 'YYYY-MM-DD HH24:MI:SS') SP_TIME,
       DECODE(T.SUBCONTRACT_LOG,
              '00',
              '委外申请',
              '10',
              '审核通过',
              '20',
              '审核不通过',
              '30',
              '回报完毕') SUBCONTRACT_LOG,
       T.SUBCONTRACT_PLINE_CODE,
       T.SUBCONTRACT_PLINE_NAME,
       T.SUBCONTRACT_NOTE,
       NVL(T.HB_FP_NUM,0) HB_FP_NUM,
       NVL(T.HB_FP_WT,0) HB_FP_WT,
       T.SP_NOTE,
       T.RESULT_NO
  FROM HTT_ENTRUSTED_BILL T
 WHERE 1=1
	  ]]>
	</query>
	<query id="FrmHttOutSourcApp.QueryStorage" desc="">
		<![CDATA[
SELECT * FROM YDM_BS_STORAGE Y
      ON MANAGEMENT_NO IN
         (SELECT DEPARTMENT_CODE
            FROM COM_BASE_PLINE
           WHERE PLINE_CODE = ?)
     AND STORAGE_ATTR = '800304'
     AND ROWNUM = 1
	]]>
	</query>
	<query id="FrmHttOutSourcApp.QueryInlistMat" desc="">
		<![CDATA[
SELECT T.MAT_NO FROM YDM_BC_INLIST T WHERE t.instock_doc = ? and ROWNUM <= ?
	]]>
	</query>
	<query id = "FrmHttOutSourcApp.insertInList" desc = "">
<![CDATA[
DECLARE
BEGIN
  FOR MYROW IN (SELECT *
                  FROM (SELECT *
                          FROM HTT_ENTRUSTED_BILL T
                         WHERE T.SUBCONTRACT_NO = '#SUBCONTRACT_NO#'
                        )
                 WHERE ROWNUM <= '#SUBCONTRACT_NUM#') LOOP
    UPDATE YDM_BC_INLIST T
       SET T.SUBCONTRACT_NO = '#SUBCONTRACT_NO#'
     WHERE T.JUDGE_STOVE_NO = '#JUDGE_STOVE_NO#'
     AND T.SUBCONTRACT_NO IS NOT NULL;
  END LOOP;
END;
]]>
</query>
<query id="FrmHttOutSourcApp.updateInStore" desc="">
		<![CDATA[
	update 	HTT_ENTRUSTED_BILL SET SUBCONTRACT_LOG ='40' where SUBCONTRACT_NO = '#SUBCONTRACT_NO#'
	]]>
	</query>
	<query id="FrmHttOutSourcApp.QueryOfflineMatNo" desc="">
		<![CDATA[
SELECT *
  FROM (SELECT *
          FROM PORT_HTT_BATCH_SAMPLE_RESULT
         WHERE HEAT_PLAN_NO = (SELECT HEAT_PLAN_NO
                                 FROM HTT_OFFLINE_RESULT
                                WHERE RESULT_NO = ?)
           AND MAT_STATUS = '40'
         ORDER BY MAT_NO) WHERE ROWNUM <= ?
	]]>
	</query>
	<query id = "FrmHttOutSourcApp.DeleteInList" desc = "撤销交库">
<![CDATA[
DECLARE
 V_COUNT NUMBER := 0;
BEGIN
  FOR MYROW IN (SELECT *
                  FROM (SELECT *
                          FROM YDM_BC_INLIST T
                         WHERE T.INSTOCK_DOC = '#INSTOCK_DOC#'
                           AND T.JUDGE_STOVE_NO = '#JUDGE_STOVE_NO#'
                           AND T.BATCH_NO = '#BATCH_NO#'
                           AND T.BATCH_GROUD_NO = '#BATCH_GROUD_NO#'
                           AND T.PLINE_CODE = '#PLINE_CODE#'
                         ORDER BY T.MAT_NO DESC)
                 WHERE ROWNUM <= #ACT_COUNT#) LOOP
     UPDATE PORT_Htt_BATCH_SAMPLE_RESULT T SET T.INSTORE_FLAG = '0',t.MAT_STATUS ='20' WHERE T.MAT_NO = MYROW.MAT_NO AND PROCESS_SEQ = (SELECT real_process_seq FROM pln_zy_rcl_m WHERE heat_plan_no = t.heat_plan_no) ;
    DELETE FROM MAT_BC_M T
     WHERE T.MAT_NO = MYROW.MAT_NO
       AND 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 T.PLINE_CODE = MYROW.PLINE_CODE;
    DELETE FROM YDM_BC_BUTTRESS S
     WHERE S.MAT_NO = MYROW.MAT_NO
       AND S.JUDGE_STOVE_NO = MYROW.JUDGE_STOVE_NO
       AND S.BATCH_NO = MYROW.BATCH_NO
       AND S.BATCH_GROUD_NO = MYROW.BATCH_GROUD_NO;
    DELETE FROM YDM_BC_INLIST F WHERE F.INSTOCK_SQE = MYROW.INSTOCK_SQE;
  END LOOP;
  DELETE FROM HTT_COM_INFO T WHERE T.INSTOCK_DOC = '#INSTOCK_DOC#'
     AND T.JUDGE_STOVE_NO = '#JUDGE_STOVE_NO#'
     AND T.PRO_PLAN_ID = '#PRO_PLAN_ID#'
     AND T.GX_PLAN_NO = '#GX_PLAN_NO#';
     UPDATE HTT_ENTRUSTED_BILL SET SUBCONTRACT_LOG = '10' WHERE SUBCONTRACT_NO = '#SUBCONTRACT_NO#';
END;
]]>
</query>
<query id="FrmHttOutSourcApp.QueryOffMatNo" desc="查询管号队列离线材料号">
        <![CDATA[  
        SELECT *
  FROM (SELECT T.MAT_NO,T.PHY_BATCH_NO,T.IS_SAMPLE_PIPE,T.ACT_COUNT
          FROM PORT_HTT_BATCH_SAMPLE_RESULT T
         WHERE T.MAT_STATUS = '20'
         	AND T.PHY_BATCH_NO = ?
           AND T.HEAT_PLAN_NO = ?
           AND T.OP_PROCESS = ?
         ORDER BY T.MAT_NO ASC)
 WHERE ROWNUM < ?
          ]]>
	</query>
		<query id="FrmHttOutSourcApp.updateOutStuts" desc="">
		<![CDATA[
	update Htt_ENTRUSTED_BILL SET SUBCONTRACT_LOG ='10' where SUBCONTRACT_NO = '#SUBCONTRACT_NO#'
	]]>
	</query>
	<query id = "FrmHttOutSourcApp.insertMatBcM" desc = "交库">
   <![CDATA[
   DECLARE
V_INSTOCK_SQE YDM_BC_INLIST.INSTOCK_SQE%TYPE := NULL;
V_ICOUNT NUMBER := 1;
BEGIN
  SELECT 
       NVL(MAX(SUBSTR(T.INSTOCK_SQE, LENGTH(T.INSTOCK_SQE) - 3)), 0) + 1 INTO V_ICOUNT
  FROM YDM_BC_INLIST T
 WHERE  T.INSTOCK_DOC LIKE '#INSTOCK_DOC#' || '%';
  FOR MYROW IN (SELECT *
                  FROM (SELECT *
                          FROM PORT_HTT_BATCH_SAMPLE_RESULT T
                         WHERE T.HEAT_PLAN_NO = '#HEAT_PLAN_NO#'
                           AND T.JUDGE_STOVE_NO = '#JUDGE_STOVE_NO#'
                           AND T.PHY_BATCH_NO = '#PHY_BATCH_NO#'
                           --AND T.IS_SAMPLE_PIPE = '#IS_SAMPLE_PIPE#'
                           AND T.MAT_STATUS = '20'
                           AND T.INSTORE_FLAG = '0'
                         ORDER BY T.MAT_NO ASC)
                 WHERE ROWNUM <= #ACT_COUNT#) LOOP
   INSERT INTO YDM_BC_BUTTRESS(
        MAT_NO,
        JUDGE_STOVE_NO,
        BATCH_NO,
        BATCH_GROUD_NO,
        STORAGE_NO,
        LOCATION_NO,
        LARY_NO,
        CREATE_NAME,
        CREATE_TIME)
 VALUES( 
        MYROW.MAT_NO,
        MYROW.JUDGE_STOVE_NO,
        MYROW.PHY_BATCH_NO,
        '#BATCH_GROUD_NO#',
        '#STORAGE_NO#',
        '#LOCATION_NO#',
        '#LARY_NO#',
        '#CREATE_NAME#',
        TO_DATE('#CREATE_TIME#','YYYY-MM-DD HH24:MI:SS'));
         INSERT INTO MAT_BC_M(
        MAT_NO,
        PRODUCT_FLAG,
        MAT_STATUS,
        LOT_NO,
        STOVE_NO,
        JUDGE_STOVE_NO,
        BATCH_NO,
        BATCH_GROUD_NO,
        SAMPLE_FLAG,
        MATERIAL_NO,
        MATERIAL_NAME,
        PRODUCCODE,
        PRODUCNAME,
        STEELCODE,
        STEELNAME,
        GRADECODE,
        GRADENAME,
        SPEC_CODE,
        SPEC_NAME,
        MODEL_CODE,
        MODEL_DESC,
        STD_CODE,
        STD_NAME,
        STD_STYLE,
        STD_STYLE_DESC,
        PRO_ORDER_NO,
        PRO_ORDER_ID,
        PROCESS_CDOE,
        PROCESS_DESC,
        NEXT_PROCESS_CDOE,
        NEXT_PROCESS_DESC,
        PLINE_CODE,
        PLINE_NAME,
        MAT_ORIGIN_CODE,
        MAT_ORIGIN_NAME,
        ACT_DIMATER,
        ACT_HEIGHT,
        ACT_LEN,
        ACT_LEN_MIN,
        ACT_LEN_MAX,
        ACT_COUNT,
        ACT_WEIGHT,
        ACT_THEORY_WEIGHT,
        BELONG_CODE,
        BELONG_NAME,
        MAT_GOWHERE_CODE,
        MAT_GOWHERE_NAME,
        INSTOCK_TIME,
        CREATE_NAME,
        CREATE_TIME,
        BAL_YEAR_MONTH,
        JUDGE_STD_DES,
        QCM_STAUS,
        HEAT_PLAN_NO,
        GX_PLAN_NO,
        CRAF_NO,
        CRAFT_SEQ,
        ORD_LN_DLY_PK,
        ORDER_NO,
        ORDER_SEQ,
        ORDER_SEQ_NO,
        HEAT_PLAN_NO_NEXT,
        FLAG_STOVE_NO_ZG,
        TARGET)
 VALUES( 
        MYROW.MAT_NO,
        '#PRODUCT_FLAG#',
        '#MAT_STATUS#',
        MYROW.LOT_NO,
        MYROW.STOVE_NO,
        MYROW.JUDGE_STOVE_NO,
        MYROW.PHY_BATCH_NO,
        '#BATCH_GROUD_NO#',
        MYROW.IS_SAMPLE_PIPE,
        '#MATERIAL_NO#',
        '#MATERIAL_NAME#',
        '#PRODUCCODE#',
        '#PRODUCNAME#',
        '#STEELCODE#',
        '#STEELNAME#',
        '#GRADECODE#',
        '#GRADENAME#',
        '#SPEC_CODE#',
        '#SPEC_NAME#',
        '#MODEL_CODE#',
        '#MODEL_DESC#',
        '#STD_CODE#',
        '#STD_NAME#',
        '#STD_STYLE#',
        '#STD_STYLE_DESC#',
        '#PRO_ORDER_NO#',
        '#PRO_ORDER_ID#',
        '#PROCESS_CDOE#',
        '#PROCESS_DESC#',
        '#NEXT_PROCESS_CDOE#',
        '#NEXT_PROCESS_DESC#',
        '#PLINE_CODE#',
        '#PLINE_NAME#',
        '#MAT_ORIGIN_CODE#',
        '#MAT_ORIGIN_NAME#',
        '#ACT_DIMATER#',
        '#ACT_HEIGHT#',
        MYROW.ACT_LEN,
        '#ACT_LEN_MIN#',
        '#ACT_LEN_MAX#',
        MYROW.ACT_COUNT,
        MYROW.ACT_WEIGHT,
        MYROW.ACT_WEIGHT,
        '#BELONG_CODE#',
        '#BELONG_NAME#',
        '#MAT_GOWHERE_CODE#',
        '#MAT_GOWHERE_NAME#',
        TO_DATE('#CREATE_TIME#','YYYY-MM-DD HH24:MI:SS'),
        '#CREATE_NAME#',
        TO_DATE('#CREATE_TIME#','YYYY-MM-DD HH24:MI:SS'),
        '#BAL_YEAR_MONTH#',
        '#JUDGE_STD_DES#',
        '#QCM_STAUS#',
        '#HEAT_PLAN_NO#',
        '#GX_PLAN_NO#',
        '#CRAF_NO#',
        '#CRAFT_SEQ#',
        '#ORD_LN_DLY_PK#',
        '#ORDER_NO#',
        '#ORDER_SEQ#',
        '#ORDER_SEQ_NO#',
        '#HEAT_PLAN_NO_NEXT#',
        '#FLAG_STOVE_NO_ZG#',
        '#TARGET#');
        
         V_INSTOCK_SQE := '#INSTOCK_DOC#' || LPAD(V_ICOUNT, 4, 0);
         INSERT INTO YDM_BC_INLIST(
        INSTOCK_SQE,
        INSTOCK_DOC,
        INSTOCK_TYPE_CODE,
        INSTOCK_TYPE_NAME,
        MAT_NO,
        LOT_NO,
        STOVE_NO,
        JUDGE_STOVE_NO,
        BATCH_NO,
        BATCH_GROUD_NO,
        MATERIAL_NO,
        MATERIAL_NAME,
        PRODUCCODE,
        PRODUCNAME,
        STD_CODE,
        STD_NAME,
        GRADECODE,
        GRADENAME,
        STEELCODE,
        STEELNAME,
        STD_STYLE,
        STD_STYLE_DESC,
        SPEC_CODE,
        SPEC_NAME,
        MODEL_CODE,
        MODEL_DESC,
        PRO_ORDER_NO,
        PLINE_CODE,
        PLINE_NAME,
        ACT_DIMATER,
        ACT_HEIGHT,
        ACT_LEN,
        ACT_LEN_MIN,
        ACT_LEN_MAX,
        ACT_COUNT,
        ACT_WEIGHT,
        ACT_THEORY_WEIGHT,
        BELONG_CODE,
        BELONG_NAME,
        STORAGE_NO,
        LOCATION_NO,
        LARY_NO,
        INSTOCK_TIME,
        CREATE_NAME,
        CREATE_TIME,
        PRODUCT_FLAG,
        MAT_STATUS,
        JUDGE_STD_NAME,
        JUDGE_STD_CODE,
        IN_TIME_F,
        BAL_YEAR_MONTH,
        MAT_ORIGIN_CODE,
        MAT_ORIGIN_NAME,
        QCM_STAUS,
        PRO_PLAN_ID,
        GX_PLAN_NO,
        SUBCONTRACT_NO)
 VALUES( 
        V_INSTOCK_SQE,
        '#INSTOCK_DOC#',
        '#INSTOCK_TYPE_CODE#',
        '#INSTOCK_TYPE_NAME#',
        MYROW.MAT_NO,
        MYROW.LOT_NO,
        MYROW.STOVE_NO,
        MYROW.JUDGE_STOVE_NO,
        MYROW.PHY_BATCH_NO,
        '#BATCH_GROUD_NO#',
        '#MATERIAL_NO#',
        '#MATERIAL_NAME#',
        '#PRODUCCODE#',
        '#PRODUCNAME#',
        '#STD_CODE#',
        '#STD_NAME#',
        '#GRADECODE#',
        '#GRADENAME#',
        '#STEELCODE#',
        '#STEELNAME#',
        '#STD_STYLE#',
        '#STD_STYLE_DESC#',
        '#SPEC_CODE#',
        '#SPEC_NAME#',
        '#MODEL_CODE#',
        '#MODEL_DESC#',
        '#PRO_ORDER_NO#',
        '#PLINE_CODE#',
        '#PLINE_NAME#',
        '#ACT_DIMATER#',
        '#ACT_HEIGHT#',
        MYROW.ACT_LEN,
        '#ACT_LEN_MIN#',
        '#ACT_LEN_MAX#',
        MYROW.ACT_COUNT,
        MYROW.ACT_WEIGHT,
        MYROW.ACT_WEIGHT,
        '#BELONG_CODE#',
        '#BELONG_NAME#',
        '#STORAGE_NO#',
        '#LOCATION_NO#',
        '#LARY_NO#',
        TO_DATE('#CREATE_TIME#','YYYY-MM-DD HH24:MI:SS'),
        '#CREATE_NAME#',
        TO_DATE('#CREATE_TIME#','YYYY-MM-DD HH24:MI:SS'),
        '#PRODUCT_FLAG#',
        '#MAT_STATUS#',
        '#JUDGE_STD_NAME#',
        '#JUDGE_STD_CODE#',
        TO_DATE('#CREATE_TIME#','YYYY-MM-DD HH24:MI:SS'),
        '#BAL_YEAR_MONTH#',
        '#MAT_ORIGIN_CODE#',
        '#MAT_ORIGIN_NAME#',
        '#QCM_STAUS#',
        '#PRO_ORDER_ID#',
        '#GX_PLAN_NO#',
        '#SUBCONTRACT_NO#');
        UPDATE PORT_HTT_BATCH_SAMPLE_RESULT T SET T.INSTORE_FLAG = '1',t.MAT_STATUS ='00' WHERE T.MAT_NO = MYROW.MAT_NO AND PROCESS_SEQ = (SELECT real_process_seq FROM pln_zy_rcl_m WHERE heat_plan_no = t.heat_plan_no);
        V_ICOUNT := V_ICOUNT + 1;
  END LOOP;
END;
   ]]>
   </query>
	<query id = "FrmHttOutSourcApp.doQueryInList" desc = "查询委外入库实绩">
SELECT T.INSTOCK_DOC,
       T.LOT_NO,
       T.JUDGE_STOVE_NO,
       T.BATCH_NO,
       T.BATCH_GROUD_NO,
       T.PRODUCCODE,
       T.PRODUCNAME,
       T.STD_CODE,
       T.STD_NAME,
       T.STEELCODE,
       T.STEELNAME,
       T.STD_STYLE,
       T.STD_STYLE_DESC,
       T.SPEC_CODE,
       T.SPEC_NAME,
       T.MODEL_CODE,
       T.MODEL_DESC,
       T.ACT_DIMATER,
       T.ACT_HEIGHT,
       TO_CHAR(T.ACT_LEN_MIN, 'FM999990.00') AS ACT_LEN_MIN,
       TO_CHAR(T.ACT_LEN_MAX, 'FM999990.00') AS ACT_LEN_MAX,
       SUM(T.ACT_COUNT) AS ACT_COUNT,
       TO_CHAR(SUM(T.ACT_WEIGHT), 'FM999999990.000') AS ACT_WEIGHT,
       T.ACT_LEN,
       T.BELONG_CODE,
       T.BELONG_NAME,
       T.STORAGE_NO,
       T.MEMO,
       T.CREATE_NAME,
       MAX(TO_CHAR(T.INSTOCK_TIME, 'YYYY-MM-DD HH24:MI:SS')) AS INSTOCK_TIME,
       MAX(TO_CHAR(T.IN_TIME_F, 'YYYY-MM-DD')) AS IN_TIME_F,
       TO_CHAR(TO_DATE(T.BAL_YEAR_MONTH, 'YYYY-MM'), 'YYYY-MM') AS BAL_YEAR_MONTH,
       T.ORDER_NO,
       T.ORDER_SEQ,
       T.DELIVERY_NO,
       T.JUDGE_STD_CODE,
       T.JUDGE_STD_NAME,
       T.PLINE_CODE,
       T.PLINE_NAME,
       T.GRADECODE,
       T.GRADENAME,
       T.MATERIAL_NO,
       T.MATERIAL_NAME,
       T.SUBCONTRACT_NO,
       DECODE(T.PRODUCT_FLAG,
              '801401',
              '在制品',
              '801402',
              '成品',
              '801403',
              '商品') PRODUCT_FLAG,
       T.MAT_STATUS,
       T.PIPMEMO,
       T.PRO_PLAN_ID,
       T.GX_PLAN_NO
  FROM YDM_BC_INLIST T
 WHERE T.INSTOCK_TYPE_CODE = '800701'
   AND T.HAND_FLAG = '0'
   AND T.QCM_STAUS = '00'
   AND T.SUBCONTRACT_NO IS NOT NULL
</query>
	<query id="FrmHttOutSourcApp.doQueryPlineCode" desc="查询产线">
	<![CDATA[
SELECT T.PLINE_CODE, T.PLINE_NAME
  FROM COM_BASE_PLINE T
 WHERE T.VALIDFLAG = '1'
	]]>
	</query>
	<query id="FrmHttOutSourcApp.QuerySubConStart" desc="查询委托状态">
	<![CDATA[
SELECT T.SUBCONTRACT_LOG
  FROM HTT_ENTRUSTED_BILL T
 WHERE T.SUBCONTRACT_NO = ?
   AND T.SUBCONTRACT_NO_SEQ = ?
	]]>
	</query>



	<query id="FrmHttOutSourcApp.UpdateOutSourc" desc="修改委托状态">
	<![CDATA[
UPDATE HTT_ENTRUSTED_BILL
   SET SP_USER                = ?,
       SP_TIME                = TO_DATE(?, 'YYYY-MM-DD HH24:MI:SS'),
       SUBCONTRACT_LOG        = ?,
       SUBCONTRACT_PLINE_CODE = ?,
       SUBCONTRACT_PLINE_NAME = ?,
       SP_NOTE                = ?
 WHERE SUBCONTRACT_NO = ?
   AND SUBCONTRACT_NO_SEQ = ?
	]]>
	</query>
	<query id="FrmHttOutSourcApp.UpdateOff" desc="释放离线表委外支吨">
	<![CDATA[
 UPDATE HTT_OFFLINE_RESULT
   SET SUBCONTRACT_NUM      = ?,
       SUBCONTRACT_WT       = ?,
       SUBCONTRACT_TIME = TO_DATE(?, 'YYYY-MM-DD HH24:MI:SS'),
       SUBCONTRACT_NAME = ?
 WHERE RESULT_NO = ?
	]]>
	</query>
	<query id="FrmHttOutSourcApp.UpdateOutSourcNum" desc="修改委外回报量">
	<![CDATA[
UPDATE HTT_ENTRUSTED_BILL
   SET HB_COMPLETE_NUM = ?,
       HB_COMPLETE_WT  = ?,
       SUBCONTRACT_LOG = ?,
       HB_FP_NUM       = ?,
       HB_FP_WT        = ?
 WHERE SUBCONTRACT_NO = ?
   AND SUBCONTRACT_NO_SEQ = ?
	]]>
	</query>
		<query id="FrmHttOutSourcApp.UpdateOffSourc" desc="修改离线表委外回报">
	<![CDATA[
UPDATE HTT_OFFLINE_RESULT
   SET SUBCONTRACTCOMPLETE_NUM = ?,
       SUBCONTRACTCOMPLETE_WT  = ?,
       HB_FP_NUM               = ?,
       HB_FP_WT                = ?
 WHERE RESULT_NO = ?

	]]>
	</query>


	<query id="FrmHttOutSourcApp.QueryOfflineMat" desc="">
		<![CDATA[
SELECT *
  FROM (SELECT *
          FROM PORT_HTT_BATCH_SAMPLE_RESULT
         WHERE result_no = ?
           AND MAT_STATUS = '20'
         ORDER BY MAT_NO) WHERE ROWNUM <= ?
	]]>
	</query>

	<query id="FrmHttOutSourcApp.UpdateBCMatStatus" desc="">
		<![CDATA[
		 UPDATE MAT_BC_M SET QCM_STAUS = '22' , (JUDGE_RESULT_CODE, JUDGE_RESULT) =
         (SELECT BASECODE, BASENAME
            FROM COM_BASE_INFO
           WHERE BASECODE ='40740705')  WHERE MAT_NO =?
	]]>
	</query>

	<query id="FrmHttOutSourcApp.UpdatePortVRPMatStatus" desc="">
		<![CDATA[
		 UPDATE PORT_HTT_BATCH_SAMPLE_RESULT T SET MAT_STATUS = '40' WHERE  MAT_NO =? AND PROCESS_SEQ = (SELECT real_process_seq FROM pln_zy_rcl_m WHERE heat_plan_no = t.heat_plan_no)
	]]>
	</query>

</queryMap>