<?xml version="1.0" encoding="UTF-8"?>
<!--
    $Author: Mouse Chow  
    $Date: 2012-12-23 下午04:13:46  
    $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 lq.lease_requisition_id,
       lq.lease_req_number,
	   pc.customer_name,
       cv.code_value_name as req_status,
       (lease_amt_sum + downpay_amount) as sum_amount
  from hls_prj_lease_requisition lq,
       hls_prj_customer          pc,
       sys_codes                 sc,
       sys_code_values_vl        cv
       #WHERE_CLAUSE#
]]></bm:query-sql>
        </bm:operation>
    </bm:operations>
    <bm:fields>
        <bm:field name="lease_requisition_id" databaseType="NUMBER" datatype="java.lang.Long" physicalName="LEASE_REQUISITION_ID"/>
        <bm:field name="lease_req_number" databaseType="VARCHAR2" datatype="java.lang.String" forDisplay="true" forQuery="true" physicalName="LEASE_REQ_NUMBER" prompt="申请编号"/>
        <bm:field name="customer_name" databaseType="VARCHAR2" datatype="java.lang.String" forDisplay="true" forQuery="true" physicalName="CUSTOMER_NAME" prompt="客户名称"/>
        <bm:field name="req_status" databaseType="VARCHAR2" datatype="java.lang.String" forDisplay="true" physicalName="req_status" prompt="申请状态"/>
        <bm:field name="sum_amount" databaseType="NUMBER" datatype="java.lang.Long" forDisplay="true" physicalName="SUM_AMOUNT" prompt="总金额"/>
    </bm:fields>
    <bm:data-filters>
        <bm:data-filter expression="lq.customer_id = pc.customer_id       
   and sc.code = &apos;HLS_LEASE_REQUISITION_STAUTS&apos;       
   and sc.code_id = cv.code_id       
   and cv.code_value = lq.requisition_status"/>
    </bm:data-filters>
    <bm:query-fields>
        <bm:query-field name="lease_req_number" queryExpression="lq.lease_req_number like ${@lease_req_number}"/>
        <bm:query-field name="customer_name" queryExpression="pc.customer_name like ${@customer_name}"/>
    </bm:query-fields>
</bm:model>
