<?xml version="1.0" encoding="UTF-8"?>
<!--
    $Author: Administrator  
    $Date: 2015-5-26 上午10:28:54  
    $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 *
				  from (select c.unit_id_n,
				               a.borrower_name,
				               a.apply_date,
				               a.link_man,
				               a.link_phone,
				               c.contract_number,
				               c.bp_id_tenant_n,
				               (select ci.description
				                  from prj_cdd_item ci
				                 where ci.cdd_item_id = b.cdd_item_id) cdd_item_des,
				               b.use_to,
				               b.deposit,
				               a.send_date,
				               a.send_number,
				               b.promise_date,
				               b.return_number,
				               b.real_date,
				               b.overdue_explain,
				               b.deposit_handle
				          from document_lend_record_hd a,
				               document_lend_record_ln b,
				               con_contract_lv               c
				         where a.lend_header_id = b.lend_header_id
				           and b.contract_id = c.contract_id) t1 
				           #WHERE_CLAUSE# order by t1.apply_date desc
]]></bm:query-sql>
        </bm:operation>
    </bm:operations>
    <bm:query-fields>
        <bm:query-field name="contract_number_from" queryExpression="t1.contract_number &gt;= ${@contract_number_from}"/>
        <bm:query-field name="contract_number_to" queryExpression="t1.contract_number &lt;= ${@contract_number_to}"/>
        <bm:query-field name="apply_date_from" queryExpression="t1.apply_date &gt;= to_date(${@apply_date_from},&apos;yyyy-mm-dd&apos;)"/>
        <bm:query-field name="apply_date_to" queryExpression="t1.apply_date &lt;= to_date(${@apply_date_to},&apos;yyyy-mm-dd&apos;)"/>
    </bm:query-fields>
</bm:model>
