# tk.Mapper **Repository Path**: jiangfeng1028/tk.Mapper ## Basic Information - **Project Name**: tk.Mapper - **Description**: tk.Mapper 代码生成器 - **Primary Language**: Java - **License**: Apache-2.0 - **Default Branch**: master - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 1 - **Forks**: 1 - **Created**: 2020-07-25 - **Last Updated**: 2024-05-30 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README <<<<<<< HEAD # mybatis-mapper-demo ### 介绍 这是center.wxp.mapper即是通用mapper查询demo,代码模板,自动生成service、serviceImpl、controller模板代码。 、、 #### 软件架构 Spring boot、Mybatis、tk.mapper ### 使用说明 #### 1. 项目参数配置: center.wxp.mapper.support.constant.ProjectConstant类: 代码示例: ``` /** * 作者名称 */ public static final String AUTHOR = "wuxiaopeng"; /*******************JDBC配置************************/ public static final String JDBC_URL = "jdbc:mysql://localhost:3306/test?nullCatalogMeansCurrent=true"; public static final String JDBC_USERNAME = "root"; public static final String JDBC_PASSWORD = "123456"; public static final String JDBC_DIVER_CLASS_NAME = "com.mysql.jdbc.Driver"; /*******************文件路径配置************************/ public static final String BASE_PACKAGE = "center.wxp.mapper"; //生成的Model所在包 public static final String MODEL_PACKAGE = BASE_PACKAGE + ".model.entity"; //生成的Mapper所在包 public static final String MAPPER_PACKAGE = BASE_PACKAGE + ".mapper"; //生成的Service所在包 public static final String SERVICE_PACKAGE = BASE_PACKAGE + ".service"; //生成的ServiceImpl所在包 public static final String SERVICE_IMPL_PACKAGE = SERVICE_PACKAGE + ".impl"; //生成的Controller所在包 public static final String CONTROLLER_PACKAGE = BASE_PACKAGE + ".controller"; //生成sql的xml资源文件路径 public static final String XML_PATH = "/mapper"; /**************模板文件路径(需要放在test路径下)******************************/ //项目在硬盘上的基础路径,这是idea默认的不需要修改 public static final String PROJECT_PATH = System.getProperty("user.dir"); //生成的模板位置 public static final String TEMPLATE_FILE_PATH = PROJECT_PATH + "/src/test/resources/generator/template"; /**************资源文件路径******************************/ //java文件路径 public static final String JAVA_PATH = "/src/main/java"; //资源文件路径 public static final String RESOURCES_PATH = "/src/main/resources"; ``` 根据自己的项目进行相应修改,注意模板只能放在test文件下。 #### 2. 在test添加模板 /src/test/resources/generator/template,模板文件 ![输入图片说明](https://images.gitee.com/uploads/images/2020/0323/161012_b044cbc5_375326.png "屏幕截图.png") #### 3. 生成模板类: ![输入图片说明](https://images.gitee.com/uploads/images/2020/0323/161100_f2858f24_375326.png "屏幕截图.png") 其中GeneratorCodeMain是生成模板主类: ``` /** * @author wuxiaopeng * @description: 生成TK模板代码 * @date 2020/3/4 15:46 */ public class GeneratorCodeMain { public static void main(String[] args) { //生成表、可以使用数组同时生成多张表使用逗号分开 genMoreTable("user"); //自定义生成的类名 //genCodeByCustomModelName("user", "user1"); } } ``` ======= # tk.Mapper #### 介绍 tk.Mapper 代码生成器 #### 软件架构 软件架构说明 #### 安装教程 1. xxxx 2. xxxx 3. xxxx #### 使用说明 1. xxxx 2. xxxx 3. xxxx #### 参与贡献 1. Fork 本仓库 2. 新建 master 分支 3. 提交代码 4. 新建 Pull Request #### 码云特技 ======= 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/) >>>>>>> b381c385bd8d9b22b0fc07f7dd7cd1cb784a8c0c