Interface CountSqlParser

All Known Implementing Classes:
DefaultCountSqlParser

public interface CountSqlParser
sql解析类,提供更智能的count查询sql
Since:
Java 17+
Author:
Kimi Liu
  • Field Details

    • AGGREGATE_FUNCTIONS

      static final Set<String> AGGREGATE_FUNCTIONS
      聚合函数,以下列函数开头的都认为是聚合函数
  • Method Details

    • addAggregateFunctions

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

      default String getSmartCountSql(String sql)
      获取智能的countSql
      Parameters:
      sql - sql
      Returns:
      the string
    • getSmartCountSql

      String getSmartCountSql(String sql, String countColumn)
      获取智能的countSql
      Parameters:
      sql - sql
      countColumn - 列名,默认 0
      Returns:
      the string