<?xml version="1.0" encoding="UTF-8"?>
<!--
    $Author: gaoyang  
    $Date: 2014-3-28 下午05:09:29  
    $Revision: 1.0  
    $Purpose: 
-->
<bm:model xmlns:bm="http://www.leaf-framework.org/schema/bm">
    <bm:operations>
        <bm:operation name="query">
            <bm:query-sql><![CDATA[
                SELECT
                    v.user_id,
                    (SELECT description FROM sys_user_v a WHERE a.user_id = v.user_id
                    ) user_desc,
                    (SELECT employee_name FROM sys_user_v a WHERE a.user_id = v.user_id
                    ) user_employee_name,
                    v.trx_category,
                    (SELECT
                        cv.trx_category_desc
                    FROM
                        aut_trx_category_v cv
                    WHERE
                        cv.trx_category = v.trx_category
                    ) trx_category_desc,
                    v.trx_id,
                    v.start_date,
                    v.end_date,
                    rtr.file_name trx_number,
                    rtr.file_name trx_name
                FROM
                    aut_trx_user_authorize v,
                    rpt_task_reports rtr #WHERE_CLAUSE#
            ]]></bm:query-sql>
        </bm:operation>
    </bm:operations>
    <bm:fields>
        <bm:field name="user_id"/>
        <bm:field name="user_desc"/>
        <bm:field name="user_employee_name"/>
        <bm:field name="trx_category"/>
        <bm:field name="trx_category_desc"/>
        <bm:field name="trx_id"/>
        <bm:field name="start_date" databaseType="DATE" datatype="java.util.Date"/>
        <bm:field name="end_date" databaseType="DATE" datatype="java.util.Date"/>
        <bm:field name="trx_number"/>
        <bm:field name="trx_name"/>
    </bm:fields>
    <bm:data-filters>
        <bm:data-filter enforceOperations="query" expression="(v.trx_id = rtr.report_id  and v.trx_category = &apos;CONFIG_REPORT_RESULT&apos; and rtr.report_id=${@report_id})"/>
    </bm:data-filters>
</bm:model>
