mirror of
https://gitee.com/chinabugotech/hutool.git
synced 2025-07-21 15:09:48 +08:00
fix count bug
This commit is contained in:
@@ -50,6 +50,17 @@ public class DbTest {
|
||||
Assert.assertEquals(1, page1.size());
|
||||
}
|
||||
|
||||
@Test
|
||||
public void pageWithParamsTest() throws SQLException {
|
||||
String sql = "select * from user where name = ?";
|
||||
PageResult<Entity> result = Db.use().page(
|
||||
sql, Page.of(0, 3), "张三");
|
||||
|
||||
Assert.assertEquals(2, result.getTotal());
|
||||
Assert.assertEquals(1, result.getTotalPage());
|
||||
Assert.assertEquals(2, result.size());
|
||||
}
|
||||
|
||||
@Test
|
||||
public void countTest() throws SQLException {
|
||||
final long count = Db.use().count("select * from user");
|
||||
|
Reference in New Issue
Block a user