public static String countSql(String sourceSql, String dbType) {
        switch (dbType) {
            case "mysql":
            case "h2":
            case "oceanbase":
            case "oracle":
            case "dm":
                return sourceSql.replaceAll("(?i)(?<=select)(.*)(?=from)", " count(1) ");
            case "postgresql":
            case "sqlserver":
                int lastIndexOfOrderBy = sourceSql.toLowerCase().lastIndexOf("order by");
                if (lastIndexOfOrderBy != -1) {
                    return sourceSql.substring(0, lastIndexOfOrderBy).replaceAll("(?i)(?<=select)(.*)(?=from)", " count(1) ");
                }
                return sourceSql.replaceAll("(?i)(?<=select)(.*)(?=from)", " count(1) ");
            default:
                throw new NotSupportYetException("PageUtil not support this dbType:" + dbType);
        }
    }
@Test
    void testCountSql() {
        String sourceSql = "select * from test where a = 1";

        String targetSql = "select count(1) from test where a = 1";

        assertEquals(PageUtil.countSql(sourceSql, "mysql"), targetSql);
        assertEquals(PageUtil.countSql(sourceSql, "h2"), targetSql);
        assertEquals(PageUtil.countSql(sourceSql, "postgresql"), targetSql);
        assertEquals(PageUtil.countSql(sourceSql, "oceanbase"), targetSql);
        assertEquals(PageUtil.countSql(sourceSql, "dm"), targetSql);
        assertEquals(PageUtil.countSql(sourceSql, "oracle"), targetSql);
        assertEquals(PageUtil.countSql(sourceSql, "sqlserver"), targetSql);

        assertThrows(NotSupportYetException.class, () -> PageUtil.countSql(sourceSql, "xxx"));
    }