<?xml version="1.0" encoding="UTF-8"?>
<!--
    $Author: hp  
    $Date: 2013-11-29 下午03:32:44  
    $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_CHANGE_REQ">
    <bm:fields>
        <bm:field name="change_req_id" databaseType="NUMBER" datatype="java.lang.Long" physicalName="CHANGE_REQ_ID" prompt="CON_CONTRACT_CHANGE_REQ.CHANGE_REQ_ID"/>
        <bm:field name="batch_id" databaseType="NUMBER" datatype="java.lang.Long" physicalName="BATCH_ID" prompt="CON_CONTRACT_CHANGE_REQ.BATCH_ID"/>
        <bm:field name="change_quotation" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="CHANGE_QUOTATION" prompt="CON_CONTRACT_CHANGE_REQ.CHANGE_QUOTATION"/>
        <bm:field name="change_req_number" databaseType="VARCHAR2" datatype="java.lang.String" forDisplay="true" forQuery="true" physicalName="CHANGE_REQ_NUMBER" prompt="AUT103.CHANGE_REQ_NUMBER"/>
        <bm:field name="document_type" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="DOCUMENT_TYPE" prompt="CON_CONTRACT_CHANGE_REQ.DOCUMENT_TYPE"/>
        <bm:field name="document_category" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="DOCUMENT_CATEGORY" prompt="CON_CONTRACT_CHANGE_REQ.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:query-fields>
        <bm:query-field field="change_req_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:primary-key>
        <bm:pk-field name="change_req_id"/>
    </bm:primary-key>
</bm:model>
