Spring Boot 整合 Mybatis Annotation 注解的完整 Web 案例

This commit is contained in:
JeffLi1993
2017-05-11 18:26:34 +08:00
committed by liqiangqiang
parent 0125485aa9
commit 942f0f58c4
5 changed files with 7 additions and 6 deletions

View File

@@ -33,6 +33,8 @@ QQ 群<br>
#### c. 『 基础 数据存储篇 』
- springboot-mybatis <br>
[《Springboot 整合 Mybatis 的完整 Web 案例》](http://www.bysocket.com/?p=1610 "Springboot 整合 Mybatis 的完整 Web 案例")<br>
- springboot-mybatis-annotation <br>
[《Spring Boot 整合 Mybatis Annotation 注解的完整 Web 案例》](http://www.bysocket.com/?p=1610 "Springboot 整合 Mybatis 的完整 Web 案例")<br>
- springboot-mybatis-mutil-datasource <br>
[《Spring Boot 整合 Mybatis 实现 Druid 多数据源详解》](http://www.bysocket.com/?p=1712 "Spring Boot 整合 Mybatis 实现 Druid 多数据源详解")<br>

View File

@@ -1 +0,0 @@
distributionUrl=https://repo1.maven.org/maven2/org/apache/maven/apache-maven/3.5.0/apache-maven-3.5.0-bin.zip

View File

@@ -8,7 +8,7 @@ import org.spring.springboot.domain.City;
*
* Created by xchunzhao on 02/05/2017.
*/
@Mapper
@Mapper // 标志为 Mybatis 的 Mapper
public interface CityDao {
/**
@@ -17,6 +17,7 @@ public interface CityDao {
* @param cityName 城市名
*/
@Select("SELECT * FROM city")
// 返回 Map 结果集
@Results({
@Result(property = "id", column = "id"),
@Result(property = "provinceId", column = "province_id"),

View File

@@ -1,6 +1,5 @@
## 数据源配置
spring.datasource.url=jdbc:mysql://localhost:3306/springbootdb?useUnicode=true&characterEncoding=utf8
spring.datasource.url=jdbc:mysql://139.224.14.39:3306/springbootdb?useUnicode=true&characterEncoding=utf8
spring.datasource.username=root
spring.datasource.password=123456
spring.datasource.driver-class-name=com.mysql.jdbc.Driver
spring.datasource.password=yt0923666
spring.datasource.driver-class-name=com.mysql.jdbc.Driver