Skip to content

Commit

Permalink
[ISSUE alibaba#12911] resolve code conflict
Browse files Browse the repository at this point in the history
  • Loading branch information
20144101037 committed Dec 6, 2024
1 parent 79f448f commit a8fb72f
Showing 1 changed file with 1 addition and 11 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -113,10 +113,8 @@ public String update(List<String> columns, List<String> where) {
public String delete(List<String> params) {
StringBuilder sql = new StringBuilder();
String method = "DELETE ";
sql.append(method).append("FROM ").append(getTableName()).append(" ");
sql.append(method).append("FROM ").append(getTableName());
appendWhereClause(params, sql);
sql.append(method).append("FROM ").append(getTableName()).append(" ").append("WHERE ");
sql.append(params.stream().map(str -> (str + " = ?")).collect(Collectors.joining(" AND ")));

return sql.toString();
}
Expand All @@ -143,14 +141,6 @@ public String[] getPrimaryKeyGeneratedKeys() {
return new String[]{"id"};
}

protected void appendWhereClause(List<String> where, StringBuilder sql) {
sql.append("WHERE ");
for (int i = 0; i < where.size(); i++) {
sql.append(where.get(i)).append(" = ").append("?");
if (i != where.size() - 1) {
sql.append(" AND ");
}
}
private void appendWhereClause(List<String> where, StringBuilder sql) {
sql.append(" WHERE ");
sql.append(where.stream().map(str -> (str + " = ?")).collect(Collectors.joining(" AND ")));
Expand Down

0 comments on commit a8fb72f

Please sign in to comment.