类 CountSqlParser
java.lang.Object
gu.sql2java.parser.CountSqlParser
sql解析类,提供更智能的count查询sql
- 作者:
- liuzh
-
字段概要
字段 -
构造器概要
构造器 -
方法概要
修饰符和类型方法说明static voidaddAggregateFunctions(String functions) 添加到聚合函数,可以是逗号隔开的多个函数前缀getSimpleCountSql(String sql) 获取普通的Count-sqlgetSimpleCountSql(String sql, String name) 获取普通的Count-sqlgetSmartCountSql(String sql) 获取智能的countSqlgetSmartCountSql(String sql, String countColumn) 获取智能的countSqlgetSmartCountSql(net.sf.jsqlparser.statement.select.Select select) 获取智能的countSqlgetSmartCountSql(net.sf.jsqlparser.statement.select.Select select, String countColumn) 获取智能的countSqlbooleanisSimpleCount(net.sf.jsqlparser.statement.select.PlainSelect select) 是否可以用简单的count查询方式booleanorderByHashParameters(List<net.sf.jsqlparser.statement.select.OrderByElement> orderByElements) 判断Orderby是否包含参数,有参数的不能去voidprocessFromItem(net.sf.jsqlparser.statement.select.FromItem fromItem) 处理子查询voidprocessPlainSelect(net.sf.jsqlparser.statement.select.PlainSelect plainSelect) 处理PlainSelect类型的selectBodyvoidprocessSelectBody(net.sf.jsqlparser.statement.select.SelectBody selectBody) 处理selectBody去除Order byvoidprocessWithItemsList(List<net.sf.jsqlparser.statement.select.WithItem> withItemsList) 处理WithItemvoidsqlToCount(net.sf.jsqlparser.statement.select.Select select, String name) 将sql转换为count查询
-
字段详细资料
-
KEEP_ORDERBY
- 另请参阅:
-
-
构造器详细资料
-
CountSqlParser
public CountSqlParser()
-
-
方法详细资料
-
addAggregateFunctions
添加到聚合函数,可以是逗号隔开的多个函数前缀- 参数:
functions-
-
getSmartCountSql
获取智能的countSql- 参数:
sql-
-
getSmartCountSql
获取智能的countSql- 参数:
sql-countColumn- 列名,默认 0
-
getSmartCountSql
public String getSmartCountSql(net.sf.jsqlparser.statement.select.Select select, String countColumn) 获取智能的countSql- 参数:
select-countColumn- 列名,默认 0
-
getSmartCountSql
获取智能的countSql- 参数:
select-
-
getSimpleCountSql
获取普通的Count-sql- 参数:
sql- 原查询sql- 返回:
- 返回count查询sql
-
getSimpleCountSql
获取普通的Count-sql- 参数:
sql- 原查询sql- 返回:
- 返回count查询sql
-
sqlToCount
将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
处理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-
-