<?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 (
                SELECT
                    hbm.bp_id,
                    hbm.owner_user_id,
                    hbm.bp_code,
                    hbm.bp_name,
                    hbm.extra_nam,
                    hbm.bp_category,
                    hbm.bp_type,
                    (select description from hls_bp_type
                    where bp_type=hbm.bp_type)bp_type_n,
                    hbc.description bp_category_n,
                    NVL(hbm.post_itfc_status, 'NEW') post_itfc_status,
                    v.code_value_name post_itfc_status_n,
                    hbm.post_itfc_log
                FROM
                    hls_bp_master hbm,
                    hls_bp_category hbc,
                    sys_code_values_v v
                WHERE
                    hbm.bp_category in ('TENANT','BORROWER_ORGANIZATION') AND
                    hbm.bp_class    = 'ORG' AND
                    hbm.bp_category = hbc.bp_category AND
                    v.code          = 'SDIC_EBS_STATUS' AND
                    v.code_value    = NVL(hbm.post_itfc_status, 'NEW')
                    ) t1 #WHERE_CLAUSE#
            ]]></bm:query-sql>
        </bm:operation>
        <bm:operation name="execute">
            <bm:update-sql><![CDATA[
                begin
                hn_ws_request_pkg.post_bp_to_nc(p_bp_id =>${@bp_id}, p_user_id =>${/session/@user_id});
                end;
            ]]></bm:update-sql>
        </bm:operation>
    </bm:operations>
    <bm:query-fields>
        <bm:query-field name="bp_code" queryExpression="t1.bp_code like &apos;%&apos;||${@bp_code}||&apos;%&apos;"/>
        <bm:query-field name="bp_name" queryExpression="t1.bp_name like &apos;%&apos;||${@bp_name}||&apos;%&apos;"/>
        <bm:query-field name="extra_nam" queryExpression="t1.extra_nam like &apos;%&apos;||${@extra_nam}||&apos;%&apos;"/>
        <bm:query-field name="post_itfc_status_n" queryExpression="t1.post_itfc_status=${@post_itfc_status}"/>
    </bm:query-fields>
</bm:model>
