<?xml version="1.0" encoding="UTF-8"?>
<!--
    $Author: mumu  
    $Date: 2014-7-24 下午11:37:22  
    $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 t.*,
            		(SELECT t2.bp_code FROM hls_bp_master t2 WHERE t2.bp_id = t.bpo_id) company_code,
					(SELECT t2.bp_name FROM hls_bp_master t2 WHERE t2.bp_id = t.bpo_id) company_name,
            		(SELECT b.bp_code FROM prj_project_bp b WHERE b.project_id = t.project_id and b.bp_id = t.bp_id_agent_level1 and rownum=1) bp_agent_code,
            		(SELECT b.bp_name FROM prj_project_bp b WHERE b.project_id = t.project_id and b.bp_id = t.bp_id_agent_level1 and rownum=1 ) bp_agent_name
            		FROM prj_project_v t
            		where t.project_id = ${@project_id} and rownum=1
            ]]></bm:query-sql>
        </bm:operation>
    </bm:operations>
</bm:model>