<?xml version="1.0" encoding="UTF-8"?>
<bm:model xmlns:bm="http://www.leaf-framework.org/schema/bm">
    <bm:operations>
        <bm:operation name="query">
            <bm:query-sql><![CDATA[
                SELECT
                    pp.project_id,
                    pp.project_number,
                    pp.project_name,
                    pqv.contract_seq,
                    pqv.document_category,
       	            pqv.calc_session_id,
                    pqv.quotation_type_name,
                    pqv.price_list_name,
                    pqv.main_contract_flag_desc,
                    pqv.quotation_id
                FROM
                    prj_quotation_v pqv,
                    prj_project pp
                WHERE
                    pqv.document_category = 'PROJECT' AND
                    pqv.document_id       = pp.project_id AND
                    pp.project_id         =${@project_id}
                    order by pqv.contract_seq
            ]]></bm:query-sql>
        </bm:operation>
        <bm:operation name="update">
            <bm:update-sql><![CDATA[
                UPDATE
                    prj_quotation t
                SET
                    t.main_contract_flag = ${@main_contract_flag},
                    t.last_updated_by = ${/session/@user_id},
                    t.last_update_date = sysdate
                WHERE
                    t.quotation_id=${@quotation_id}
            ]]></bm:update-sql>
        </bm:operation>
    </bm:operations>
</bm:model>
