Commit a10fb050 authored by đinh thị đầm's avatar đinh thị đầm

commit code searchOperation

parent 266fb8e6
......@@ -28,6 +28,7 @@ public interface CustomerService {
ResultDTO getCustomerDetailById(Long companySiteId, Long customerListId, Long customerId);
// ------------ customer list ------------ //
ResultDTO getAllCustomerList(int page, int pageSize, String sort, Long companySiteId);
......
package com.viettel.campaign.utils;
public enum SearchOperation {
EQUALITY, NEGATION, GREATER_THAN, LESS_THAN, LIKE, STARTS_WITH, ENDS_WITH, CONTAINS;
public static final String[] SIMPLE_OPERATION_SET = { ":", "!", ">", "<", "~" };
public static final String OR_PREDICATE_FLAG = "'";
public static final String ZERO_OR_MORE_REGEX = "*";
public static final String OR_OPERATOR = "OR";
public static final String AND_OPERATOR = "AND";
public static final String LEFT_PARANTHESIS = "(";
public static final String RIGHT_PARANTHESIS = ")";
public static SearchOperation getSimpleOperation(final char input) {
switch (input) {
case ':':
return EQUALITY;
case '!':
return NEGATION;
case '>':
return GREATER_THAN;
case '<':
return LESS_THAN;
case '~':
return LIKE;
default:
return null;
}
}
}
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment