<?xml version="1.0" encoding="UTF-8"?>
<bm:model xmlns:bm="http://www.leaf-framework.org/schema/bm" needAccessControl="false">
    <bm:operations>
        <bm:operation name="query">
            <bm:query-sql><![CDATA[
           select *  from  (
              SELECT c.contract_number,
               h.bp_name,
               --机型
               ccli.modelcd pattern,
               --合同签订日
               to_char(c.CONTRACT_SIGN_DATE,'yyyy-mm-dd') inception_of_lease,
               --c.rate
               ch.bp_code client_bp_code,
               ch.bp_name client_bp_name,
               --机号
               ccli.machine_number,
               c.contract_id,
               to_char(c.lease_start_date,'yyyy-mm-dd')lease_start_date,
               --期间
               c.lease_times,
               (to_number(c.int_rate_display)*100||'%')int_rate_display
        from con_contract c,
             hls_bp_master h,
             hls_bp_master ch,
             con_contract_lease_item ccli
        WHERE c.bp_id_agent_level1=h.bp_id
              AND ccli.contract_id=c.contract_id
              AND ch.bp_id=c.bp_id_tenant
          ) t
                #WHERE_CLAUSE#
                #ORDER_BY_CLAUSE#
                ]]></bm:query-sql>
        </bm:operation>
    </bm:operations>
    <bm:query-fields>
<!--        <bm:query-field name="contract_id" queryExpression="t.contract_id=${@contract_id}"/>-->
    </bm:query-fields>
</bm:model>
