18.MyBatis的分页查询

 

分页的实现

分页sql

mysql

1
select * from 表名  limit startIndex, pageSize

oracle

1
2
3
4
5
6
7
8
9
10
11
12
SELECT * 
FROM
(
SELECT RUNUM AS RN, t1.*
FROM
(
SELECT * FROM 表名 where 条件 order by
) t1
WHERE RUNUM <= 10
-- RUNUM只能<,不能>
)
WHERE RN > 5

UserDao.java

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
package com.course.dao;

import java.util.List;
import java.util.Map;

import com.course.vo.PageBean;
import com.course.vo.User;

public interface UserDao {

public List<User> queryByPage1(Integer startIndex, Integer pageSize);

public List<User> queryByPage2(Map<String, Object> paramMap);

public List<User> queryAllUser();

public Integer queryTotalCount();

public List<User> queryByPage5(PageBean pageBean);

}

UserMapper.xml

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
<?xml version="1.0" encoding="UTF-8"?>

<!DOCTYPE mapper
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">


<mapper namespace="com.course.dao.UserDao">

<select id="queryByPage1" parameterType="int" resultType="com.course.vo.User">
select id, name, age, address, birthday
from user
limit #{param1}, #{param2}
</select>

<select id="queryByPage2" parameterType="map" resultType="com.course.vo.User">
select id, name, age, address, birthday
from user
limit #{startIndex}, #{pageSize}
</select>

<select id="queryAllUser" resultType="com.course.vo.User">
select id, name, age, address, birthday
from user
</select>

<select id="queryTotalCount" resultType="int">
select count(id)
from user
</select>

<select id="queryByPage5" parameterType="com.course.vo.PageBean" resultType="com.course.vo.User">
select id, name, age, address, birthday
from user
limit #{startIndex}, #{pageSize}
</select>

</mapper>

创建PageBean.java

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
package com.course.vo;

public class PageBean {

private Integer pageIndex;

private Integer pageSize;

private Integer totalRecordCount;

private Integer totalPageCount;

private Integer startIndex;

public Integer getPageIndex() {
return pageIndex;
}

public void setPageIndex(Integer pageIndex) {
this.pageIndex = pageIndex;
// 设置起始的记录索引
if(this.pageIndex != null && this.pageSize != null) {
this.startIndex = this.pageIndex * this.pageSize;
}
}

public Integer getPageSize() {
return pageSize;
}

public void setPageSize(Integer pageSize) {
this.pageSize = pageSize;
// 设置起始的记录索引
if(this.pageIndex != null && this.pageSize != null) {
this.startIndex = this.pageIndex * this.pageSize;
}
// 计算总页数
if(this.totalRecordCount != null && this.pageSize != null) {
this.totalPageCount = (int) Math.ceil((this.totalRecordCount*1.0)/this.pageSize);
}
}

public Integer getTotalRecordCount() {
return totalRecordCount;
}

public void setTotalRecordCount(Integer totalRecordCount) {
this.totalRecordCount = totalRecordCount;
// 计算总页数
if(this.totalRecordCount != null && this.pageSize != null) {
this.totalPageCount = (int) Math.ceil((this.totalRecordCount*1.0)/this.pageSize);
}
}

public Integer getTotalPageCount() {
return totalPageCount;
}

public void setTotalPageCount(Integer totalPageCount) {
this.totalPageCount = totalPageCount;
}

public Integer getStartIndex() {
return startIndex;
}

public void setStartIndex(Integer startIndex) {
this.startIndex = startIndex;
}

}

测试类:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
package com.course.test;

import java.util.HashMap;
import java.util.List;
import java.util.Map;

import org.apache.ibatis.session.RowBounds;
import org.apache.ibatis.session.SqlSession;
import org.junit.Test;

import com.course.dao.UserDao;
import com.course.util.MyBatisUtil;
import com.course.vo.PageBean;
import com.course.vo.User;

