<?xml version="1.0" encoding="UTF-8"?>
<!--
    $Author: jack  
    $Date: 2014-6-6 下午2:26:15  
    $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.*,rownum from (    
            SELECT a.bp_category,
       a.bp_class,
       a.bp_type,
       a.project_id,
       b.bp_name,
       b.registered_capital,
       b.founded_date,
       b.ref_v01            money_resouce,
       b.corporate_code,
       b.ref_v06            hos_lvl,
       c.description_text   legal_form_name,
       b.ref_n01            service_person,
       b.ref_n02            area_rank,
       b.ref_v04            area_around,
       b.ref_v03            construct_around,
       b.ref_n03            employee_acount,
       b.ref_n04            bed_account,
       b.ref_n05*100   bed_used_persent,
       b.ref_n07            year_in_account,
       b.ref_n08            year_out_account,
       b.ref_n06*100   drug_persent,
       b.ref_n09            avg_in_account,
       b.ref_n10            avg_account,
       b.ref_v05            avg_day,
       b.main_products      hos_area,
       b.paid_up_capital    income,
       b.primary_business   ,
       b.ref_v02    hos_comments,
       a.description project_comments
  FROM prj_project_bp a,
       hls_bp_master b,
       (SELECT b.code_value,
               c.description_text
          FROM sys_codes        a,
               sys_code_values  b,
               fnd_descriptions c
         WHERE a.code_id = b.code_id
               AND a.code = 'HLS211_LEGAL_FORM'
               AND b.code_value_name_id = c.description_id
               AND c.language = 'ZHS') c

 WHERE a.bp_id = b.bp_id
       AND b.legal_form = c.code_value(+)
      )  t1 #WHERE_CLAUSE#
       ]]></bm:query-sql>
        </bm:operation>
    </bm:operations>
</bm:model>
