<?xml version="1.0" encoding="UTF-8"?>
<!--
    $Author: huangtianyang
    $Date: 2018/6/29 下午4:39
    $Revision: 1.0 
-->
<bm:model xmlns:bm="http://www.leaf-framework.org/schema/bm">
    <bm:operations>
        <bm:operation name="query">
            <bm:query-sql><![CDATA[
                SELECT
                    t1.CREDIT_CATE,
                    COUNT (1) credit_count,
                    (
                        SELECT
                            COUNT (1)
                        FROM
                            HLS_BP_MASTER_FUNDS_LV
                    ) credit_sum,
                    TRUNC (
                        COUNT (1) / (
                            SELECT
                                COUNT (1)
                            FROM
                                HLS_BP_MASTER_FUNDS_LV
                                where credit_cate in ('银行','金融机构')
                        ),
                        2
                    ) * 100 credit_per_cent,
                    (
                        SELECT
                            COUNT (1)
                        FROM
                            HLS_BP_MASTER_FUNDS_LV
                        WHERE
                            CREATION_DATE >= TRUNC (SYSDATE, 'mm')
                    ) current_month_append
                FROM
                    HLS_BP_MASTER_FUNDS_LV t1
                where t1.credit_cate in ('银行','金融机构')
                GROUP BY
                    t1.CREDIT_CATE
            ]]></bm:query-sql>
        </bm:operation>
    </bm:operations>
</bm:model>