public class MainTest {

private SqlSession sqlSession = MyBatisUtil.openSqlSession();
private UserDao userDao = sqlSession.getMapper(UserDao.class);

@Test
public void queryByPage01() {
Integer pageIndex = 2;
Integer pageSize = 10;
Integer startIndex = pageIndex * pageSize;
List<User> userList = userDao.queryByPage1(startIndex, pageSize);
for (User userVO : userList) {
System.out.println(userVO.toString());
}

MyBatisUtil.closeSqlSession(sqlSession);
}

@Test
public void queryByPage02() {
Integer pageIndex = 2;
Integer pageSize = 10;
Integer startIndex = pageIndex * pageSize;
Map<String , Object> paramMap = new HashMap<>();
paramMap.put("startIndex", startIndex);
paramMap.put("pageSize", pageSize);
List<User> userList = userDao.queryByPage2(paramMap);
for (User userVO : userList) {
System.out.println(userVO.toString());
}

MyBatisUtil.closeSqlSession(sqlSession);
}

@Test
public void queryByPage03() {
Integer pageIndex = 2;
Integer pageSize = 10;
Integer startIndex = pageIndex * pageSize;
RowBounds rowBounds = new RowBounds(startIndex, pageSize);
List<User> userList = sqlSession.selectList("com.course.dao.UserDao.queryAllUser", null, rowBounds);
for (User userVO : userList) {
System.out.println(userVO.toString());
}

MyBatisUtil.closeSqlSession(sqlSession);
}

@Test
public void queryByPage04() {
Integer totalCount = userDao.queryTotalCount();
System.out.println("totalCount = " + totalCount);
Integer pageIndex = 2;
Integer pageSize = 10;
Integer startIndex = pageIndex * pageSize;
Map<String , Object> paramMap = new HashMap<>();
paramMap.put("startIndex", startIndex);
paramMap.put("pageSize", pageSize);
List<User> userList = userDao.queryByPage2(paramMap);
for (User userVO : userList) {
System.out.println(userVO.toString());
}

MyBatisUtil.closeSqlSession(sqlSession);
}

@Test
public void queryByPage05() {
Integer pageIndex = 1;
Integer pageSize = 10;

PageBean pageBean = new PageBean();
pageBean.setPageIndex(pageIndex);
pageBean.setPageSize(pageSize);
Integer totalCount = userDao.queryTotalCount();
pageBean.setTotalRecordCount(totalCount);

List<User> userList = userDao.queryByPage5(pageBean);
for (User userVO : userList) {
System.out.println(userVO.toString());
}
System.out.println("第" + (pageBean.getPageIndex()+1) + "/" + pageBean.getTotalPageCount() + "页,共" + pageBean.getTotalRecordCount() + "条记录");

MyBatisUtil.closeSqlSession(sqlSession);
}

}
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
queryByPage01():
DEBUG [main] - ==> Preparing: select id, name, age, address, birthday from user limit ?, ?
DEBUG [main] - ==> Parameters: 20(Integer), 10(Integer)
DEBUG [main] - <== Total: 10
User [id=26, name=user26, age=10, address=address26, birthday=null]
User [id=27, name=user27, age=10, address=address27, birthday=null]
User [id=28, name=user28, age=10, address=address28, birthday=null]
User [id=29, name=user29, age=10, address=address29, birthday=null]
User [id=30, name=user30, age=10, address=address30, birthday=null]
User [id=31, name=user31, age=10, address=address31, birthday=null]
User [id=32, name=user32, age=10, address=address32, birthday=null]
User [id=33, name=user33, age=10, address=address33, birthday=null]
User [id=34, name=user34, age=10, address=address34, birthday=null]
User [id=35, name=user35, age=10, address=address35, birthday=null]

queryByPage02():
DEBUG [main] - ==> Preparing: select id, name, age, address, birthday from user limit ?, ?
DEBUG [main] - ==> Parameters: 20(Integer), 10(Integer)
DEBUG [main] - <== Total: 10
User [id=26, name=user26, age=10, address=address26, birthday=null]
User [id=27, name=user27, age=10, address=address27, birthday=null]
User [id=28, name=user28, age=10, address=address28, birthday=null]
User [id=29, name=user29, age=10, address=address29, birthday=null]
User [id=30, name=user30, age=10, address=address30, birthday=null]
User [id=31, name=user31, age=10, address=address31, birthday=null]
User [id=32, name=user32, age=10, address=address32, birthday=null]
User [id=33, name=user33, age=10, address=address33, birthday=null]
User [id=34, name=user34, age=10, address=address34, birthday=null]
User [id=35, name=user35, age=10, address=address35, birthday=null]

queryByPage03():
DEBUG [main] - ==> Preparing: select id, name, age, address, birthday from user
DEBUG [main] - ==> Parameters:
User [id=26, name=user26, age=10, address=address26, birthday=null]
User [id=27, name=user27, age=10, address=address27, birthday=null]
User [id=28, name=user28, age=10, address=address28, birthday=null]
User [id=29, name=user29, age=10, address=address29, birthday=null]
User [id=30, name=user30, age=10, address=address30, birthday=null]
User [id=31, name=user31, age=10, address=address31, birthday=null]
User [id=32, name=user32, age=10, address=address32, birthday=null]
User [id=33, name=user33, age=10, address=address33, birthday=null]
User [id=34, name=user34, age=10, address=address34, birthday=null]
User [id=35, name=user35, age=10, address=address35, birthday=null]

