<?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 (select hv.comment_text
			          from zj_wfl_workflow_instance wi, zj_wfl_approve_history_v hv
			         where wi.instance_id = hd.wfl_instance_id
			           and wi.instance_id = hv.instance_id
			           and hv.node_sequence_num = 130 --节点序号
			           and hv.record_id = (select max(hv1.record_id)
			                                 from zj_wfl_workflow_instance wi1,
			                                      zj_wfl_approve_history_v hv1
			                                where wi1.instance_id = hd.wfl_instance_id
			                                  and wi1.instance_id = hv1.instance_id
			                                  and hv1.node_sequence_num = 130 --节点序号
			                               )) business_department_head,--分管副总(融资)审批
			       zr.user_id,
			       ev.user_desc
			  from csh_payment_req_hd hd, zj_wfl_approve_record zr, exp_emp_user_e_v ev
			 where zr.record_id =
			       (select hv.record_id
			          from zj_wfl_workflow_instance wi, zj_wfl_approve_history_v hv
			         where wi.instance_id = hd.wfl_instance_id
			           and wi.instance_id = hv.instance_id
			           and hv.node_sequence_num = 130 --节点序号
			           and hv.record_id = (select max(hv1.record_id)
			                                 from zj_wfl_workflow_instance wi1,
			                                      zj_wfl_approve_history_v hv1
			                                where wi1.instance_id = hd.wfl_instance_id
			                                  and wi1.instance_id = hv1.instance_id
			                                  and hv1.node_sequence_num = 130 --节点序号
			                               ))
			   and zr.user_id = ev.user_id
			   and hd.payment_req_id=${/parameter/@payment_req_id}
			   ]]></bm:query-sql>
            <!-- <bm:parameters>
                <bm:parameter inputPath="/parameter/@payment_req_id"/>
            </bm:parameters> -->
        </bm:operation>
    </bm:operations>
</bm:model>
