2021-11-17 21:29:46 +08:00
|
|
|
// Copyright GoFrame Author(https://goframe.org). All Rights Reserved.
|
|
|
|
//
|
|
|
|
// This Source Code Form is subject to the terms of the MIT License.
|
|
|
|
// If a copy of the MIT was not distributed with this file,
|
|
|
|
// You can obtain one at https://github.com/gogf/gf.
|
|
|
|
|
|
|
|
package gdb
|
|
|
|
|
|
|
|
// WherePrefix performs as Where, but it adds prefix to each field in where statement.
|
2022-05-07 15:11:31 +08:00
|
|
|
// See WhereBuilder.WherePrefix.
|
2021-11-17 21:29:46 +08:00
|
|
|
func (m *Model) WherePrefix(prefix string, where interface{}, args ...interface{}) *Model {
|
2022-04-30 15:53:56 +08:00
|
|
|
return m.callWhereBuilder(m.whereBuilder.WherePrefix(prefix, where, args...))
|
2021-11-17 21:29:46 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
// WherePrefixLT builds `prefix.column < value` statement.
|
2022-05-07 15:11:31 +08:00
|
|
|
// See WhereBuilder.WherePrefixLT.
|
2021-11-17 21:29:46 +08:00
|
|
|
func (m *Model) WherePrefixLT(prefix string, column string, value interface{}) *Model {
|
2022-04-30 15:53:56 +08:00
|
|
|
return m.callWhereBuilder(m.whereBuilder.WherePrefixLT(prefix, column, value))
|
2021-11-17 21:29:46 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
// WherePrefixLTE builds `prefix.column <= value` statement.
|
2022-05-07 15:11:31 +08:00
|
|
|
// See WhereBuilder.WherePrefixLTE.
|
2021-11-17 21:29:46 +08:00
|
|
|
func (m *Model) WherePrefixLTE(prefix string, column string, value interface{}) *Model {
|
2022-04-30 15:53:56 +08:00
|
|
|
return m.callWhereBuilder(m.whereBuilder.WherePrefixLTE(prefix, column, value))
|
2021-11-17 21:29:46 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
// WherePrefixGT builds `prefix.column > value` statement.
|
2022-05-07 15:11:31 +08:00
|
|
|
// See WhereBuilder.WherePrefixGT.
|
2021-11-17 21:29:46 +08:00
|
|
|
func (m *Model) WherePrefixGT(prefix string, column string, value interface{}) *Model {
|
2022-04-30 15:53:56 +08:00
|
|
|
return m.callWhereBuilder(m.whereBuilder.WherePrefixGT(prefix, column, value))
|
2021-11-17 21:29:46 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
// WherePrefixGTE builds `prefix.column >= value` statement.
|
2022-05-07 15:11:31 +08:00
|
|
|
// See WhereBuilder.WherePrefixGTE.
|
2021-11-17 21:29:46 +08:00
|
|
|
func (m *Model) WherePrefixGTE(prefix string, column string, value interface{}) *Model {
|
2022-04-30 15:53:56 +08:00
|
|
|
return m.callWhereBuilder(m.whereBuilder.WherePrefixGTE(prefix, column, value))
|
2021-11-17 21:29:46 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
// WherePrefixBetween builds `prefix.column BETWEEN min AND max` statement.
|
2022-05-07 15:11:31 +08:00
|
|
|
// See WhereBuilder.WherePrefixBetween.
|
2021-11-17 21:29:46 +08:00
|
|
|
func (m *Model) WherePrefixBetween(prefix string, column string, min, max interface{}) *Model {
|
2022-04-30 15:53:56 +08:00
|
|
|
return m.callWhereBuilder(m.whereBuilder.WherePrefixBetween(prefix, column, min, max))
|
2021-11-17 21:29:46 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
// WherePrefixLike builds `prefix.column LIKE like` statement.
|
2022-05-07 15:11:31 +08:00
|
|
|
// See WhereBuilder.WherePrefixLike.
|
2021-11-17 21:29:46 +08:00
|
|
|
func (m *Model) WherePrefixLike(prefix string, column string, like interface{}) *Model {
|
2022-04-30 15:53:56 +08:00
|
|
|
return m.callWhereBuilder(m.whereBuilder.WherePrefixLike(prefix, column, like))
|
2021-11-17 21:29:46 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
// WherePrefixIn builds `prefix.column IN (in)` statement.
|
2022-05-07 15:11:31 +08:00
|
|
|
// See WhereBuilder.WherePrefixIn.
|
2021-11-17 21:29:46 +08:00
|
|
|
func (m *Model) WherePrefixIn(prefix string, column string, in interface{}) *Model {
|
2022-04-30 15:53:56 +08:00
|
|
|
return m.callWhereBuilder(m.whereBuilder.WherePrefixIn(prefix, column, in))
|
2021-11-17 21:29:46 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
// WherePrefixNull builds `prefix.columns[0] IS NULL AND prefix.columns[1] IS NULL ...` statement.
|
2022-05-07 15:11:31 +08:00
|
|
|
// See WhereBuilder.WherePrefixNull.
|
2021-11-17 21:29:46 +08:00
|
|
|
func (m *Model) WherePrefixNull(prefix string, columns ...string) *Model {
|
2022-04-30 15:53:56 +08:00
|
|
|
return m.callWhereBuilder(m.whereBuilder.WherePrefixNull(prefix, columns...))
|
2021-11-17 21:29:46 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
// WherePrefixNotBetween builds `prefix.column NOT BETWEEN min AND max` statement.
|
2022-05-07 15:11:31 +08:00
|
|
|
// See WhereBuilder.WherePrefixNotBetween.
|
2021-11-17 21:29:46 +08:00
|
|
|
func (m *Model) WherePrefixNotBetween(prefix string, column string, min, max interface{}) *Model {
|
2022-04-30 15:53:56 +08:00
|
|
|
return m.callWhereBuilder(m.whereBuilder.WherePrefixNotBetween(prefix, column, min, max))
|
2021-11-17 21:29:46 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
// WherePrefixNotLike builds `prefix.column NOT LIKE like` statement.
|
2022-05-07 15:11:31 +08:00
|
|
|
// See WhereBuilder.WherePrefixNotLike.
|
2021-11-17 21:29:46 +08:00
|
|
|
func (m *Model) WherePrefixNotLike(prefix string, column string, like interface{}) *Model {
|
2022-04-30 15:53:56 +08:00
|
|
|
return m.callWhereBuilder(m.whereBuilder.WherePrefixNotLike(prefix, column, like))
|
2021-11-17 21:29:46 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
// WherePrefixNot builds `prefix.column != value` statement.
|
2022-05-07 15:11:31 +08:00
|
|
|
// See WhereBuilder.WherePrefixNot.
|
2021-11-17 21:29:46 +08:00
|
|
|
func (m *Model) WherePrefixNot(prefix string, column string, value interface{}) *Model {
|
2022-04-30 15:53:56 +08:00
|
|
|
return m.callWhereBuilder(m.whereBuilder.WherePrefixNot(prefix, column, value))
|
2021-11-17 21:29:46 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
// WherePrefixNotIn builds `prefix.column NOT IN (in)` statement.
|
2022-05-07 15:11:31 +08:00
|
|
|
// See WhereBuilder.WherePrefixNotIn.
|
2021-11-17 21:29:46 +08:00
|
|
|
func (m *Model) WherePrefixNotIn(prefix string, column string, in interface{}) *Model {
|
2023-10-11 21:34:17 +08:00
|
|
|
return m.callWhereBuilder(m.whereBuilder.WherePrefixNotIn(prefix, column, in))
|
2021-11-17 21:29:46 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
// WherePrefixNotNull builds `prefix.columns[0] IS NOT NULL AND prefix.columns[1] IS NOT NULL ...` statement.
|
2022-05-07 15:11:31 +08:00
|
|
|
// See WhereBuilder.WherePrefixNotNull.
|
2021-11-17 21:29:46 +08:00
|
|
|
func (m *Model) WherePrefixNotNull(prefix string, columns ...string) *Model {
|
2022-04-30 15:53:56 +08:00
|
|
|
return m.callWhereBuilder(m.whereBuilder.WherePrefixNotNull(prefix, columns...))
|
2021-11-17 21:29:46 +08:00
|
|
|
}
|