Browse Source

update getSqlAndSqlParamsMap in order to replace title

pull/2/head
ligang 6 years ago
parent
commit
b664c08c15
  1. 6
      escheduler-server/src/main/java/cn/escheduler/server/worker/task/sql/SqlTask.java

6
escheduler-server/src/main/java/cn/escheduler/server/worker/task/sql/SqlTask.java

@ -189,6 +189,12 @@ public class SqlTask extends AbstractTask {
return new SqlBinds(sqlBuilder.toString(), sqlParamsMap); return new SqlBinds(sqlBuilder.toString(), sqlParamsMap);
} }
if (StringUtils.isNotEmpty(sqlParameters.getTitle())){
String title = ParameterUtils.convertParameterPlaceholders(sqlParameters.getTitle(), ParamUtils.convert(paramsMap));
logger.info(title);
sqlParameters.setTitle(title);
}
// special characters need to be escaped, ${} needs to be escaped // special characters need to be escaped, ${} needs to be escaped
String rgex = "'?\\$\\{(.*?)\\}'?"; String rgex = "'?\\$\\{(.*?)\\}'?";
setSqlParamsMap(sql,rgex,sqlParamsMap,paramsMap); setSqlParamsMap(sql,rgex,sqlParamsMap,paramsMap);

Loading…
Cancel
Save