<?xml version="1.0" encoding="UTF-8"?>
<!--
    $Author: weiwuzhen  
    $Date: 2016-5-30 下午1:56:09  
    $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  (SELECT COUNT(1)
           FROM hn_doc_approver har ,hn_prj_project_side hs,hn_doc_approval hal
           WHERE hs.prj_side_id=hal.document_id
           and hal.approval_id=har.approval_id
           and hal.approval_count=(
           select max(to_number(hal.approval_count)) from hn_doc_approval hal, hn_prj_project_side hs
           where hs.prj_side_id=hal.document_id
           and hs.prj_side_id=${/parameter/@prj_side_id})
           and hs.prj_side_id=${/parameter/@prj_side_id})meet_num,--总人数
           (SELECT COUNT(1)
           FROM hn_doc_approver har ,hn_prj_project_side hs,hn_doc_approval hal
           WHERE hs.prj_side_id=hal.document_id
           and hal.approval_id=har.approval_id
           AND har.approve_status = 'agree'
           and hal.approval_count=(
           select max(to_number(hal.approval_count)) from hn_doc_approval hal, hn_prj_project_side hs
           where hs.prj_side_id=hal.document_id
           and hs.prj_side_id=${/parameter/@prj_side_id})
           and hs.prj_side_id=${/parameter/@prj_side_id} ) meet_agree,--同意人数
           (SELECT COUNT(1)
           FROM hn_doc_approver har ,hn_prj_project_side hs,hn_doc_approval hal
           WHERE hs.prj_side_id=hal.document_id
           and hal.approval_id=har.approval_id
           AND har.approve_status = 'refuse'
           and hal.approval_count=(
           select max(to_number(hal.approval_count)) from hn_doc_approval hal, hn_prj_project_side hs
           where hs.prj_side_id=hal.document_id
           and hs.prj_side_id=${/parameter/@prj_side_id})
           and hs.prj_side_id=${/parameter/@prj_side_id} ) meet_refuse,--拒绝人数
           (SELECT COUNT(1)
           FROM hn_doc_approver har ,hn_prj_project_side hs,hn_doc_approval hal
           WHERE hs.prj_side_id=hal.document_id
           and hal.approval_id=har.approval_id
           AND har.approve_status = 'discuss'
           and hal.approval_count=(
           select max(to_number(hal.approval_count)) from hn_doc_approval hal, hn_prj_project_side hs
           where hs.prj_side_id=hal.document_id
           and hs.prj_side_id=${/parameter/@prj_side_id})
           and hs.prj_side_id=${/parameter/@prj_side_id} ) meet_discuss--再议人数          
           from dual]]></bm:query-sql>
        </bm:operation>
    </bm:operations>
</bm:model>
