<?xml version="1.0" encoding="UTF-8"?>
<!--
    $Author: qwm  
    $Date: 2013-6-20 上午10:06:11  
    $Revision: 1.0  
    $Purpose: 
-->
<bm:model xmlns:bm="http://www.leaf-framework.org/schema/bm">
    <bm:fields>
        <bm:field name="contract_id"/>
        <bm:field name="contract_number" displayWidth="120" forDisplay="true" forQuery="true" prompt="合同编号"/>
        <bm:field name="contract_name" displayWidth="200" forDisplay="true" forQuery="true" prompt="合同名称"/>
        <bm:field name="bp_name" displayWidth="200" forDisplay="true" forQuery="true" prompt="承租人"/>
    </bm:fields>
    <bm:operations>
        <bm:operation name="query">
            <bm:query-sql><![CDATA[
                SELECT
                    contract_id,
                    contract_number,
                    contract_name,
                    bp_name
                FROM
                    con_contract_v t1 #WHERE_CLAUSE#
            ]]></bm:query-sql>
        </bm:operation>
    </bm:operations>
    <bm:query-fields>
        <bm:query-field field="contract_number" queryExpression="upper(t1.contract_number) like &apos;%&apos; || upper(${@contract_number}) || &apos;%&apos;"/>
        <bm:query-field field="contract_name" queryExpression="upper(t1.contract_name) like &apos;%&apos; || upper(${@contract_name}) || &apos;%&apos;"/>
        <bm:query-field field="bp_name" queryExpression="upper(t1.bp_name) like &apos;%&apos; || upper(${@bp_name}) || &apos;%&apos;"/>
    </bm:query-fields>
    <bm:data-filters>
        <bm:data-filter enforceOperations="query" expression="t1.contract_status not in (&apos;CANCEL&apos;)"/>
        <bm:data-filter enforceOperations="query" expression="t1.data_class  in (&apos;NORMAL&apos;)"/>
    </bm:data-filters>
</bm:model>
