Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Sign in / Register
Toggle navigation
Y
yzg-util
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
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
YZG
yzg-util
Commits
ca4e45ce
Commit
ca4e45ce
authored
Jun 18, 2020
by
yanzg
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
压缩视频
parent
155205f0
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
3 additions
and
3 deletions
+3
-3
BaseDaoSql.java
...db/src/main/java/com/yanzuoguang/dao/impl/BaseDaoSql.java
+3
-3
No files found.
yzg-util-db/src/main/java/com/yanzuoguang/dao/impl/BaseDaoSql.java
View file @
ca4e45ce
...
@@ -561,7 +561,7 @@ public abstract class BaseDaoSql {
...
@@ -561,7 +561,7 @@ public abstract class BaseDaoSql {
((
InitDaoQuery
)
model
).
initCond
();
((
InitDaoQuery
)
model
).
initCond
();
}
}
sql
=
handleCodeRelease
(
sql
,
sqlData
,
model
,
codeMap
);
sql
=
handleCodeRelease
(
sql
,
sqlData
,
model
,
codeMap
);
sql
=
handleCodeReplace
(
sql
,
codeMap
);
sql
=
handleCodeReplace
(
sql
Data
,
sql
,
codeMap
);
// 通过正则表达式处理参数 @name 并替换SQL语句成 ?
// 通过正则表达式处理参数 @name 并替换SQL语句成 ?
sql
=
handlePara
(
sql
,
paras
,
model
);
sql
=
handlePara
(
sql
,
paras
,
model
);
...
@@ -576,7 +576,7 @@ public abstract class BaseDaoSql {
...
@@ -576,7 +576,7 @@ public abstract class BaseDaoSql {
* @param codeMap 替换内容
* @param codeMap 替换内容
* @return Sql语句值
* @return Sql语句值
*/
*/
protected
String
handleCodeReplace
(
String
sql
,
Map
<
String
,
List
<
String
>>
codeMap
)
{
protected
String
handleCodeReplace
(
S
qlData
sqlData
,
S
tring
sql
,
Map
<
String
,
List
<
String
>>
codeMap
)
{
// 正则表达式匹配代码片段,并根据代码片段获取数组进行增加
// 正则表达式匹配代码片段,并根据代码片段获取数组进行增加
String
regex
=
"\\{.*?\\}"
;
String
regex
=
"\\{.*?\\}"
;
Pattern
p
=
Pattern
.
compile
(
regex
);
Pattern
p
=
Pattern
.
compile
(
regex
);
...
@@ -587,7 +587,7 @@ public abstract class BaseDaoSql {
...
@@ -587,7 +587,7 @@ public abstract class BaseDaoSql {
break
;
break
;
}
}
if
(
sql
.
length
()
>
MAX_SQL_LENGTH
)
{
if
(
sql
.
length
()
>
MAX_SQL_LENGTH
)
{
throw
new
CodeException
(
"SQL语句过长,不能再次处理代码片段"
);
throw
new
CodeException
(
"SQL语句
"
+
this
.
getClass
().
getSimpleName
()
+
"."
+
sqlData
.
getName
()
+
"
过长,不能再次处理代码片段"
);
}
}
// 寻找到的代码片段 不包含分括号
// 寻找到的代码片段 不包含分括号
String
name
=
m
.
group
();
String
name
=
m
.
group
();
...
...
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