<?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
                    *
                FROM
                    (SELECT
                        pp.project_id,
                        (SELECT su.description FROM sys_user su WHERE su.user_id = pp.owner_user_id
                        ) project_manager,
                        t.node_sequence_num,
                        t.approver,
                        NVL(t.comment_text, DECODE(t.action_type, 'OK', '同意', 'NO', '拒绝')) comment_text,
                        bgfl_special_parameter_pkg.get_approver_comment_text(p_project_id => pp.project_id, p_rcpt_record_id => t.rcpt_record_id) risk_content,
                        SUBSTR(t.create_date_fmt,1,4) YEAR,
                        SUBSTR(t.create_date_fmt,6,2) MONTH,
                        SUBSTR(t.create_date_fmt,9,2) DAY
                    FROM
                        zj_wfl_approve_history_v t,
                        prj_project pp
                    WHERE
                        pp.wfl_instance_id = t.instance_id AND
                        t.workflow_code    = 'PROJECT_REPORT_WORK_FLOW'
                    ) t1 #WHERE_CLAUSE#
                ORDER BY
                    t1.node_sequence_num
            ]]></bm:query-sql>
        </bm:operation>
    </bm:operations>
</bm:model>
