diff --git a/option.go b/option.go index ff682c6..27b6b21 100644 --- a/option.go +++ b/option.go @@ -28,6 +28,7 @@ type Option struct { Start map[string]interface{} `json:"start"` // >= 条件 End map[string]interface{} `json:"end"` // < 条件 Like map[string]string `json:"like"` // like 语句 + NotLike map[string]string `json:"not_like"` // not like 语句 NotEqual map[string]interface{} `json:"not_equal"` // != 语句 } @@ -209,6 +210,36 @@ func WithBatchLike(data map[string]string) SetOption { } } +// WithNotLike NOT LIKE 语句 +// +// Author : go_developer@163.com<白茶清欢> +// +// Date : 17:50 2022/5/15 +func WithNotLike(field string, value string) SetOption { + return func(o *Option) { + if nil == o.NotLike { + o.NotLike = make(map[string]string) + } + o.NotLike[field] = value + } +} + +// WithBatchNotLike ... +// +// Author : go_developer@163.com<白茶清欢> +// +// Date : 17:52 2022/5/15 +func WithBatchNotLike(data map[string]string) SetOption { + return func(o *Option) { + if nil == o.NotLike { + o.NotLike = make(map[string]string) + } + for field, value := range data { + o.NotLike[field] = value + } + } +} + // WithNotEqual 设置不等于语句 // // Author : go_developer@163.com<白茶清欢>