<?xml version="1.0" encoding="UTF-8"?>
<bm:model xmlns:o="leaf.database.local.oracle" xmlns:e="leaf.service.exception" xmlns:f="leaf.database.features" xmlns:bm="http://www.leaf-framework.org/schema/bm">
    <bm:fields>
        <bm:field name="node_action_id" databaseType="NUMBER" datatype="java.lang.Long" physicalName="NODE_ACTION_ID" prompt="ZJ_WFL_WORKFLOW_NODE_ACTION.NODE_ACTION_ID"/>
        <bm:field name="node_id" databaseType="NUMBER" datatype="java.lang.Long" physicalName="NODE_ID" prompt="ZJ_WFL_WORKFLOW_NODE_ACTION.NODE_ID"/>
        <bm:field name="jump_node_id" databaseType="NUMBER" datatype="java.lang.Long" physicalName="JUMP_NODE_ID" prompt="ZJ_WFL_WORKFLOW_NODE_ACTION.JUMP_NODE_ID"/>
        <bm:field name="jump_node_desc" datatype="java.lang.String" forInsert="false" forUpdate="false"/>
        <bm:field name="action_type" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="ACTION_TYPE" prompt="ZJ_WFL_WORKFLOW_NODE_ACTION.ACTION_TYPE"/>
        <bm:field name="action_type_desc" datatype="java.lang.String" forInsert="false" forUpdate="false"/>
        <bm:field name="sequence_num" databaseType="NUMBER" datatype="java.lang.Long" physicalName="SEQUENCE_NUM" prompt="ZJ_WFL_WORKFLOW_NODE_ACTION.SEQUENCE_NUM"/>
        <bm:field name="procedure_id" databaseType="NUMBER" datatype="java.lang.Long" physicalName="PROCEDURE_ID" prompt="ZJ_WFL_WORKFLOW_NODE_ACTION.PROCEDURE_ID"/>
        <bm:field name="exec_procedure" datatype="java.lang.String" forInsert="false" forUpdate="false"/>
        <bm:field name="procedure_code" datatype="java.lang.String" forInsert="false" forUpdate="false"/>
        <bm:field name="procedure_desc" datatype="java.lang.String" forInsert="false" forUpdate="false"/>
        <bm:field name="service_id" databaseType="NUMBER" datatype="java.lang.Long" physicalName="SERVICE_ID" prompt="ZJ_WFL_WORKFLOW_NODE_ACTION.SERVICE_ID"/>
        <bm:field name="service_name" datatype="java.lang.String" forInsert="false" forUpdate="false"/>
        <bm:field name="service_desc" datatype="java.lang.String" forInsert="false" forUpdate="false"/>
        <bm:field name="node_action_desc" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="NODE_ACTION_DESC" prompt="ZJ_WFL_WORKFLOW_NODE_ACTION.NODE_ACTION_DESC"/>
        <bm:field name="node_action_prompt" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="NODE_ACTION_PROMPT" prompt="ZJ_WFL_WORKFLOW_NODE_ACTION.NODE_ACTION_PROMPT"/>
        <bm:field name="default_action_flag" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="DEFAULT_ACTION_FLAG" prompt="ZJ_WFL_WORKFLOW_NODE_ACTION.DEFAULT_ACTION_FLAG"/>
        <bm:field name="can_transfer_approver_flag" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="CAN_TRANSFER_APPROVER_FLAG"/>
    </bm:fields>
    <bm:operations>
        <bm:operation name="query">
            <bm:query-sql><![CDATA[
                SELECT
                    *
                FROM
                    (SELECT
                        t1.node_action_id,
                        t1.node_id,
                        t1.jump_node_id,
                        t1.jump_node_desc,
                        t1.action_type,
                        t1.action_type_desc,
                        t1.sequence_num,
                        t1.procedure_id,
                        t1.exec_procedure,
                        t1.procedure_code,
                        t1.procedure_desc,
                        t1.service_id,
                        t1.service_name,
                        t1.service_desc,
                        t1.node_action_desc,
                        NVL(t1.node_action_prompt,'您确认吗？') AS node_action_prompt,
                        t1.default_action_flag,
                        NULL can_transfer_approver_flag
                    FROM
                        zj_wfl_workflow_node_action_v t1
                    UNION ALL
                    SELECT
                        -999 node_action_id,
                        t.node_id,
                        NULL jump_node_id,
                        NULL jump_node_desc,
                        '-1' action_type,
                        NULL action_type_desc,
                        99999 sequence_num,
                        NULL procedure_id,
                        NULL exec_procedure,
                        NULL procedure_code,
                        NULL procedure_desc,
                        NULL service_id,
                        NULL service_name,
                        NULL service_desc,
                        '转交' node_action_desc,
                        NULL node_action_prompt,
                        NULL default_action_flag,
                        t.can_transfer_approver_flag
                    FROM
                        zj_wfl_workflow_node t
                    WHERE
                        t.can_transfer_approver_flag='Y'
                    ) h #WHERE_CLAUSE#
                ORDER BY
                    h.sequence_num
            ]]></bm:query-sql>
        </bm:operation>
    </bm:operations>
    <bm:data-filters>
        <bm:data-filter enforceOperations="query" expression="h.node_id = ${@node_id} and h.action_type in (&apos;1&apos;,&apos;2&apos;,&apos;3&apos;) and exists(select 1 from zj_wfl_instance_node_recipient rcpt where rcpt.record_id =${@rcpt_record_id})"/>
    </bm:data-filters>
</bm:model>
