<?xml version="1.0" encoding="UTF-8"?>
<!--
    $Author: zhangxing5129  
    $Date: 2014-11-24 下午04:34:31  
    $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_V">
    <bm:fields>
        <bm:field name="contract_id" databaseType="NUMBER" datatype="java.lang.Long" physicalName="CONTRACT_ID" prompt="CON_CONTRACT_V.CONTRACT_ID"/>
        <bm:field name="contract_number" databaseType="VARCHAR2" datatype="java.lang.String" displayWidth="200" forDisplay="true" forQuery="true" physicalName="CONTRACT_NUMBER" prompt="合同编号"/>
        <bm:field name="contract_name" databaseType="VARCHAR2" datatype="java.lang.String" displayWidth="200" forDisplay="true" forQuery="true" physicalName="CONTRACT_NAME" prompt="合同名称"/>
        <bm:field name="business_type" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="BUSINESS_TYPE" prompt="CON_CONTRACT_V.BUSINESS_TYPE"/>
        <bm:field name="business_type_desc" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="BUSINESS_TYPE_DESC" prompt="CON_CONTRACT_V.BUSINESS_TYPE_DESC"/>
        <bm:field name="document_type" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="DOCUMENT_TYPE" prompt="CON_CONTRACT_V.DOCUMENT_TYPE"/>
        <bm:field name="document_type_desc" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="DOCUMENT_TYPE_DESC" prompt="CON_CONTRACT_V.DOCUMENT_TYPE_DESC"/>
        <bm:field name="document_category" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="DOCUMENT_CATEGORY" prompt="CON_CONTRACT_V.DOCUMENT_CATEGORY"/>
        <bm:field name="document_category_desc" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="DOCUMENT_CATEGORY_DESC" prompt="CON_CONTRACT_V.DOCUMENT_CATEGORY_DESC"/>
        <bm:field name="lease_organization" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="LEASE_ORGANIZATION" prompt="CON_CONTRACT_V.LEASE_ORGANIZATION"/>
        <bm:field name="lease_organization_desc" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="LEASE_ORGANIZATION_DESC" prompt="CON_CONTRACT_V.LEASE_ORGANIZATION_DESC"/>
        <bm:field name="lease_channel" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="LEASE_CHANNEL" prompt="CON_CONTRACT_V.LEASE_CHANNEL"/>
        <bm:field name="lease_channel_desc" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="LEASE_CHANNEL_DESC" prompt="CON_CONTRACT_V.LEASE_CHANNEL_DESC"/>
        <bm:field name="bp_id_tenant" databaseType="NUMBER" datatype="java.lang.Long" physicalName="BP_ID_TENANT" prompt="CON_CONTRACT_V.BP_ID_TENANT"/>
        <bm:field name="bp_name" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="BP_NAME" prompt="CON_CONTRACT_V.BP_NAME"/>
        <bm:field name="bp_type_desc" expression="(select bt.description from hls_bp_type bt where bt.bp_type = (select m.bp_type from hls_bp_master m where m.bp_id=t1.bp_id_tenant))"/>
        <bm:field name="hls_lease_channel_desc" expression="(select lc.description  from hls_lease_channel lc where lc.lease_channel = t1.lease_channel)"/>
    </bm:fields>
    <bm:features>
        <f:standard-who/>
    </bm:features>
    <bm:query-fields>
        <bm:query-field field="contract_number" queryOperator="like"/>
        <bm:query-field field="contract_name" queryOperator="like"/>
    </bm:query-fields>
</bm:model>
