Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
S
szpt
Project overview
Project overview
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
以墨为白
szpt
Commits
937de8ea
Commit
937de8ea
authored
Mar 27, 2025
by
以墨为白
🎧
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
generator
parent
52f83702
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
15 additions
and
77 deletions
+15
-77
src/main/java/generatorConfig.xml
src/main/java/generatorConfig.xml
+0
-68
src/main/resources/generatorConfig.xml
src/main/resources/generatorConfig.xml
+15
-9
No files found.
src/main/java/generatorConfig.xml
deleted
100644 → 0
View file @
52f83702
<?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>
<!-- mysql数据源配置文件路径 -->
<properties
resource=
"mysql.properties"
/>
<context
id=
"DB2Tables"
targetRuntime=
"MyBatis3"
>
<!-- plugin顺序必须在这里-->
<plugin
type=
"com.zksy.szpt.config.BaseMapperPlugin"
/>
<plugin
type=
"com.zksy.szpt.config.SwaggerAnnotationPlugin"
/>
<plugin
type=
"com.zksy.szpt.config.TableRemarksPlugin"
></plugin>
<!--使用自定义主食类,将表注释写入实体类注释中-->
<commentGenerator
type=
"com.zksy.szpt.config.MybatisGenerator"
>
<!--去掉mybatisgenerator自己的注释-->
<property
name=
"suppressDate"
value=
"true"
/>
<property
name=
"suppressAllComments"
value=
"true"
/>
</commentGenerator>
<!--配置数据库连接-->
<jdbcConnection
driverClass=
"${jdbc.driver}"
connectionURL=
"${db.url}"
userId=
"${db.username}"
password=
"${db.password}"
>
<property
name=
"nullCatalogMeansCurrent"
value=
"true"
/>
</jdbcConnection>
<javaTypeResolver>
<property
name=
"forceBigDecimals"
value=
"false"
/>
</javaTypeResolver>
<!--指定生成javabean的位置-->
<javaModelGenerator
targetPackage=
"com.zksy.szpt.domain.po"
targetProject=
".\src\main\java"
>
<property
name=
"enableSubPackages"
value=
"false"
/>
<property
name=
"trimStrings"
value=
"true"
/>
</javaModelGenerator>
<!--指定sql的映射文件-->
<sqlMapGenerator
targetPackage=
"mapper"
targetProject=
".\src\main\resources"
>
<property
name=
"enableSubPackages"
value=
"true"
/>
</sqlMapGenerator>
<!--指定dao接口生成的位置,mapper接口-->
<javaClientGenerator
type=
"XMLMAPPER"
targetPackage=
"com.zksy.szpt.mapper"
targetProject=
".\src\main\java"
>
<property
name=
"enableSubPackages"
value=
"true"
/>
</javaClientGenerator>
<!--table的生成策略-->
<!-- <table tableName="ALLTYPES" domainObjectName="Customer" >
<property name="useActualColumnNames" value="true"/>
<generatedKey column="ID" sqlStatement="DB2" identity="true" />
<columnOverride column="DATE_FIELD" property="startDate" />
<ignoreColumn column="FRED" />
<columnOverride column="LONG_VARCHAR_FIELD" jdbcType="VARCHAR" />
</table> -->
<!--可多写 要生成的表名-->
<table
tableName=
"%"
schema=
"szpt"
>
</table>
</context>
</generatorConfiguration>
\ No newline at end of file
src/main/resources/generatorConfig.xml
View file @
937de8ea
...
...
@@ -10,6 +10,12 @@
<properties
resource=
"mysql.properties"
/>
<context
id=
"DB2Tables"
targetRuntime=
"MyBatis3"
>
<!-- plugin顺序必须在这里-->
<plugin
type=
"com.zksy.szpt.config.BaseMapperPlugin"
/>
<plugin
type=
"com.zksy.szpt.config.SwaggerAnnotationPlugin"
/>
<plugin
type=
"com.zksy.szpt.config.TableRemarksPlugin"
></plugin>
<!--使用自定义主食类,将表注释写入实体类注释中-->
<commentGenerator
type=
"com.zksy.szpt.config.MybatisGenerator"
>
<!--去掉mybatisgenerator自己的注释-->
...
...
@@ -22,26 +28,27 @@
connectionURL=
"${db.url}"
userId=
"${db.username}"
password=
"${db.password}"
>
<property
name=
"nullCatalogMeansCurrent"
value=
"true"
/>
</jdbcConnection>
<javaTypeResolver
>
<property
name=
"forceBigDecimals"
value=
"false"
/>
<javaTypeResolver>
<property
name=
"forceBigDecimals"
value=
"false"
/>
</javaTypeResolver>
<!--指定生成javabean的位置-->
<javaModelGenerator
targetPackage=
"com.zksy.szpt.domain.po"
targetProject=
".\src\main\java"
>
<property
name=
"enableSubPackages"
value=
"false"
/>
<property
name=
"trimStrings"
value=
"true"
/>
<property
name=
"enableSubPackages"
value=
"false"
/>
<property
name=
"trimStrings"
value=
"true"
/>
</javaModelGenerator>
<!--指定sql的映射文件-->
<sqlMapGenerator
targetPackage=
"mapper"
targetProject=
".\src\main\resources"
>
<property
name=
"enableSubPackages"
value=
"true"
/>
<property
name=
"enableSubPackages"
value=
"true"
/>
</sqlMapGenerator>
<!--指定dao接口生成的位置,mapper接口-->
<javaClientGenerator
type=
"XMLMAPPER"
targetPackage=
"com.zksy.szpt.mapper"
targetProject=
".\src\main\java"
>
<property
name=
"enableSubPackages"
value=
"true"
/>
<property
name=
"enableSubPackages"
value=
"true"
/>
</javaClientGenerator>
<!--table的生成策略-->
...
...
@@ -57,6 +64,5 @@
</table>
</context>
</generatorConfiguration>
\ No newline at end of file
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment