<?xml version="1.0" encoding="UTF-8"?>
<!--
    $Author: hp  
    $Date: 2013-11-29 下午04:21:03  
    $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_ET_HD">
    <bm:fields>
        <bm:field name="et_agreement_id" databaseType="NUMBER" datatype="java.lang.Long" physicalName="ET_AGREEMENT_ID" prompt="CON_CONTRACT_ET_HD.ET_AGREEMENT_ID"/>
        <bm:field name="et_agreement_number" databaseType="VARCHAR2" datatype="java.lang.String" forDisplay="true" forQuery="true" physicalName="ET_AGREEMENT_NUMBER" prompt="AUT103.ET_AGREEMENT_NUMBER"/>
        <bm:field name="business_type" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="BUSINESS_TYPE" prompt="CON_CONTRACT_ET_HD.BUSINESS_TYPE"/>
        <bm:field name="document_type" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="DOCUMENT_TYPE" prompt="CON_CONTRACT_ET_HD.DOCUMENT_TYPE"/>
        <bm:field name="document_category" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="DOCUMENT_CATEGORY" prompt="CON_CONTRACT_ET_HD.DOCUMENT_CATEGORY"/>
        <bm:field name="contract_id" databaseType="NUMBER" datatype="java.lang.Long" prompt="AUT103.CONTRACT_ID"/>
        <bm:field name="contract_number" expression="(select t.contract_number from con_contract  t where t.contract_id=t1.contract_id) " forDisplay="true" forQuery="true" prompt="HLS.CONTRACT_NUMBER"/>
        <bm:field name="contract_name" expression="(select t.contract_name from con_contract  t where t.contract_id=t1.contract_id) " forDisplay="true" forQuery="true" prompt="HLS.CONTRACT_NAME"/>
    </bm:fields>
    <bm:features>
        <f:standard-who/>
    </bm:features>
    <bm:primary-key>
        <bm:pk-field name="et_agreement_id"/>
    </bm:primary-key>
    <bm:query-fields>
        <bm:query-field field="et_agreement_number" queryOperator="like"/>
        <bm:query-field field="contract_number" queryExpression="t1.contract_id in (select t.contract_id from con_contract t where t.contract_number like ${@contract_number})"/>
        <bm:query-field field="contract_name" queryExpression="t1.contract_id in (select t.contract_id from con_contract t where t.contract_name like ${@contract_name})"/>
    </bm:query-fields>
    <bm:data-filters>
        <bm:data-filter enforceOperations="query" expression="company_id=${/session/@company_id}"/>
    </bm:data-filters>
</bm:model>
