<?xml version="1.0" encoding="UTF-8"?>
<!--
    $Author: Foreinyel  
    $Date: 2014-5-14 下午2:35:18  
    $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_CONTRACT_TMPT_CLAUSE">
    <bm:fields>
        <bm:field name="clause_id" databaseType="NUMBER" datatype="java.lang.Long" physicalName="CLAUSE_ID" prompt="CON_CONTRACT_TMPT_CLAUSE.CLAUSE_ID"/>
        <bm:field name="contract_id" databaseType="NUMBER" datatype="java.lang.Long" physicalName="CONTRACT_ID" prompt="CON_CONTRACT_TMPT_CLAUSE.CONTRACT_ID"/>
        <bm:field name="tmpt_id" databaseType="NUMBER" datatype="java.lang.Long" physicalName="TMPT_ID" prompt="CON_CONTRACT_TMPT_CLAUSE.TMPT_ID"/>
        <bm:field name="bp_category" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="BP_CATEGORY" prompt="CON_CONTRACT_TMPT_CLAUSE.BP_CATEGORY"/>
        <bm:field name="bp_class" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="BP_CLASS" prompt="CON_CONTRACT_TMPT_CLAUSE.BP_CLASS"/>
        <bm:field name="division" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="DIVISION" prompt="CON_CONTRACT_TMPT_CLAUSE.DIVISION"/>
        <bm:field name="lease_channel" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="LEASE_CHANNEL" prompt="CON_CONTRACT_TMPT_CLAUSE.LEASE_CHANNEL"/>
        <bm:field name="document_type" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="DOCUMENT_TYPE" prompt="CON_CONTRACT_TMPT_CLAUSE.DOCUMENT_TYPE"/>
        <bm:field name="lease_organization" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="LEASE_ORGANIZATION" prompt="CON_CONTRACT_TMPT_CLAUSE.LEASE_ORGANIZATION"/>
        <bm:field name="car_brand" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="CAR_BRAND" prompt="CON_CONTRACT_TMPT_CLAUSE.CAR_BRAND"/>
        <bm:field name="price_list" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="PRICE_LIST" prompt="CON_CONTRACT_TMPT_CLAUSE.PRICE_LIST"/>
        <bm:field name="contract_number" expression="(select contract_number from con_contract c where c.contract_id = t1.contract_id)" forInsert="false" forUpdate="false"/>
        <bm:field name="bp_category_n" expression="(select bc.description from hls_bp_category bc where bc.bp_category = t1.bp_category)" forInsert="false" forUpdate="false"/>
        <bm:field name="business_type" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="BUSINESS_TYPE"/>
        <bm:field name="business_type_n" expression="(select v.description from HLS_BUSINESS_TYPE_V v where v.business_type = t1.business_type)" forInsert="false" forUpdate="false"/>
        <bm:field name="document_type_n" expression="(select v.document_type_desc from hls_document_type_v  v where v.document_type = t1.document_type)" forInsert="false" forUpdate="false"/>
        <bm:field name="division_n" expression="(select v.description from HLS_DIVISION v where v.division = t1.division)" forInsert="false" forUpdate="false"/>
        <bm:field name="lease_channel_n" expression="(select v.description from HLS_LEASE_CHANNEL v where v.lease_channel = t1.lease_channel)" forInsert="false" forUpdate="false"/>
        <bm:field name="lease_organization_n" expression="(select v.description from hls_lease_organization v where v.lease_organization = t1.lease_organization)" forInsert="false" forUpdate="false"/>
        <bm:field name="price_list_n" expression="(select v.description from HLS_PRICE_LIST v where v.price_list = t1.price_list)" forInsert="false" forUpdate="false"/>
        <bm:field name="other_tmpt_clause" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="OTHER_TMPT_CLAUSE" prompt="CON_CONTRACT_TMPT_CLAUSE.OTHER_TMPT_CLAUSE"/>
        <bm:field name="bp_tenant_type" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="BP_TENANT_TYPE" prompt="CON_CONTRACT_TMPT_CLAUSE.BP_TENANT_TYPE"/>
        <bm:field name="bp_vender_type" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="BP_VENDER_TYPE" prompt="CON_CONTRACT_TMPT_CLAUSE.BP_VENDER_TYPE"/>
        <bm:field name="nationality" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="NATIONALITY" prompt="CON_CONTRACT_TMPT_CLAUSE.NATIONALITY"/>
        <bm:field name="content_type"/>
        <bm:field name="reschedule_flag"/>
        <bm:field name="et_flag"/>
        <bm:field name="tenant_change_flag"/>
        <bm:field name="bank_acc_change_flag"/>
        <bm:field name="lease_item_change_flag"/>
        <bm:field name="mortgage_change_flag"/>
        <bm:field name="guarantor_change_flag"/>
        <bm:field name="contract_cancel_flag"/>
        <bm:field name="cashflow_change_flag"/>
        <bm:field name="data_class"/>
        <bm:field name="consult_fee_flag"/>
        <bm:field name="mortgage_type"/>
        <bm:field name="mortgage_type_n" expression="(select t.code_value_name from sys_code_values_vl t,sys_codes_vl t2 where t.code_id=t2.code_id and t2.code = &apos;HLS209_MORTGAGE_TYPE&apos; and t.code_value=t1.mortgage_type)" forInsert="false" forUpdate="false"/>
        <bm:field name="mortgage_ast_classfication"/>
        <bm:field name="mortgage_ast_classfication_n" expression="(select t.code_value_name from sys_code_values_vl t,sys_codes_vl t2 where t.code_id=t2.code_id and t2.code in (&apos;HLS209_ASSET_MORTGAGE&apos;,&apos;HLS209_ASSET_PLEDGE&apos;) and t.code_value=t1.mortgage_ast_classfication)" forInsert="false" forUpdate="false"/>
        <bm:field name="mortgage_asset_detail"/>
        <bm:field name="mortgage_asset_detail_n" expression="(select t.code_value_name from sys_code_values_vl t,sys_codes_vl t2 where t.code_id=t2.code_id and t2.code in (&apos;HLS209_ASSET_DETAIL_IMMOVABLE_PROPERTY_M&apos;,&apos;HLS209_ASSET_DETAIL_MOVABLE_PROPERTY_M&apos;,&apos;HLS209_ASSET_DETAIL_RIGHT_P&apos;) and t.code_value=t1.mortgage_asset_detail)" forInsert="false" forUpdate="false"/>
        <bm:field name="loan_type"/>
        <bm:field name="loan_type_n" expression="(select v.code_value_name from sys_code_values_v v where v.code = &apos;LOAN_TYPE&apos; and v.code_value=t1.loan_type)" forInsert="false" forUpdate="false"/>
        <bm:field name="tenant_is_pledger"/>
        <bm:field name="tenant_is_pledger_n" expression="(select v.code_value_name from sys_code_values_v v where v.code = &apos;YES_OR_NO&apos; and v.code_value=t1.tenant_is_pledger)" forInsert="false" forUpdate="false"/>
        <bm:field name="authority_purchase_flag"/>
        <bm:field name="authority_purchase_flag_n" expression="(select v.code_value_name from sys_code_values_v v where v.code = &apos;AUTHORITY_PURCHASE_FLAG&apos; and v.code_value=t1.authority_purchase_flag)" forInsert="false" forUpdate="false"/>
        <bm:field name="district"/>
        <bm:field name="district_n" expression="(select a.code_value_name from sys_code_values_v a where a.code=&apos;PRJ500N_DISTRICT_AREAS&apos;      and a.code_value= t1.district)" forInsert="false" forUpdate="false"/>
        <bm:field name="withhold_way"/>
        <bm:field name="withhold_way_n" expression="(select code_value_name from sys_code_values_v scv where scv.code=&apos;WITHHOLD_WAYS&apos; and scv.code_value = t1.withhold_way)" forInsert="false" forUpdate="false"/>
        <bm:field name="first_contract_flag"/>
        <bm:field name="finance_type"/>
        <bm:field name="secondary_lease"/>
        <bm:field name="vender_id"/>
        <bm:field name="vender_id_n" expression="(decode(vender_id,-100,'买断机',(select scv.bp_name from hls_bp_master scv where scv.enabled_flag=&apos;Y&apos; and scv.bp_id = t1.vender_id)))" forInsert="false" forUpdate="false"/>

        <bm:field name="finance_type_n" expression="(select code_value_name from sys_code_values_v scv where scv.code=&apos;FINANCE_TYPE&apos; and scv.code_value = t1.finance_type)" forInsert="false" forUpdate="false"/>
    </bm:fields>
    <bm:features>
        <o:sequence-pk sequenceName="con_contract_tmpt_clause_s"/>
        <f:standard-who/>
    </bm:features>
    <bm:query-fields>
        <bm:query-field name="tmpt_id" queryExpression="t1.tmpt_id = ${@tmpt_id}"/>
    </bm:query-fields>
    <bm:primary-key>
        <bm:pk-field name="clause_id"/>
    </bm:primary-key>
</bm:model>
