<?xml version="1.0" encoding="UTF-8"?>
<bm:model xmlns:bm="http://www.leaf-framework.org/schema/bm">
    <bm:operations>
        <bm:operation name="query">
            <bm:query-sql><![CDATA[
            select * from (
                SELECT
                    v.internal_period_num,
                    v.period_name
                FROM
                    gld_period_all_v v
                WHERE
                    v.adjustment_flag = 'N' AND
                    v.company_id      = 2145 AND
                    v.end_date       >= to_date((TO_CHAR(sysdate, 'yyyy') - 2)
                    || '-'
                    || (TO_CHAR(sysdate, 'mm-dd')), 'yyyy-mm-dd') AND
                    v.start_date <= TRUNC(sysdate)
                ORDER BY
                    v.internal_period_num desc) t1
                    #WHERE_CLAUSE#
            ]]></bm:query-sql>
        </bm:operation>
    </bm:operations>
    <bm:fields>
        <bm:field name="internal_period_num" forDisplay="true" forQuery="true" prompt="计算期间"/>
        <bm:field name="period_name" databaseType="VARCHAR2" datatype="java.lang.String" forDisplay="true" forQuery="true" physicalName="PERIOD_NAME" prompt="期间名称"/>
    </bm:fields>
    <bm:query-fields>
        <bm:query-field name="internal_period_num" queryExpression="t1.internal_period_num like &apos;%&apos;||${@internal_period_num}||&apos;%&apos;"/>
        <bm:query-field name="period_name" queryExpression="t1.period_name like &apos;%&apos;||${@period_name}||&apos;%&apos;"/>
    </bm:query-fields>
</bm:model>
