<?xml version="1.0" encoding="UTF-8"?>
<!--
    $Author: hp  
    $Date: 2015-2-15 上午10:22:47  
    $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 * from    (SELECT substr(to_char(cc.termination_date, 'yyyy-mm-dd'), 0, 7) termination_date,
       COUNT(1) total_quantity
  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')
 GROUP BY substr(to_char(cc.termination_date, 'yyyy-mm-dd'), 0, 7)
 ORDER BY substr(to_char(cc.termination_date, 'yyyy-mm-dd'), 0, 7) ASC) t1
 where t1.termination_date >= nvl(${@from_termination_date},t1.termination_date)
 and t1.termination_date <= nvl(${@to_termination_date},t1.termination_date)

            ]]></bm:query-sql>
        </bm:operation>
    </bm:operations>
    <bm:fields>
        <bm:field name="termination_date"/>
        <bm:field name="total_quantity"/>
    </bm:fields>
</bm:model>
