<?xml version="1.0" encoding="UTF-8"?>
<!--
    $Author: DJ  
    $Date: 2013-12-30 下午5:33:43  
    $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
                    TO_CHAR(to_date(${@internal_period_num}, 'yyyymm') + (rownum - 1),'yyyy-mm-dd') calc_end_date
                FROM
                    all_tables
                WHERE
                    rownum <=
                    (SELECT
                        last_day(to_date(${@internal_period_num},'yyyymm')) - to_date(${@internal_period_num},'yyyymm')+1
                    FROM
                        dual
                    )) #WHERE_CLAUSE#
            ]]></bm:query-sql>
        </bm:operation>
    </bm:operations>
    <bm:fields>
        <bm:field name="calc_end_date" forDisplay="true" forQuery="true" prompt="截止日"/>
        <!--   <bm:field name="internal_period_num"/> -->
    </bm:fields>
    <bm:query-fields>
        <bm:query-field name="calc_end_date" queryExpression="calc_end_date = ${@calc_end_date}"/>
    </bm:query-fields>
     <!--   <bm:query-fields>
        <bm:query-field name="internal_period_num" queryExpression="v.internal_period_num like ${@internal_period_num}"/>
    </bm:query-fields> -->
</bm:model>
