<?xml version="1.0" encoding="UTF-8"?>
<!--
    $Author: feng
    $Date: 2013-9-11 下午15:13:20
    $Revision: 1.0
    $Purpose:
-->
<bm:model xmlns:bm="http://www.leaf-framework.org/schema/bm" needAccessControl="false">
    <bm:operations>
        <bm:operation name="query">
            <bm:query-sql>
                <![CDATA[
                select tt.bp_name,tt.bp_id ,tt.bp_code from (
                select t.bp_id,
                t.bp_name,
                t.bp_code,
                t.bp_type
                from hls_bp_master t
                where t.bp_category = 'TENANT'
                and t.enabled_flag = 'Y'
                union
                select t.bp_id   ,
                t.bp_name ,
                t.bp_code,
                t.bp_type
                from hls_bp_master_role d, hls_bp_master t
                where d.bp_id = t.bp_id
                and d.bp_category =  'TENANT'
                and d.enabled_flag = 'Y')tt #WHERE_CLAUSE#
                ]]></bm:query-sql>
        </bm:operation>

    </bm:operations>
    <bm:fields>
        <bm:field name="bp_name" fordisplay="true" forQuery="true" prompt="承租人名称"/>
        <bm:field name="bp_code"  fordisplay="true" forQuery="true" prompt="承租人代码"/>
        <bm:field name="bp_id"/>
    </bm:fields>
    <bm:query-fields>
    <bm:query-field field="bp_code" queryOperator="like"/>
    <bm:query-field field="bp_name" queryOperator="like"/>
    </bm:query-fields>
</bm:model>
