springboot实现分页查询
- 快速搭建一个springboot项目,持久层采用mybatis框架,导入相关依赖,并创建数据库
数据库脚本:
DROP TABLE IF EXISTS `user`;
CREATE TABLE `user` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`username` varchar(32) NOT NULL COMMENT '�û�����',
`birthday` date DEFAULT NULL COMMENT '����',
`sex` char(1) DEFAULT NULL COMMENT '�Ա�',
`address` varchar(256) DEFAULT NULL COMMENT '��ַ',
PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=11 DEFAULT CHARSET=utf8;
-- ----------------------------
-- Records of user
-- ----------------------------
INSERT INTO `user` VALUES ('1', 'yy', '2019-12-17', '男', '666');
INSERT INTO `user` VALUES ('2', 'ee', '2019-12-04', '女', '333');
INSERT INTO `user` VALUES ('3', 'rr', '2020-02-24', '男', '江苏南京');
INSERT INTO `user` VALUES ('4', '哈哈', '2020-03-17', '男', '广东深圳');
INSERT INTO `user` VALUES ('5', 'kk', '2020-02-25', '女', '江西南昌');
INSERT INTO `user` VALUES ('6', '飘飘', '2020-02-26', '女', '江北新奇');
INSERT INTO `user` VALUES ('7', '简单', '2020-02-27', '女', '江西宜春');
INSERT INTO `user` VALUES ('8', '美美', '2020-02-28', '女', '江西九江');
INSERT INTO `user` VALUES ('9', '楠楠', '2020-03-21', '女', '江西赣州');
INSERT INTO `user` VALUES ('10', '大大', '2020-03-12', '男', '浙江临安府');