<?xml version="1.0" encoding="UTF-8"?>
<!--
    $Author: weiwuzhen  
    $Date: 2016-5-30 下午1:47:12  
    $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 
hs.project_id,
hs.prj_side_id,
(select to_char(sysdate,'yyyy') from dual)  current_year,--当前年
ha.approval_seq,--会议序号
p.project_name,--项目名称
SDIC_INDIVIDUAL_PKG.string_combination('select sv.description
from hn_doc_approver ppa, hn_doc_approval pa, hn_prj_project_side hs1,sys_user_v sv
 where ppa.approval_id=pa.approval_id
   and pa.document_id = hs1.prj_side_id
    and pa.approval_count=(
   select max(to_number(pa.approval_count)) from hn_doc_approval pa, hn_prj_project_side hs2
    where hs2.prj_side_id = pa.document_id
     and hs2.prj_side_id=hs1.prj_side_id)
     and ppa.approver_user_id = sv.user_id
     and hs1.prj_side_id=', hs.prj_side_id,'、') meet_name,
hs.side_item,--审议事项
hs.side_note,--变更说明
to_char( substr(ha.approver_comment_summary,1,4000)) approver_comment_summary,--综述
(select o.description
          from hls_lease_organization o
         where o.lease_organization = p.lease_organization) as lease_organization_n --业务部门
 from  hn_prj_project_side hs, prj_project p,hn_doc_approval ha
 where nvl(hs.side_discuss_times,0)=(
 select nvl(max(hs.side_discuss_times),0) from hn_prj_project_side hs
 where  hs.prj_side_id=${/parameter/@prj_side_id})					
 and hs.project_id=p.project_id
 and hs.prj_side_id=ha.document_id
 and ha.approval_count=(
select max(ha.approval_count) from hn_doc_approval ha
where ha.document_id=hs.prj_side_id
)
 and hs.prj_side_id=${/parameter/@prj_side_id}]]></bm:query-sql>
        </bm:operation>
    </bm:operations>
</bm:model>
