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

Merged
merged 8 commits into from
Oct 4, 2024
Merged
Show file tree
Hide file tree
Changes from all 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 @@ -180,4 +180,5 @@ public class ServiceConstants {

public static final String VEHICLE_ID_FIELD = "vehicleIds";

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.PERCENTAGE_WILDCARD;

@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
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,8 @@ public class PlanConfiguration {
public enum StatusEnum {
DRAFT ,
GENERATED,
INVALID_DATA
INVALID_DATA,
SETUP_COMPLETED
}

}