diff --git a/internal/usecases/convertquery/createConstraints.go b/internal/usecases/convertquery/createConstraints.go index b03d06f79342d39122612dd076eeedf5afe37f8b..f5415e34269c7ce2620255eb516dc0ca909fd032 100644 --- a/internal/usecases/convertquery/createConstraints.go +++ b/internal/usecases/convertquery/createConstraints.go @@ -44,24 +44,30 @@ func createConstraintBoolExpression(constraint *entity.QueryConstraintStruct, na line string ) + // Constraint datatypes back end + // text MatchTypes: EQ/NEQ/contains/excludes + // number MatchTypes: EQ/NEQ/GT/LT/GET/LET + // bool MatchTypes: EQ/NEQ + switch constraint.DataType { case "text": value = fmt.Sprintf("\"%s\"", constraint.Value) switch constraint.MatchType { + case "NEQ": + match = "!=" case "contains": - match = "IN" - case "startswith": match = "LIKE" + case "excludes": + match = "NOT LIKE" value = fmt.Sprintf("\"%s%%\"", constraint.Value) - case "endswith": - match = "LIKE" - value = fmt.Sprintf("\"_%s\"", constraint.Value) - default: //exact + default: //EQ match = "==" } case "number": value = constraint.Value switch constraint.MatchType { + case "NEQ": + match = "!=" case "GT": match = ">" case "LT":