Commit e8089efb by 林永健

fix parse sql bug

1 parent 86d26e98
......@@ -204,6 +204,18 @@ public class SopDataService {
* 将指定条件SQL进行拼接
*/
public String parseSQL(SopDataActionDTO action, String StageName, String instId) {
String res = parseSQL(action);
if (!StringUtils.hasLength(res)) {
return "";
}
res = res.replace("&lt;", "<")
.replace("&gt;", ">")
.replace("&eq;", "=")
.replace("&ne;", "!=");
return sqlAnd(String.format(updateStagePrefix, StageName, instId), res) + ";";
}
public String parseSQL(SopDataActionDTO action) {
String res = action.getSql();
if (CollectionUtils.isEmpty(action.getConditions())) {
return res;
......@@ -224,15 +236,8 @@ public class SopDataService {
}
condStrList.add(condStr);
}
res = sqlAnd(res, joinWithDelimiter(" and ", condStrList));
if (!StringUtils.hasLength(res.trim())) {
return "";
}
res = res.replace("&lt;", "<")
.replace("&gt;", ">")
.replace("&eq;", "=")
.replace("&ne;", "!=");
return sqlAnd(String.format(updateStagePrefix, StageName, instId), res) + ";";
return sqlAnd(res, joinWithDelimiter(" and ", condStrList));
}
private String parseSQLWithOperator(SopDataConditionDTO condition) {
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!