<?xml version="1.0" encoding="UTF-8"?>
<queryMap desc="BOM清单保存数据SQL">

	<query id="IBomSaveDao.saveLineBom" desc="保存合同行与物料对应关系">
		<![CDATA[
				INSERT INTO SLM_ORD_LINE_BOM (DESGIN_KEY, BOM) VALUES (?, ?)
		        ]]>
	</query>

	<query id="IBomSaveDao.saveLineBomJG" desc="保存合同行与产品物料、接箍物料对应关系">
		<![CDATA[
				INSERT INTO SLM_ORD_LINE_BOM_JG (DESGIN_KEY, BOM, BOM_JG) VALUES (?, ?, ?)
		        ]]>
	</query>

	<query id="IBomSaveDao.saveBomA" desc="保存BOM电炉">
		<![CDATA[
				INSERT INTO SLM_ORD_DESIGN_BOM_A
                           (BOM,
                            IN_MATERIAL_NO,
                            IN_MATERIAL_DESC,
                            OUT_MATERIAL_NO,
                            OUT_MATERIAL_DESC)
                     VALUES
                           (?, ?, ?, ?, ?)		
		        ]]>
	</query>

	<query id="IBomSaveDao.saveBomB" desc="保存BOM-铸造">
		<![CDATA[
			INSERT INTO SLM_ORD_DESIGN_BOM_B
                       (BOM,
                        IN_MATERIAL_NO,
                        IN_MATERIAL_DESC,
                        OUT_MATERIAL_NO,
                        OUT_MATERIAL_DESC)
                 VALUES
                       (?, ?, ?, ?, ?)			
		         ]]>
	</query>

	<query id="IBomSaveDao.saveBomC" desc="保存BOM-锻造">
		<![CDATA[
			INSERT INTO SLM_ORD_DESIGN_BOM_C
                       (BOM,
                        IN_MATERIAL_NO,
                        IN_MATERIAL_DESC,
                        OUT_MATERIAL_NO,
                        OUT_MATERIAL_DESC)
                 VALUES
                        (?, ?, ?, ?, ?)
		        ]]>
	</query>

	<query id="IBomSaveDao.saveBomD" desc="保存BOM-轧管">
		<![CDATA[
			INSERT INTO SLM_ORD_DESIGN_BOM_D
                       (BOM,
                        IN_MATERIAL_NO,
                        IN_MATERIAL_DESC,
                        OUT_MATERIAL_NO,
                        OUT_MATERIAL_DESC)
                 VALUES
                        (?, ?, ?, ?, ?)
		        ]]>
	</query>

	<query id="IBomSaveDao.saveBomE" desc="保存BOM-镦拨扩">
		<![CDATA[
			INSERT INTO SLM_ORD_DESIGN_BOM_E
                       (BOM,
                        IN_MATERIAL_NO,
                        IN_MATERIAL_DESC,
                        OUT_MATERIAL_NO,
                        OUT_MATERIAL_DESC)
                 VALUES
                       (?, ?, ?, ?, ?)
		         ]]>
	</query>

	<query id="IBomSaveDao.saveBomF" desc="保存BOM-热处理">
		<![CDATA[
				INSERT INTO SLM_ORD_DESIGN_BOM_F
                      (BOM,
                       IN_MATERIAL_NO,
                       IN_MATERIAL_DESC,
                       OUT_MATERIAL_NO,
                       OUT_MATERIAL_DESC)
                VALUES
                      (?, ?, ?, ?, ?)
		       ]]>
	</query>

	<query id="IBomSaveDao.saveBomI" desc="保存BOM-加工">
		<![CDATA[
				INSERT INTO SLM_ORD_DESIGN_BOM_I
                      (BOM,
                       IN_MATERIAL_NO,
                       IN_MATERIAL_DESC,
                       OUT_MATERIAL_NO,
                       OUT_MATERIAL_DESC)
                VALUES
                      (?, ?, ?, ?, ?)
		       ]]>
	</query>

	<query id="IBomSaveDao.saveBom" desc="保存BOM清单">
		<![CDATA[
				 INSERT INTO SLM_ORD_DESIGN_BOM(
        MATERIAL_NO,
        MATERIAL_DESC,
        BOM,
        BOM_TYP,
        MSC_PLINE,
        WHOLE_BACKLOG,
        WHOLE_BACKLOG_DESC,
        MSC,
        MSC_DESC,
        GRADECODE,
        GRADENAME,
        SPEC_CODE_C,
        SPEC_NAME_C,
        SPEC_CODE_R,
        SPEC_NAME_R,
        SPEC_CODE_D,
        SPEC_NAME_D,
        SPEC_CODE_Z,
        SPEC_NAME_Z,
        A_IN_MATERIAL_NO,
        A_IN_MATERIAL_DESC,
        A_OUT_MATERIAL_NO,
        A_OUT_MATERIAL_DESC,
        B_IN_MATERIAL_NO,
        B_IN_MATERIAL_DESC,
        B_OUT_MATERIAL_NO,
        B_OUT_MATERIAL_DESC,
        C_IN_MATERIAL_NO,
        C_IN_MATERIAL_DESC,
        C_OUT_MATERIAL_NO,
        C_OUT_MATERIAL_DESC,
        D_IN_MATERIAL_NO,
        D_IN_MATERIAL_DESC,
        D_OUT_MATERIAL_NO,
        D_OUT_MATERIAL_DESC,
        E_IN_MATERIAL_NO,
        E_IN_MATERIAL_DESC,
        E_OUT_MATERIAL_NO,
        E_OUT_MATERIAL_DESC,
        F_IN_MATERIAL_NO,
        F_IN_MATERIAL_DESC,
        F_OUT_MATERIAL_NO,
        F_OUT_MATERIAL_DESC,
        J_IN_MATERIAL_NO,
        J_IN_MATERIAL_DESC,
        J_OUT_MATERIAL_NO,
        J_OUT_MATERIAL_DESC,
        I_IN_MATERIAL_NO,
        I_IN_MATERIAL_DESC,
        I_OUT_MATERIAL_NO,
        I_OUT_MATERIAL_DESC,
        PROCESS_CODE_CS)
 VALUES( 
        '#MATERIAL_NO#',
        '#MATERIAL_DESC#',
         SYS_GUID(),
        '#BOM_TYP#',
        '#MSC_PLINE#',
        '#WHOLE_BACKLOG#',
        '#WHOLE_BACKLOG_DESC#',
        '#MSC#',
        '#MSC_DESC#',
        '#GRADECODE#',
        '#GRADENAME#',
        '#SPEC_CODE_C#',
        '#SPEC_NAME_C#',
        '#SPEC_CODE_R#',
        '#SPEC_NAME_R#',
        '#SPEC_CODE_D#',
        '#SPEC_NAME_D#',
        '#SPEC_CODE_Z#',
        '#SPEC_NAME_Z#',
        '#A_IN_MATERIAL_NO#',
        '#A_IN_MATERIAL_DESC#',
        '#A_OUT_MATERIAL_NO#',
        '#A_OUT_MATERIAL_DESC#',
        '#B_IN_MATERIAL_NO#',
        '#B_IN_MATERIAL_DESC#',
        '#B_OUT_MATERIAL_NO#',
        '#B_OUT_MATERIAL_DESC#',
        '#C_IN_MATERIAL_NO#',
        '#C_IN_MATERIAL_DESC#',
        '#C_OUT_MATERIAL_NO#',
        '#C_OUT_MATERIAL_DESC#',
        '#D_IN_MATERIAL_NO#',
        '#D_IN_MATERIAL_DESC#',
        '#D_OUT_MATERIAL_NO#',
        '#D_OUT_MATERIAL_DESC#',
        '#E_IN_MATERIAL_NO#',
        '#E_IN_MATERIAL_DESC#',
        '#E_OUT_MATERIAL_NO#',
        '#E_OUT_MATERIAL_DESC#',
        '#F_IN_MATERIAL_NO#',
        '#F_IN_MATERIAL_DESC#',
        '#F_OUT_MATERIAL_NO#',
        '#F_OUT_MATERIAL_DESC#',
        '#J_IN_MATERIAL_NO#',
        '#J_IN_MATERIAL_DESC#',
        '#J_OUT_MATERIAL_NO#',
        '#J_OUT_MATERIAL_DESC#',
        '#I_IN_MATERIAL_NO#',
        '#I_IN_MATERIAL_DESC#',
        '#I_OUT_MATERIAL_NO#',
        '#I_OUT_MATERIAL_DESC#',
        '#PROCESS_CODE_CS#')		
		]]>
	</query>

	<query id="IBomSaveDao.updateBom" desc="修改BOM清单">
		<![CDATA[
UPDATE SLM_ORD_DESIGN_BOM T
   SET T.MATERIAL_NO         = '#MATERIAL_NO#',
       T.MATERIAL_DESC       = '#MATERIAL_DESC#',
       T.BOM_TYP             = '#BOM_TYP#',
       T.MSC_PLINE           = '#MSC_PLINE#',
       T.WHOLE_BACKLOG       = '#WHOLE_BACKLOG#',
       T.WHOLE_BACKLOG_DESC  = '#WHOLE_BACKLOG_DESC#',
       T.MSC                 = '#MSC#',
       T.MSC_DESC            = '#MSC_DESC#',
       T.GRADECODE           = '#GRADECODE#',
       T.GRADENAME           = '#GRADENAME#',
       T.SPEC_CODE_C         = '#SPEC_CODE_C#',
       T.SPEC_NAME_C         = '#SPEC_NAME_C#',
       T.SPEC_CODE_R         = '#SPEC_CODE_R#',
       T.SPEC_NAME_R         = '#SPEC_NAME_R#',
       T.SPEC_CODE_D         = '#SPEC_CODE_D#',
       T.SPEC_NAME_D         = '#SPEC_NAME_D#',
       T.SPEC_CODE_Z         = '#SPEC_CODE_Z#',
       T.SPEC_NAME_Z         = '#SPEC_NAME_Z#',
       T.A_IN_MATERIAL_NO    = '#A_IN_MATERIAL_NO#',
       T.A_IN_MATERIAL_DESC  = '#A_IN_MATERIAL_DESC#',
       T.A_OUT_MATERIAL_NO   = '#A_OUT_MATERIAL_NO#',
       T.A_OUT_MATERIAL_DESC = '#A_OUT_MATERIAL_DESC#',
       T.B_IN_MATERIAL_NO    = '#B_IN_MATERIAL_NO#',
       T.B_IN_MATERIAL_DESC  = '#B_IN_MATERIAL_DESC#',
       T.B_OUT_MATERIAL_NO   = '#B_OUT_MATERIAL_NO#',
       T.B_OUT_MATERIAL_DESC = '#B_OUT_MATERIAL_DESC#',
       T.C_IN_MATERIAL_NO    = '#C_IN_MATERIAL_NO#',
       T.C_IN_MATERIAL_DESC  = '#C_IN_MATERIAL_DESC#',
       T.C_OUT_MATERIAL_NO   = '#C_OUT_MATERIAL_NO#',
       T.C_OUT_MATERIAL_DESC = '#C_OUT_MATERIAL_DESC#',
       T.D_IN_MATERIAL_NO    = '#D_IN_MATERIAL_NO#',
       T.D_IN_MATERIAL_DESC  = '#D_IN_MATERIAL_DESC#',
       T.D_OUT_MATERIAL_NO   = '#D_OUT_MATERIAL_NO#',
       T.D_OUT_MATERIAL_DESC = '#D_OUT_MATERIAL_DESC#',
       T.E_IN_MATERIAL_NO    = '#E_IN_MATERIAL_NO#',
       T.E_IN_MATERIAL_DESC  = '#E_IN_MATERIAL_DESC#',
       T.E_OUT_MATERIAL_NO   = '#E_OUT_MATERIAL_NO#',
       T.E_OUT_MATERIAL_DESC = '#E_OUT_MATERIAL_DESC#',
       T.F_IN_MATERIAL_NO    = '#F_IN_MATERIAL_NO#',
       T.F_IN_MATERIAL_DESC  = '#F_IN_MATERIAL_DESC#',
       T.F_OUT_MATERIAL_NO   = '#F_OUT_MATERIAL_NO#',
       T.F_OUT_MATERIAL_DESC = '#F_OUT_MATERIAL_DESC#',
       T.J_IN_MATERIAL_NO    = '#J_IN_MATERIAL_NO#',
       T.J_IN_MATERIAL_DESC  = '#J_IN_MATERIAL_DESC#',
       T.J_OUT_MATERIAL_NO   = '#J_OUT_MATERIAL_NO#',
       T.J_OUT_MATERIAL_DESC = '#J_OUT_MATERIAL_DESC#',
       T.I_IN_MATERIAL_NO    = '#I_IN_MATERIAL_NO#',
       T.I_IN_MATERIAL_DESC  = '#I_IN_MATERIAL_DESC#',
       T.I_OUT_MATERIAL_NO   = '#I_OUT_MATERIAL_NO#',
       T.I_OUT_MATERIAL_DESC = '#I_OUT_MATERIAL_DESC#',
       T.PROCESS_CODE_CS     = '#PROCESS_CODE_CS#'
 WHERE  T.BOM = '#BOM#'	
		]]>
	</query>

	<query id="IBomSaveDao.saveBaseMaterialA" desc="保存基础物料-电炉">
		<![CDATA[
			INSERT INTO SLM_BASE_MATERIAL_A
                       (IN_MATERIAL_NO, IN_MATERIAL_DESC, OUT_MATERIAL_NO, OUT_MATERIAL_DESC)
                        VALUES 
                       (?, ?, ?, ?)
		        ]]>
	</query>

	<query id="IBomSaveDao.saveBaseMaterialB" desc="保存基础物料-铸造">
		<![CDATA[
			INSERT INTO SLM_BASE_MATERIAL_B
                       (IN_MATERIAL_NO, IN_MATERIAL_DESC, OUT_MATERIAL_NO, OUT_MATERIAL_DESC)
                        VALUES 
                       (?, ?, ?, ?)
		        ]]>
	</query>

	<query id="IBomSaveDao.saveBaseMaterialC" desc="保存基础物料-锻造">
		<![CDATA[
			INSERT INTO SLM_BASE_MATERIAL_C
                       (IN_MATERIAL_NO, IN_MATERIAL_DESC, OUT_MATERIAL_NO, OUT_MATERIAL_DESC)
                        VALUES 
                       (?, ?, ?, ?)
		        ]]>
	</query>

	<query id="IBomSaveDao.saveBaseMaterialD" desc="保存基础物料-轧管">
		<![CDATA[
			INSERT INTO SLM_BASE_MATERIAL_D
                       (IN_MATERIAL_NO, IN_MATERIAL_DESC, OUT_MATERIAL_NO, OUT_MATERIAL_DESC)
                        VALUES 
                       (?, ?, ?, ?)
		        ]]>
	</query>

	<query id="IBomSaveDao.saveBaseMaterialE" desc="保存基础物料-墩拔扩">
		<![CDATA[
			INSERT INTO SLM_BASE_MATERIAL_E
                       (IN_MATERIAL_NO, IN_MATERIAL_DESC, OUT_MATERIAL_NO, OUT_MATERIAL_DESC)
                        VALUES 
                       (?, ?, ?, ?)
		        ]]>
	</query>

	<query id="IBomSaveDao.saveBaseMaterialF" desc="保存基础物料-热处理">
		<![CDATA[
			INSERT INTO SLM_BASE_MATERIAL_F
                       (IN_MATERIAL_NO, IN_MATERIAL_DESC, OUT_MATERIAL_NO, OUT_MATERIAL_DESC)
                        VALUES 
                       (?, ?, ?, ?)
		        ]]>
	</query>

	<query id="IBomSaveDao.saveBaseMaterialI" desc="保存基础数据-加工">
		<![CDATA[
			INSERT INTO SLM_BASE_MATERIAL_I
                       (IN_MATERIAL_SET, OUT_MATERIAL_NO, OUT_MATERIAL_DESC)
                 VALUES
                       (?, ?, ?)
		        ]]>
	</query>

	<query id="IBomSaveDao.saveBaseMaterialIIn" desc="保存-投入物料集合-加工">
		<![CDATA[
			INSERT INTO SLM_BASE_MATERIAL_I_IN
                       (IN_MATERIAL_SET, IN_MATERIAL_NO, IN_MATERIAL_DESC)
                 VALUES
                       (?, ?, ?)
		        ]]>
	</query>

	<query id="IBomSaveDao.saveBaseMaterialJ" desc="保存基础物料-接箍">
		<![CDATA[
			INSERT INTO SLM_BASE_MATERIAL_J
                       (IN_MATERIAL_NO, IN_MATERIAL_DESC, OUT_MATERIAL_NO, OUT_MATERIAL_DESC)
                        VALUES 
                       (?, ?, ?, ?)
		        ]]>
	</query>



	<query id="IBomSaveDao.saveBaseMaterial" desc="保存基础物料">
		<![CDATA[
			INSERT INTO SLM_BASE_MATERIAL(
        MATERIAL_NO,
        MATERIAL_DESC,
        PRODUCCODE,
        PRODUCNAME,
        PRODUC_JX,
        PRODUC_ENG,
        STD_STYLE,
        STD_STYLE_DESC,
        STEELCODE,
        STEELNAME,
        GRADECODE,
        GRADENAME,
        DIMATER,
        HEIGHT,
        SPEC_CODE,
        SPEC_NAME,
        MODEL_CODE,
        MODEL_DESC,
        OUTSRC_ALLOW,
        FIRST_PRDC,
        CREATE_NAME,
        CREATE_TIME,
        UPDATE_NAME,
        UPDATE_TIME,
        DELETE_NAME,
        DELETE_TIME)
 VALUES( 
        '#MATERIAL_NO#',
        '#MATERIAL_DESC#',
        '#PRODUCCODE#',
        '#PRODUCNAME#',
        '#PRODUC_JX#',
        '#PRODUC_ENG#',
        '#STD_STYLE#',
        '#STD_STYLE_DESC#',
        '#STEELCODE#',
        '#STEELNAME#',
        '#GRADECODE#',
        '#GRADENAME#',
        '#DIMATER#',
        '#HEIGHT#',
        '#SPEC_CODE#',
        '#SPEC_NAME#',
        '#MODEL_CODE#',
        '#MODEL_DESC#',
        '#OUTSRC_ALLOW#',
        '#FIRST_PRDC#',
        NULL,
        SYSDATE,
        NULL,
        NULL,
        NULL,
        NULL)
		        ]]>
	</query>

	<query id="IBomSaveDao.saveBaseMaterialAPl" desc="保存 基础数据-电炉投入产出-产线能力">
		<![CDATA[
		INSERT INTO SLM_BASE_MATERIAL_A_PL
                   (IN_MATERIAL_NO,
                    OUT_MATERIAL_NO,
                    PLINE_CODE,
                    PLINE_NAME)
             VALUES
                   (?, ?, ?, ?)
		        ]]>
	</query>

	<query id="IBomSaveDao.saveBaseMaterialBPl" desc="保存 基础数据-铸造投入产出-产线能力">
		<![CDATA[
		INSERT INTO SLM_BASE_MATERIAL_B_PL
  (IN_MATERIAL_NO,
   OUT_MATERIAL_NO,
   PLINE_CODE,
   PLINE_NAME)
VALUES
  (?, ?, ?, ?)
		        ]]>
	</query>

	<query id="IBomSaveDao.saveBaseMaterialCPl" desc="保存 基础数据-锻造投入产出-产线能力">
		<![CDATA[
		INSERT INTO SLM_BASE_MATERIAL_C_PL
  (IN_MATERIAL_NO,
   OUT_MATERIAL_NO,
   PLINE_CODE,
   PLINE_NAME)
VALUES
  (?, ?, ?, ?)
		        ]]>
	</query>

	<query id="IBomSaveDao.saveBaseMaterialDPl" desc="保存 基础数据-轧管投入产出-产线能力">
		<![CDATA[
		INSERT INTO SLM_BASE_MATERIAL_D_PL
  (IN_MATERIAL_NO,
   OUT_MATERIAL_NO,
   PLINE_CODE,
   PLINE_NAME)
VALUES
  (?, ?, ?, ?)
		        ]]>
	</query>

	<query id="IBomSaveDao.saveBaseMaterialEPl" desc="保存 基础数据-墩拔扩投入产出-产线能力">
		<![CDATA[
		INSERT INTO SLM_BASE_MATERIAL_E_PL
  (IN_MATERIAL_NO,
   OUT_MATERIAL_NO,
   PLINE_CODE,
   PLINE_NAME)
VALUES
  (?, ?, ?, ?)
		        ]]>
	</query>

	<query id="IBomSaveDao.saveBaseMaterialFPl" desc="保存 基础数据-热处理投入产出-产线能力">
		<![CDATA[
		INSERT INTO SLM_BASE_MATERIAL_F_PL
  (IN_MATERIAL_NO,
   OUT_MATERIAL_NO,
   PLINE_CODE,
   PLINE_NAME)
VALUES
  (?, ?, ?, ?)
		        ]]>
	</query>

	<query id="IBomSaveDao.saveBaseMaterialJPl" desc="保存 基础数据-接箍投入产出-产线能力">
		<![CDATA[
		INSERT INTO SLM_BASE_MATERIAL_J_PL
  (IN_MATERIAL_NO,
   OUT_MATERIAL_NO,
   PLINE_CODE,
   PLINE_NAME)
VALUES
  (?, ?, ?, ?)
		        ]]>
	</query>

	<query id="IBomSaveDao.saveBaseMaterialIPl" desc="保存 基础数据-加工投入产出-产线能力">
		<![CDATA[
		INSERT INTO SLM_BASE_MATERIAL_I_PL
  (OUT_MATERIAL_NO, PLINE_CODE, PLINE_NAME)
VALUES
  (?, ?, ?)
		        ]]>
	</query>

	<query id="IBomSaveDao.saveBomK" desc="保存BOM-加工">
		<![CDATA[
				INSERT INTO SLM_ORD_DESIGN_BOM_K
                      (BOM,
                       IN_MATERIAL_NO,
                       IN_MATERIAL_DESC,
                       OUT_MATERIAL_NO,
                       OUT_MATERIAL_DESC,
                       GROUP_NUM,
                       MARK)
                VALUES
                      (?, ?, ?, ?, ?,?,?)
		       ]]>
	</query>

	<query id="IBomSaveDao.saveBaseMaterialK" desc="保存基础物料-加工">
		<![CDATA[
			INSERT INTO SLM_BASE_MATERIAL_K
                       (IN_MATERIAL_NO, IN_MATERIAL_DESC, OUT_MATERIAL_NO, OUT_MATERIAL_DESC)
                        VALUES 
                       (?, ?, ?, ?)
		        ]]>
	</query>

	<query id="IBomSaveDao.saveBaseMaterialKPl" desc="保存 基础数据-加工投入产出-产线能力">
		<![CDATA[
		INSERT INTO SLM_BASE_MATERIAL_K_PL
  (IN_MATERIAL_NO,
   OUT_MATERIAL_NO,
   PLINE_CODE,
   PLINE_NAME,
   IN_MATERIAL_DESC,
   OUT_MATERIAL_DESC)
VALUES
  (?, ?, ?, ?, ?, ?)
		        ]]>
	</query>

	<query id="IBomSaveDao.saveBaseMaterialH" desc="保存基础物料-接箍加工">
		<![CDATA[
			INSERT INTO SLM_BASE_MATERIAL_H
                       (IN_MATERIAL_NO, IN_MATERIAL_DESC, OUT_MATERIAL_NO, OUT_MATERIAL_DESC)
                        VALUES 
                       (?, ?, ?, ?)
		        ]]>
	</query>

	<query id="IBomSaveDao.saveBaseMaterialHPl" desc="保存 基础数据-接箍加工-产线能力">
		<![CDATA[
	INSERT INTO SLM_BASE_MATERIAL_H_PL
  (IN_MATERIAL_NO,
   IN_MATERIAL_DESC,
   OUT_MATERIAL_NO,
   OUT_MATERIAL_DESC,
   PLINE_CODE,
   PLINE_NAME)
VALUES
  (?, ?, ?, ?, ?, ?)
		        ]]>
	</query>

	<query id="IBomSaveDao.saveBomH" desc="保存BOM-接箍加工">
		<![CDATA[
				INSERT INTO SLM_ORD_DESIGN_BOM_H
                      (BOM,
                       IN_MATERIAL_NO,
                       IN_MATERIAL_DESC,
                       OUT_MATERIAL_NO,
                       OUT_MATERIAL_DESC
                      )
                VALUES
                      (?, ?, ?, ?, ?)
		       ]]>
	</query>

</queryMap>