<?xml version="1.0" encoding="UTF-8"?>
<queryMap desc="权限功能表查询">

    <query id="CrmBaseMaterial.saveBaseMaterial" desc="保存基础物料">
        <![CDATA[
			INSERT INTO CRM_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,
        DATA_STATUS,
        DATA_TIME,
        AUTO_CRAFT)
 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#',
        DECODE('#FIRST_PRDC#', '1', '首次生产', '0', '已生产过'),
        NULL,
        SYSDATE,
        NULL,
        NULL,
        NULL,
        NULL,
        '0',
        SYSDATE,
        DECODE(‘0’, '1', '是', '0', '否'))
		        ]]>
    </query>

    <query id="CrmBaseMaterial.updateBaseMaterial" desc="保存基础物料">
        <![CDATA[
         INSERT INTO CRM_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,
        AUTO_CRAFT,
        MATERIAL_TYPE_MAX,
        MATERIAL_TYPE_MID,
        MATERIAL_TYPE_MIN,
        PROPERTY_TYPE_1,
        PROPERTY_TYPE_2,
        TP_SERIES,
        SPECIAL_MODEL,
        UPMARKET_PRODUCT,
        HIGH_ADDITIONAL_PRODUCT,
        MATERIAL_TYPE_MAX_DESC,
        MATERIAL_TYPE_MID_DESC,
        MATERIAL_TYPE_MIN_DESC,
        PROPERTY_TYPE_1_DESC,
        PROPERTY_TYPE_2_DESC,
        TOTAL_COST,
        DATA_STATUS,
        IS_FLAG,
        DATA_TIME)
  SELECT
       T.MATERIAL_NO,
       T.MATERIAL_DESC,
       T.PRODUCCODE,
       T.PRODUCNAME,
       T.PRODUC_JX,
       T.PRODUC_ENG,
       T.STD_STYLE,
       T.STD_STYLE_DESC,
       T.STEELCODE,
       T.STEELNAME,
       T.GRADECODE,
       T.GRADENAME,
       T.DIMATER,
       T.HEIGHT,
       T.SPEC_CODE,
       T.SPEC_NAME,
       T.MODEL_CODE,
       T.MODEL_DESC,
       DECODE(T.OUTSRC_ALLOW, '1', '是', '0', '否') OUTSRC_ALLOW,
       DECODE(T.FIRST_PRDC, '1', '首次生产', '0', '已生产过') FIRST_PRDC,
       T.CREATE_NAME,
       T.CREATE_TIME,
       T.UPDATE_NAME,
       T.UPDATE_TIME,
       T.DELETE_NAME,
       T.DELETE_TIME,
       DECODE(T.AUTO_CRAFT, '1', '是', '0', '否') AUTO_CRAFT,
       T.MATERIAL_TYPE_MAX,
       T.MATERIAL_TYPE_MID,
       T.MATERIAL_TYPE_MIN,
       T.PROPERTY_TYPE_1,
       T.PROPERTY_TYPE_2,
       DECODE(T.TP_SERIES, '1', '是', '0', '否') TP_SERIES,
       DECODE(T.SPECIAL_MODEL, '1', '是', '0', '否') SPECIAL_MODEL,
       DECODE(T.UPMARKET_PRODUCT, '1', '是', '0', '否') UPMARKET_PRODUCT,
       DECODE(T.HIGH_ADDITIONAL_PRODUCT, '1', '是', '0', '否') HIGH_ADDITIONAL_PRODUCT,
       T.MATERIAL_TYPE_MAX_DESC,
       T.MATERIAL_TYPE_MID_DESC,
       T.MATERIAL_TYPE_MIN_DESC,
       T.PROPERTY_TYPE_1_DESC,
       T.PROPERTY_TYPE_2_DESC,
       T.TOTAL_COST,
       '#DATA_STATUS#',
       '0',
       SYSDATE
 FROM SLM_BASE_MATERIAL T
 WHERE
T.MATERIAL_NO = '#MATERIAL_NO#'
		        ]]>
    </query>

</queryMap>