<?xml version="1.0" encoding="UTF-8"?>
<!--
    $Author: qm  
    $Date: 2014-4-21 上午9:52:31  
    $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="AST_CAR_LICENSE">
    <bm:fields>
        <bm:field name="ast_car_license_id" databaseType="NUMBER" datatype="java.lang.Long" physicalName="AST_CAR_LICENSE_ID" prompt="AST_CAR_LICENSE.AST_CAR_LICENSE_ID"/>
        <bm:field name="item_detail_id" databaseType="NUMBER" datatype="java.lang.Long" insertExpression="${/parameter/@item_detail_id}" physicalName="ITEM_DETAIL_ID" prompt="AST_CAR_LICENSE.ITEM_DETAIL_ID"/>
        <bm:field name="license_number" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="LICENSE_NUMBER" prompt="AST_CAR_LICENSE.LICENSE_NUMBER" required="true"/>
        <bm:field name="on_car_date" databaseType="DATE" datatype="java.util.Date" physicalName="ON_CAR_DATE" prompt="AST_CAR_LICENSE.ON_CAR_DATE" required="true"/>
        <bm:field name="license_fee" databaseType="NUMBER" datatype="java.lang.Long" physicalName="LICENSE_FEE" prompt="AST_CAR_LICENSE.LICENSE_FEE"/>
        <bm:field name="license_attach_fee" databaseType="NUMBER" datatype="java.lang.Long" physicalName="LICENSE_ATTACH_FEE" prompt="AST_CAR_LICENSE.LICENSE_ATTACH_FEE"/>
        <bm:field name="shh_license_flag" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="SHH_LICENSE_FLAG" prompt="AST_CAR_LICENSE.SHH_LICENSE_FLAG"/>
        <bm:field name="purchase_date" databaseType="DATE" datatype="java.util.Date" physicalName="PURCHASE_DATE" prompt="AST_CAR_LICENSE.PURCHASE_DATE"/>
        <bm:field name="purchase_price" databaseType="NUMBER" datatype="java.lang.Long" physicalName="PURCHASE_PRICE" prompt="AST_CAR_LICENSE.PURCHASE_PRICE"/>
        <bm:field name="license_end_date" databaseType="DATE" datatype="java.util.Date" physicalName="LICENSE_END_DATE" prompt="AST_CAR_LICENSE.LICENSE_END_DATE"/>
        <bm:field name="enabled_flag" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="ENABLED_FLAG" prompt="AST_CAR_LICENSE.ENABLED_FLAG"/>
        <bm:field name="mortgage_date" databaseType="DATE" datatype="java.util.Date" physicalName="MORTGAGE_DATE" prompt="AST_CAR_LICENSE.MORTGAGE_DATE"/>
        <bm:field name="license_flag" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="LICENSE_FLAG" prompt="AST_CAR_LICENSE.LICENSE_FLAG"/>
        <bm:field name="license_type" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="LICENSE_TYPE" prompt="AST_CAR_LICENSE.LICENSE_TYPE"/>
        <bm:field name="mortgage_flag" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="MORTGAGE_FLAG" prompt="AST_CAR_LICENSE.MORTGAGE_FLAG"/>
        <bm:field name="mortgage_by" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="MORTGAGE_BY" prompt="AST_CAR_LICENSE.MORTGAGE_BY"/>
        <bm:field name="license_address" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="LICENSE_ADDRESS" prompt="AST_CAR_LICENSE.LICENSE_ADDRESS"/>
        <bm:field name="license_end_transfer_fee" databaseType="NUMBER" datatype="java.lang.Long" physicalName="LICENSE_END_TRANSFER_FEE" prompt="AST_CAR_LICENSE.LICENSE_END_TRANSFER_FEE"/>
        <bm:field name="cashflow_flag" databaseType="VARCHAR2" datatype="java.lang.String"/>
        <bm:field name="ref_v01"/>
        <bm:field name="mortgage_to" databaseType="VARCHAR2" datatype="java.lang.String"/>
    </bm:fields>
    <bm:operations>
        <bm:operation name="insert">
            <bm:update-sql><![CDATA[
    			begin
    				ast_car_pkg.insert_car_license(p_item_detail_id           =>${/parameter/@item_detail_id},
                               p_license_number           =>${@license_number},
                               p_on_car_date              =>${@on_car_date},
                               p_license_fee              =>${@license_fee},
                               p_license_attach_fee       =>${@license_attach_fee},
                               p_shh_license_flag         =>${@shh_license_flag},
                               p_enabled_flag             =>${@enabled_flag},
                               p_purchase_date            =>${@purchase_date},
                               p_purchase_price           =>${@purchase_price},
                               p_license_end_date         =>${@license_end_date},
                               p_mortgage_date            =>${@mortgage_date},
                               p_license_flag             =>${@license_flag},
                               p_license_type             =>${@license_type},
                               p_mortgage_flag            =>${@mortgage_flag},
                               p_mortgage_by		      =>${@mortgage_by},
                               p_license_end_transfer_fee =>${@license_end_transfer_fee},
                               p_license_address		  =>${@license_address},
                               p_ref_v01                  =>${@ref_v01},
                               p_user_id                  =>${/session/@user_id},
                               p_mortgage_to			  =>${@mortgage_to});
    			end;
    		]]></bm:update-sql>
        </bm:operation>
        <bm:operation name="update">
            <bm:update-sql><![CDATA[
                 begin
    				ast_car_pkg.update_car_license(p_ast_car_license_id =>${@ast_car_license_id},
    						   p_item_detail_id           =>${/parameter/@item_detail_id},
                               p_license_number           =>${@license_number},
                               p_on_car_date              =>${@on_car_date},
                               p_license_fee              =>${@license_fee},
                               p_license_attach_fee       =>${@license_attach_fee},
                               p_shh_license_flag         =>${@shh_license_flag},
                               p_enabled_flag             =>${@enabled_flag},
                               p_purchase_date            =>${@purchase_date},
                               p_purchase_price           =>${@purchase_price},
                               p_license_end_date         =>${@license_end_date},
                               p_mortgage_date            =>${@mortgage_date},
                               p_license_flag             =>${@license_flag},
                               p_license_type             =>${@license_type},
                               p_mortgage_flag            =>${@mortgage_flag},
                               p_mortgage_by		      =>${@mortgage_by},
                               p_license_end_transfer_fee =>${@license_end_transfer_fee},
                               p_license_address		  =>${@license_address},
                               p_ref_v01                  =>${@ref_v01},
                               p_user_id                  =>${/session/@user_id},
                               p_mortgage_to			  =>${@mortgage_to});
    			end;
            ]]></bm:update-sql>
        </bm:operation>
    </bm:operations>
    <bm:features>
        <f:standard-who/>
        <o:sequence-pk sequenceName="ast_car_license_s"/>
    </bm:features>
    <bm:primary-key>
        <bm:pk-field name="ast_car_license_id"/>
    </bm:primary-key>
    <bm:query-fields>
        <bm:query-field field="item_detail_id" queryOperator="="/>
    </bm:query-fields>
</bm:model>
