{"id":16479229,"url":"https://github.com/zoeminghong/spring-boot-starter-mybatis","last_synced_at":"2026-05-03T12:39:19.392Z","repository":{"id":57730046,"uuid":"119782726","full_name":"zoeminghong/spring-boot-starter-mybatis","owner":"zoeminghong","description":"mybatis的spring boot分页插件","archived":false,"fork":false,"pushed_at":"2018-05-18T06:19:04.000Z","size":26,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-01-11T08:44:58.826Z","etag":null,"topics":["mybatis","mybatis-page","mybatis-spring-boot-starter","mybatis-springboot","page","spring","spring-boot"],"latest_commit_sha":null,"homepage":"https://zoeminghong.github.io/spring-boot-starter-mybatis/","language":"Java","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/zoeminghong.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2018-02-01T04:27:45.000Z","updated_at":"2018-05-11T06:52:22.000Z","dependencies_parsed_at":"2022-09-08T00:21:27.408Z","dependency_job_id":null,"html_url":"https://github.com/zoeminghong/spring-boot-starter-mybatis","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zoeminghong%2Fspring-boot-starter-mybatis","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zoeminghong%2Fspring-boot-starter-mybatis/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zoeminghong%2Fspring-boot-starter-mybatis/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zoeminghong%2Fspring-boot-starter-mybatis/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/zoeminghong","download_url":"https://codeload.github.com/zoeminghong/spring-boot-starter-mybatis/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":241180629,"owners_count":19923258,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["mybatis","mybatis-page","mybatis-spring-boot-starter","mybatis-springboot","page","spring","spring-boot"],"created_at":"2024-10-11T12:51:25.047Z","updated_at":"2026-05-03T12:39:14.337Z","avatar_url":"https://github.com/zoeminghong.png","language":"Java","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Spring-Boot-Starter-Mybatis\n\n[![https://img.shields.io/github/release/zoeminghong/spring-boot-starter-mybatis.svg](https://img.shields.io/github/release/zoeminghong/spring-boot-starter-mybatis.svg)](http://search.maven.org/#search%7Cga%7C1%7Ccom.zerostech) ![https://img.shields.io/github/license/zoeminghong/spring-boot-starter-mybatis.svg](https://img.shields.io/github/license/zoeminghong/spring-boot-starter-mybatis.svg)\n\n基于Spring Boot和Mybatis，添加分页相关功能，免配置即可用\n\n## 依赖\n\nspring boot:1.5.6\n\nmybatis-spring-boot-starter:1.3.1\n\ncluster-common:1.2.2-RC\n\n## 快速开始\n\n1. 添加依赖\n\n```xml\n\u003cdependency\u003e\n    \u003cgroupId\u003ecom.zerostech\u003c/groupId\u003e\n    \u003cartifactId\u003espring-boot-starter-mybatis\u003c/artifactId\u003e\n    \u003cversion\u003e${lastest.version}\u003c/version\u003e\n\u003c/dependency\u003e\n```\n\n2. JDBC配置\n\n```yaml\nspring:\n  datasource:\n    driver-class-name: org.h2.Driver\n    url: jdbc:h2:mem:test\n    schema: classpath:db/schema.sql\n    data: classpath:db/data.sql    \n```\n\n3. MyBatis配置\n\n```yaml\nmybatis:\n    type-aliases-package: com.zeros.demo.model\n    type-handlers-package: com.zerso.demo.typehandler\n    configuration:\n        map-underscore-to-camel-case: true\n        default-fetch-size: 100\n        default-statement-timeout: 30\n```\n\n4. 服务\n\n```java\n@Mapper\npublic interface RoleDao {\n\n    @Select(\"SELECT * FROM t_role WHERE id = #{id}\")\n    Role findById(@Param(\"id\") int id);\n\n    @Select(\"SELECT * FROM t_role\")\n    List\u003cRole\u003e fetchRoles();\n}\n```\n\n```java\n@GetMapping\npublic Resp\u003cPage\u003cRole\u003e\u003e fetchRoles() {           \n  MybatisPageContext.setPageRequest(new MybatisPageContext.PageRequest(1, 2));\n  roleDao.fetchRoles();\n  Page\u003cRole\u003e roleResponsePage = MybatisPageContext.getPage();\n  MybatisPageContext.clearAll();\n  return Resp.success(roleResponsePage);\n}\n```\n\n## 演示\n\n项目目录`example/mybatis-demo`\n\n## 参考\n\n[Mybatis](http://www.mybatis.org/spring-boot-starter/mybatis-spring-boot-autoconfigure/)\n\n[Spring Boot Reference](http://docs.spring.io/spring-boot/docs/current/reference/htmlsingle/)","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fzoeminghong%2Fspring-boot-starter-mybatis","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fzoeminghong%2Fspring-boot-starter-mybatis","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fzoeminghong%2Fspring-boot-starter-mybatis/lists"}