<?xml version="1.0" encoding="UTF-8"?>
<!--
    $Author:
    $Date: 2020-05-11
    $Revision: 1.0  
    $Purpose:
-->
<bm:model xmlns:bm="http://www.leaf-framework.org/schema/bm" needAccessControl="false">
    <bm:fields>
        <bm:field name="role_code" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="ROLE_CODE"/>
    </bm:fields>

    <bm:operations>
        <bm:operation name="query">
            <bm:query-sql><![CDATA[
            	 Select nvl(decode(${/session/@user_id},
                        10413,
                        'NO',
                        (Select decode(t.role_code,
									   '0009',
                                       'NO',
									   '0038',
                                       'NO',
                                       '0014',
                                       'YES',
                                       '0013',
                                       'YES',
                                       '0017',
                                       'YES',
                                       'HAND',
                                       'YES',
                                       'N')
                           From sys_role t
                          Where t.role_id = ${/session/@role_id})), 'N') as role_code
            From dual
    		]]></bm:query-sql>
        </bm:operation>
    </bm:operations>
</bm:model>
