|
@@ -24,20 +24,13 @@ import com.baomidou.mybatisplus.extension.plugins.pagination.DialectModel;
|
|
* @since 2022-04-13
|
|
* @since 2022-04-13
|
|
*/
|
|
*/
|
|
public class XCloudDialect implements IDialect {
|
|
public class XCloudDialect implements IDialect {
|
|
- /**
|
|
|
|
- *
|
|
|
|
- * @param originalSql
|
|
|
|
- * @param offset
|
|
|
|
- * @param limit
|
|
|
|
- * @return
|
|
|
|
- */
|
|
|
|
|
|
|
|
@Override
|
|
@Override
|
|
public DialectModel buildPaginationSql(String originalSql, long offset, long limit) {
|
|
public DialectModel buildPaginationSql(String originalSql, long offset, long limit) {
|
|
StringBuilder sql = new StringBuilder(originalSql).append(" LIMIT ");
|
|
StringBuilder sql = new StringBuilder(originalSql).append(" LIMIT ");
|
|
if (offset != 0L) {
|
|
if (offset != 0L) {
|
|
- sql.append(" ("+FIRST_MARK +","+SECOND_MARK+") ") ;
|
|
|
|
- return new DialectModel(sql.toString(), offset+1, offset+limit).setConsumerChain();
|
|
|
|
|
|
+ sql.append(" (" + FIRST_MARK + "," + SECOND_MARK + ") ");
|
|
|
|
+ return new DialectModel(sql.toString(), offset + 1, offset + limit).setConsumerChain();
|
|
} else {
|
|
} else {
|
|
sql.append(FIRST_MARK);
|
|
sql.append(FIRST_MARK);
|
|
return new DialectModel(sql.toString(), limit).setConsumer(true);
|
|
return new DialectModel(sql.toString(), limit).setConsumer(true);
|