REQ-2135: format code
This commit is contained in:
parent
91257be07e
commit
c3042796a5
@ -19,15 +19,16 @@ public class QueryFormatter {
|
||||
}
|
||||
|
||||
public static String format(AbstractWrapper<?, ?, ?> wrapper) {
|
||||
return formatImpl(wrapper.clone());
|
||||
return formatImpl(wrapper);
|
||||
}
|
||||
|
||||
private static String formatImpl(AbstractWrapper<?, ?, ?> wrapper) {
|
||||
String sql = wrapper.getSqlSegment();
|
||||
Map<String, Object> name2Values = wrapper.getParamNameValuePairs();
|
||||
AbstractWrapper<?, ?, ?> copy = wrapper.clone();
|
||||
String sql = copy.getSqlSegment();
|
||||
Map<String, Object> name2Values = copy.getParamNameValuePairs();
|
||||
if (StringUtils.isBlank(sql) || name2Values == null || name2Values.isEmpty())
|
||||
return sql;
|
||||
return TemplateParser.parseNumberSign(sql, ImmutableMap.of(Constants.WRAPPER, wrapper));
|
||||
return TemplateParser.parseNumberSign(sql, ImmutableMap.of(Constants.WRAPPER, copy));
|
||||
}
|
||||
|
||||
}
|
||||
Loading…
Reference in New Issue
Block a user