<?xml version="1.0" encoding="UTF-8"?>
<queryMap desc="FrmBalance">

<query id = "FrmBalance.DoDelete" desc = "删除">
  DELETE FROM BZTQNQD02 T WHERE T.ASKPLAN_ID = ? AND CAL_TYPE = ?
</query>

 <query id = "FrmBalance.DoAdd" desc = "新增炼钢配料记录表">
     <![CDATA[
      INSERT INTO BZTQNQD02(
        REC_CREATOR,
        REC_CREATE_TIME,
        WHOLE_BACKLOG_NAME,
        ORD_NO,
		ORD_SEQ,
		ASKPLAN_ID,
		OUT_SG_SIGN,
		IS_OUT_SOURCING,
		OUT_STEEL_TYPE_CODE,
		MEMO,
		CAL_TYPE,
		IS_SUCCESS
        )
 VALUES( 
        '#REC_CREATOR#',
        '#REC_CREATE_TIME#',
        '#WHOLE_BACKLOG_NAME#',
        '#ORD_NO#',
        '#ORD_SEQ#',
        '#ASKPLAN_ID#',
        '#OUT_SG_SIGN#',
        '#IS_OUT_SOURCING#',
        '#OUT_STEEL_TYPE_CODE#',
        '#MEMO#',
        '#CAL_TYPE#',
        '#IS_SUCCESS#'
        )
      ]]>
 </query>
  <query id = "FrmBalance.Insert" desc ="新增">
    INSERT INTO BZTQNQD04(
        REC_CREATOR,
        REC_CREATE_TIME,
        OUT_STEEL_TYPE_CODE,
        PROCESS_CODE,
        MATERIAL_NAME,
        MATERIAL_CODE,
        UNIT_PRICE,
        ALLOY_WT,
        ALLOY_PRICE,
        ALLOY_PRICE_NOW,
        ALLOY_PRICE_NEXT,
        UNIT_PRICE_NOW,
        UNIT_PRICE_NEXT)
 VALUES( 
        '#REC_CREATOR#',
        to_char(sysdate,'yyyy-mm-dd hh24:mi:ss'),
        '#OUT_STEEL_TYPE_CODE#',
        '#PROCESS_CODE#',
        '#MATERIAL_NAME#',
        '#MATERIAL_CODE#',
        '#UNIT_PRICE#',
        '#ALLOY_WT#',
        '#ALLOY_PRICE#',
        '#ALLOY_PRICE_NOW#',
        '#ALLOY_PRICE_NEXT#',
        '#UNIT_PRICE_NOW#',
        '#UNIT_PRICE_NEXT#')
    </query>
    <quer id = "FrmBalance06.Insert" desc = "新增">
	    INSERT INTO BZTQNQD06(
	    LTEM_NUM,
	    WHOLE_BACKLOG_CODE,
	    DANHAO,
	    UNIT_PRICE,
	    PROCESS_COST,
	    PROCESS_COST_NOW,
	    PROCESS_COST_NEXT,
	    RP_CODE,
	    PROCESS_CODE,
	    MATERIAL_CODE,
	    UNIT_PRICE_NOW,
	    UNIT_PRICE_NEXT,
	    MAT_ORIGIN,
	    CLASS_INTERVAL,
	    REC_CREATOR,
	    REC_CREATE_TIME,
	    SERIAL_NUM,
	    SPARE_ITEM_N1
	    )
	    VALUES
	    (
	     '#LTEM_NUM#',
	     '#WHOLE_BACKLOG_CODE#',
	     '#DANHAO#',
	     '#UNIT_PRICE#',
	     '#PROCESS_COST#',
	     '#PROCESS_COST_NOW#',
	     '#PROCESS_COST_NEXT#',
	     '#RP_CODE#',
	     '#PROCESS_CODE#',
	     '#MATERIAL_CODE#',
	     '#UNIT_PRICE_NOW#',
	     '#UNIT_PRICE_NEXT#',
	     '#MAT_ORIGIN#',
	     '#CLASS_INTERVAL#',
	     '#REC_CREATOR#',
	      TO_CHAR(SYSDATE,'yyyy-mm-dd hh24:mi:ss'),
	      '#SERIAL_NUM#',
	      '#SPARE_ITEM_N1#'
	    )
    </quer>
    <quer id = "FrmBalance03.Insert" desc = "新增">
	    INSERT INTO BZTQNQD03(
		   REC_CREATOR,
		   REC_CREATE_TIME,
		   WHOLE_BACKLOG_NAME,
		   WHOLE_BACKLOG,
		   LTEM_NUM,
		   OUT_SG_SIGN,
		   PROCESS_CODE,
		   OUT_STEEL_TYPE_CODE,
		   SUB_BACKLOG,
		   UNIT_PRICE
	    )
	    VALUES
	    (
	     '#REC_CREATOR#',
	    TO_CHAR(SYSDATE,'yyyy-mm-dd hh24:mi:ss'),
	     '#WHOLE_BACKLOG_NAME#',
	     '#WHOLE_BACKLOG#',
	     '#LTEM_NUM#',
	     '#OUT_SG_SIGN#',
	     '#PROCESS_CODE#',
	     '#OUT_STEEL_TYPE_CODE#',
	     '#SUB_BACKLOG#',
	     '#UNIT_PRICE#'
	    )
    </quer>
</queryMap>