<?xml version="1.0" encoding="UTF-8"?>
<!--
    $Author: weiwuzhen  
    $Date: 2016-5-8 下午2:53:48  
    $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 
            p.group_leader_n,
            pb.right_decision,--有权决策机构
       P.project_number,
       p.project_id,
  	   to_char(pb.prj_bp_id) prj_bp_id,
       --新增--
       p.risk_reveal,--潜在风险及控制措施
       p.summarize,--结论性意见
       P.financing_purpose,--融资用途
        to_char(p.total_investment,'999,999,999,990.99') total_investment,--电站总投
       to_char(p.lease_item_total_price,'999,999,999,990.99') lease_item_total_price,--设备价值（万元）
       pb.pro_tenant_basic_bank,--基本账户开户银行
       pb.pro_tenant_main_bank,--主要结算户开户银行
       --------
       p.lease_organization_n,--主办部门
       p.employee_id_n,--项目经理 &项目成员
       (select to_char(sysdate, 'yyyy') || '年' || to_char(sysdate, 'mm') || '月' ||
               to_char(sysdate, 'dd') || '日'
          from dual) current_date, --当前日期
       pb.bp_name, --主承租人
       P.project_name,--项目名称
       p.co_type_n,--项目类别
       p.prj_scale,--项目规模
       p.co_union,--合作机构      to_char(to_date(p.creation_date_n,'yyyy-mm-dd'),'yyyy')||'/'||to_char(to_date(p.creation_date_n,'yyyy-mm-dd'),'mm')||'/'||to_char(to_date(p.creation_date_n,'yyyy-mm-dd'),'dd')
       creation_date_n,--项目立项时间
       to_char(p.prj_date,'yyyy')||'/'||to_char(p.prj_date,'mm')||'/'||to_char(p.prj_date,'dd')
       prj_date,--开展尽调时间       
       p.chance_advice,--立项意见
       p.chance_advice_carry,--立项条件落实情况       
       p.project_flow_intro,--产权转回
       p.l_analysis_appraise,--保险情况
       pb.workers_number--在册职工人数
  from prj_project_lv p ,prj_project_bp_lv pb
  where p.project_id=pb.project_id
  and  pb.bp_category='GUARANTOR'
  --AND  pb.bp_type='GUARANTOR'
  and p.project_id=${/parameter/@project_id}
  ]]></bm:query-sql>
        </bm:operation>
    </bm:operations>
</bm:model>
