43dd4e9234
Signed-off-by: Anton Nesterov <anton@demiurg.io>
23 lines
350 B
Go
23 lines
350 B
Go
package filters
|
|
|
|
import (
|
|
"fmt"
|
|
)
|
|
|
|
type Gt struct {
|
|
Gt interface{} `json:"$gt"`
|
|
}
|
|
|
|
func (f Gt) FromJSON(data interface{}) IFilter {
|
|
return FromJson[Gt](data)
|
|
}
|
|
|
|
func (f Gt) ToSQLPart(ctx Dialect) string {
|
|
if f.Gt == nil {
|
|
return ""
|
|
}
|
|
name := ctx.GetFieldName()
|
|
value := ctx.NormalizeValue(f.Gt)
|
|
return fmt.Sprintf("%s > %v", name, value)
|
|
}
|