一、下载mybatis generator插件
二、生成generatorConfig.xml
new一个generatorConfig.xml
三、修改generatorConfig.xml
<strong><?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE generatorConfiguration PUBLIC "-//mybatis.org//DTD MyBatis Generator Configuration 1.0//EN" "http://mybatis.org/dtd/mybatis-generator-config_1_0.dtd">
<generatorConfiguration>
<classPathEntry
location="D:/MavenStore/mysql/mysql-connector-java/5.1.44/mysql-connector-java-5.1.44-sources.jar" />
<context id="context1">
<!-- 去掉自动生成的注释 -->
<commentGenerator>
<property name="suppressDate" value="true"/>
<property name="suppressAllComments" value="true"/>
</commentGenerator>
<jdbcConnection connectionURL="jdbc:mysql://localhost:3306/pms" driverClass="com.mysql.jdbc.Driver" password="mysql" userId="root" />
<!-- bean-->
<javaModelGenerator targetPackage="com.zcy.rflow.entity.user" targetProject="redictflow-entity\src\main\java" />
<!-- xml -->
<sqlMapGenerator targetPackage="mapper" targetProject="redictflow-dao\src\main\resources" />
<!-- dao -->
<javaClientGenerator targetPackage="com.zcy.rflow.dao.user" targetProject="redictflow-dao\src\main\java" type="XMLMAPPER" />
<table tableName="pms_sys_user" enableCountByExample="false" enableUpdateByExample="false"
enableDeleteByExample="false" enableSelectByExample="false" selectByExampleQueryId="false" >
</table>
</context>
</generatorConfiguration></strong>
四、生成generatorConfig.xml,自动生成bean、mapper、mapper xml