queryByPage04():
DEBUG [main] - ==> Preparing: select count(id) from user
DEBUG [main] - ==> Parameters:
DEBUG [main] - <== Total: 1
totalCount = 154
DEBUG [main] - ==> Preparing: select id, name, age, address, birthday from user limit ?, ?
DEBUG [main] - ==> Parameters: 20(Integer), 10(Integer)
DEBUG [main] - <== Total: 10
User [id=26, name=user26, age=10, address=address26, birthday=null]
User [id=27, name=user27, age=10, address=address27, birthday=null]
User [id=28, name=user28, age=10, address=address28, birthday=null]
User [id=29, name=user29, age=10, address=address29, birthday=null]
User [id=30, name=user30, age=10, address=address30, birthday=null]
User [id=31, name=user31, age=10, address=address31, birthday=null]
User [id=32, name=user32, age=10, address=address32, birthday=null]
User [id=33, name=user33, age=10, address=address33, birthday=null]
User [id=34, name=user34, age=10, address=address34, birthday=null]
User [id=35, name=user35, age=10, address=address35, birthday=null]

queryByPage05():
DEBUG [main] - ==> Preparing: select count(id) from user
DEBUG [main] - ==> Parameters:
DEBUG [main] - <== Total: 1
DEBUG [main] - ==> Preparing: select id, name, age, address, birthday from user limit ?, ?
DEBUG [main] - ==> Parameters: 10(Integer), 10(Integer)
DEBUG [main] - <== Total: 10
User [id=16, name=user16, age=10, address=address16, birthday=Fri Aug 20 16:58:17 CST 2021]
User [id=17, name=user17, age=10, address=address17, birthday=Fri Aug 20 17:37:48 CST 2021]
User [id=18, name=user18, age=10, address=address18, birthday=Fri Aug 20 17:41:03 CST 2021]
User [id=19, name=user18, age=10, address=address18, birthday=null]
User [id=20, name=user20, age=10, address=address20, birthday=null]
User [id=21, name=user21, age=10, address=address21, birthday=null]
User [id=22, name=user22, age=10, address=address22, birthday=null]
User [id=23, name=user23, age=10, address=address23, birthday=null]
User [id=24, name=user24, age=10, address=address24, birthday=null]
User [id=25, name=user25, age=10, address=address25, birthday=null]
第2/16页,共154条记录

分页+模糊查询

UserMapper.xml

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
<?xml version="1.0" encoding="UTF-8"?>

<!DOCTYPE mapper
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">


<mapper namespace="com.course.dao.UserDao">

