类 CountSqlParser

java.lang.Object
gu.sql2java.parser.CountSqlParser

public class CountSqlParser extends Object
sql解析类,提供更智能的count查询sql
作者:
liuzh
  • 字段详细资料

  • 构造器详细资料

    • CountSqlParser

      public CountSqlParser()
  • 方法详细资料

    • addAggregateFunctions

      public static void addAggregateFunctions(String functions)
      添加到聚合函数,可以是逗号隔开的多个函数前缀
      参数:
      functions -
    • getSmartCountSql

      public String getSmartCountSql(String sql)
      获取智能的countSql
      参数:
      sql -
    • getSmartCountSql

      public String getSmartCountSql(String sql, String countColumn)
      获取智能的countSql
      参数:
      sql -
      countColumn - 列名,默认 0
    • getSmartCountSql

      public String getSmartCountSql(net.sf.jsqlparser.statement.select.Select select, String countColumn)
      获取智能的countSql
      参数:
      select -
      countColumn - 列名,默认 0
    • getSmartCountSql

      public String getSmartCountSql(net.sf.jsqlparser.statement.select.Select select)
      获取智能的countSql
      参数:
      select -
    • getSimpleCountSql

      public String getSimpleCountSql(String sql)
      获取普通的Count-sql
      参数:
      sql - 原查询sql
      返回:
      返回count查询sql
    • getSimpleCountSql

      public String getSimpleCountSql(String sql, String name)
      获取普通的Count-sql
      参数:
      sql - 原查询sql
      返回:
      返回count查询sql
    • sqlToCount

      public void sqlToCount(net.sf.jsqlparser.statement.select.Select select, String name)
      将sql转换为count查询
      参数:
      select -
    • isSimpleCount

      public boolean isSimpleCount(net.sf.jsqlparser.statement.select.PlainSelect select)
      是否可以用简单的count查询方式
      参数:
      select -
    • processSelectBody

      public void processSelectBody(net.sf.jsqlparser.statement.select.SelectBody selectBody)
      处理selectBody去除Order by
      参数:
      selectBody -
    • processPlainSelect

      public void processPlainSelect(net.sf.jsqlparser.statement.select.PlainSelect plainSelect)
      处理PlainSelect类型的selectBody
      参数:
      plainSelect -
    • processWithItemsList

      public void processWithItemsList(List<net.sf.jsqlparser.statement.select.WithItem> withItemsList)
      处理WithItem
      参数:
      withItemsList -
    • processFromItem

      public void processFromItem(net.sf.jsqlparser.statement.select.FromItem fromItem)
      处理子查询
      参数:
      fromItem -
    • orderByHashParameters

      public boolean orderByHashParameters(List<net.sf.jsqlparser.statement.select.OrderByElement> orderByElements)
      判断Orderby是否包含参数,有参数的不能去
      参数:
      orderByElements -