<?xml version="1.0" encoding="UTF-8"?>
<!--
    $Author: gaoyang  
    $Date: 2013-5-22 下午01:53:57  
    $Revision: 1.0  
    $Purpose: 
-->
<ns1:model xmlns:ns1="http://www.leaf-framework.org/schema/bm" alias="t1" extend="cont.CON500.con_contract_v" extendMode="reference" needAccessControl="false">
    <ns1:fields>
        <ns1:field name="contract_id"/>
        <ns1:field name="project_id"/>
        <ns1:field name="business_type"/>
        <ns1:field name="contract_number" forDisplay="true" forQuery="true" prompt="HLS.CONTRACT_NUMBER"/>
        <ns1:field name="contract_name" forDisplay="true" forQuery="true" prompt="HLS.CONTRACT_NAME"/>
        <ns1:field name="project_number" forDisplay="true" forQuery="true" prompt="申请编号"/>
        <!-- <ns1:field name="project_name" forDisplay="false" forQuery="false" prompt="HLS.PROJECT_NAME"/> -->
        <ns1:field name="currency"/>
        <ns1:field name="currency_desc"/>
        <ns1:field name="data_class"/>
    </ns1:fields>
    <ns1:query-fields>
        <ns1:query-field field="contract_number" queryOperator="like"/>
        <ns1:query-field field="project_number" queryOperator="like"/>
        <!-- <ns1:query-field field="project_name" queryOperator="like"/> -->
        <ns1:query-field field="contract_name" queryOperator="like"/>
        <ns1:query-field name="not_master_contract_flag" queryExpression="${@not_master_contract_flag}=&apos;Y&apos; and t1.business_type!=&apos;MASTER_CONTRACT&apos;"/>
        <ns1:query-field name="inception_flag" queryExpression="(${@inception_flag}=&apos;Y&apos; and t1.contract_status =&apos;SIGN&apos;)"/>
        <ns1:query-field name="sign_flag" queryExpression="(${@sign_flag}=&apos;Y&apos; and t1.contract_status =&apos;NEW&apos;)"/>
        <ns1:query-field name="transaction_id" queryExpression="exists(SELECT 1 FROM   csh_transaction t WHERE  t.transaction_id = ${@transaction_id} AND t.bp_id = t1.bp_id_tenant OR t.bp_id = t1.bp_id_vender OR t.bp_id = t1.bp_id_agent_level1)"/>
    </ns1:query-fields>
    <ns1:data-filters>
        <ns1:data-filter enforceOperations="query" expression="t1.data_class = &apos;NORMAL&apos;"/>
        <ns1:data-filter enforceOperations="query" expression="t1.contract_status NOT IN (&apos;NEW&apos;)"/>
    </ns1:data-filters>
</ns1:model>
