Package org.aoju.bus.pager.parser
Class CountSqlParser
java.lang.Object
org.aoju.bus.pager.parser.CountSqlParser
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic voidaddAggregateFunctions(String functions) 添加到聚合函数,可以是逗号隔开的多个函数前缀getSimpleCountSql(String sql) 获取普通的Count-sqlgetSimpleCountSql(String sql, String name) 获取普通的Count-sqlgetSmartCountSql(String sql) 获取智能的countSqlgetSmartCountSql(String sql, String column) 获取智能的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查询
-
Field Details
-
KEEP_ORDERBY
- See Also:
-
-
Constructor Details
-
CountSqlParser
public CountSqlParser() -
CountSqlParser
-
-
Method Details
-
addAggregateFunctions
添加到聚合函数,可以是逗号隔开的多个函数前缀- Parameters:
functions- 函数
-
getSmartCountSql
-
getSmartCountSql
-
getSimpleCountSql
-
getSimpleCountSql
-
sqlToCount
将sql转换为count查询- Parameters:
select- 查询name- 名称
-
isSimpleCount
public boolean isSimpleCount(net.sf.jsqlparser.statement.select.PlainSelect select) 是否可以用简单的count查询方式- Parameters:
select- 查询- Returns:
- the boolean
-
processSelectBody
public void processSelectBody(net.sf.jsqlparser.statement.select.SelectBody selectBody) 处理selectBody去除Order by- Parameters:
selectBody- 查询信息
-
processPlainSelect
public void processPlainSelect(net.sf.jsqlparser.statement.select.PlainSelect plainSelect) 处理PlainSelect类型的selectBody- Parameters:
plainSelect- 计划查询
-
processWithItemsList
处理WithItem- Parameters:
withItemsList- WithItem
-
processFromItem
public void processFromItem(net.sf.jsqlparser.statement.select.FromItem fromItem) 处理子查询- Parameters:
fromItem- FromItem
-
orderByHashParameters
public boolean orderByHashParameters(List<net.sf.jsqlparser.statement.select.OrderByElement> orderByElements) 判断Orderby是否包含参数,有参数的不能去- Parameters:
orderByElements- OrderByElement- Returns:
- the boolean
-