Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Z
ZhangKuan
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
JIRA
JIRA
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
张宽
ZhangKuan
Commits
93d5647d
Commit
93d5647d
authored
May 27, 2017
by
胡小根
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'master' of 115.28.80.125:templates/springmvcprojecttemplate
parents
8dc55e65
be5c7c11
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
66 additions
and
24 deletions
+66
-24
README.md
README.md
+35
-0
pom.xml
pom.xml
+17
-17
oracleGeneratorConfig.xml
web/src/main/resources/mybatis/oracleGeneratorConfig.xml
+4
-4
postgresqlGeneratorConfig.xml
web/src/main/resources/mybatis/postgresqlGeneratorConfig.xml
+1
-1
postgresqlGeneratorConfig1.xml
...src/main/resources/mybatis/postgresqlGeneratorConfig1.xml
+9
-2
No files found.
README.md
0 → 100644
View file @
93d5647d
##SpringMVCProjectTemplate 自动生成代码文档说明
此项目用于自动生成后端代码,生成包含实体类的两个文件,以及dao层接口Mapper以及xml文件。
### 1.修改xxxxGeneratorConfig.XML文件
#### 进入项目后根据我们项目使用的数据库选择相应xml配置文件进行更改(mysql,oracle或者postgresql)
***(1)文件所在的位置**
*
~/web/src/main/resources/mybatis/xxxxGeneratorConfig.xml
***(2)开始更改**
*
根据使用的数据库更改相应的xxxxGeneratorConfig.xml文件(例如使用mysql会修改mysqlGeneratorConfig.xml)。
***(3)第一点更改**
*
xml文件中存在标签:
***classPathEntry location=""**
*
中location对应的jar包路径,更改为自己本地的路径。(建议使用的maven本地仓库中的jar包)
***(4)第二点更改**
*
***jdbcConnection:**
*
1.
connectionURL 更改为需要连接的url
2.
userId 数据库的用户名
3.
password 数据库密码
***(5)第三点更改**
*
oracle数据库:
<table>
中schema更改为 "DataBase用户"
postgresql数据库:
<table>
中schema更改为 "DataBase用户" tableName中表名,具体参考示例
omainObjectName生成的实体类的名字
enableCountByExample 默认true
### 2.修改pom.xml
修改pom.xml中
***标签plugins**
*->*
**标签plugin**
*->*
**标签configuration**
*
下包含
mysql,
oracle,
postgresql
使用的配置路径(例:使用的mysql就启用${basedir}/src/main/resources/mybatis/mysqlGeneratorConfig.xml配置文件) 将不用的注释掉。
### 3.运行生成过程
运行mybatis_generate.sh文件,就在项目根目录下面。
### 4.备注
PS:项目根目录下面的脚本作用clean_mybatis_generated.sh和clean_mybatis_generated_springmvc.sh 删除相应目录下所有的文件。
\ No newline at end of file
pom.xml
View file @
93d5647d
...
@@ -160,24 +160,24 @@
...
@@ -160,24 +160,24 @@
</dependency>
</dependency>
<!-- 添加oracle jdbc driver -->
<!-- 添加oracle jdbc driver -->
<!--<dependency>-->
<!--<groupId>com.oracle</groupId>-->
<!--<artifactId>ojdbc6</artifactId>-->
<!--<version>11.2.0.1.0</version>-->
<!--</dependency>-->
<!-- 添加mysql jdbc driver -->
<dependency>
<dependency>
<groupId>
mysql
</groupId>
<groupId>
com.oracle
</groupId>
<artifactId>
mysql-connector-java
</artifactId>
<artifactId>
ojdbc6
</artifactId>
<version>
5.1.38
</version>
<version>
11.2.0.1.0
</version>
</dependency>
</dependency>
<dependency>
<!-- 添加mysql jdbc driver -->
<groupId>
postgresql
</groupId>
<!--<dependency>-->
<artifactId>
postgresql
</artifactId>
<!--<groupId>mysql</groupId>-->
<version>
9.1-901-1.jdbc4
</version>
<!--<artifactId>mysql-connector-java</artifactId>-->
</dependency>
<!--<version>5.1.38</version>-->
<!--</dependency>-->
<!--<dependency>-->
<!--<groupId>postgresql</groupId>-->
<!--<artifactId>postgresql</artifactId>-->
<!--<version>9.1-901-1.jdbc4</version>-->
<!--</dependency>-->
<!-- json -->
<!-- json -->
<dependency>
<dependency>
...
@@ -522,8 +522,8 @@
...
@@ -522,8 +522,8 @@
<version>
1.3.5
</version>
<version>
1.3.5
</version>
<configuration>
<configuration>
<!--<configurationFile>${basedir}/src/main/resources/mybatis/mysqlGeneratorConfig.xml</configurationFile>-->
<!--<configurationFile>${basedir}/src/main/resources/mybatis/mysqlGeneratorConfig.xml</configurationFile>-->
<
!--<configurationFile>${basedir}/src/main/resources/mybatis/oracleGeneratorConfig.xml</configurationFile>--
>
<
configurationFile>
${basedir}/src/main/resources/mybatis/oracleGeneratorConfig.xml
</configurationFile
>
<
configurationFile>
${basedir}/src/main/resources/mybatis/postgresqlGeneratorConfig1.xml
</configurationFile
>
<
!--<configurationFile>${basedir}/src/main/resources/mybatis/postgresqlGeneratorConfig1.xml</configurationFile>--
>
<!--postgresqlGeneratorConfig.xml-->
<!--postgresqlGeneratorConfig.xml-->
<verbose>
true
</verbose>
<verbose>
true
</verbose>
<overwrite>
true
</overwrite>
<overwrite>
true
</overwrite>
...
...
web/src/main/resources/mybatis/oracleGeneratorConfig.xml
View file @
93d5647d
...
@@ -13,9 +13,9 @@
...
@@ -13,9 +13,9 @@
<plugin
type=
"org.mybatis.generator.plugins.ToStringPlugin"
/>
<plugin
type=
"org.mybatis.generator.plugins.ToStringPlugin"
/>
<jdbcConnection
driverClass=
"oracle.jdbc.driver.OracleDriver"
<jdbcConnection
driverClass=
"oracle.jdbc.driver.OracleDriver"
connectionURL=
"jdbc:oracle:thin:@
bcs.hitevision.com:1521:crmd02
"
connectionURL=
"jdbc:oracle:thin:@
haomo-studio.com:21521:xe
"
userId=
"
crm
"
userId=
"
STEAM_MONITOR
"
password=
"
sohu2020
"
/>
password=
"
STEAM_MONITOR
"
/>
<!-- 指定生成的类型为java类型,避免数据库中number等类型字段 -->
<!-- 指定生成的类型为java类型,避免数据库中number等类型字段 -->
<javaTypeResolver>
<javaTypeResolver>
...
@@ -45,7 +45,7 @@
...
@@ -45,7 +45,7 @@
value=
"false"
/>
value=
"false"
/>
</javaClientGenerator>
</javaClientGenerator>
<table
schema=
"
CRM
"
tableName=
"%"
>
<table
schema=
"
STEAM_MONITOR
"
tableName=
"%"
>
<property
name=
"useActualColumnNames"
value=
"false"
/>
<property
name=
"useActualColumnNames"
value=
"false"
/>
</table>
</table>
</context>
</context>
...
...
web/src/main/resources/mybatis/postgresqlGeneratorConfig.xml
View file @
93d5647d
...
@@ -59,7 +59,7 @@
...
@@ -59,7 +59,7 @@
<table
schema=
"public"
tableName=
"act_hi_procinst"
domainObjectName=
"ActHiProcinst"
enableCountByExample=
"true"
></table>
<table
schema=
"public"
tableName=
"act_hi_procinst"
domainObjectName=
"ActHiProcinst"
enableCountByExample=
"true"
></table>
<table
schema=
"public"
tableName=
"act_hi_taskinst"
domainObjectName=
"ActHiTaskinst"
enableCountByExample=
"true"
></table>
<table
schema=
"public"
tableName=
"act_hi_taskinst"
domainObjectName=
"ActHiTaskinst"
enableCountByExample=
"true"
></table>
<table
schema=
"public"
tableName=
"act_hi_varinst"
domainObjectName=
"ActHi
Y
arinst"
enableCountByExample=
"true"
></table>
<table
schema=
"public"
tableName=
"act_hi_varinst"
domainObjectName=
"ActHi
V
arinst"
enableCountByExample=
"true"
></table>
<table
schema=
"public"
tableName=
"act_id_group"
domainObjectName=
"ActIdGroup"
enableCountByExample=
"true"
></table>
<table
schema=
"public"
tableName=
"act_id_group"
domainObjectName=
"ActIdGroup"
enableCountByExample=
"true"
></table>
<table
schema=
"public"
tableName=
"act_id_info"
domainObjectName=
"ActIdInfo"
enableCountByExample=
"true"
></table>
<table
schema=
"public"
tableName=
"act_id_info"
domainObjectName=
"ActIdInfo"
enableCountByExample=
"true"
></table>
<table
schema=
"public"
tableName=
"act_id_membership"
domainObjectName=
"ActIdMembership"
enableCountByExample=
"true"
></table>
<table
schema=
"public"
tableName=
"act_id_membership"
domainObjectName=
"ActIdMembership"
enableCountByExample=
"true"
></table>
...
...
web/src/main/resources/mybatis/postgresqlGeneratorConfig1.xml
View file @
93d5647d
...
@@ -56,7 +56,7 @@
...
@@ -56,7 +56,7 @@
<table
schema=
"public"
tableName=
"act_hi_procinst"
domainObjectName=
"ActHiProcinst"
enableCountByExample=
"true"
></table>
<table
schema=
"public"
tableName=
"act_hi_procinst"
domainObjectName=
"ActHiProcinst"
enableCountByExample=
"true"
></table>
<table
schema=
"public"
tableName=
"act_hi_taskinst"
domainObjectName=
"ActHiTaskinst"
enableCountByExample=
"true"
></table>
<table
schema=
"public"
tableName=
"act_hi_taskinst"
domainObjectName=
"ActHiTaskinst"
enableCountByExample=
"true"
></table>
<table
schema=
"public"
tableName=
"act_hi_varinst"
domainObjectName=
"ActHi
Y
arinst"
enableCountByExample=
"true"
></table>
<table
schema=
"public"
tableName=
"act_hi_varinst"
domainObjectName=
"ActHi
V
arinst"
enableCountByExample=
"true"
></table>
<table
schema=
"public"
tableName=
"act_id_group"
domainObjectName=
"ActIdGroup"
enableCountByExample=
"true"
></table>
<table
schema=
"public"
tableName=
"act_id_group"
domainObjectName=
"ActIdGroup"
enableCountByExample=
"true"
></table>
<table
schema=
"public"
tableName=
"act_id_info"
domainObjectName=
"ActIdInfo"
enableCountByExample=
"true"
></table>
<table
schema=
"public"
tableName=
"act_id_info"
domainObjectName=
"ActIdInfo"
enableCountByExample=
"true"
></table>
<table
schema=
"public"
tableName=
"act_id_membership"
domainObjectName=
"ActIdMembership"
enableCountByExample=
"true"
></table>
<table
schema=
"public"
tableName=
"act_id_membership"
domainObjectName=
"ActIdMembership"
enableCountByExample=
"true"
></table>
...
@@ -72,9 +72,16 @@
...
@@ -72,9 +72,16 @@
<table
schema=
"public"
tableName=
"act_ru_job"
domainObjectName=
"ActRuJob"
enableCountByExample=
"true"
></table>
<table
schema=
"public"
tableName=
"act_ru_job"
domainObjectName=
"ActRuJob"
enableCountByExample=
"true"
></table>
<table
schema=
"public"
tableName=
"act_ru_task"
domainObjectName=
"ActRuTask"
enableCountByExample=
"true"
></table>
<table
schema=
"public"
tableName=
"act_ru_task"
domainObjectName=
"ActRuTask"
enableCountByExample=
"true"
></table>
<table
schema=
"public"
tableName=
"act_ru_variable"
domainObjectName=
"ActRuVariable"
enableCountByExample=
"true"
></table>
<table
schema=
"public"
tableName=
"act_ru_variable"
domainObjectName=
"ActRuVariable"
enableCountByExample=
"true"
></table>
<table
schema=
"public"
tableName=
"process_property"
domainObjectName=
"ProcessProperty"
enableCountByExample=
"true"
></table>
<table
schema=
"public"
tableName=
"section_property"
domainObjectName=
"SectionProperty"
enableCountByExample=
"true"
></table>
<table
schema=
"public"
tableName=
"section_property"
domainObjectName=
"SectionProperty"
enableCountByExample=
"true"
></table>
<table
schema=
"public"
tableName=
"template_section_m2m"
domainObjectName=
"TemplateSectionM2m"
enableCountByExample=
"true"
></table>
<table
schema=
"public"
tableName=
"template_section_m2m"
domainObjectName=
"TemplateSectionM2m"
enableCountByExample=
"true"
></table>
<table
schema=
"public"
tableName=
"process_property"
domainObjectName=
"ProcessProperty"
enableCountByExample=
"true"
></table>
<table
schema=
"public"
tableName=
"section_task_m2m"
domainObjectName=
"SectionTaskM2m"
enableCountByExample=
"true"
></table>
<table
schema=
"public"
tableName=
"task"
domainObjectName=
"Task"
enableCountByExample=
"true"
></table>
<table
schema=
"public"
tableName=
"variant_property"
domainObjectName=
"VariantProperty"
enableCountByExample=
"true"
></table>
<table
schema=
"public"
tableName=
"role"
domainObjectName=
"Role"
enableCountByExample=
"true"
></table>
<table
schema=
"public"
tableName=
"user"
domainObjectName=
"User"
enableCountByExample=
"true"
></table>
</context>
</context>
</generatorConfiguration>
</generatorConfiguration>
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