Extend filtering logic in NodeRepository by including external_mapping_id in search criteria. Fix for Issue #77
This commit is contained in:
parent
640f466441
commit
6ddd48400e
1 changed files with 4 additions and 4 deletions
|
|
@ -106,8 +106,8 @@ public class NodeRepository {
|
|||
entities = jdbcTemplate.query(query, new NodeMapper(), pagination.getLimit(), pagination.getOffset());
|
||||
totalCount = jdbcTemplate.queryForObject(countQuery, Integer.class);
|
||||
} else {
|
||||
entities = jdbcTemplate.query(query, new NodeMapper(), "%" + filter + "%", "%" + filter + "%", "%" + filter + "%", pagination.getLimit(), pagination.getOffset());
|
||||
totalCount = jdbcTemplate.queryForObject(countQuery, Integer.class, "%" + filter + "%", "%" + filter + "%", "%" + filter + "%");
|
||||
entities = jdbcTemplate.query(query, new NodeMapper(), "%" + filter + "%", "%" + filter + "%", "%" + filter + "%", "%" + filter + "%", pagination.getLimit(), pagination.getOffset());
|
||||
totalCount = jdbcTemplate.queryForObject(countQuery, Integer.class, "%" + filter + "%", "%" + filter + "%", "%" + filter + "%", "%" + filter + "%");
|
||||
}
|
||||
|
||||
|
||||
|
|
@ -125,7 +125,7 @@ public class NodeRepository {
|
|||
queryBuilder.append(" AND node.is_deprecated = FALSE");
|
||||
}
|
||||
if (filter != null) {
|
||||
queryBuilder.append(" AND (node.name LIKE ? OR node.address LIKE ? OR country.iso_code LIKE ?)");
|
||||
queryBuilder.append(" AND (node.name LIKE ? OR node.external_mapping_id LIKE ? OR node.address LIKE ? OR country.iso_code LIKE ?)");
|
||||
}
|
||||
|
||||
return queryBuilder.toString();
|
||||
|
|
@ -143,7 +143,7 @@ public class NodeRepository {
|
|||
queryBuilder.append(" AND node.is_deprecated = FALSE");
|
||||
}
|
||||
if (filter != null) {
|
||||
queryBuilder.append(" AND (node.name LIKE ? OR node.address LIKE ? OR country.iso_code LIKE ?)");
|
||||
queryBuilder.append(" AND (node.name LIKE ? OR node.external_mapping_id LIKE ? OR node.address LIKE ? OR country.iso_code LIKE ?)");
|
||||
}
|
||||
queryBuilder.append(" ORDER BY node.id LIMIT ? OFFSET ?");
|
||||
return queryBuilder.toString();
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue