<?xml version="1.0" encoding="UTF-8"?>
<!--
    $Author: gaoyang  
    $Date: 2015-11-13 下午03:23:39  
    $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.contract_id,
                    c.contract_number,
                    c.contract_name,
                    m.bp_name
                FROM
                    con_contract c,
                    hls_bp_master m
                WHERE
                    c.data_class       = 'NORMAL' AND
                    c.contract_status IN ('INCEPT', 'PAID', 'SIGN','NEW') AND
                    c.int_rate_type    = 'FLOATING' AND
                    c.bp_id_tenant     = m.bp_id(+) AND
                    c.company_id       = ${/session/@company_id}
            ]]></bm:query-sql>
        </bm:operation>
    </bm:operations>
    <bm:fields>
        <bm:field name="contract_id" databaseType="NUMBER" datatype="java.lang.Long" physicalName="CONTRACT_ID"/>
        <bm:field name="contract_number" databaseType="VARCHAR2" datatype="java.lang.String" forDisplay="true" forQuery="true" physicalName="CONTRACT_NUMBER" prompt="合同编号"/>
        <bm:field name="contract_name" databaseType="VARCHAR2" datatype="java.lang.String" forDisplay="true" forQuery="true" physicalName="CONTRACT_NAME" prompt="合同名称"/>
        <bm:field name="bp_name" databaseType="VARCHAR2" datatype="java.lang.String" forDisplay="true" physicalName="BP_NAME" prompt="主承租人"/>
    </bm:fields>
    <bm:query-fields>
        <bm:query-field field="contract_number" queryOperator="like"/>
        <bm:query-field field="contract_name" queryOperator="like"/>
    </bm:query-fields>
</bm:model>
