# mybatis-faster **Repository Path**: comYLScn/mybatis-faster ## Basic Information - **Project Name**: mybatis-faster - **Description**: springboot+mybatis快速生成crud - **Primary Language**: Unknown - **License**: Not specified - **Default Branch**: master - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 0 - **Forks**: 0 - **Created**: 2019-11-22 - **Last Updated**: 2021-11-04 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README # mybatis-faster #### 介绍 针对springboot+mybatis快速生成 ### 编写目的: 1. 为了减少对mybatis通用代码的开发,避免重复的制造轮子 2. 提升开发效率 ## 目录结构: 1. 模板resources/templates ### 技术选型: 1. 数据库技术选型为springboot +thymyelaf+mybatis 2. mybatis-genrator插件 ### 注意事项: 1. product_name 数据库字段必须按次下划线分隔,生成实体对象会驼峰命名 2. create_date、modify_date,这些字段要求要有,因为模板中有定义引用 3. 针对的主键id为String的 4、如模板不符合要求,可调整模板符合自己的开发规范 #### 使用说明: 1. 生成前准备工作,设计好表,把生成的表配置到resouces 下的插件配置中generatorConfig.xml 2. 初始化生成前,保证model、dao、service、controller包为空,不为空每次生成都会追加(注意resouces/mapper/xml文件),*(controller+service+service/impl)这些包不存在则需要手动创建 3. 修改application.yml文件下的配置为你【开发项目】所在的包名,和作者信息 默认为当前工程所在的包(可根据自己当前所写的项目,修改为当前项目所在的包) com: cool: faster: #当前引用的model包 modelPackage: com.template.model #当前引用controller所在的包 controllerPackage: com.template.controller #当前引用的servcie包 servicePackage: com.template.service #当前引用实现的包 serviceImplPackage: com.template.service.impl #当前引用dao所在的包 daoPackage: com.template.dao author: yls 3. 执行命令mybatis-generator:generate 使用插件,由表生成model和dao,以及xml配置文件,model+dao层的基本实现 4. 找见generator包下的FasterGenerator类,运行单元测试方法即可生成controller+service层的基本实现 5. 生成基本的crud包含分页,有些表生成的可能不适应,生成成功后,自动引入相应的包,调整即可 #### 码云特技 1. 使用 Readme\_XXX.md 来支持不同的语言,例如 Readme\_en.md, Readme\_zh.md 2. 码云官方博客 [blog.gitee.com](https://blog.gitee.com) 3. 你可以 [https://gitee.com/explore](https://gitee.com/explore) 这个地址来了解码云上的优秀开源项目 4. [GVP](https://gitee.com/gvp) 全称是码云最有价值开源项目,是码云综合评定出的优秀开源项目 5. 码云官方提供的使用手册 [https://gitee.com/help](https://gitee.com/help) 6. 码云封面人物是一档用来展示码云会员风采的栏目 [https://gitee.com/gitee-stars/](https://gitee.com/gitee-stars/)