<?xml version="1.0" encoding="UTF-8"?>
<!--
    $Author: hand  
    $Date: 2016-6-20 下午1:32:45  
    $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="CON_COLLECTION_TYPE" needAccessControl="false">
    <bm:fields>
        <bm:field name="type_id" databaseType="NUMBER" datatype="java.lang.Long" physicalName="TYPE_ID" prompt="CON_COLLECTION_TYPE.TYPE_ID"/>
        <bm:field name="type_code" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="TYPE_CODE" prompt="CON_COLLECTION_TYPE.TYPE_CODE"/>
        <bm:field name="type_name" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="TYPE_NAME" prompt="CON_COLLECTION_TYPE.TYPE_NAME"/>
        <bm:field name="start_date" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="START_DATE" prompt="CON_COLLECTION_TYPE.START_DATE"/>
        <bm:field name="end_date" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="END_DATE" prompt="CON_COLLECTION_TYPE.END_DATE"/>
        <bm:field name="collection_way" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="COLLECTION_WAY" prompt="CON_COLLECTION_TYPE.COLLECTION_WAY"/>
        <bm:field name="note" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="NOTE" prompt="CON_COLLECTION_TYPE.NOTE"/>
    </bm:fields>
    <bm:operations>
        <bm:operation name="insert">
            <bm:parameters>
                <bm:parameter name="type_id" input="false" output="true" outputPath="@type_id"/>
            </bm:parameters>
            <bm:update-sql><![CDATA[
               begin
               con_collection_type_pkg.insert_into(p_type_id =>${@type_id},
                                      p_type_code => ${@type_code},
                                      p_type_name => ${@type_name},
                                      p_start_date => ${@start_date},
                                      p_end_date => ${@end_date},
                                      p_collection_way =>${@collection_way},
                                      p_note => ${@note},
                                      p_user_id => ${session/@user_id});
               end;
            ]]></bm:update-sql>
        </bm:operation>
    </bm:operations>
    <bm:features>
        <f:standard-who/>
        <o:sequence-pk/>
    </bm:features>
    <bm:primary-key>
        <bm:pk-field name="type_id"/>
    </bm:primary-key>
</bm:model>
