<?xml version="1.0" encoding="UTF-8"?>

<bm:model xmlns:bm="http://www.leaf-framework.org/schema/bm" needAccessControl="true">
    <bm:operations>
        <bm:operation name="query">
            <bm:query-sql><![CDATA[
          select nvl((select 'Y'
                       from dual
                      where exists (select 1
                               from exp_emp_assign_e_v           ee,
                                    hls_bp_master                h,
                                    hls_bp_master_agent_division hb
                              where ee.unit_id = h.unit_id
                                and h.bp_id = hb.bp_id
                                and h.bp_category = 'AGENT'
                                and ee.user_id = ${/session/@user_id}
                                and hb.division in ('70', '92'))),
                     'N') second_lease_flag
            from dual

                ]]></bm:query-sql>
        </bm:operation>
    </bm:operations>
</bm:model>
