<?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
                    h.hd_id,
                    h.data_id,
                    t.plan_year,
                    (t.plan_year
                    || '年') plan_year_n,
                    t.plan_month,
                    (t.plan_month
                    || '月') plan_month_n,
                    t.plan_frequency,
                    (SELECT
                        v.code_value_name
                    FROM
                        sys_code_values_v v
                    WHERE
                        v.code       = 'PLAN_FREQUENCY' AND
                        v.code_value = t.plan_frequency
                    ) plan_frequency_n,
                    h.description,
                    h.wfl_instance_id,
                    h.status,
                    (SELECT
                        v.code_value_name
                    FROM
                        sys_code_values_v v
                    WHERE
                        v.code       = 'VIRTUAL_CON_CONTENT_STATUS' AND
                        v.code_value = h.status
                    ) status_n
                FROM
                    sdic_fin_plan_rpt_month_hd h,
                    sdic_fin_plan_base_data t
                WHERE
                    h.data_id = t.data_id
                    and h.status='APPROVED'
            ]]></bm:query-sql>
        </bm:operation>
    </bm:operations>
</bm:model>
