github.com/wangyougui/gf/v2@v2.6.5/database/gdb/gdb_model_where_prefix.go (about)

     1  // Copyright GoFrame Author(https://goframe.org). All Rights Reserved.
     2  //
     3  // This Source Code Form is subject to the terms of the MIT License.
     4  // If a copy of the MIT was not distributed with this file,
     5  // You can obtain one at https://github.com/wangyougui/gf.
     6  
     7  package gdb
     8  
     9  // WherePrefix performs as Where, but it adds prefix to each field in where statement.
    10  // See WhereBuilder.WherePrefix.
    11  func (m *Model) WherePrefix(prefix string, where interface{}, args ...interface{}) *Model {
    12  	return m.callWhereBuilder(m.whereBuilder.WherePrefix(prefix, where, args...))
    13  }
    14  
    15  // WherePrefixLT builds `prefix.column < value` statement.
    16  // See WhereBuilder.WherePrefixLT.
    17  func (m *Model) WherePrefixLT(prefix string, column string, value interface{}) *Model {
    18  	return m.callWhereBuilder(m.whereBuilder.WherePrefixLT(prefix, column, value))
    19  }
    20  
    21  // WherePrefixLTE builds `prefix.column <= value` statement.
    22  // See WhereBuilder.WherePrefixLTE.
    23  func (m *Model) WherePrefixLTE(prefix string, column string, value interface{}) *Model {
    24  	return m.callWhereBuilder(m.whereBuilder.WherePrefixLTE(prefix, column, value))
    25  }
    26  
    27  // WherePrefixGT builds `prefix.column > value` statement.
    28  // See WhereBuilder.WherePrefixGT.
    29  func (m *Model) WherePrefixGT(prefix string, column string, value interface{}) *Model {
    30  	return m.callWhereBuilder(m.whereBuilder.WherePrefixGT(prefix, column, value))
    31  }
    32  
    33  // WherePrefixGTE builds `prefix.column >= value` statement.
    34  // See WhereBuilder.WherePrefixGTE.
    35  func (m *Model) WherePrefixGTE(prefix string, column string, value interface{}) *Model {
    36  	return m.callWhereBuilder(m.whereBuilder.WherePrefixGTE(prefix, column, value))
    37  }
    38  
    39  // WherePrefixBetween builds `prefix.column BETWEEN min AND max` statement.
    40  // See WhereBuilder.WherePrefixBetween.
    41  func (m *Model) WherePrefixBetween(prefix string, column string, min, max interface{}) *Model {
    42  	return m.callWhereBuilder(m.whereBuilder.WherePrefixBetween(prefix, column, min, max))
    43  }
    44  
    45  // WherePrefixLike builds `prefix.column LIKE like` statement.
    46  // See WhereBuilder.WherePrefixLike.
    47  func (m *Model) WherePrefixLike(prefix string, column string, like interface{}) *Model {
    48  	return m.callWhereBuilder(m.whereBuilder.WherePrefixLike(prefix, column, like))
    49  }
    50  
    51  // WherePrefixIn builds `prefix.column IN (in)` statement.
    52  // See WhereBuilder.WherePrefixIn.
    53  func (m *Model) WherePrefixIn(prefix string, column string, in interface{}) *Model {
    54  	return m.callWhereBuilder(m.whereBuilder.WherePrefixIn(prefix, column, in))
    55  }
    56  
    57  // WherePrefixNull builds `prefix.columns[0] IS NULL AND prefix.columns[1] IS NULL ...` statement.
    58  // See WhereBuilder.WherePrefixNull.
    59  func (m *Model) WherePrefixNull(prefix string, columns ...string) *Model {
    60  	return m.callWhereBuilder(m.whereBuilder.WherePrefixNull(prefix, columns...))
    61  }
    62  
    63  // WherePrefixNotBetween builds `prefix.column NOT BETWEEN min AND max` statement.
    64  // See WhereBuilder.WherePrefixNotBetween.
    65  func (m *Model) WherePrefixNotBetween(prefix string, column string, min, max interface{}) *Model {
    66  	return m.callWhereBuilder(m.whereBuilder.WherePrefixNotBetween(prefix, column, min, max))
    67  }
    68  
    69  // WherePrefixNotLike builds `prefix.column NOT LIKE like` statement.
    70  // See WhereBuilder.WherePrefixNotLike.
    71  func (m *Model) WherePrefixNotLike(prefix string, column string, like interface{}) *Model {
    72  	return m.callWhereBuilder(m.whereBuilder.WherePrefixNotLike(prefix, column, like))
    73  }
    74  
    75  // WherePrefixNot builds `prefix.column != value` statement.
    76  // See WhereBuilder.WherePrefixNot.
    77  func (m *Model) WherePrefixNot(prefix string, column string, value interface{}) *Model {
    78  	return m.callWhereBuilder(m.whereBuilder.WherePrefixNot(prefix, column, value))
    79  }
    80  
    81  // WherePrefixNotIn builds `prefix.column NOT IN (in)` statement.
    82  // See WhereBuilder.WherePrefixNotIn.
    83  func (m *Model) WherePrefixNotIn(prefix string, column string, in interface{}) *Model {
    84  	return m.callWhereBuilder(m.whereBuilder.WherePrefixNotIn(prefix, column, in))
    85  }
    86  
    87  // WherePrefixNotNull builds `prefix.columns[0] IS NOT NULL AND prefix.columns[1] IS NOT NULL ...` statement.
    88  // See WhereBuilder.WherePrefixNotNull.
    89  func (m *Model) WherePrefixNotNull(prefix string, columns ...string) *Model {
    90  	return m.callWhereBuilder(m.whereBuilder.WherePrefixNotNull(prefix, columns...))
    91  }