private String count(IMapping mapping, WrapperData ew, boolean withLimit) {
        MapperSql text = new MapperSql();
        text.COUNT(mapping, ew.table(), ew);
        text.WHERE_GROUP_BY(mapping, ew);
        String sql = text.toString();
        if (withLimit) {
            sql = ew.wrappedByPaged(sql).get(mapping);
        }
        if (ew.hasGroupBy()) {
            return joinWithSpace(SELECT.key(), COUNT_ASTERISK, FROM.key(), brackets(sql), tmpTable());
        } else {
            return sql;
        }
    }
https://blog.csdn.net/w_y_t_/article/details/51416201
<p>
https://www.cnblogs.com/xunux/p/4882761.html
<p>
https://blog.csdn.net/weixin_41175479/article/details/80608512
fluent-mybatis/src/main/java/cn/org/atool/fluent/mybatis/base/provider/CommonSqlKit.java