# mybatis-generator **Repository Path**: it_freshman/mybatis-generator ## Basic Information - **Project Name**: mybatis-generator - **Description**: No description available - **Primary Language**: Unknown - **License**: Not specified - **Default Branch**: master - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 0 - **Forks**: 0 - **Created**: 2021-04-23 - **Last Updated**: 2021-04-23 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README ## 配置 ### 数据源配置 **config.properties** ```properties jdbc.driverClass = com.mysql.jdbc.Driver jdbc.url = jdbc:mysql://localhost:3306/sharding_db jdbc.user = XX jdbc.password = XXX ``` ### 生成代码包路径配置 这部分数据配置存放在`pom.xml/`中,主要是依托于maven获取当前项目根路径的功能。 ```xml ${basedir}/src/main/java ${project.groupId}.xyz.mapper ${project.groupId}.xyz.model ${basedir}/src/main/resources mapper/xyz ``` ### 映射表配置-generatorConfig.xml **通配符配置** ```xml
``` ## 运行 ```shell $ mvn clean mybatis-generator:generate log4j:WARN See http://logging.apache.org/log4j/1.2/faq.html#noconfig for more info. [INFO] Generating Record class for table res_auth_paper_detail_11 [INFO] Generating Mapper Interface for table res_auth_paper_detail_11 [INFO] Generating SQL Map for table res_auth_paper_detail_11 [INFO] Generating Record class for table res_auth_paper_detail_34 [INFO] Generating Mapper Interface for table res_auth_paper_detail_34 [INFO] Generating SQL Map for table res_auth_paper_detail_34 [INFO] Saving file ResAuthPaperDetail11Mapper.xml [INFO] Saving file ResAuthPaperDetail34Mapper.xml [INFO] Saving file ResAuthPaperDetail11.java [INFO] Saving file ResAuthPaperDetail11Mapper.java [INFO] Saving file ResAuthPaperDetail34.java [INFO] Saving file ResAuthPaperDetail34Mapper.java ``` **执行结果** ![执行结果](./结果.png)