<?xml version="1.0" encoding="UTF-8"?>
<bm:model xmlns:bm="http://www.leaf-framework.org/schema/bm" accessControlMode="false" needAccessControl="false">
    <bm:operations>
        <bm:operation name="query">
            <bm:query-sql><![CDATA[
                SELECT *
                FROM (
                      SELECT t1.project_id, t1.project_number,t1.business_type_n,t1.employee_id_n,to_char(t1.creation_date,'YYYY-MM-DD') creation_date_desc,t1.key_customer_flag,t1.key_customer_id_n,t2.bp_name,t2.gender_n,t2.working_place,t2.company_nature_n,(
                          SELECT t3.score_result
                          FROM fnd_score_headers t3
                          WHERE t3.project_id = t1.project_id
                        ) AS score_result,(
                          SELECT t4.score_level
                          FROM fnd_score_headers t4
                          WHERE t4.project_id = t1.project_id
                        ) AS score_level,prj_project_lease_item_pkg.get_lease_items (t1.project_id) AS lease_desc,'备注' AS detail,t2.ref_v01,t2.ref_v02,t2.ref_v03,t2.ref_v04,t2.ref_v05
                      FROM prj_project_lv t1,prj_project_bp_lv t2
                      WHERE t1.project_id = t2.project_id
                        AND t2.bp_category = 'TENANT'
                    ) v #WHERE_CLAUSE#
            ]]></bm:query-sql>
        </bm:operation>
    </bm:operations>
    <bm:fields>
        <bm:field name="project_id" databaseType="NUMBER" datatype="java.lang.Long"/>
        <bm:field name="project_number" databaseType="VARCHAR2" datatype="java.lang.String"/>
        <bm:field name="business_type_n" databaseType="VARCHAR2" datatype="java.lang.String"/>
        <bm:field name="employee_id_n" databaseType="VARCHAR2" datatype="java.lang.String"/>
        <bm:field name="creation_date_desc" databaseType="VARCHAR2" datatype="java.lang.String"/>
        <bm:field name="key_customer_flag" databaseType="VARCHAR2" datatype="java.lang.String"/>
        <bm:field name="key_customer_id_n" databaseType="VARCHAR2" datatype="java.lang.String"/>
        <bm:field name="bp_name" databaseType="VARCHAR2" datatype="java.lang.String"/>
        <bm:field name="gender_n" databaseType="VARCHAR2" datatype="java.lang.String"/>
        <bm:field name="working_place" databaseType="VARCHAR2" datatype="java.lang.String"/>
        <bm:field name="company_nature_n" databaseType="VARCHAR2" datatype="java.lang.String"/>
        <bm:field name="score_result" databaseType="VARCHAR2" datatype="java.lang.String"/>
        <bm:field name="score_level" databaseType="VARCHAR2" datatype="java.lang.String"/>
        <bm:field name="lease_desc" databaseType="VARCHAR2" datatype="java.lang.String"/>
        <bm:field name="detail" databaseType="VARCHAR2" datatype="java.lang.String"/>
        <bm:field name="ref_v01" databaseType="VARCHAR2" datatype="java.lang.String"/>
        <bm:field name="ref_v02" databaseType="VARCHAR2" datatype="java.lang.String"/>
        <bm:field name="ref_v03" databaseType="VARCHAR2" datatype="java.lang.String"/>
        <bm:field name="ref_v04" databaseType="VARCHAR2" datatype="java.lang.String"/>
        <bm:field name="ref_v05" databaseType="VARCHAR2" datatype="java.lang.String"/>
    </bm:fields>
</bm:model>
