Remember my previous code generation tool, this time I upgraded it

The gadget is upgraded

I previously developed a customized code generation tool based on MyBatis Generatordevelopment. Those who are interested can take a look at this article I wrote before:

MyBatis generator reverse generation entity plug-in development

At that time, this tool could generate xml files of entity classes, Mapper classes, and Mapper with one click . But it is far from satisfying the company's development needs. For this reason, I upgraded this tool.

The upgraded small plug-in can generate entity classes, Mapper classes, Mapper XML files, Service, ServiceImpl, and Controller . Generated in one second, so that the mechanical and tasteless mybatis file writing work is gone forever. Anytime, anywhere, convenient and fast.

How to use

We only need to configure the application.propertiesconfiguration file, and then start the Mainclass.

The application file configuration is as follows:

Database connection configuration

#数据库连接配置
datasource.url=jdbc:mysql://xxx:3306/rmp?characterEncoding=utf-8
datasource.username=root
datasource.password=xxx
datasource.driver-class-name=com.mysql.jdbc.Driver

Generate code address

targetProjectPath=E:\\code

Author

#作者
mybatis.author=lvshen

Package names

#包名
mybatis.controller=com.lvshen.rmp.controller
mybatis.service=com.lvshen.rmp.service
mybatis.serviceImpl=com.lvshen.rmp.service.impl
mybatis.entity=com.lvshen.rmp.entity
mybatis.mapper=com.lvshen.rmp.mapper

Parent interface

#父类接口
mybatis.rootModelInterface=com.xxx.rmp.entity.RmpBaseEntity
mybatis.superServiceInterface=com.xxx.framework.base.service.BaseService
mybatis.superServiceImpl=com.xxx.framework.base.service.impl.BaseServiceImpl
mybatis.superController=com.xxx.basic.controller.BaseController
mybatis.rootMapperInterface=com.xxx.framework.base.mapper.BaseMapper

Location of mapper file

#mapper文件的位置
mybatis.resources=com.lvshen.rmp.mapper

The database table configuration of the entity to be transferred

#配置表->实体
mybatis.table=rmp3_return_replacement_apply
mybatis.classname=ReturnReplacementApply

We convert the rmp3_return_replacement_applytable to generate entities ReturnReplacementApply.

The content of the overall configuration file is as follows:

Generate results

File Directory

Entity

mapper

service

Service implementation class

controller

This small plug-in custom generates codes according to the actual needs of the company, and the above codes are all generated by tools. Compared with Mybatis-plus, it is more customized.

I have uploaded the source code of the gadget to github. If you need it, you can follow my official account and chat with me to get it.

 

Recommended in the past

Scan the QR code to get more exciting. Or search Lvshen_9 on WeChat , you can reply to get information in the background

  1. 回复"java" 获取java电子书;

  2. 回复"python"获取python电子书;

  3. 回复"算法"获取算法电子书;

  4. 回复"大数据"获取大数据电子书;

  5. 回复"spring"获取SpringBoot的学习视频。

  6. 回复"面试"获取一线大厂面试资料

  7. 回复"进阶之路"获取Java进阶之路的思维导图

  8. 回复"手册"获取阿里巴巴Java开发手册(嵩山终极版)

  9. 回复"总结"获取Java后端面试经验总结PDF版

  10. 回复"Redis"获取Redis命令手册,和Redis专项面试习题(PDF)

  11. 回复"并发导图"获取Java并发编程思维导图(xmind终极版)

Another: Click [ My Benefits ] to have more surprises.

 

Guess you like

Origin blog.csdn.net/wujialv/article/details/109502899