Skip to content

Commit

Permalink
Merge branch 'master' of https://github.com/chubaostream/joyqueue
Browse files Browse the repository at this point in the history
  • Loading branch information
majun87 committed Dec 29, 2020
2 parents c3ed5db + 435a700 commit 2378f6f
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,8 @@ public class QBroker implements Query {

private String keyword;

private Boolean fuzzy;

@Deprecated
private List<Integer> brokerGroupIds;

Expand Down Expand Up @@ -116,4 +118,11 @@ public void setInBrokerIds(List<Integer> inBrokerIds) {
this.inBrokerIds = inBrokerIds;
}

public Boolean getFuzzy() {
return fuzzy;
}

public void setFuzzy(Boolean fuzzy) {
this.fuzzy = fuzzy;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -167,6 +167,7 @@ private BrokerQuery brokerQueryConvert(QBroker query){
brokerQuery.setIp(query.getIp());
brokerQuery.setKeyword(query.getKeyword());
brokerQuery.setBrokerList(query.getInBrokerIds());
brokerQuery.setFuzzy(query.getFuzzy());
}
return brokerQuery;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -128,9 +128,7 @@ protected String getSearchSql(String prefix, BrokerQuery query, List<Object> par
} else {
if (query.getFuzzy() != null && query.getFuzzy()) {
sql.append(" AND `ip` LIKE ?");
params.add("%");
params.add(query.getKeyword());
params.add("%");
params.add("%" + query.getKeyword() + "%");
} else {
sql.append(" AND `ip` = ?");
params.add(query.getKeyword());
Expand Down

0 comments on commit 2378f6f

Please sign in to comment.