2024-08-07 19:16:40 +00:00
|
|
|
package filters
|
|
|
|
|
|
|
|
import (
|
|
|
|
"fmt"
|
|
|
|
)
|
|
|
|
|
|
|
|
type Gt struct {
|
|
|
|
Gt interface{} `json:"$gt"`
|
|
|
|
}
|
|
|
|
|
2024-08-08 17:26:29 +00:00
|
|
|
func (f Gt) FromJSON(data interface{}) IFilter {
|
2024-08-07 19:16:40 +00:00
|
|
|
return FromJson[Gt](data)
|
|
|
|
}
|
|
|
|
|
2024-08-11 19:49:19 +00:00
|
|
|
func (f Gt) ToSQLPart(ctx Dialect) string {
|
2024-08-07 19:16:40 +00:00
|
|
|
if f.Gt == nil {
|
|
|
|
return ""
|
|
|
|
}
|
|
|
|
name := ctx.GetFieldName()
|
|
|
|
value := ctx.NormalizeValue(f.Gt)
|
|
|
|
return fmt.Sprintf("%s > %v", name, value)
|
|
|
|
}
|