Skip to content

Commit

Permalink
mybatis-plus
Browse files Browse the repository at this point in the history
  • Loading branch information
gqzdev committed Sep 3, 2020
1 parent f8e97df commit 6754051
Show file tree
Hide file tree
Showing 7 changed files with 18 additions and 26 deletions.
13 changes: 6 additions & 7 deletions spring-boot-start-orm-mybatis-plus/README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# spring-boot-demo-orm-mybatis-plus

> 此 demo 演示了 Spring Boot 如何集成 mybatis-plus,简化Mybatis开发,带给你难以置信的开发体验。
> Spring Boot 如何集成 mybatis-plus,简化Mybatis开发,带给你难以置信的开发体验。
## pom.xml

Expand All @@ -10,15 +10,14 @@
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>

<artifactId>spring-boot-demo-orm-mybatis-plus</artifactId>
<artifactId>spring-boot-start-orm-mybatis-plus</artifactId>
<version>1.0.0-SNAPSHOT</version>
<packaging>jar</packaging>

<name>spring-boot-demo-orm-mybatis-plus</name>
<name>spring-boot-start-orm-mybatis-plus</name>
<description>Demo project for Spring Boot</description>

<parent>
<groupId>com.xkcoding</groupId>
<groupId>com.gqzdev</groupId>
<artifactId>spring-boot-demo</artifactId>
<version>1.0.0-SNAPSHOT</version>
</parent>
Expand Down Expand Up @@ -100,7 +99,7 @@
* @modified: yangkai.shen
*/
@Configuration
@MapperScan(basePackages = {"com.xkcoding.orm.mybatis.plus.mapper"})
@MapperScan(basePackages = {"com.gqzdev.orm.mybatis.plus.mapper"})
@EnableTransactionManagement
public class MybatisPlusConfig {
/**
Expand All @@ -124,7 +123,7 @@ public class MybatisPlusConfig {
## CommonFieldHandler.java

```java
package com.xkcoding.orm.mybatis.plus.config;
package com.gqzdev.orm.mybatis.plus.config;

import com.baomidou.mybatisplus.core.handlers.MetaObjectHandler;
import lombok.extern.slf4j.Slf4j;
Expand Down
2 changes: 1 addition & 1 deletion spring-boot-start-orm-mybatis-plus/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@
</dependencies>

<build>
<finalName>spring-boot-demo-orm-mybatis-plus</finalName>
<finalName>spring-boot-start-orm-mybatis-plus</finalName>
<plugins>
<plugin>
<groupId>org.springframework.boot</groupId>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
* 通用字段填充
* </p>
*
* @package: com.xkcoding.orm.mybatis.plus.config
* @package: com.gqzdev.orm.mybatis.plus.config
* @description: 通用字段填充
* @author: yangkai.shen
* @date: Created in 2018/11/8 17:40
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
* @modified: yangkai.shen
*/
@Configuration
@MapperScan(basePackages = {"com.xkcoding.orm.mybatis.plus.mapper"})
@MapperScan(basePackages = {"com.gqzdev.orm.mybatis.plus.mapper"})
@EnableTransactionManagement
public class MybatisPlusConfig {
/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,17 +14,10 @@
import static com.baomidou.mybatisplus.annotation.FieldFill.INSERT_UPDATE;

/**
* <p>
* 用户实体类
* </p>
*
* @package: com.xkcoding.orm.mybatis.plus.entity
* @description: 用户实体类
* @author: yangkai.shen
* @date: Created in 2018/11/8 16:49
* @copyright: Copyright (c) 2018
* @version: V1.0
* @modified: yangkai.shen
*/
@Data
@NoArgsConstructor
Expand Down
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
spring:
datasource:
url: jdbc:mysql://127.0.0.1:3306/spring-boot-demo?useUnicode=true&characterEncoding=UTF-8&useSSL=false&autoReconnect=true&failOverReadOnly=false&serverTimezone=GMT%2B8
url: jdbc:mysql://127.0.0.1:3306/spring-boot-start?useUnicode=true&characterEncoding=UTF-8&useSSL=false&autoReconnect=true&failOverReadOnly=false&serverTimezone=GMT%2B8
username: root
password: root
password: ganquanzhong
driver-class-name: com.mysql.cj.jdbc.Driver
type: com.zaxxer.hikari.HikariDataSource
initialization-mode: always
continue-on-error: true
schema:
- "classpath:db/schema.sql"
data:
- "classpath:db/data.sql"
# schema:
# - "classpath:db/schema.sql"
# data:
# - "classpath:db/data.sql"
hikari:
minimum-idle: 5
connection-test-query: SELECT 1 FROM DUAL
Expand All @@ -27,7 +27,7 @@ logging:
mybatis-plus:
mapper-locations: classpath:mappers/*.xml
#实体扫描,多个package用逗号或者分号分隔
typeAliasesPackage: com.xkcoding.orm.mybatis.plus.entity
typeAliasesPackage: com.gqzdev.orm.mybatis.plus.entity
global-config:
# 数据库相关配置
db-config:
Expand All @@ -48,4 +48,4 @@ mybatis-plus:
# 原生配置
configuration:
map-underscore-to-camel-case: true
cache-enabled: true
cache-enabled: true
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,4 @@ CREATE TABLE `orm_user` (
`create_time` DATETIME NOT NULL DEFAULT NOW() COMMENT '创建时间',
`last_login_time` DATETIME DEFAULT NULL COMMENT '上次登录时间',
`last_update_time` DATETIME NOT NULL DEFAULT NOW() COMMENT '上次更新时间'
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='Spring Boot Demo Orm 系列示例表';
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='Spring Boot Start Orm 系列示例表';

0 comments on commit 6754051

Please sign in to comment.