安装好mybaties 插件后执行你想工程脚本。
<?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:\Maven\repository\org\postgresql\postgresql\9.4.1212.jre7\postgresql-9.4.1212.jre7.jar" />
<context id="context1">
<commentGenerator>
<!-- 是否去除自动生成的注释 true:是 : false:否 -->
<property name="suppressAllComments" value="true" />
</commentGenerator>
<!-- 数据库链接URL、用户名、密码 -->
<jdbcConnection connectionURL="jdbc:postgresql://10.25.81.215:54321/rrmp"
driverClass="org.postgresql.Driver" password="123456" userId="postgres" />
<!-- 生成模型的包名和位置 -->
<javaModelGenerator targetPackage="com.paic.rrmp.entity.rrmpOtherDimension"
targetProject="rrmp-service/src/main/java" />
<!-- 生成的映射文件报名和位置 -->
<sqlMapGenerator targetPackage="mapper.rrmpOtherDimension" targetProject="rrmp-service/src/main/resources" />
<!-- 生成DAO的包名和位置 -->
<javaClientGenerator targetPackage="com.paic.rrmp.dao.rrmpOtherDimension"
targetProject="rrmp-service/src/main/java" type="XMLMAPPER" />
<table tableName="rrmp_other_dimension" domainObjectName="RrmpOtherDimension" schema="public"
enableCountByExample="false"
enableUpdateByExample="false"
enableDeleteByExample="false" enableSelectByExample="false"
selectByExampleQueryId="false"></table>
<!-- <table schema="public" tableName="rrmp_menu"
domainObjectName="rrmpMenu" enableCountByExample="false"
enableUpdateByExample="false" enableDeleteByExample="false"
enableSelectByExample="false" selectByExampleQueryId="false">
</table> -->
</context>
</generatorConfiguration>