MyBatisPlus的自动生成代码的策略详解

MyBatisPlus之代码自动生成器

代码自动一键生成,功能强大,大大节省了开发时间 主要介绍一下springboot玩家,先来看配置的依赖maven 注意不要用最新版的依赖,很多东西新版以及移除了

<dependency>
            <groupId>com.baomidou</groupId>
            <artifactId>mybatis-plus-boot-starter</artifactId>
            <version>3.0.6</version>
        </dependency>

        <!-- 模板引擎 -->
        <dependency>
            <groupId>org.apache.velocity</groupId>
            <artifactId>velocity-engine-core</artifactId>
            <version>2.0</version>
        </dependency>

        <dependency>
            <groupId>io.springfox</groupId>
            <artifactId>springfox-swagger2</artifactId>
            <version>2.6.1</version>
        </dependency>

在测试类中进行配置

如果是想一次性生成多个表 最后的工程文件 自动生成策略大大减少了写配置的时间,这个也许就是你比别人加班少的原因。

经验分享 程序员 微信小程序 职场和发展