<?xml version="1.0" encoding="UTF-8"?>
<!--
    $Author: jack  
    $Date: 2014-6-9 上午10:44:24  
    $Revision: 1.0  
    $Purpose: 
-->
<bm:model xmlns:bm="http://www.leaf-framework.org/schema/bm">
    <bm:operations>
        <bm:operation name="query">
            <bm:query-sql><![CDATA[
                select t1.* from(    
       SELECT a.project_name,
       a.project_id,
       b.company_full_name,
       c.name,
       to_char(a.creation_date,
               'yyyy') this_year,
       to_char(a.creation_date,
               'mm') this_month,
       to_char(a.creation_date,
               'dd') this_day,
       e.description_text chance_cource_name,
       a.description_lease_item,
       a.financing_purpose,
       a.lease_subject,
       a.ref_v07
  FROM prj_project   a,
       fnd_companies b,
       exp_employees c,
       prj_chance d  ,
       (
       SELECT b.code_value,
       c.description_text
  FROM sys_codes        a,
       sys_code_values  b,
       fnd_descriptions c
 WHERE a.code = 'LCH501_CHANCE_SOURCE'
       AND a.code_id = b.code_id
       AND c.description_id = b.code_value_name_id
       AND c.language = 'ZHS'
       ) e
 WHERE a.company_id = b.company_id
       AND a.employee_id = c.employee_id
       and a.chance_id=d.chance_id
       and d.chance_source=e.code_value(+)) t1 #WHERE_CLAUSE#
]]></bm:query-sql>
        </bm:operation>
    </bm:operations>
</bm:model>
