<?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
                    hv.create_date_fmt,
                    decode(hv.node_desc,'-','60-信审总监审批',hv.node_desc) node_desc,
                    hv.approver,
                    nvl(hv.action_type_desc,'同意') action_type_desc,
                    hv.comment_text,
                    cus_get_date_str((hv.creation_date - NVL(
                    (SELECT
                        MAX(ar.creation_date)
                    FROM
                        zj_wfl_approve_record ar
                    WHERE
                        ar.instance_id            = hv.instance_id AND
                        hv.instance_approve_count = ar.approve_count AND
                        ar.record_type           != 'AUTO' AND
                        ar.record_id              <hv.record_id
                    ),hv.instance_cr_date))) date_between
                FROM
                    ZJ_WFL_APPROVE_HISTORY_V hv #WHERE_CLAUSE#
                ORDER BY
                    hv.record_id
            ]]></bm:query-sql>
        </bm:operation>
    </bm:operations>
    <bm:data-filters>
        <bm:data-filter enforceOperations="query" expression="hv.instance_id = ${@instance_id}"/>
        <bm:data-filter enforceOperations="query" expression="nvl(hv.record_type,&apos;OK&apos;) != &apos;NOTICE&apos;"/>
    </bm:data-filters>
</bm:model>
