<?xml version="1.0" encoding="UTF-8"?>
<!--
    $Author: jack  
    $Date: 2014-11-18 下午2:06:59  
    $Revision: 1.0  
    $Purpose: 
-->
<bm:model xmlns:bm="http://www.leaf-framework.org/schema/bm" xmlns:f="leaf.database.features" alias="t1" baseTable="CON_CONTRACT_ITEM_DETAIL">
    <bm:fields>
        <bm:field name="item_detail_id" databaseType="NUMBER" datatype="java.lang.Long" physicalName="ITEM_DETAIL_ID" prompt="CON_CONTRACT_ITEM_DETAIL.ITEM_DETAIL_ID"/>
        <bm:field name="insurance_location" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="INSURANCE_LOCATION" prompt="CON_CONTRACT_ITEM_DETAIL.INSURANCE_LOCATION"/>
        <bm:field name="insurance_company" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="INSURANCE_COMPANY" prompt="CON_CONTRACT_ITEM_DETAIL.INSURANCE_COMPANY"/>
        <bm:field name="insurance_number" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="INSURANCE_NUMBER" prompt="CON_CONTRACT_ITEM_DETAIL.INSURANCE_NUMBER"/>
        <bm:field name="insurance_type" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="INSURANCE_TYPE" prompt="CON_CONTRACT_ITEM_DETAIL.INSURANCE_TYPE"/>
        <bm:field name="contract_lease_item_id" databaseType="NUMBER" datatype="java.lang.Long" physicalName="CONTRACT_LEASE_ITEM_ID" prompt="CON_CONTRACT_ITEM_DETAIL.CONTRACT_LEASE_ITEM_ID"/>
        <bm:field name="compulsory_insurance_number" databaseType="NUMBER" datatype="java.lang.Long" physicalName="COMPULSORY_INSURANCE_NUMBER" prompt="CON_CONTRACT_ITEM_DETAIL.COMPULSORY_INSURANCE_NUMBER"/>
        <bm:field name="insurance_type1" databaseType="NUMBER" datatype="java.lang.Long" physicalName="INSURANCE_TYPE1" prompt="CON_CONTRACT_ITEM_DETAIL.INSURANCE_TYPE1"/>
        <bm:field name="insurance_type2" databaseType="NUMBER" datatype="java.lang.Long" physicalName="INSURANCE_TYPE2" prompt="CON_CONTRACT_ITEM_DETAIL.INSURANCE_TYPE2"/>
        <bm:field name="insurance_type3" databaseType="NUMBER" datatype="java.lang.Long" physicalName="INSURANCE_TYPE3" prompt="CON_CONTRACT_ITEM_DETAIL.INSURANCE_TYPE3"/>
        <bm:field name="insurance_type4" databaseType="NUMBER" datatype="java.lang.Long" physicalName="INSURANCE_TYPE4" prompt="CON_CONTRACT_ITEM_DETAIL.INSURANCE_TYPE4"/>
        <bm:field name="insurance_type5" databaseType="NUMBER" datatype="java.lang.Long" physicalName="INSURANCE_TYPE5" prompt="CON_CONTRACT_ITEM_DETAIL.INSURANCE_TYPE5"/>
        <bm:field name="insurance_type6" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="INSURANCE_TYPE6" prompt="CON_CONTRACT_ITEM_DETAIL.INSURANCE_TYPE6"/>
        <bm:field name="item_frame_number" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="ITEM_FRAME_NUMBER" prompt="CON_CONTRACT_ITEM_DETAIL.ITEM_FRAME_NUMBER"/>
        <bm:field name="item_engine_number" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="ITEM_ENGINE_NUMBER" prompt="CON_CONTRACT_ITEM_DETAIL.ITEM_ENGINE_NUMBER"/>
        <bm:field name="item_price" databaseType="NUMBER" datatype="java.lang.Long" physicalName="ITEM_PRICE" prompt="CON_CONTRACT_ITEM_DETAIL.ITEM_PRICE"/>
        <bm:field name="qualified_number" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="QUALIFIED_NUMBER" prompt="CON_CONTRACT_ITEM_DETAIL.QUALIFIED_NUMBER"/>
        <bm:field name="insurance_date" databaseType="DATE" datatype="java.util.Date" physicalName="INSURANCE_DATE" prompt="CON_CONTRACT_ITEM_DETAIL.INSURANCE_DATE"/>
        <bm:field name="insurance_end_date" databaseType="DATE" datatype="java.util.Date" physicalName="INSURANCE_END_DATE" prompt="CON_CONTRACT_ITEM_DETAIL.INSURANCE_END_DATE"/>
        <bm:field name="insurance_received_date" databaseType="DATE" datatype="java.util.Date" physicalName="INSURANCE_RECEIVED_DATE" prompt="CON_CONTRACT_ITEM_DETAIL.INSURANCE_RECEIVED_DATE"/>
        <bm:field name="description" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="DESCRIPTION" prompt="CON_CONTRACT_ITEM_DETAIL.DESCRIPTION"/>
        <bm:field name="contract_id" databaseType="NUMBER" datatype="java.lang.Long" physicalName="CONTRACT_ID" prompt="CON_CONTRACT_ITEM_DETAIL.CONTRACT_ID"/>
        <bm:field name="line_number" databaseType="NUMBER" datatype="java.lang.Long" physicalName="LINE_NUMBER" prompt="CON_CONTRACT_ITEM_DETAIL.LINE_NUMBER"/>
        <bm:field name="brand_id" databaseType="NUMBER" datatype="java.lang.Long" physicalName="BRAND_ID" prompt="CON_CONTRACT_ITEM_DETAIL.BRAND_ID"/>
        <bm:field name="series_id" databaseType="NUMBER" datatype="java.lang.Long" physicalName="SERIES_ID" prompt="CON_CONTRACT_ITEM_DETAIL.SERIES_ID"/>
        <bm:field name="pattern" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="PATTERN" prompt="CON_CONTRACT_ITEM_DETAIL.PATTERN"/>
        <bm:field name="key_flag" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="KEY_FLAG" prompt="CON_CONTRACT_ITEM_DETAIL.KEY_FLAG"/>
        <bm:field name="registration_flag" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="REGISTRATION_FLAG" prompt="CON_CONTRACT_ITEM_DETAIL.REGISTRATION_FLAG"/>
        <bm:field name="purchase_flag" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="PURCHASE_FLAG" prompt="CON_CONTRACT_ITEM_DETAIL.PURCHASE_FLAG"/>
        <bm:field name="insurance_flag" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="INSURANCE_FLAG" prompt="CON_CONTRACT_ITEM_DETAIL.INSURANCE_FLAG"/>
        <bm:field name="status" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="STATUS" prompt="CON_CONTRACT_ITEM_DETAIL.STATUS"/>
        <bm:field name="ownership_transfer_flag" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="OWNERSHIP_TRANSFER_FLAG" prompt="CON_CONTRACT_ITEM_DETAIL.OWNERSHIP_TRANSFER_FLAG"/>
        <bm:field name="transfer_date" databaseType="DATE" datatype="java.util.Date" physicalName="TRANSFER_DATE" prompt="CON_CONTRACT_ITEM_DETAIL.TRANSFER_DATE"/>
        <bm:field name="brands_des" expression="(SELECT b.description FROM con_contract_lease_item a, hls_car_brands_vl           b WHERE a.contract_lease_item_id = t1.contract_lease_item_id AND b.brand_id = a.brand_id)" forInsert="false" forUpdate="false"/>
        <bm:field name="series_des" expression="(SELECT b.description  FROM con_contract_lease_item a,   hls_car_series_vl           b  WHERE a.contract_lease_item_id = t1.contract_lease_item_id  AND b.series_id = a.series_id)" forInsert="false" forUpdate="false"/>
        <bm:field name="model_des" expression="(SELECT b.description  FROM con_contract_lease_item a,hls_car_model_vl b  WHERE a.contract_lease_item_id = t1.contract_lease_item_id  AND b.model_id = a.model_id)" forInsert="false" forUpdate="false"/>
    </bm:fields>
    <bm:features>
        <f:standard-who/>
    </bm:features>
    <bm:primary-key>
        <bm:pk-field name="item_detail_id"/>
    </bm:primary-key>
    <bm:query-fields>
        <bm:query-field name="contract_id" queryExpression="t1.contract_lease_item_id=(select a.contract_lease_item_id from con_contract_lease_item a where a.contract_id=${@contract_id})"/>
    </bm:query-fields>
</bm:model>
