<?xml version="1.0" encoding="UTF-8"?>
<bm:model xmlns:ns2="leaf.database.local.oracle" xmlns:f="leaf.database.features" xmlns:bm="http://www.leaf-framework.org/schema/bm">
    <bm:operations>
        <bm:operation name="query">
            <bm:query-sql><![CDATA[
        Select nvl((Select distinct zw.workflow_code
                                 From zj_wfl_workflow zw
                                Where zw.workflow_id = t1.workflow_id),'N') as workflow_code,
               nvl((Select hm.is_constru_unit
                     From prj_project pp, hls_bp_master hm
                    Where pp.invoice_agent_id = hm.bp_id
                      And pp.wfl_instance_id = t1.instance_id),
                   'N') as is_constru_unit,
		              (select pp.division from prj_project pp where pp.wfl_instance_id=t1.instance_id) as division,
				(select cc.division from csh_payment_req_hd crh,con_contract cc where crh.contract_id=cc.contract_id and crh.wfl_instance_id=t1.instance_id) payment_division
          From zj_wfl_workflow_instance t1
         #WHERE_CLAUSE#
          ]]></bm:query-sql>
        </bm:operation>
    </bm:operations>
</bm:model>
