<?xml version="1.0" encoding="UTF-8"?>
<!--
    $Author: Feng  
    $Date: 2013-9-24 下午2:19:04  
    $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">
    <bm:fields>
        <bm:field name="contract_id" databaseType="NUMBER" datatype="java.lang.Long" physicalName="CONTRACT_ID" prompt="CON_CONTRACT.CONTRACT_ID"/>
        <bm:field name="contract_number" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="CONTRACT_NUMBER" prompt="CON_CONTRACT.CONTRACT_NUMBER"/>
        <bm:field name="bp_id_tenant" databaseType="NUMBER" datatype="java.lang.Long" physicalName="BP_ID_TENANT" prompt="CON_CONTRACT.BP_ID_TENANT"/>
        <bm:field name="bp_id_agent_level1" databaseType="NUMBER" datatype="java.lang.Long" physicalName="BP_ID_AGENT_LEVEL1" prompt="CON_CONTRACT.BP_ID_AGENT_LEVEL1"/>
        <bm:field name="bp_id_tenant_desc" datatype="java.lang.String" expression="(SELECT hbm.bp_name FROM hls_bp_master hbm WHERE hbm.bp_id = t1.bp_id_tenant) " forInsert="false" forUpdate="false"/>
        <bm:field name="bp_id_agent_desc" datatype="java.lang.String" expression="(SELECT hbm.bp_name FROM hls_bp_master hbm WHERE hbm.bp_id = t1.bp_id_agent_level1) " forInsert="false" forUpdate="false"/>
    </bm:fields>
    <bm:features>
        <f:standard-who/>
    </bm:features>
    <bm:primary-key>
        <bm:pk-field name="contract_id"/>
    </bm:primary-key>
    <bm:query-fields>
        <bm:query-field name="contract_id" queryExpression="t1.contract_id = ${/parameter/@contract_id}"/>
    </bm:query-fields>
</bm:model>
