main_put_chart.lwm 7.27 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 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150
<?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
                        ROUND(nvl(SUM(cc.principal),0),0)
                    FROM
                        con_contract_cashflow cc,
                        con_contract c
                    WHERE
                        cc.contract_id =c.contract_id AND
                        to_char(c.creation_date,'yyyy')=to_char(sysdate,'yyyy')) year_count,
                        
  (SELECT
                        ROUND(nvl(SUM(cc.principal),0),0)
                    FROM
                        con_contract_cashflow cc,
                        con_contract c
                    WHERE
                        cc.contract_id =c.contract_id AND
                        to_char(c.creation_date,'yyyy')=to_char(sysdate,'yyyy') and
                        to_char(c.creation_date,'mm')='01') jan_count, 
   (SELECT
                        ROUND(nvl(SUM(cc.principal),0),0)
                    FROM
                        con_contract_cashflow cc,
                        con_contract c
                    WHERE
                        cc.contract_id =c.contract_id AND
                        to_char(c.creation_date,'yyyy')=to_char(sysdate,'yyyy') and
                        to_char(c.creation_date,'mm')='02') feb_count,
   (SELECT
                        ROUND(nvl(SUM(cc.principal),0),0)
                    FROM
                        con_contract_cashflow cc,
                        con_contract c
                    WHERE
                        cc.contract_id =c.contract_id AND
                        to_char(c.creation_date,'yyyy')=to_char(sysdate,'yyyy') and
                        to_char(c.creation_date,'mm')='03') mar_count,  
   (SELECT
                        ROUND(nvl(SUM(cc.principal),0),0)
                    FROM
                        con_contract_cashflow cc,
                        con_contract c
                    WHERE
                        cc.contract_id =c.contract_id AND
                        to_char(c.creation_date,'yyyy')=to_char(sysdate,'yyyy') and
                        to_char(c.creation_date,'mm')='04') apr_count, 
   (SELECT
                        ROUND(nvl(SUM(cc.principal),0),0)
                    FROM
                        con_contract_cashflow cc,
                        con_contract c
                    WHERE
                        cc.contract_id =c.contract_id AND
                        to_char(c.creation_date,'yyyy')=to_char(sysdate,'yyyy') and
                        to_char(c.creation_date,'mm')='05') may_count,  
   (SELECT
                        ROUND(nvl(SUM(cc.principal),0),0)
                    FROM
                        con_contract_cashflow cc,
                        con_contract c
                    WHERE
                        cc.contract_id =c.contract_id AND
                        to_char(c.creation_date,'yyyy')=to_char(sysdate,'yyyy') and
                        to_char(c.creation_date,'mm')='06') jun_count, 
   (SELECT
                        ROUND(nvl(SUM(cc.principal),0),0)
                    FROM
                        con_contract_cashflow cc,
                        con_contract c
                    WHERE
                        cc.contract_id =c.contract_id AND
                        to_char(c.creation_date,'yyyy')=to_char(sysdate,'yyyy') and
                        to_char(c.creation_date,'mm')='07') jul_count,  
   (SELECT
                        ROUND(nvl(SUM(cc.principal),0),0)
                    FROM
                        con_contract_cashflow cc,
                        con_contract c
                    WHERE
                        cc.contract_id =c.contract_id AND
                        to_char(c.creation_date,'yyyy')=to_char(sysdate,'yyyy') and
                        to_char(c.creation_date,'mm')='08') aug_count, 
    (SELECT
                        ROUND(nvl(SUM(cc.principal),0),0)
                    FROM
                        con_contract_cashflow cc,
                        con_contract c
                    WHERE
                        cc.contract_id =c.contract_id AND
                        to_char(c.creation_date,'yyyy')=to_char(sysdate,'yyyy') and
                        to_char(c.creation_date,'mm')='09') sep_count,  
    (SELECT
                        ROUND(nvl(SUM(cc.principal),0),0)
                    FROM
                        con_contract_cashflow cc,
                        con_contract c
                    WHERE
                        cc.contract_id =c.contract_id AND
                        to_char(c.creation_date,'yyyy')=to_char(sysdate,'yyyy') and
                        to_char(c.creation_date,'mm')='10') oct_count, 
    (SELECT
                        ROUND(nvl(SUM(cc.principal),0),0)
                    FROM
                        con_contract_cashflow cc,
                        con_contract c
                    WHERE
                        cc.contract_id =c.contract_id AND
                        to_char(c.creation_date,'yyyy')=to_char(sysdate,'yyyy') and
                        to_char(c.creation_date,'mm')='11') nov_count,
   (SELECT
                        ROUND(nvl(SUM(cc.principal),0),0)
                    FROM
                        con_contract_cashflow cc,
                        con_contract c
                    WHERE
                        cc.contract_id =c.contract_id AND
                        to_char(c.creation_date,'yyyy')=to_char(sysdate,'yyyy') and
                        to_char(c.creation_date,'mm')='12') dec_count          
                        
                        from dual
            ]]></bm:query-sql>
        </bm:operation>
    </bm:operations>
    <bm:fields>
        <bm:field name="year_count" databaseType="NUMBER" datatype="java.lang.Long" physicalName="YEAR_COUNT"/>
        <bm:field name="jan_count" databaseType="NUMBER" datatype="java.lang.Long" physicalName="JAN_COUNT"/>
        <bm:field name="feb_count" databaseType="NUMBER" datatype="java.lang.Long" physicalName="FEB_COUNT"/>
        <bm:field name="mar_count" databaseType="NUMBER" datatype="java.lang.Long" physicalName="MAR_COUNT"/>
        <bm:field name="apr_count" databaseType="NUMBER" datatype="java.lang.Long" physicalName="APR_COUNT"/>
        <bm:field name="may_count" databaseType="NUMBER" datatype="java.lang.Long" physicalName="MAY_COUNT"/>
        <bm:field name="jun_count" databaseType="NUMBER" datatype="java.lang.Long" physicalName="JUN_COUNT"/>
        <bm:field name="jul_count" databaseType="NUMBER" datatype="java.lang.Long" physicalName="JUL_COUNT"/>
        <bm:field name="aug_count" databaseType="NUMBER" datatype="java.lang.Long" physicalName="AUG_COUNT"/>
        <bm:field name="sep_count" databaseType="NUMBER" datatype="java.lang.Long" physicalName="SEP_COUNT"/>
        <bm:field name="oct_count" databaseType="NUMBER" datatype="java.lang.Long" physicalName="OCT_COUNT"/>
        <bm:field name="nov_count" databaseType="NUMBER" datatype="java.lang.Long" physicalName="NOV_COUNT"/>
        <bm:field name="dec_count" databaseType="NUMBER" datatype="java.lang.Long" physicalName="DEC_COUNT"/>
    </bm:fields>
</bm:model>