<?xml version="1.0" encoding="UTF-8"?>
<!--
    $Author: hp  
    $Date: 2015-2-15 上午11:30:59  
    $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
                    tt.termination_date,
                    NVL(tt.division,'##') division,
                    COUNT(1)quantity
                FROM
                    (SELECT
                        cc.division,
                        SUBSTR(TO_CHAR(cc.termination_date, 'yyyy-mm'), 0, 7) termination_date
                    FROM
                        con_contract cc
                    WHERE
                        1                           = 1 AND
                        cc.data_class               = 'NORMAL' AND cc.contract_status = 'TERMINATE' AND
                        NVL(cc.hd_user_col_v10,'N') = 'N' AND
                        cc.division NOT  IN ('20')
                    ) tt
                GROUP BY
                    tt.termination_date,
                    tt.division
                ORDER BY
                    tt.termination_date ASC #WHERE_CLAUSE#
            ]]></bm:query-sql>
        </bm:operation>
    </bm:operations>
    <bm:fields>
        <bm:field name="division"/>
        <bm:field name="quantity"/>
        <bm:field name="termination_date"/>
    </bm:fields>
</bm:model>
