<?xml version="1.0" encoding="UTF-8"?>
<bm:model xmlns:bm="http://www.leaf-framework.org/schema/bm">
    <bm:operations>
        <bm:operation name="execute">
            <bm:update-sql><![CDATA[
begin
  -- Call the procedure
  ds_document_interface_pkg.update_app_condition(p_contract_id => ${@contract_id},
                                                 p_down_payment_ratio => ${@down_payment_ratio},
                                                 p_down_payment => ${@down_payment},
                                                 p_lease_times => ${@lease_times},
                                                 p_product_name => ${@product_name},
                                                 p_user_id => ${/session/@user_id});
end;
            ]]></bm:update-sql>
        </bm:operation>
        <bm:operation name="query">
            <bm:query-sql><![CDATA[
select pp.dealer_cd,
       pp.chance_no,
       pp.machine_type,
       pp.project_id,
       cc.contract_id,
       cc.contract_number,
       cc.bp_id_agent_level1,
       (select bp_name from hls_bp_master hbm where hbm.bp_id = cc.bp_id_agent_level1) bp_id_agent_level1_n,
       cc.other_fee,
       cc.finance_amount,
       cc.product_code,
       cc.product_name,
       cc.product_type,
       cc.sub_price_list,
       cc.sub_price_list_name,
       cc.sub_price_list_code,
       cc.down_payment,
       cc.down_payment_ratio,
       cc.lease_term_month,
       cc.lease_times,
       cc.lease_term,
       cc.annual_pay_times
  from con_contract cc, prj_project pp
 where cc.project_id = pp.project_id(+)
and cc.contract_id = ${@contract_id}
            ]]></bm:query-sql>
        </bm:operation>
    </bm:operations>
</bm:model>
