<?xml version="1.0" encoding="UTF-8"?>
<!--
    $Author: zhangxing5129
    $Date: 2013-10-23 下午09:09:04
    $Revision: 1.0
    $Purpose:
-->
<bm:model xmlns:bm="http://www.leaf-framework.org/schema/bm">
    <bm:operations>
        <bm:operation name="query">
            <bm:query-sql><![CDATA[
				    select c.project_id,
				       c.contract_id,
				       c.contract_number,
				       c.contract_name,
				       c.contract_status,
				       c.contract_status_desc,
				       c.bp_id_tenant,
				       c.bp_name,
				       prj305_save_pkg.get_con_lease_item(c.contract_id) lease_item_name,
				       prj305_save_pkg.get_con_guarantor(c.contract_id) guarantor_name,
				       c.finance_amount,
				       c.document_type,
				       c.document_type_desc,
				       c.billing_method,
				       c.billing_method_desc
				  from con_contract_v c
				 #WHERE_CLAUSE#
				 order by c.contract_number desc
 ]]></bm:query-sql>
        </bm:operation>
    </bm:operations>
    <bm:fields>
        <bm:field name="project_id"/>
        <bm:field name="contract_number"/>
        <bm:field name="contract_name"/>
        <bm:field name="contract_status"/>
        <bm:field name="contract_status_desc"/>
        <bm:field name="bp_id_tenant"/>
        <bm:field name="bp_name"/>
        <bm:field name="guarantor_name"/>
        <bm:field name="lease_item_name"/>
        <bm:field name="finance_amount"/>
        <bm:field name="document_type_desc"/>
        <bm:field name="billing_method"/>
        <bm:field name="billing_method_desc"/>
    </bm:fields>
    <bm:data-filters>
        <!--<bm:data-filter enforceOperations="query" expression="c.project_id=${@project_id}"/>-->
    </bm:data-filters>
</bm:model>