<?xml version="1.0" encoding="UTF-8"?>
<!--
    $Author: Feng  
    $Date: 2014-1-23 下午9:12:39  
    $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="data_class" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="DATA_CLASS" prompt="CON_CONTRACT.DATA_CLASS"/>
        <bm:field name="contract_number" databaseType="VARCHAR2" datatype="java.lang.String" displayWidth="230" forDisplay="true" forQuery="true" physicalName="CONTRACT_NUMBER" prompt="合同编号"/>
        <bm:field name="contract_status" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="CONTRACT_STATUS" prompt="CON_CONTRACT.CONTRACT_STATUS"/>
        <bm:field name="bp_tenant_name" displayWidth="230" expression="(select bp_name from hls_bp_master where bp_id = t1.bp_id_tenant)" forDisplay="true" forQuery="true" prompt="承租人"/>
    </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="bp_tenant_name" queryExpression="(select bp_name from hls_bp_master where bp_id = t1.bp_id_tenant) like ${@bp_tenant_name}"/>
        <bm:query-field name="contract_number" queryExpression="t1.contract_number like ${@contract_number}"/>
    </bm:query-fields>
    <bm:data-filters>
        <bm:data-filter name="data_class" enforceOperations="query" expression="t1.data_class = &apos;NORMAL&apos;"/>
        <!-- <bm:data-filter name="contract_status" enforceOperations="query" expression="t1.contract_status IN (&apos;INCEPT&apos;,&apos;SIGN&apos;)"/> -->
    </bm:data-filters>
</bm:model>
