# springboot-tkmybatis **Repository Path**: showtime5096213/springboot-tkmybatis ## Basic Information - **Project Name**: springboot-tkmybatis - **Description**: No description available - **Primary Language**: Java - **License**: Not specified - **Default Branch**: master - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 0 - **Forks**: 0 - **Created**: 2020-12-11 - **Last Updated**: 2020-12-18 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README # springboot-tkmybatis #### 介绍 学习demo 流程 1.pom引入jar ``` tk.mybatis mapper-spring-boot-starter 2.0.2 mysql mysql-connector-java runtime com.alibaba druid 1.0.20 ``` 2.配置文件 ``` # 数据库连接 spring.datasource.type=com.alibaba.druid.pool.DruidDataSource spring.datasource.driver-class-name=com.mysql.cj.jdbc.Driver spring.datasource.url=jdbc:mysql://localhost:3306/test?serverTimezone=UTC&useUnicode=true&characterEncoding=utf-8 spring.datasource.username=root spring.datasource.password=123456 # mybatis mybatis.type-aliases-package=com.ways.mms.entity mybatis.mapperLocations: classpath:mapper/*.xml ``` 3.创建相应的实体类(数据库开头大写,驼峰命名) 4.创建dao接口,继承extends tk.mybatis.mapper.common.Mapper 5.springboot的开始类上,加注解@MapperScan("com.ways.mms.dao"),不然不会引入 6.然后就可以直接用通用mapper的方法了