use of com.baomidou.mybatisplus.solon.plugins.inner.PaginationInnerInterceptor in project solon by noear.
the class SelectBodyToPlainSelectTest method testPaginationInterceptorOrderByEmptyColumnFix.
@Test
void testPaginationInterceptorOrderByEmptyColumnFix() {
String actualSql = new PaginationInnerInterceptor().concatOrderBy("select * from test", ITEMS);
assertThat(actualSql).isEqualTo("SELECT * FROM test ORDER BY column ASC");
String actualSqlWhere = new PaginationInnerInterceptor().concatOrderBy("select * from test where 1 = 1", ITEMS);
assertThat(actualSqlWhere).isEqualTo("SELECT * FROM test WHERE 1 = 1 ORDER BY column ASC");
}
use of com.baomidou.mybatisplus.solon.plugins.inner.PaginationInnerInterceptor in project solon-examples by noear.
the class Config method db1_interceptor.
@Bean
public void db1_interceptor(@Db("db1") org.apache.ibatis.session.Configuration cfg) {
MybatisPlusInterceptor plusInterceptor = new MybatisPlusInterceptor();
plusInterceptor.addInnerInterceptor(new PaginationInnerInterceptor(DbType.MYSQL));
cfg.setCacheEnabled(false);
cfg.addInterceptor(plusInterceptor);
}
Aggregations