generatorConfig.xml
2.53 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
<?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>
<context id="DB2Tables" targetRuntime="MyBatis3">
<plugin type="com.zteits.job.util.OverWriteIsMergeablePlugin" />
<!-- 自定义注释生成器 MybatisGeneratorCommon类为我自定义的继承CommentGenerator的类 -->
<commentGenerator type="com.zteits.job.util.MybatisGeneratorCommon">
<!-- 关闭自动生成的注释 -->
<property name="suppressAllComments" value="true" />
<property name="suppressDate" value="true" />
<property name="javaFileEncoding" value="UTF-8"/>
</commentGenerator>
<!-- 定义如何连接目标数据库 -->
<jdbcConnection driverClass="${park-datasource.driverClassName}"
connectionURL="${park-datasource.url}"
userId="${park-datasource.username}"
password="${park-datasource.password}">
</jdbcConnection>
<!-- 默认false,把JDBC DECIMAL 和 NUMERIC 类型解析为 Integer
true,把JDBC DECIMAL 和 NUMERIC 类型解析为java.math.BigDecimal
-->
<javaTypeResolver >
<property name="forceBigDecimals" value="true" />
</javaTypeResolver>
<!-- 指定生成 Java 模型对象所属的包 -->
<javaModelGenerator targetPackage="com.zteits.job.domain" targetProject="zteits-job/src/main/java">
<property name="enableSubPackages" value="false" />
<property name="trimStrings" value="true" />
</javaModelGenerator>
<!-- 指定生成 SQL 映射文件所属的包和的目标项目 -->
<sqlMapGenerator targetPackage="mybatis.mapper" targetProject="zteits-job/src/main/resources">
<property name="enableSubPackages" value="false" />
</sqlMapGenerator>
<!-- 指定目标包和目标项目生成的客户端接口和类 -->
<javaClientGenerator type="XMLMAPPER" targetPackage="com.zteits.job.mapper" targetProject="zteits-job/src/main/java">
<property name="enableSubPackages" value="true" />
</javaClientGenerator>
<table tableName="tp_p_freeberth_statistic_rule"
enableCountByExample="true" enableUpdateByExample="true"
enableDeleteByExample="true" enableSelectByExample="true"
selectByExampleQueryId="true">
<!-- 指定自动生成主键的属性 -->
<generatedKey column="id" sqlStatement="MySql" identity="true"></generatedKey>
</table>
</context>
</generatorConfiguration>