<?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 t.reservation_id,
       v.project_number,
       v.project_name,
       t.project_id,
       t.reserve_amount,
       t.paid_date,
       t.status,
       (SELECT fd.description_text
          FROM sys_codes sc, sys_code_values scv, fnd_descriptions fd
         WHERE sc.code = 'RESERVE_STATUS'
           AND sc.code_id = scv.code_id
           AND scv.code_value = t.status
           AND fd.description_id = scv.code_value_name_id
           AND fd.language = 'ZHS') status_n,
       t.description,
       t.paid_date_fin,
       t.confirm_status,
       (SELECT fd.description_text
          FROM sys_codes sc, sys_code_values scv, fnd_descriptions fd
         WHERE sc.code = 'RESERVATION_CONFIRM_STATUS'
           AND sc.code_id = scv.code_id
           AND scv.code_value = t.confirm_status
           AND fd.description_id = scv.code_value_name_id
           AND fd.language = 'ZHS') as confirm_status_desc,
       t.description_fin
  from tre_funds_reservation t, prj_project_v v
 where t.project_id = v.project_id and t.project_id=${/parameter/@project_id}
            ]]></bm:query-sql>
        </bm:operation>
    </bm:operations>
</bm:model>
