<?xml version="1.0" encoding="UTF-8"?>
<!--
    $Author: DJ  
    $Date: 2013-3-3 下午12:08:49  
    $Revision: 1.0  
    $Purpose: 
-->
<bm:model xmlns:bm="http://www.leaf-framework.org/schema/bm">
    <bm:fields>
        <bm:field name="column_name" displayWidth="250" forDisplay="true" forQuery="true" prompt="HLS.COLUMN_NAME"/>
        <bm:field name="column_desc" displayWidth="250" forDisplay="true" forQuery="true" prompt="HLS.COLUMN_DESC"/>
        <bm:field name="data_type"/>
        <bm:field name="data_type_desc" displayWidth="100" forDisplay="true" prompt="HLS.COLUMN_DATA_TYPE"/>
    </bm:fields>
    <bm:operations>
        <bm:operation name="query">
            <bm:query-sql><![CDATA[
			  select * from
			  (
				select a.column_name,
				       a.table_name,
				       b.comments        as column_desc,
				       a.data_type,
				       v.code_value_name as data_type_desc,
				       a.column_id
				  from user_tab_columns a, user_col_comments b, sys_code_values_v v
				 WHERE a.table_name = ${@table_name}
				   and b.table_name = a.table_name
				   and b.column_name = a.column_name
				   and v.code = 'GLD104_COLUMN_TYPE'
				   and v.code_value = a.data_type
				   and not exists (select 1
				          from gld_je_trx_tab_columns c
				         where c.je_transaction_code = ${@je_transaction_code}
				           and c.table_name = a.table_name
				           and c.table_column = a.column_name)
			   )
			   #WHERE_CLAUSE#
			 order by column_id
            ]]></bm:query-sql>
        </bm:operation>
    </bm:operations>
    <bm:query-fields>
        <bm:query-field field="column_name" queryOperator="like"/>
        <bm:query-field field="column_desc" queryOperator="like"/>
    </bm:query-fields>
</bm:model>
