Skip to content
Toggle navigation
Projects
Groups
Snippets
Help
platform
/
platform-process-server
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Settings
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit e8089efb
authored
Jan 11, 2024
by
林永健
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
fix parse sql bug
1 parent
86d26e98
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
14 additions
and
9 deletions
platform-process/src/main/java/cn/com/glsx/process/modules/service/SopDataService.java
platform-process/src/main/java/cn/com/glsx/process/modules/service/SopDataService.java
View file @
e8089ef
...
@@ -204,6 +204,18 @@ public class SopDataService {
...
@@ -204,6 +204,18 @@ public class SopDataService {
* 将指定条件SQL进行拼接
* 将指定条件SQL进行拼接
*/
*/
public
String
parseSQL
(
SopDataActionDTO
action
,
String
StageName
,
String
instId
)
{
public
String
parseSQL
(
SopDataActionDTO
action
,
String
StageName
,
String
instId
)
{
String
res
=
parseSQL
(
action
);
if
(!
StringUtils
.
hasLength
(
res
))
{
return
""
;
}
res
=
res
.
replace
(
"<"
,
"<"
)
.
replace
(
">"
,
">"
)
.
replace
(
"&eq;"
,
"="
)
.
replace
(
"≠"
,
"!="
);
return
sqlAnd
(
String
.
format
(
updateStagePrefix
,
StageName
,
instId
),
res
)
+
";"
;
}
public
String
parseSQL
(
SopDataActionDTO
action
)
{
String
res
=
action
.
getSql
();
String
res
=
action
.
getSql
();
if
(
CollectionUtils
.
isEmpty
(
action
.
getConditions
()))
{
if
(
CollectionUtils
.
isEmpty
(
action
.
getConditions
()))
{
return
res
;
return
res
;
...
@@ -224,15 +236,8 @@ public class SopDataService {
...
@@ -224,15 +236,8 @@ public class SopDataService {
}
}
condStrList
.
add
(
condStr
);
condStrList
.
add
(
condStr
);
}
}
res
=
sqlAnd
(
res
,
joinWithDelimiter
(
" and "
,
condStrList
));
if
(!
StringUtils
.
hasLength
(
res
.
trim
()))
{
return
sqlAnd
(
res
,
joinWithDelimiter
(
" and "
,
condStrList
));
return
""
;
}
res
=
res
.
replace
(
"<"
,
"<"
)
.
replace
(
">"
,
">"
)
.
replace
(
"&eq;"
,
"="
)
.
replace
(
"≠"
,
"!="
);
return
sqlAnd
(
String
.
format
(
updateStagePrefix
,
StageName
,
instId
),
res
)
+
";"
;
}
}
private
String
parseSQLWithOperator
(
SopDataConditionDTO
condition
)
{
private
String
parseSQLWithOperator
(
SopDataConditionDTO
condition
)
{
...
...
Write
Preview
Markdown
is supported
Attach a file
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 post a comment