<?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
                    ppa.approver_user_id,
                    (SELECT
                        su.description
                    FROM
                        sys_user su
                    WHERE
                        su.user_id = ppa.approver_user_id
                    ) user_name,
                    ppa.approve_status,
                    DECODE(ppa.approve_status, 'agree', '同意', 'refuse', '拒绝', 'discuss', '再议', 'leave', '请假') approve_status_n,
                    ppa.reject_reason
                FROM
                    prj_project_approver ppa
                WHERE
                    ppa.approval_id =
                    (SELECT
                        MAX(pp.approval_id)
                    FROM
                        prj_project_approval pp
                    WHERE
                        pp.project_id = ${@project_id}
                    )
            ]]></bm:query-sql>
        </bm:operation>
    </bm:operations>
</bm:model>
