<?xml version="1.0" encoding="UTF-8"?>
<!--
    $Author: jack  
    $Date: 2014-11-27 下午3:36:18  
    $Revision: 1.0  
    $Purpose: 
-->
<bm:model xmlns:bm="http://www.leaf-framework.org/schema/bm" defaultOrderBy="t1.order_seq">
    <bm:operations>
        <bm:operation name="query">
            <bm:query-sql><![CDATA[select t1.* from (SELECT a.table_name,
       b.comments,
       CASE a.table_name
         WHEN 'HLS_BP_MASTER' THEN
          1
         WHEN 'CON_CONTRACT' THEN
          1
         WHEN 'CON_CONTRACT_BP' THEN
          1
         WHEN 'CON_CONTRACT_LEASE_ITEM' THEN
          1
         WHEN 'CON_CONTRACT_ITEM_DETAIL' THEN
          1
         WHEN 'HLS_BP_MASTER_BANK_ACCOUNT' THEN
          1
         WHEN 'HLS_BP_MASTER_CONTACT_INFO' THEN
          1
         ELSE
          2
       END order_seq
  FROM user_tables      a,
       all_tab_comments b
 WHERE a.table_name = b.table_name and b.OWNER=USER) t1 #WHERE_CLAUSE# 
  ORDER BY t1.order_seq 
]]></bm:query-sql>
        </bm:operation>
    </bm:operations>
    <bm:fields>
        <bm:field name="table_name" databaseType="VARCHAR2" datatype="java.lang.String" displayWidth="230" forDisplay="true" forQuery="true" physicalName="TABLE_NAME" prompt="变更内容"/>
        <bm:field name="comments" databaseType="VARCHAR2" datatype="java.lang.String" displayWidth="230" forDisplay="true" forQuery="true" physicalName="COMMENTS" prompt="变更描述"/>
        <bm:field name="order_seq" databaseType="NUMBER" datatype="java.lang.Long" physicalName="ORDER_SEQ"/>
    </bm:fields>
    <bm:query-fields>
        <bm:query-field name="table_name" queryExpression="t1.table_name like ${@table_name}"/>
        <bm:query-field name="table_name_desc" queryExpression="t1.comments like ${@table_name_desc}"/>
        <bm:query-field name="source_table" queryExpression="t1.table_name like ${@source_table}"/>
        <bm:query-field name="source_table_desc" queryExpression="t1.comments like ${@source_table_desc}"/>
    </bm:query-fields>
</bm:model>
