Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

HCMPRE-400 : plan config name - implement fuzzy search #873

Open
wants to merge 4 commits into
base: microplanning-dev
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -110,4 +110,6 @@ public class ServiceConstants {
public static final String MDMS_SCHEMA_PROPERTIES_IS_REQUIRED = "isRequired";
public static final String BOUNDARY_CODE = "boundaryCode";

public static final String PERCENTAGE_WILDCARD = "%";

}
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
import org.springframework.stereotype.Component;
import org.springframework.util.CollectionUtils;
import org.springframework.util.ObjectUtils;
import static digit.config.ServiceConstants.*;

@Component
public class PlanConfigQueryBuilder {
Expand Down Expand Up @@ -105,8 +106,8 @@ private String buildPlanConfigSearchQuery(PlanConfigurationSearchCriteria criter

if (criteria.getName() != null) {
addClauseIfRequired(preparedStmtList, builder);
builder.append(" pc.name = ?");
preparedStmtList.add(criteria.getName());
builder.append(" pc.name LIKE ?");
preparedStmtList.add(criteria.getName() + PERCENTAGE_WILDCARD);
}

if (criteria.getStatus() != null) {
Expand Down