<?xml version="1.0" encoding="UTF-8"?>
<bm:model xmlns:bm="http://www.leaf-framework.org/schema/bm" needAccessControl="false">
    <bm:operations>
        <bm:operation name="query">
            <bm:query-sql><![CDATA[
                SELECT
                    (SELECT
                        DECODE(COUNT((MAX(zw.node_id))), 0, 'N', 'Y') rerurn_flag
                    FROM
                        zj_wfl_approve_record_v zw,
                        prj_project pp,
                        zj_wfl_workflow_node tt
                    WHERE
                        zw.record_type     != 'AUTO' AND
                        zw.node_action_type = 'JUMP' AND
                        zw.instance_id      = pp.wfl_instance_id AND
                        pp.project_id       = t1.project_id AND
                        zw.node_id          = tt.node_id AND
                        tt.sequence_num     > 50
                    GROUP BY
                        zw.node_id
                    ) rerurn_flag
                FROM
                    con_contract t1 #WHERE_CLAUSE#
            ]]></bm:query-sql>
        </bm:operation>
    </bm:operations>
    <!-- <bm:data-filters>
        <bm:data-filter enforceOperations="query" expression="t1.contract_id=${@contract_id}"/>
    </bm:data-filters> -->
    <bm:query-fields>
        <bm:query-field name="contract_id" queryExpression="t1.contract_id=${@contract_id}"/>
    </bm:query-fields>
</bm:model>
