<?xml version="1.0" encoding="UTF-8"?>
<!--
    $Author: 王建文  
    $Date: 2017-3-6 下午7:49:17  
    $Revision: 1.0  
    $Purpose: 
-->
<bm:model xmlns:bm="http://www.leaf-framework.org/schema/bm" needAccessControl="false">
    <bm:operations>
        <bm:operation name="query">
            <bm:query-sql><![CDATA[
                SELECT
                    (SELECT
                        COUNT(*)
                    FROM
                        prj_project p
                    WHERE
                        p.business_type                  = 'LEASEBACK' AND
                        
                        TO_CHAR(p.creation_date, 'yyyy-mm') = TO_CHAR(sysdate, 'yyyy-mm')
                    ) leaseback_count,
                    (SELECT
                        COUNT(*)
                    FROM
                        prj_project p
                    WHERE
                        p.business_type                  = 'FORMLB' AND
                        
                        TO_CHAR(p.creation_date, 'yyyy-mm') = TO_CHAR(sysdate, 'yyyy-mm')
                    ) formlb_count,
                    (SELECT
                        COUNT(*)
                    FROM
                        prj_project p
                    WHERE
                        p.business_type                  = 'LEASE' AND
                       
                        TO_CHAR(p.creation_date, 'yyyy-mm') = TO_CHAR(sysdate, 'yyyy-mm')
                    ) lease_count
                FROM
                    dual
            ]]></bm:query-sql>
        </bm:operation>
    </bm:operations>
    <bm:fields>
        <bm:field name="leaseback_count" databaseType="NUMBER" datatype="java.lang.Long" physicalName="LEASEBACK_COUNT"/>
        <bm:field name="formlb_count" databaseType="NUMBER" datatype="java.lang.Long" physicalName="FORMLB_COUNT"/>
        <bm:field name="lease_count" databaseType="NUMBER" datatype="java.lang.Long" physicalName="LEASE_COUNT"/>
    </bm:fields>
</bm:model>
