package zr.zrpower.queryengine;

import zr.zrpower.queryengine.service.QueryConfig;
import java.util.List;

public class QueryCfgBean {
  QueryConfig queryConfig = null;
  public QueryCfgBean() {
    try {
      queryConfig = new QueryConfig();
    }
    catch (Exception ex) {
    }
  }

  /**
   * 获取不包含指定表名称的数据表列表
   * @return List            包含(表名称、表中文名称)的List
   */
  public List GetTableList(String tableName) {
    List result = null;
    if (queryConfig != null) {
      try {
        result = queryConfig.GetTableList(tableName);
      }
      catch (Exception ex) {
      }
    }
    return result;
  }

  public List GetFieldList(String TableName) {
    List result = null;
    if (queryConfig != null) {
      try {
        result = queryConfig.GetFieldList(TableName);
      }
      catch (Exception ex) {
      }
    }
    return result;
  }

  /**
   * 获取数据表的字段列表   表名.表名.表名......
   * @param TableName String   数据表名称
   * @param flag   是否包含字段类型
   * @return List            包含(字段名称、字段中文名称)的List
   */
  public List GetTableFieldList(String TableName, boolean flag) {
    List result = null;
    if (queryConfig != null) {
      try {
        result = queryConfig.GetTableFieldList(TableName, flag);
      }
      catch (Exception ex) {
      }
    }
    return result;




  }

  /**
   * 获取表名.字段名中文
   * @param tableFieldName String   表名.字段名(英文)
   * @return resultStr           表名.字段名中文
   */
  public String GetTableFieldCnNameByEn(String tableFieldName) {
    String resultStr = "";
    if (queryConfig != null) {
      try {
        resultStr = queryConfig.GetTableFieldCnNameByEn(tableFieldName);
      }
      catch (Exception ex) {
        resultStr = "";
      }
    }
    return resultStr;

  }

}
