<?xml version="1.0" encoding="UTF-8"?>
<!--
    $Author: gaoyang  
    $Date: 2013-10-10 下午06:38:56  
    $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 (select count(*)
	          from prj_project_bp d
	         where d.project_id = ${@project_id}
	           and d.bp_category in ('TENANT','TENANT_SEC')) number_of_tenant,
	       	(select count(*)
	          from prj_project_bp d
	         where d.project_id = ${@project_id}
	           and d.bp_category = 'GUARANTOR') number_of_guarantor,
	       	(select count(*)
	          from prj_project_act_ctrler_hd h
	         where h.project_id = ${@project_id}) number_of_actual_controller
  			from dual
  		]]></bm:query-sql>
        </bm:operation>
    </bm:operations>
    <bm:fields>
        <bm:field name="number_of_tenant" databaseType="NUMBER" datatype="java.lang.Long" physicalName="number_of_tenant"/>
        <bm:field name="number_of_guarantor" databaseType="NUMBER" datatype="java.lang.Long" physicalName="NUMBER_OF_GUARANTOR"/>
        <bm:field name="number_of_actual_controller" databaseType="NUMBER" datatype="java.lang.Long" physicalName="NUMBER_OF_ACTUAL_CONTROLLER"/>
    </bm:fields>
</bm:model>
