<?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
                        ROWNUM RN,
                        t1.project_number,
                        t1.project_status_desc,
                        t2.bp_class,
                        t2.organization_code,
                        t2.bp_name,
                        t2.id_card_no,
                        t1.project_id
                    FROM
                        prj_project_v t1,
                        prj_project_bp t2
                    WHERE
                        t1.project_id      = t2.project_id AND
                        t2.bp_category     = 'TENANT' AND
                        t1.project_status IN('NEW','APPROVED_RETURN') AND
                        ROWNUM            <= NVL(${@record_num_from},20)
                    ORDER BY
                        t1.project_number
                    )
                WHERE
                    RN > NVL(${@record_num_to},0)
                ORDER BY
                    RN
            ]]></bm:query-sql>
        </bm:operation>
    </bm:operations>
    <bm:fields>
        <bm:field name="project_id" databaseType="NUMBER" datatype="java.lang.Long" physicalName="PROJECT_ID"/>
        <bm:field name="project_number" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="PROJECT_NUMBER"/>
        <bm:field name="project_status_desc" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="PROJECT_STATUS_DESC"/>
        <bm:field name="bp_class" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="BP_CLASS"/>
        <bm:field name="organization_code" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="ORGANIZATION_CODE"/>
        <bm:field name="bp_name" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="BP_NAME"/>
        <bm:field name="id_card_no" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="ID_CARD_NO"/>
    </bm:fields>
</bm:model>