mirror of
https://github.com/gogf/gf.git
synced 2025-04-05 03:05:05 +08:00
add WhereOrNot/WhereOrPrefixNot functions for gdb.Model (#2661)
This commit is contained in:
parent
f0d22fe570
commit
dc0467e934
@ -51,22 +51,27 @@ func (b *WhereBuilder) WhereOrf(format string, args ...interface{}) *WhereBuilde
|
||||
return b.doWhereOrfType(``, format, args...)
|
||||
}
|
||||
|
||||
// WhereOrLT builds `column < value` statement in `OR` conditions..
|
||||
// WhereOrNot builds `column != value` statement in `OR` conditions.
|
||||
func (b *WhereBuilder) WhereOrNot(column string, value interface{}) *WhereBuilder {
|
||||
return b.WhereOrf(`%s != ?`, column, value)
|
||||
}
|
||||
|
||||
// WhereOrLT builds `column < value` statement in `OR` conditions.
|
||||
func (b *WhereBuilder) WhereOrLT(column string, value interface{}) *WhereBuilder {
|
||||
return b.WhereOrf(`%s < ?`, column, value)
|
||||
}
|
||||
|
||||
// WhereOrLTE builds `column <= value` statement in `OR` conditions..
|
||||
// WhereOrLTE builds `column <= value` statement in `OR` conditions.
|
||||
func (b *WhereBuilder) WhereOrLTE(column string, value interface{}) *WhereBuilder {
|
||||
return b.WhereOrf(`%s <= ?`, column, value)
|
||||
}
|
||||
|
||||
// WhereOrGT builds `column > value` statement in `OR` conditions..
|
||||
// WhereOrGT builds `column > value` statement in `OR` conditions.
|
||||
func (b *WhereBuilder) WhereOrGT(column string, value interface{}) *WhereBuilder {
|
||||
return b.WhereOrf(`%s > ?`, column, value)
|
||||
}
|
||||
|
||||
// WhereOrGTE builds `column >= value` statement in `OR` conditions..
|
||||
// WhereOrGTE builds `column >= value` statement in `OR` conditions.
|
||||
func (b *WhereBuilder) WhereOrGTE(column string, value interface{}) *WhereBuilder {
|
||||
return b.WhereOrf(`%s >= ?`, column, value)
|
||||
}
|
||||
@ -76,7 +81,7 @@ func (b *WhereBuilder) WhereOrBetween(column string, min, max interface{}) *Wher
|
||||
return b.WhereOrf(`%s BETWEEN ? AND ?`, b.model.QuoteWord(column), min, max)
|
||||
}
|
||||
|
||||
// WhereOrLike builds `column LIKE like` statement in `OR` conditions.
|
||||
// WhereOrLike builds `column LIKE 'like'` statement in `OR` conditions.
|
||||
func (b *WhereBuilder) WhereOrLike(column string, like interface{}) *WhereBuilder {
|
||||
return b.WhereOrf(`%s LIKE ?`, b.model.QuoteWord(column), like)
|
||||
}
|
||||
|
@ -24,22 +24,27 @@ func (b *WhereBuilder) WhereOrPrefix(prefix string, where interface{}, args ...i
|
||||
return builder
|
||||
}
|
||||
|
||||
// WhereOrPrefixLT builds `prefix.column < value` statement in `OR` conditions..
|
||||
// WhereOrPrefixNot builds `prefix.column != value` statement in `OR` conditions.
|
||||
func (b *WhereBuilder) WhereOrPrefixNot(prefix string, column string, value interface{}) *WhereBuilder {
|
||||
return b.WhereOrf(`%s.%s != ?`, b.model.QuoteWord(prefix), b.model.QuoteWord(column), value)
|
||||
}
|
||||
|
||||
// WhereOrPrefixLT builds `prefix.column < value` statement in `OR` conditions.
|
||||
func (b *WhereBuilder) WhereOrPrefixLT(prefix string, column string, value interface{}) *WhereBuilder {
|
||||
return b.WhereOrf(`%s.%s < ?`, b.model.QuoteWord(prefix), b.model.QuoteWord(column), value)
|
||||
}
|
||||
|
||||
// WhereOrPrefixLTE builds `prefix.column <= value` statement in `OR` conditions..
|
||||
// WhereOrPrefixLTE builds `prefix.column <= value` statement in `OR` conditions.
|
||||
func (b *WhereBuilder) WhereOrPrefixLTE(prefix string, column string, value interface{}) *WhereBuilder {
|
||||
return b.WhereOrf(`%s.%s <= ?`, b.model.QuoteWord(prefix), b.model.QuoteWord(column), value)
|
||||
}
|
||||
|
||||
// WhereOrPrefixGT builds `prefix.column > value` statement in `OR` conditions..
|
||||
// WhereOrPrefixGT builds `prefix.column > value` statement in `OR` conditions.
|
||||
func (b *WhereBuilder) WhereOrPrefixGT(prefix string, column string, value interface{}) *WhereBuilder {
|
||||
return b.WhereOrf(`%s.%s > ?`, b.model.QuoteWord(prefix), b.model.QuoteWord(column), value)
|
||||
}
|
||||
|
||||
// WhereOrPrefixGTE builds `prefix.column >= value` statement in `OR` conditions..
|
||||
// WhereOrPrefixGTE builds `prefix.column >= value` statement in `OR` conditions.
|
||||
func (b *WhereBuilder) WhereOrPrefixGTE(prefix string, column string, value interface{}) *WhereBuilder {
|
||||
return b.WhereOrf(`%s.%s >= ?`, b.model.QuoteWord(prefix), b.model.QuoteWord(column), value)
|
||||
}
|
||||
@ -49,7 +54,7 @@ func (b *WhereBuilder) WhereOrPrefixBetween(prefix string, column string, min, m
|
||||
return b.WhereOrf(`%s.%s BETWEEN ? AND ?`, b.model.QuoteWord(prefix), b.model.QuoteWord(column), min, max)
|
||||
}
|
||||
|
||||
// WhereOrPrefixLike builds `prefix.column LIKE like` statement in `OR` conditions.
|
||||
// WhereOrPrefixLike builds `prefix.column LIKE 'like'` statement in `OR` conditions.
|
||||
func (b *WhereBuilder) WhereOrPrefixLike(prefix string, column string, like interface{}) *WhereBuilder {
|
||||
return b.WhereOrf(`%s.%s LIKE ?`, b.model.QuoteWord(prefix), b.model.QuoteWord(column), like)
|
||||
}
|
||||
@ -73,7 +78,7 @@ func (b *WhereBuilder) WhereOrPrefixNotBetween(prefix string, column string, min
|
||||
return b.WhereOrf(`%s.%s NOT BETWEEN ? AND ?`, b.model.QuoteWord(prefix), b.model.QuoteWord(column), min, max)
|
||||
}
|
||||
|
||||
// WhereOrPrefixNotLike builds `prefix.column NOT LIKE like` statement in `OR` conditions.
|
||||
// WhereOrPrefixNotLike builds `prefix.column NOT LIKE 'like'` statement in `OR` conditions.
|
||||
func (b *WhereBuilder) WhereOrPrefixNotLike(prefix string, column string, like interface{}) *WhereBuilder {
|
||||
return b.WhereOrf(`%s.%s NOT LIKE ?`, b.model.QuoteWord(prefix), b.model.QuoteWord(column), like)
|
||||
}
|
||||
|
@ -18,25 +18,25 @@ func (m *Model) WhereOrf(format string, args ...interface{}) *Model {
|
||||
return m.callWhereBuilder(m.whereBuilder.WhereOrf(format, args...))
|
||||
}
|
||||
|
||||
// WhereOrLT builds `column < value` statement in `OR` conditions..
|
||||
// WhereOrLT builds `column < value` statement in `OR` conditions.
|
||||
// See WhereBuilder.WhereOrLT.
|
||||
func (m *Model) WhereOrLT(column string, value interface{}) *Model {
|
||||
return m.callWhereBuilder(m.whereBuilder.WhereOrLT(column, value))
|
||||
}
|
||||
|
||||
// WhereOrLTE builds `column <= value` statement in `OR` conditions..
|
||||
// WhereOrLTE builds `column <= value` statement in `OR` conditions.
|
||||
// See WhereBuilder.WhereOrLTE.
|
||||
func (m *Model) WhereOrLTE(column string, value interface{}) *Model {
|
||||
return m.callWhereBuilder(m.whereBuilder.WhereOrLTE(column, value))
|
||||
}
|
||||
|
||||
// WhereOrGT builds `column > value` statement in `OR` conditions..
|
||||
// WhereOrGT builds `column > value` statement in `OR` conditions.
|
||||
// See WhereBuilder.WhereOrGT.
|
||||
func (m *Model) WhereOrGT(column string, value interface{}) *Model {
|
||||
return m.callWhereBuilder(m.whereBuilder.WhereOrGT(column, value))
|
||||
}
|
||||
|
||||
// WhereOrGTE builds `column >= value` statement in `OR` conditions..
|
||||
// WhereOrGTE builds `column >= value` statement in `OR` conditions.
|
||||
// See WhereBuilder.WhereOrGTE.
|
||||
func (m *Model) WhereOrGTE(column string, value interface{}) *Model {
|
||||
return m.callWhereBuilder(m.whereBuilder.WhereOrGTE(column, value))
|
||||
@ -72,12 +72,18 @@ func (m *Model) WhereOrNotBetween(column string, min, max interface{}) *Model {
|
||||
return m.callWhereBuilder(m.whereBuilder.WhereOrNotBetween(column, min, max))
|
||||
}
|
||||
|
||||
// WhereOrNotLike builds `column NOT LIKE like` statement in `OR` conditions.
|
||||
// WhereOrNotLike builds `column NOT LIKE 'like'` statement in `OR` conditions.
|
||||
// See WhereBuilder.WhereOrNotLike.
|
||||
func (m *Model) WhereOrNotLike(column string, like interface{}) *Model {
|
||||
return m.callWhereBuilder(m.whereBuilder.WhereOrNotLike(column, like))
|
||||
}
|
||||
|
||||
// WhereOrNot builds `column != value` statement.
|
||||
// See WhereBuilder.WhereOrNot.
|
||||
func (m *Model) WhereOrNot(column string, value interface{}) *Model {
|
||||
return m.callWhereBuilder(m.whereBuilder.WhereOrNot(column, value))
|
||||
}
|
||||
|
||||
// WhereOrNotIn builds `column NOT IN (in)` statement.
|
||||
// See WhereBuilder.WhereOrNotIn.
|
||||
func (m *Model) WhereOrNotIn(column string, in interface{}) *Model {
|
||||
|
@ -12,25 +12,25 @@ func (m *Model) WhereOrPrefix(prefix string, where interface{}, args ...interfac
|
||||
return m.callWhereBuilder(m.whereBuilder.WhereOrPrefix(prefix, where, args...))
|
||||
}
|
||||
|
||||
// WhereOrPrefixLT builds `prefix.column < value` statement in `OR` conditions..
|
||||
// WhereOrPrefixLT builds `prefix.column < value` statement in `OR` conditions.
|
||||
// See WhereBuilder.WhereOrPrefixLT.
|
||||
func (m *Model) WhereOrPrefixLT(prefix string, column string, value interface{}) *Model {
|
||||
return m.callWhereBuilder(m.whereBuilder.WhereOrPrefixLT(prefix, column, value))
|
||||
}
|
||||
|
||||
// WhereOrPrefixLTE builds `prefix.column <= value` statement in `OR` conditions..
|
||||
// WhereOrPrefixLTE builds `prefix.column <= value` statement in `OR` conditions.
|
||||
// See WhereBuilder.WhereOrPrefixLTE.
|
||||
func (m *Model) WhereOrPrefixLTE(prefix string, column string, value interface{}) *Model {
|
||||
return m.callWhereBuilder(m.whereBuilder.WhereOrPrefixLTE(prefix, column, value))
|
||||
}
|
||||
|
||||
// WhereOrPrefixGT builds `prefix.column > value` statement in `OR` conditions..
|
||||
// WhereOrPrefixGT builds `prefix.column > value` statement in `OR` conditions.
|
||||
// See WhereBuilder.WhereOrPrefixGT.
|
||||
func (m *Model) WhereOrPrefixGT(prefix string, column string, value interface{}) *Model {
|
||||
return m.callWhereBuilder(m.whereBuilder.WhereOrPrefixGT(prefix, column, value))
|
||||
}
|
||||
|
||||
// WhereOrPrefixGTE builds `prefix.column >= value` statement in `OR` conditions..
|
||||
// WhereOrPrefixGTE builds `prefix.column >= value` statement in `OR` conditions.
|
||||
// See WhereBuilder.WhereOrPrefixGTE.
|
||||
func (m *Model) WhereOrPrefixGTE(prefix string, column string, value interface{}) *Model {
|
||||
return m.callWhereBuilder(m.whereBuilder.WhereOrPrefixGTE(prefix, column, value))
|
||||
@ -83,3 +83,9 @@ func (m *Model) WhereOrPrefixNotIn(prefix string, column string, in interface{})
|
||||
func (m *Model) WhereOrPrefixNotNull(prefix string, columns ...string) *Model {
|
||||
return m.callWhereBuilder(m.whereBuilder.WhereOrPrefixNotNull(prefix, columns...))
|
||||
}
|
||||
|
||||
// WhereOrPrefixNot builds `prefix.column != value` statement in `OR` conditions.
|
||||
// See WhereBuilder.WhereOrPrefixNot.
|
||||
func (m *Model) WhereOrPrefixNot(prefix string, column string, value interface{}) *Model {
|
||||
return m.callWhereBuilder(m.whereBuilder.WhereOrPrefixNot(prefix, column, value))
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user