<select id="queryTotalCount6" parameterType="map" resultType="int">
select count(id)
from user
where name like concat('%', #{name}, '%') and address like concat('%', #{address}, '%')
</select>

<select id="queryByPage6" parameterType="map" resultType="com.course.vo.User">
select id, name, age, address, birthday
from user
where name like concat('%', #{name}, '%') and address like concat('%', #{address}, '%')
limit #{startIndex}, #{pageSize}
</select>

</mapper>

UserDao.java

1
2
3
4
5
6
7
8
9
10
11
12
13
14
package com.course.dao;

import java.util.List;
import java.util.Map;

import com.course.vo.PageBean;
import com.course.vo.User;

public interface UserDao {

public Integer queryTotalCount6(Map<String, Object> paramMap);

public List<User> queryByPage6(Map<String, Object> paramMap);
}

测试类:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
@Test
public void queryByPage06() {
String name = "user1";
String address = "address1";
Integer pageIndex = 1;
Integer pageSize = 10;

PageBean pageBean = new PageBean();
pageBean.setPageIndex(pageIndex);
pageBean.setPageSize(pageSize);

Map<String, Object> paramMap = new HashMap<>();
paramMap.put("name", name);
paramMap.put("address", address);
paramMap.put("startIndex", pageBean.getStartIndex());
paramMap.put("pageSize", pageBean.getPageSize());

Integer totalCount = userDao.queryTotalCount6(paramMap);
pageBean.setTotalRecordCount(totalCount);

List<User> userList = userDao.queryByPage6(paramMap);
for (User userVO : userList) {
System.out.println(userVO.toString());
}
System.out.println("第" + (pageBean.getPageIndex()+1) + "/" + pageBean.getTotalPageCount() + "页,共" + pageBean.getTotalRecordCount() + "条记录");

MyBatisUtil.closeSqlSession(sqlSession);
}
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
DEBUG [main] - ==>  Preparing: select count(id) from user where name like concat('%', ?, '%') and address like concat('%', ?, '%') 
DEBUG [main] - ==> Parameters: user1(String), address1(String)
DEBUG [main] - <== Total: 1
DEBUG [main] - ==> Preparing: select id, name, age, address, birthday from user where name like concat('%', ?, '%') and address like concat('%', ?, '%') limit ?, ?
DEBUG [main] - ==> Parameters: user1(String), address1(String), 10(Integer), 10(Integer)
DEBUG [main] - <== Total: 10
User [id=101, name=user101, age=10, address=address101, birthday=null]
User [id=102, name=user102, age=10, address=address102, birthday=null]
User [id=103, name=user103, age=10, address=address103, birthday=null]
User [id=104, name=user104, age=10, address=address104, birthday=null]
User [id=105, name=user105, age=10, address=address105, birthday=null]
User [id=106, name=user106, age=10, address=address106, birthday=null]
User [id=107, name=user107, age=10, address=address107, birthday=null]
User [id=108, name=user108, age=10, address=address108, birthday=null]
User [id=109, name=user109, age=10, address=address109, birthday=null]
User [id=110, name=user110, age=10, address=address110, birthday=null]
第2/7页,共69条记录

使用分页插件

导入依赖包:

  • pagehelper-5.1.4.jar
  • jsqlparser-1.2.jar

mybatis.cfg.xml

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE configuration
PUBLIC "-//mybatis.org//DTD Config 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-config.dtd">

<!-- MyBatis的整体配置 -->
<configuration>
<!--
The content of element type "configuration" must match
"(properties?,settings?,typeAliases?,typeHandlers?,
objectFactory?,objectWrapperFactory?,reflectorFactory?,
plugins?,environments?,databaseIdProvider?,mappers?)".

<properties></properties>
<typeAliases></typeAliases>
<plugins></plugins>
<environments></environments>
<mappers></mappers>
-->
<properties resource="db.properties"></properties>

<settings>
<!-- 让log4j去记录sql日志,打印mybatis执行的sql语句 -->
<setting name="logImpl" value="LOG4J"/>
<!-- https://mybatis.org/mybatis-3/zh/configuration.html#properties -->
</settings>

<typeAliases>
<!-- 批量配置包下所有的实体类 -->
<package name="com.course.vo"/>
</typeAliases>

<plugins>
<plugin interceptor="com.github.pagehelper.PageInterceptor"></plugin>
</plugins>

<!-- 数据源环境配置,default默认数据源的id -->
<environments default="mysql_test">
<!-- ... -->
</environments>

</configuration>

UserMapper.xml

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
<?xml version="1.0" encoding="UTF-8"?>

<!DOCTYPE mapper
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">


<mapper namespace="com.course.dao.UserDao">

<select id="queryByPageHelper" parameterType="com.course.vo.User" resultType="com.course.vo.User">
select id, name, age, address, birthday
from user
where name like "%"#{name}"%" and address like "%"#{address}"%"
</select>

</mapper>

UserDao.java

1
2
3
4
5
6
7
8
9
10
11
package com.course.dao;

import java.util.List;

import com.course.vo.User;

public interface UserDao {

public List<User> queryByPageHelper(User user);

}

测试类:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
package com.course.test;

import java.util.List;

import org.apache.ibatis.session.SqlSession;
import org.junit.Test;

import com.course.dao.UserDao;
import com.course.util.MyBatisUtil;
import com.course.vo.User;
import com.github.pagehelper.Page;
import com.github.pagehelper.PageHelper;

public class MainTest {

private SqlSession sqlSession = MyBatisUtil.openSqlSession();
private UserDao userDao = sqlSession.getMapper(UserDao.class);

@Test
public void queryByPageHelper() {
String name = "user1";
String address = "address1";
Integer pageIndex = 1;
Integer pageSize = 10;

User user =new User();
user.setName(name);
user.setAddress(address);

Page<User> page = PageHelper.startPage(pageIndex, pageSize, true);

List<User> userList = userDao.queryByPageHelper(user);
for (User userVO : userList) {
System.out.println(userVO.toString());
}
System.out.println("第" + (pageIndex+1) + "/" + page.getPages() + "页,共" + page.getTotal() + "条记录");

MyBatisUtil.closeSqlSession(sqlSession);
}

}
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
DEBUG [main] - ==>  Preparing: select count(0) from (select id, name, age, address, birthday from user where name like "%"?"%" and address like "%"?"%") tmp_count 
DEBUG [main] - ==> Parameters: user1(String), address1(String)
DEBUG [main] - <== Total: 1
DEBUG [main] - ==> Preparing: select id, name, age, address, birthday from user where name like "%"?"%" and address like "%"?"%" LIMIT ?
DEBUG [main] - ==> Parameters: user1(String), address1(String), 10(Integer)
DEBUG [main] - <== Total: 10
User [id=1, name=user1, age=10, address=address1, birthday=Fri Aug 13 12:35:22 CST 2021]
User [id=4, name=user1, age=10, address=address1, birthday=Fri Aug 13 16:55:22 CST 2021]
User [id=7, name=user1, age=10, address=address1, birthday=Fri Aug 13 16:57:01 CST 2021]
User [id=11, name=user11, age=10, address=address11, birthday=Fri Aug 13 16:58:27 CST 2021]
User [id=15, name=user15, age=10, address=address15, birthday=Fri Aug 20 12:36:11 CST 2021]
User [id=16, name=user16, age=10, address=address16, birthday=Fri Aug 20 16:58:17 CST 2021]
User [id=17, name=user17, age=10, address=address17, birthday=Fri Aug 20 17:37:48 CST 2021]
User [id=18, name=user18, age=10, address=address18, birthday=Fri Aug 20 17:41:03 CST 2021]
User [id=19, name=user18, age=10, address=address18, birthday=null]
User [id=100, name=user100, age=10, address=address100, birthday=null]
第2/7页,共69条记录

当name和address为null时的处理

测试类:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
package com.course.test;

import java.util.List;

import org.apache.ibatis.session.SqlSession;
import org.junit.Test;

import com.course.dao.UserDao;
import com.course.util.MyBatisUtil;
import com.course.vo.User;
import com.github.pagehelper.Page;
import com.github.pagehelper.PageHelper;

public class MainTest {

private SqlSession sqlSession = MyBatisUtil.openSqlSession();
private UserDao userDao = sqlSession.getMapper(UserDao.class);

@Test
public void queryByPageHelper() {
String name = "user1";
String address = "address1";
Integer pageIndex = 1;
Integer pageSize = 10;

User user =new User();
// user.setName(name);
// user.setAddress(address);

Page<User> page = PageHelper.startPage(pageIndex, pageSize, true);

List<User> userList = userDao.queryByPageHelper(user);
for (User userVO : userList) {
System.out.println(userVO.toString());
}
System.out.println("第" + (pageIndex+1) + "/" + page.getPages() + "页,共" + page.getTotal() + "条记录");

MyBatisUtil.closeSqlSession(sqlSession);
}

}
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
package com.course.vo;

import java.util.Date;

public class User {

public String getName() {
return name==null?"":name;
}

public String getAddress() {
return address==null?"":address;
}

}
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
DEBUG [main] - ==>  Preparing: select count(0) from (select id, name, age, address, birthday from user where name like "%"?"%" and address like "%"?"%") tmp_count 
DEBUG [main] - ==> Parameters: (String), (String)
DEBUG [main] - <== Total: 1
DEBUG [main] - ==> Preparing: select id, name, age, address, birthday from user where name like "%"?"%" and address like "%"?"%" LIMIT ?
DEBUG [main] - ==> Parameters: (String), (String), 10(Integer)
DEBUG [main] - <== Total: 10
User [id=1, name=user1, age=10, address=address1, birthday=Fri Aug 13 12:35:22 CST 2021]
User [id=2, name=user2, age=10, address=address2, birthday=Fri Aug 13 16:51:11 CST 2021]
User [id=4, name=user1, age=10, address=address1, birthday=Fri Aug 13 16:55:22 CST 2021]
User [id=5, name=user2, age=10, address=address2, birthday=Fri Aug 13 16:55:22 CST 2021]
User [id=7, name=user1, age=10, address=address1, birthday=Fri Aug 13 16:57:01 CST 2021]
User [id=8, name=user2, age=10, address=address2, birthday=Fri Aug 13 16:57:01 CST 2021]
User [id=9, name=user3, age=10, address=address3, birthday=Fri Aug 13 16:57:01 CST 2021]
User [id=11, name=user11, age=10, address=address11, birthday=Fri Aug 13 16:58:27 CST 2021]
User [id=12, name=user12, age=10, address=address2, birthday=Mon Aug 16 15:54:29 CST 2021]
User [id=15, name=user15, age=10, address=address15, birthday=Fri Aug 20 12:36:11 CST 2021]
第2/16页,共154条记录