diff --git a/README.md b/README.md index 7ab1dcc..7d32bf5 100644 --- a/README.md +++ b/README.md @@ -33,6 +33,8 @@ QQ 群
#### c. 『 基础 – 数据存储篇 』 - springboot-mybatis
[《Springboot 整合 Mybatis 的完整 Web 案例》](http://www.bysocket.com/?p=1610 "Springboot 整合 Mybatis 的完整 Web 案例")
+- springboot-mybatis-annotation
+ [《Spring Boot 整合 Mybatis Annotation 注解的完整 Web 案例》](http://www.bysocket.com/?p=1610 "Springboot 整合 Mybatis 的完整 Web 案例")
- springboot-mybatis-mutil-datasource
[《Spring Boot 整合 Mybatis 实现 Druid 多数据源详解》](http://www.bysocket.com/?p=1712 "Spring Boot 整合 Mybatis 实现 Druid 多数据源详解")
diff --git a/springboot-mybatis-annotation/.mvn/wrapper/maven-wrapper.jar b/springboot-mybatis-annotation/.mvn/wrapper/maven-wrapper.jar deleted file mode 100644 index 9cc84ea..0000000 Binary files a/springboot-mybatis-annotation/.mvn/wrapper/maven-wrapper.jar and /dev/null differ diff --git a/springboot-mybatis-annotation/.mvn/wrapper/maven-wrapper.properties b/springboot-mybatis-annotation/.mvn/wrapper/maven-wrapper.properties deleted file mode 100644 index c315043..0000000 --- a/springboot-mybatis-annotation/.mvn/wrapper/maven-wrapper.properties +++ /dev/null @@ -1 +0,0 @@ -distributionUrl=https://repo1.maven.org/maven2/org/apache/maven/apache-maven/3.5.0/apache-maven-3.5.0-bin.zip diff --git a/springboot-mybatis-annotation/src/main/java/org/spring/springboot/dao/CityDao.java b/springboot-mybatis-annotation/src/main/java/org/spring/springboot/dao/CityDao.java index d64b17b..7850b92 100644 --- a/springboot-mybatis-annotation/src/main/java/org/spring/springboot/dao/CityDao.java +++ b/springboot-mybatis-annotation/src/main/java/org/spring/springboot/dao/CityDao.java @@ -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"), diff --git a/springboot-mybatis-annotation/src/main/resources/application.properties b/springboot-mybatis-annotation/src/main/resources/application.properties index c882f41..4ac32f8 100644 --- a/springboot-mybatis-annotation/src/main/resources/application.properties +++ b/springboot-mybatis-annotation/src/main/resources/application.properties @@ -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 \ No newline at end of file