<?xml version="1.0" encoding="UTF-8"?>
<!--
    $Author: ZLF  
    $Date: 2015-2-6 上午1:47:23  
    $Revision: 1.0  
    $Purpose: 
-->
<bm:model xmlns:bm="http://www.leaf-framework.org/schema/bm">
    <bm:operations>
        <bm:operation name="update">
            <bm:update-sql><![CDATA[
                BEGIN
                    UPDATE
                        sys_parameter_values pv
                    SET
                        pv.parameter_value=TO_CHAR(to_number(pv.parameter_value)+${@step})
                    WHERE
                        pv.parameter_id=103 AND
                        (
                            NOT EXISTS
                            (SELECT
                                1
                            FROM
                                acr_invoice_hd h
                            WHERE
                                h.invoice_hd_id  IN (${:@invoice_hd_id}) AND
                                h.receipt_number IS NOT NULL
                            ) OR
                            ${/parameter/@again_flag}='Y'
                        );
                END;
            ]]></bm:update-sql>
        </bm:operation>
    </bm:operations>
</bm:model>
