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