<?xml version="1.0" encoding="UTF-8"?>
<!--
    $Author: chenlingfeng  
    $Date: 2013-11-29 上午10:13:50  
    $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 *
  from (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,
               (select v.code_value_name from sys_code_values_v v where v.code = 'HLS211_BP_CLASS' and v.code_value = bp.bp_class) trx_number,
               bp.chance_bp_name trx_name
          from aut_trx_user_authorize v, hn_chance_bp bp
         where v.trx_id = bp.chance_bp_id
           and v.trx_category = 'CHANCE_BP') t1

				  
				  #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:query-fields>
        <bm:query-field name="user_desc" queryExpression="t1.user_desc like ${@user_desc}"/>
        <bm:query-field name="trx_number" queryExpression="t1.trx_number like ${@trx_number}"/>
        <bm:query-field name="trx_name" queryExpression="t1.trx_name like ${@trx_name}"/>
    </bm:query-fields>
</bm:model>
