<?xml version="1.0" encoding="UTF-8"?>
<bm:model xmlns:bm="http://www.leaf-framework.org/schema/bm">
    <bm:fields>
        <bm:field name="id" databaseType="NUMBER" datatype="java.lang.Long"/>
        <bm:field name="code" databaseType="VARCHAR2" datatype="java.lang.String" forDisplay="true" forQuery="true" prompt="角色代码"/>
        <bm:field name="description" databaseType="VARCHAR2" datatype="java.lang.String" forDisplay="true" forQuery="true" prompt="角色描述"/>
    </bm:fields>
    <bm:operations>
        <bm:operation name="query">
            <bm:query-sql><![CDATA[
				SELECT *
  FROM (SELECT a.role_id   AS id,
               a.role_code AS code,
               a.role_name description
          FROM sys_role_vl a
         WHERE a.enabled_flag = 'Y'
         AND trunc(SYSDATE) BETWEEN trunc(a.start_date) AND nvl(trunc(a.end_date),SYSDATE)) v #WHERE_CLAUSE#
 ORDER BY v.id
		   ]]></bm:query-sql>
        </bm:operation>
    </bm:operations>
    <bm:query-fields>
        <bm:query-field name="code" queryExpression="v.code like ${@code}"/>
        <bm:query-field name="description" queryExpression="v.description like ${@description}"/>
    </bm:query-fields>
</bm:model>
