<?xml version="1.0" encoding="UTF-8"?>
<bm:model xmlns:bm="http://www.leaf-framework.org/schema/bm">
    <bm:operations>
        <bm:operation name="query">
            <bm:query-sql><![CDATA[select *
  		from hls_bp_master_lv t1
         #WHERE_CLAUSE# 
         
         ]]></bm:query-sql>
        </bm:operation>
    </bm:operations>
    <bm:data-filters>
        <bm:data-filter enforceOperations="query" expression="exists (select 1     from hls_bp_master_role mr   where mr.bp_category in (&apos;TENANT&apos;, &apos;GUARANTOR&apos;)) and t1.enabled_flag=&apos;Y&apos;"/>
    </bm:data-filters>
    <bm:fields>
        <bm:field name="bp_id" databaseType="NUMBER" datatype="java.lang.Long" physicalName="BP_ID" required="true"/>
        <bm:field name="bp_code" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="BP_CODE"/>
        <bm:field name="bp_name" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="BP_NAME"/>
        <bm:field name="extra_nam" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="EXTRA_NAM"/>
        <bm:field name="bp_category" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="BP_CATEGORY"/>
        <bm:field name="bp_category_n" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="BP_CATEGORY_N"/>
        <bm:field name="bp_type" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="BP_TYPE"/>
        <bm:field name="bp_type_n" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="BP_TYPE_N"/>
        <bm:field name="bp_class" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="BP_CLASS"/>
        <bm:field name="bp_class_n" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="BP_CLASS_N"/>
        <bm:field name="bp_title" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="BP_TITLE"/>
        <bm:field name="bp_title_n" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="BP_TITLE_N"/>
        <bm:field name="search_term_1" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="SEARCH_TERM_1"/>
        <bm:field name="search_term_2" databaseType="NUMBER" datatype="java.lang.Long" physicalName="SEARCH_TERM_2"/>
        <bm:field name="external_bp_code" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="EXTERNAL_BP_CODE"/>
        <bm:field name="address_id" databaseType="NUMBER" datatype="java.lang.Long" physicalName="ADDRESS_ID"/>
        <bm:field name="enabled_flag" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="ENABLED_FLAG"/>
        <bm:field name="first_name" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="FIRST_NAME"/>
        <bm:field name="middle_name" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="MIDDLE_NAME"/>
        <bm:field name="last_name" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="LAST_NAME"/>
        <bm:field name="gender" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="GENDER"/>
        <bm:field name="gender_n" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="GENDER_N"/>
        <bm:field name="nationality" databaseType="NUMBER" datatype="java.lang.Long" physicalName="NATIONALITY"/>
        <bm:field name="nationality_n" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="NATIONALITY_N"/>
        <bm:field name="date_of_birth" databaseType="DATE" datatype="java.util.Date" physicalName="DATE_OF_BIRTH"/>
        <bm:field name="place_of_birth" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="PLACE_OF_BIRTH"/>
        <bm:field name="name_at_birth" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="NAME_AT_BIRTH"/>
        <bm:field name="marital_status" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="MARITAL_STATUS"/>
        <bm:field name="marital_status_n" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="MARITAL_STATUS_N"/>
        <bm:field name="number_of_children" databaseType="NUMBER" datatype="java.lang.Long" physicalName="NUMBER_OF_CHILDREN"/>
        <bm:field name="academic_background" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="ACADEMIC_BACKGROUND"/>
        <bm:field name="academic_background_n" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="ACADEMIC_BACKGROUND_N"/>
        <bm:field name="age" databaseType="NUMBER" datatype="java.lang.Long" physicalName="AGE"/>
        <bm:field name="id_type" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="ID_TYPE"/>
        <bm:field name="id_type_n" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="ID_TYPE_N"/>
        <bm:field name="id_card_no" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="ID_CARD_NO"/>
        <bm:field name="annual_income" databaseType="NUMBER" datatype="java.lang.Long" physicalName="ANNUAL_INCOME"/>
        <bm:field name="currency" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="CURRENCY"/>
        <bm:field name="currency_n" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="CURRENCY_N"/>
        <bm:field name="capital_of_family" databaseType="NUMBER" datatype="java.lang.Long" physicalName="CAPITAL_OF_FAMILY"/>
        <bm:field name="liability_of_family" databaseType="NUMBER" datatype="java.lang.Long" physicalName="LIABILITY_OF_FAMILY"/>
        <bm:field name="legal_form" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="LEGAL_FORM"/>
        <bm:field name="legal_form_n" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="LEGAL_FORM_N"/>
        <bm:field name="industry" databaseType="NUMBER" datatype="java.lang.Long" physicalName="INDUSTRY"/>
        <bm:field name="industry_n" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="INDUSTRY_N"/>
        <bm:field name="business_license_num" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="BUSINESS_LICENSE_NUM"/>
        <bm:field name="corporate_code" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="CORPORATE_CODE"/>
        <bm:field name="organization_code" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="ORGANIZATION_CODE"/>
        <bm:field name="tax_registry_num" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="TAX_REGISTRY_NUM"/>
        <bm:field name="registered_place" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="REGISTERED_PLACE"/>
        <bm:field name="founded_date" databaseType="DATE" datatype="java.util.Date" physicalName="FOUNDED_DATE"/>
        <bm:field name="registered_capital" databaseType="NUMBER" datatype="java.lang.Long" physicalName="REGISTERED_CAPITAL"/>
        <bm:field name="balance_sheet_currency" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="BALANCE_SHEET_CURRENCY"/>
        <bm:field name="invoice_title" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="INVOICE_TITLE"/>
        <bm:field name="invoice_bp_address_phone_num" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="INVOICE_BP_ADDRESS_PHONE_NUM"/>
        <bm:field name="invoice_bp_bank_account" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="INVOICE_BP_BANK_ACCOUNT"/>
        <bm:field name="taxpayer_type" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="TAXPAYER_TYPE"/>
        <bm:field name="taxpayer_type_n" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="TAXPAYER_TYPE_N"/>
        <bm:field name="company_nature" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="COMPANY_NATURE"/>
        <bm:field name="company_nature_n" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="COMPANY_NATURE_N"/>
        <bm:field name="paid_up_capital" databaseType="NUMBER" datatype="java.lang.Long" physicalName="PAID_UP_CAPITAL"/>
        <bm:field name="main_products" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="MAIN_PRODUCTS"/>
        <bm:field name="primary_business" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="PRIMARY_BUSINESS"/>
        <bm:field name="bp_name_sp" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="BP_NAME_SP"/>
        <bm:field name="gender_sp" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="GENDER_SP"/>
        <bm:field name="gender_sp_n" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="GENDER_SP_N"/>
        <bm:field name="date_of_birth_sp" databaseType="DATE" datatype="java.util.Date" physicalName="DATE_OF_BIRTH_SP"/>
        <bm:field name="academic_background_sp" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="ACADEMIC_BACKGROUND_SP"/>
        <bm:field name="academic_background_sp_n" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="ACADEMIC_BACKGROUND_SP_N"/>
        <bm:field name="id_type_sp" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="ID_TYPE_SP"/>
        <bm:field name="id_type_sp_n" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="ID_TYPE_SP_N"/>
        <bm:field name="id_card_no_sp" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="ID_CARD_NO_SP"/>
        <bm:field name="country_sp" databaseType="NUMBER" datatype="java.lang.Long" physicalName="COUNTRY_SP"/>
        <bm:field name="country_sp_n" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="COUNTRY_SP_N"/>
        <bm:field name="province_sp" databaseType="NUMBER" datatype="java.lang.Long" physicalName="PROVINCE_SP"/>
        <bm:field name="province_sp_n" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="PROVINCE_SP_N"/>
        <bm:field name="city_sp" databaseType="NUMBER" datatype="java.lang.Long" physicalName="CITY_SP"/>
        <bm:field name="city_sp_n" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="CITY_SP_N"/>
        <bm:field name="district_sp" databaseType="NUMBER" datatype="java.lang.Long" physicalName="DISTRICT_SP"/>
        <bm:field name="district_sp_n" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="DISTRICT_SP_N"/>
        <bm:field name="address_sp" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="ADDRESS_SP"/>
        <bm:field name="loan_card_num" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="LOAN_CARD_NUM"/>
        <bm:field name="legal_person" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="LEGAL_PERSON"/>
        <bm:field name="enterprise_scale" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="ENTERPRISE_SCALE"/>
        <bm:field name="enterprise_scale_n" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="ENTERPRISE_SCALE_N"/>
        <bm:field name="created_by" databaseType="NUMBER" datatype="java.lang.Long" physicalName="CREATED_BY"/>
        <bm:field name="creation_date" databaseType="DATE" datatype="java.util.Date" physicalName="CREATION_DATE"/>
        <bm:field name="last_updated_by" databaseType="NUMBER" datatype="java.lang.Long" physicalName="LAST_UPDATED_BY"/>
        <bm:field name="last_update_date" databaseType="DATE" datatype="java.util.Date" physicalName="LAST_UPDATE_DATE"/>
        <bm:field name="ref_v01" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="REF_V01"/>
        <bm:field name="ref_v02" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="REF_V02"/>
        <bm:field name="ref_v03" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="REF_V03"/>
        <bm:field name="ref_v04" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="REF_V04"/>
        <bm:field name="ref_v05" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="REF_V05"/>
        <bm:field name="ref_v06" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="REF_V06"/>
        <bm:field name="ref_v07" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="REF_V07"/>
        <bm:field name="ref_v08" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="REF_V08"/>
        <bm:field name="ref_v09" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="REF_V09"/>
        <bm:field name="ref_v10" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="REF_V10"/>
        <bm:field name="ref_v11" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="REF_V11"/>
        <bm:field name="ref_v12" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="REF_V12"/>
        <bm:field name="ref_v13" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="REF_V13"/>
        <bm:field name="ref_v14" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="REF_V14"/>
        <bm:field name="ref_v15" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="REF_V15"/>
        <bm:field name="ref_n01" databaseType="NUMBER" datatype="java.lang.Long" physicalName="REF_N01"/>
        <bm:field name="ref_n02" databaseType="NUMBER" datatype="java.lang.Long" physicalName="REF_N02"/>
        <bm:field name="ref_n03" databaseType="NUMBER" datatype="java.lang.Long" physicalName="REF_N03"/>
        <bm:field name="ref_n04" databaseType="NUMBER" datatype="java.lang.Long" physicalName="REF_N04"/>
        <bm:field name="ref_n05" databaseType="NUMBER" datatype="java.lang.Long" physicalName="REF_N05"/>
        <bm:field name="ref_n06" databaseType="NUMBER" datatype="java.lang.Long" physicalName="REF_N06"/>
        <bm:field name="ref_n07" databaseType="NUMBER" datatype="java.lang.Long" physicalName="REF_N07"/>
        <bm:field name="ref_n08" databaseType="NUMBER" datatype="java.lang.Long" physicalName="REF_N08"/>
        <bm:field name="ref_n09" databaseType="NUMBER" datatype="java.lang.Long" physicalName="REF_N09"/>
        <bm:field name="ref_n10" databaseType="NUMBER" datatype="java.lang.Long" physicalName="REF_N10"/>
        <bm:field name="ref_d01" databaseType="DATE" datatype="java.util.Date" physicalName="REF_D01"/>
        <bm:field name="ref_d02" databaseType="DATE" datatype="java.util.Date" physicalName="REF_D02"/>
        <bm:field name="ref_d03" databaseType="DATE" datatype="java.util.Date" physicalName="REF_D03"/>
        <bm:field name="ref_d04" databaseType="DATE" datatype="java.util.Date" physicalName="REF_D04"/>
        <bm:field name="ref_d05" databaseType="DATE" datatype="java.util.Date" physicalName="REF_D05"/>
        <bm:field name="spouse_phone" databaseType="NUMBER" datatype="java.lang.Long" physicalName="SPOUSE_PHONE"/>
        <bm:field name="license_terms" databaseType="DATE" datatype="java.util.Date" physicalName="LICENSE_TERMS"/>
    </bm:fields>
    <bm:query-fields>
        <bm:query-field field="bp_class" queryOperator="="/>
        <bm:query-field field="bp_type" queryOperator="="/>
        <bm:query-field name="bp_code_from" queryExpression="bp_code &gt;= ${@bp_code_from} "/>
        <bm:query-field name="bp_code_to" queryExpression="bp_code &lt;= ${@bp_code_to} "/>
        <bm:query-field field="enabled_flag" queryExpression="(t1.enabled_flag=${@enabled_flag} or ${@enabled_flag}=&apos;ALL&apos;)"/>
        <bm:query-field name="search_term_1_from" queryExpression="search_term_1 &gt;= ${@search_term_1_from} "/>
        <bm:query-field name="search_term_1_to" queryExpression="search_term_1 &lt;= ${@search_term_1_to} "/>
        <bm:query-field name="search_term_2_from" queryExpression="search_term_2 &gt;= ${@search_term_2_from} "/>
        <bm:query-field name="search_term_2_to" queryExpression="search_term_2 &lt;= ${@search_term_2_to} "/>
        <bm:query-field field="bp_id" queryOperator="="/>
        <bm:query-field field="bp_category" queryOperator="="/>
        <bm:query-field field="extra_nam" queryOperator="like"/>
        <bm:query-field field="bp_name" queryOperator="like"/>
    </bm:query-fields>
</bm:model>
