<?xml version="1.0" encoding="UTF-8"?>
<!--
    $Author: ZLF  
    $Date: 2014-11-5 上午10:04:30  
    $Revision: 1.0  
    $Purpose: 
-->
<bm:model xmlns:o="leaf.database.local.oracle" xmlns:bm="http://www.leaf-framework.org/schema/bm" xmlns:f="leaf.database.features" alias="t1" baseTable="PRJ_SPECIAL_RETAIL" needAccessControl="false">
    <bm:fields>
        <bm:field name="special_retail_id" databaseType="NUMBER" datatype="java.lang.Long" physicalName="SPECIAL_RETAIL_ID" prompt="PRJ_SPECIAL_RETAIL.SPECIAL_RETAIL_ID"/>
        <bm:field name="special_retail_number" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="SPECIAL_RETAIL_NUMBER" prompt="PRJ_SPECIAL_RETAIL.SPECIAL_RETAIL_NUMBER"/>
        <bm:field name="user_id" databaseType="NUMBER" datatype="java.lang.Long" physicalName="USER_ID" prompt="PRJ_SPECIAL_RETAIL.USER_ID"/>
        <bm:field name="customer_name" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="CUSTOMER_NAME" prompt="PRJ_SPECIAL_RETAIL.CUSTOMER_NAME"/>
        <bm:field name="years_of_application" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="YEARS_OF_APPLICATION" prompt="PRJ_SPECIAL_RETAIL.YEARS_OF_APPLICATION"/>
        <bm:field name="product_name" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="PRODUCT_NAME" prompt="PRJ_SPECIAL_RETAIL.PRODUCT_NAME"/>
        <bm:field name="brand_id" databaseType="NUMBER" datatype="java.lang.Long" physicalName="BRAND_ID" prompt="PRJ_SPECIAL_RETAIL.BRAND_ID"/>
        <bm:field name="series_id" databaseType="NUMBER" datatype="java.lang.Long" physicalName="SERIES_ID" prompt="PRJ_SPECIAL_RETAIL.SERIES_ID"/>
        <bm:field name="model_id" databaseType="NUMBER" datatype="java.lang.Long" physicalName="MODEL_ID" prompt="PRJ_SPECIAL_RETAIL.MODEL_ID"/>
        <bm:field name="risk_open" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="RISK_OPEN" prompt="PRJ_SPECIAL_RETAIL.RISK_OPEN"/>
        <bm:field name="special_category" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="SPECIAL_CATEGORY" prompt="PRJ_SPECIAL_RETAIL.SPECIAL_CATEGORY"/>
        <bm:field name="status" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="STATUS" prompt="PRJ_SPECIAL_RETAIL.STATUS"/>
        <bm:field name="description" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="DESCRIPTION" prompt="PRJ_SPECIAL_RETAIL.DESCRIPTION"/>
        <bm:field name="special_content" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="SPECIAL_CONTENT" prompt="PRJ_SPECIAL_RETAIL.SPECIAL_CONTENT"/>
        <bm:field name="apply_reason" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="APPLY_REASON" prompt="PRJ_SPECIAL_RETAIL.APPLY_REASON"/>
        <bm:field name="document_category" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="DOCUMENT_CATEGORY" prompt="PRJ_SPECIAL_RETAIL.DOCUMENT_CATEGORY"/>
        <bm:field name="document_type" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="DOCUMENT_TYPE" prompt="PRJ_SPECIAL_RETAIL.DOCUMENT_TYPE"/>
        <bm:field name="company_id" databaseType="NUMBER" datatype="java.lang.Long" physicalName="COMPANY_ID" prompt="PRJ_SPECIAL_RETAIL.COMPANY_ID"/>
    </bm:fields>
    <bm:primary-key>
        <bm:pk-field name="special_retail_id"/>
    </bm:primary-key>
    <bm:features>
        <f:standard-who/>
        <o:sequence-pk autoReturn="true"/>
    </bm:features>
    <bm:operations>
        <bm:operation name="insert">
            <bm:update-sql><![CDATA[
    			begin
    				yonda_prj_project_pkg.insert_special_retail(p_company_id         =>${/session/@company_id},
                                  p_user_id              =>${/session/@user_id},
                                  p_customer_name        =>${@customer_name},
                                  p_years_of_application =>${@years_of_application},
                                  p_product_name         =>${@product_name},
                                  p_brand_id             =>${@brand_id},
                                  p_series_id            =>${@series_id},
                                  p_model_id             =>${@model_id},
                                  p_risk_open            =>${@risk_open},
                                  p_special_category     =>${@special_category},
                                  p_status               =>${@status},
                                  p_description          =>${@description},
                                  p_special_content      =>${@special_content},
                                  p_apply_reason         =>${@apply_reason},
                                  p_document_category	 =>${@document_category},
                                  p_document_type		 =>${@document_type},
                                  p_special_retail_id	 =>${@special_retail_id} );
    			end;
    		]]></bm:update-sql>
            <bm:parameters>
                <bm:parameter name="special_retail_id" output="true"/>
            </bm:parameters>
        </bm:operation>
    </bm:operations>
    <bm:query-fields>
        <bm:query-field field="special_retail_id" queryOperator="="/>
    </bm:query-fields>
</bm:model>
