month_prj_division.lwm 3.39 KB
Newer Older
Spencer Chang's avatar
Spencer Chang committed
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85
<?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
                        hls_division h,
                        prj_project p
                    WHERE
                        h.division     =p.division AND
                        h.description  ='二手车' AND
                        
                        
                        TO_CHAR(p.creation_date, 'yyyy-mm') = TO_CHAR(sysdate, 'yyyy-mm')
                    ) old_count,
                    (SELECT
                        COUNT(*)
                    FROM
                        hls_division h,
                        prj_project p
                    WHERE
                        h.division     =p.division AND
                        h.description  ='新车' AND
                        
                        
                        TO_CHAR(p.creation_date, 'yyyy-mm') = TO_CHAR(sysdate, 'yyyy-mm')
                    ) new_count,
                    (SELECT
                        COUNT(*)
                    FROM
                        hls_division h,
                        prj_project p
                    WHERE
                        h.division     =p.division AND
                        h.description  ='节能环保' AND
                        
                        
                        TO_CHAR(p.creation_date, 'yyyy-mm') = TO_CHAR(sysdate, 'yyyy-mm')
                    ) protection_count,
                    (SELECT
                        COUNT(*)
                    FROM
                        hls_division h,
                        prj_project p
                    WHERE
                        h.division     =p.division AND
                        h.description  ='公共建设' AND
                        
                        
                        TO_CHAR(p.creation_date, 'yyyy-mm') = TO_CHAR(sysdate, 'yyyy-mm')
                    ) public_count,
                    (SELECT
                        COUNT(*)
                    FROM
                        hls_division h,
                        prj_project p
                    WHERE
                        h.division     =p.division AND
                        h.description  ='其它' AND
                        
                        
                        TO_CHAR(p.creation_date, 'yyyy-mm') = TO_CHAR(sysdate, 'yyyy-mm')
                    ) other_count
                FROM
                    dual
            ]]></bm:query-sql>
        </bm:operation>
    </bm:operations>
    <bm:fields>
        <bm:field name="old_count" databaseType="NUMBER" datatype="java.lang.Long" physicalName="OLD_COUNT"/>
        <bm:field name="new_count" databaseType="NUMBER" datatype="java.lang.Long" physicalName="NEW_COUNT"/>
        <bm:field name="protection_count" databaseType="NUMBER" datatype="java.lang.Long" physicalName="PROTECTION_COUNT"/>
        <bm:field name="public_count" databaseType="NUMBER" datatype="java.lang.Long" physicalName="PUBLIC_COUNT"/>
        <bm:field name="other_count" databaseType="NUMBER" datatype="java.lang.Long" physicalName="OTHER_COUNT"/>
    </bm:fields>
</bm:model>