Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
S
sts网站
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
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
liyang
sts网站
Commits
c0cd030d
Commit
c0cd030d
authored
Mar 13, 2020
by
RuoYi
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
批量替换表前缀修改
parent
7604d59e
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
22 additions
and
18 deletions
+22
-18
GenUtils.java
...c/main/java/com/ruoyi/project/tool/gen/util/GenUtils.java
+22
-18
No files found.
ruoyi/src/main/java/com/ruoyi/project/tool/gen/util/GenUtils.java
View file @
c0cd030d
...
...
@@ -166,12 +166,32 @@ public class GenUtils
if
(
autoRemovePre
&&
StringUtils
.
isNotEmpty
(
tablePrefix
))
{
String
[]
searchList
=
StringUtils
.
split
(
tablePrefix
,
","
);
String
[]
replacementList
=
emptyList
(
searchList
.
length
);
tableName
=
StringUtils
.
replaceEach
(
tableName
,
searchList
,
replacementList
);
tableName
=
replaceFirst
(
tableName
,
searchList
);
}
return
StringUtils
.
convertToCamelCase
(
tableName
);
}
/**
* 批量替换前缀
*
* @param replacementm 替换值
* @param searchList 替换列表
* @return
*/
public
static
String
replaceFirst
(
String
replacementm
,
String
[]
searchList
)
{
String
text
=
StringUtils
.
EMPTY
;
for
(
String
searchString
:
searchList
)
{
if
(
replacementm
.
startsWith
(
searchString
))
{
text
=
replacementm
.
replaceFirst
(
searchString
,
""
);
break
;
}
}
return
text
;
}
/**
* 关键字替换
*
...
...
@@ -219,20 +239,4 @@ public class GenUtils
return
0
;
}
}
/**
* 获取空数组列表
*
* @param length 长度
* @return 数组信息
*/
public
static
String
[]
emptyList
(
int
length
)
{
String
[]
values
=
new
String
[
length
];
for
(
int
i
=
0
;
i
<
length
;
i
++)
{
values
[
i
]
=
StringUtils
.
EMPTY
;
}
return
values
;
}
}
\ 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