dal/pkg/filters/Lte.go

19 lines
348 B
Go
Raw Normal View History

package filters
type Lte struct {
Lte interface{} `json:"$lte"`
}
2024-08-08 17:26:29 +00:00
func (f Lte) FromJSON(data interface{}) IFilter {
return FromJson[Lte](data)
}
func (f Lte) ToSQLPart(ctx Dialect) (string, Values) {
if f.Lte == nil {
return "", nil
}
name := ctx.GetFieldName()
value := ctx.NormalizeValue(f.Lte)
return FmtCompare("<=", name, value)
}