github.com/wangyougui/gf/v2@v2.6.5/database/gdb/gdb_model_whereor_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 // WhereOrPrefix performs as WhereOr, but it adds prefix to each field in where statement. 10 // See WhereBuilder.WhereOrPrefix. 11 func (m *Model) WhereOrPrefix(prefix string, where interface{}, args ...interface{}) *Model { 12 return m.callWhereBuilder(m.whereBuilder.WhereOrPrefix(prefix, where, args...)) 13 } 14 15 // WhereOrPrefixLT builds `prefix.column < value` statement in `OR` conditions. 16 // See WhereBuilder.WhereOrPrefixLT. 17 func (m *Model) WhereOrPrefixLT(prefix string, column string, value interface{}) *Model { 18 return m.callWhereBuilder(m.whereBuilder.WhereOrPrefixLT(prefix, column, value)) 19 } 20 21 // WhereOrPrefixLTE builds `prefix.column <= value` statement in `OR` conditions. 22 // See WhereBuilder.WhereOrPrefixLTE. 23 func (m *Model) WhereOrPrefixLTE(prefix string, column string, value interface{}) *Model { 24 return m.callWhereBuilder(m.whereBuilder.WhereOrPrefixLTE(prefix, column, value)) 25 } 26 27 // WhereOrPrefixGT builds `prefix.column > value` statement in `OR` conditions. 28 // See WhereBuilder.WhereOrPrefixGT. 29 func (m *Model) WhereOrPrefixGT(prefix string, column string, value interface{}) *Model { 30 return m.callWhereBuilder(m.whereBuilder.WhereOrPrefixGT(prefix, column, value)) 31 } 32 33 // WhereOrPrefixGTE builds `prefix.column >= value` statement in `OR` conditions. 34 // See WhereBuilder.WhereOrPrefixGTE. 35 func (m *Model) WhereOrPrefixGTE(prefix string, column string, value interface{}) *Model { 36 return m.callWhereBuilder(m.whereBuilder.WhereOrPrefixGTE(prefix, column, value)) 37 } 38 39 // WhereOrPrefixBetween builds `prefix.column BETWEEN min AND max` statement in `OR` conditions. 40 // See WhereBuilder.WhereOrPrefixBetween. 41 func (m *Model) WhereOrPrefixBetween(prefix string, column string, min, max interface{}) *Model { 42 return m.callWhereBuilder(m.whereBuilder.WhereOrPrefixBetween(prefix, column, min, max)) 43 } 44 45 // WhereOrPrefixLike builds `prefix.column LIKE like` statement in `OR` conditions. 46 // See WhereBuilder.WhereOrPrefixLike. 47 func (m *Model) WhereOrPrefixLike(prefix string, column string, like interface{}) *Model { 48 return m.callWhereBuilder(m.whereBuilder.WhereOrPrefixLike(prefix, column, like)) 49 } 50 51 // WhereOrPrefixIn builds `prefix.column IN (in)` statement in `OR` conditions. 52 // See WhereBuilder.WhereOrPrefixIn. 53 func (m *Model) WhereOrPrefixIn(prefix string, column string, in interface{}) *Model { 54 return m.callWhereBuilder(m.whereBuilder.WhereOrPrefixIn(prefix, column, in)) 55 } 56 57 // WhereOrPrefixNull builds `prefix.columns[0] IS NULL OR prefix.columns[1] IS NULL ...` statement in `OR` conditions. 58 // See WhereBuilder.WhereOrPrefixNull. 59 func (m *Model) WhereOrPrefixNull(prefix string, columns ...string) *Model { 60 return m.callWhereBuilder(m.whereBuilder.WhereOrPrefixNull(prefix, columns...)) 61 } 62 63 // WhereOrPrefixNotBetween builds `prefix.column NOT BETWEEN min AND max` statement in `OR` conditions. 64 // See WhereBuilder.WhereOrPrefixNotBetween. 65 func (m *Model) WhereOrPrefixNotBetween(prefix string, column string, min, max interface{}) *Model { 66 return m.callWhereBuilder(m.whereBuilder.WhereOrPrefixNotBetween(prefix, column, min, max)) 67 } 68 69 // WhereOrPrefixNotLike builds `prefix.column NOT LIKE like` statement in `OR` conditions. 70 // See WhereBuilder.WhereOrPrefixNotLike. 71 func (m *Model) WhereOrPrefixNotLike(prefix string, column string, like interface{}) *Model { 72 return m.callWhereBuilder(m.whereBuilder.WhereOrPrefixNotLike(prefix, column, like)) 73 } 74 75 // WhereOrPrefixNotIn builds `prefix.column NOT IN (in)` statement. 76 // See WhereBuilder.WhereOrPrefixNotIn. 77 func (m *Model) WhereOrPrefixNotIn(prefix string, column string, in interface{}) *Model { 78 return m.callWhereBuilder(m.whereBuilder.WhereOrPrefixNotIn(prefix, column, in)) 79 } 80 81 // WhereOrPrefixNotNull builds `prefix.columns[0] IS NOT NULL OR prefix.columns[1] IS NOT NULL ...` statement in `OR` conditions. 82 // See WhereBuilder.WhereOrPrefixNotNull. 83 func (m *Model) WhereOrPrefixNotNull(prefix string, columns ...string) *Model { 84 return m.callWhereBuilder(m.whereBuilder.WhereOrPrefixNotNull(prefix, columns...)) 85 } 86 87 // WhereOrPrefixNot builds `prefix.column != value` statement in `OR` conditions. 88 // See WhereBuilder.WhereOrPrefixNot. 89 func (m *Model) WhereOrPrefixNot(prefix string, column string, value interface{}) *Model { 90 return m.callWhereBuilder(m.whereBuilder.WhereOrPrefixNot(prefix, column, value)) 91 }