<?xml version="1.0" encoding="UTF-8"?>
<!--
    $Author: gaoyang  
    $Date: 2013-10-2 下午04:15:23  
    $Revision: 1.0  
    $Purpose: 
-->
<bm:model xmlns:bm="http://www.leaf-framework.org/schema/bm">
    <bm:operations>
        <bm:operation name="execute">
            <bm:update-sql><![CDATA[
                BEGIN
                    SELECT
                        COUNT(*)
                    INTO
                        ${@number}
                    FROM
                        con_contract_lease_item ccli,
                        con_contract cc,
                        prj_project pp
                    WHERE
                        cc.project_id                = pp.project_id AND
                        pp.project_status NOT       IN ('REJECT', 'CLOSED') AND
                        ccli.item_frame_number       = ${@item_frame_number} AND
                        cc.contract_id               = ccli.contract_id AND
                        cc.data_class='NORMAL' and
                        cc.contract_status NOT      IN ('SIGN_REJECT', 'CANCEL', 'CLOSED') AND
                        ccli.contract_lease_item_id != NVL(${@contract_lease_item_id}, 0);
                END;
            ]]></bm:update-sql>
            <bm:parameters>
                <bm:parameter name="number" input="false" output="true" outputPath="@number"/>
            </bm:parameters>
        </bm:operation>
        <bm:operation name="update">
            <bm:update-sql><![CDATA[
                BEGIN
                    SELECT
                        ppb.bp_class
                    INTO
                        ${@bp_class_out}
                    FROM
                        con_contract cc ,
                        prj_project ppb
                    WHERE
                        cc.project_id =ppb.project_id AND
                        cc.contract_id=${@contract_id};
                END;
            ]]></bm:update-sql>
            <bm:parameters>
                <bm:parameter name="bp_class_out" input="false" output="true" outputPath="@bp_class_out"/>
            </bm:parameters>
        </bm:operation>
    </bm:operations>
</bm:model>
