You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
121 lines
1.6 KiB
121 lines
1.6 KiB
package builder
|
|
|
|
func CondType(cond Cond) string {
|
|
switch cond.(type) {
|
|
case condAnd:
|
|
return "and"
|
|
case condOr:
|
|
return "or"
|
|
case condIn:
|
|
return "in"
|
|
case condNotIn:
|
|
return "not in"
|
|
case condIf:
|
|
return "if"
|
|
}
|
|
return ""
|
|
}
|
|
|
|
func GetCondAnd(cond Cond) condAnd {
|
|
switch cond.(type) {
|
|
case condAnd:
|
|
return cond.(condAnd)
|
|
}
|
|
return nil
|
|
}
|
|
|
|
func GetCondOr(cond Cond) condOr {
|
|
switch cond.(type) {
|
|
case condOr:
|
|
return cond.(condOr)
|
|
}
|
|
return nil
|
|
}
|
|
|
|
func GetCondEq(cond Cond) Eq {
|
|
switch cond.(type) {
|
|
case Eq:
|
|
return cond.(Eq)
|
|
}
|
|
return nil
|
|
}
|
|
|
|
func GetCondNeq(cond Cond) Neq {
|
|
switch cond.(type) {
|
|
case Neq:
|
|
return cond.(Neq)
|
|
}
|
|
return nil
|
|
}
|
|
|
|
func GetCondGt(cond Cond) Gt {
|
|
switch cond.(type) {
|
|
case Gt:
|
|
return cond.(Gt)
|
|
}
|
|
return nil
|
|
}
|
|
|
|
func GetCondGte(cond Cond) Gte {
|
|
switch cond.(type) {
|
|
case Gte:
|
|
return cond.(Gte)
|
|
}
|
|
return nil
|
|
}
|
|
|
|
func GetCondLt(cond Cond) Lt {
|
|
switch cond.(type) {
|
|
case Lt:
|
|
return cond.(Lt)
|
|
}
|
|
return nil
|
|
}
|
|
|
|
func GetCondLte(cond Cond) Lte {
|
|
switch cond.(type) {
|
|
case Lte:
|
|
return cond.(Lte)
|
|
}
|
|
return nil
|
|
}
|
|
|
|
func GetCondLike(cond Cond) (l Like) {
|
|
|
|
switch cond.(type) {
|
|
case Like:
|
|
return cond.(Like)
|
|
}
|
|
return
|
|
}
|
|
|
|
func GetCondIn(cond Cond) (i condIn) {
|
|
switch cond.(type) {
|
|
case condIn:
|
|
return cond.(condIn)
|
|
}
|
|
return
|
|
}
|
|
|
|
func GetCondNotIn(cond Cond) (i condNotIn) {
|
|
switch cond.(type) {
|
|
case condNotIn:
|
|
return cond.(condNotIn)
|
|
}
|
|
return
|
|
}
|
|
|
|
func GetCondIF(cond Cond) (i condIf) {
|
|
switch cond.(type) {
|
|
case condIf:
|
|
return cond.(condIf)
|
|
}
|
|
return
|
|
}
|
|
|
|
func GetCondByBuilder(b Builder) (cond Cond) {
|
|
|
|
return b.cond
|
|
}
|
|
|
|
type Field string
|