<?xml version="1.0" encoding="UTF-8"?>
<!--
    $Author: chenlingfeng  
    $Date: 2017-12-14 下午6:04:14  
    $Revision: 1.0  
    $Purpose: 
-->
<bm:model xmlns:bm="http://www.leaf-framework.org/schema/bm">
    <bm:operations>
        <bm:operation name="query">
            <bm:query-sql><![CDATA[
                SELECT
                    *
                FROM
                    (SELECT
                        t.prj_bp_id,
                        t.project_id,
                        t.bp_id,
                        t.bp_category,
                        t.bp_type,
                        (SELECT bt.description FROM hls_bp_type bt WHERE bt.bp_type = t.bp_type
                        ) AS bp_type_n,
                        (SELECT
                            bc.description
                        FROM
                            hls_bp_category bc
                        WHERE
                            bc.bp_category = t.bp_category
                        ) AS bp_category_n,
                        t2.bp_code,
                        t2.bp_name
                    FROM
                        prj_project_bp t,
                        hls_bp_master t2
                    WHERE
                        t.bp_id = t2.bp_id
                    ) t1 #WHERE_CLAUSE#
            ]]></bm:query-sql>
        </bm:operation>
    </bm:operations>
    <bm:query-fields>
        <bm:query-field name="bp_type" queryExpression="t1.bp_type=${@bp_type}"/>
    </bm:query-fields>
    <bm:data-filters>
        <bm:data-filter expression="t1.project_id = ${@project_id}"/>
    </bm:data-filters>
</bm:model>
