查询条件支持覆盖默认表名
This commit is contained in:
12
option.go
12
option.go
@ -30,6 +30,7 @@ type ORCondition struct {
|
||||
//
|
||||
// Date : 8:05 下午 2021/8/8
|
||||
type Option struct {
|
||||
Table string `json:"table"` // 查询的数据表
|
||||
Limit int `json:"limit"` // 限制数量
|
||||
Offset int `json:"offset"` // 偏移量
|
||||
In map[string]interface{} `json:"in"` // in语句
|
||||
@ -44,6 +45,17 @@ type Option struct {
|
||||
OR []*ORCondition `json:"or"` // or 语句, or 和其他属性 and 关系, 内部 OR 关系
|
||||
}
|
||||
|
||||
// WithTable 设置查询的表名
|
||||
//
|
||||
// Author : go_developer@163.com<白茶清欢>
|
||||
//
|
||||
// Date : 20:56 2023/3/22
|
||||
func WithTable(tableName string) SetOption {
|
||||
return func(o *Option) {
|
||||
o.Table = tableName
|
||||
}
|
||||
}
|
||||
|
||||
// WithWhere 设置where条件
|
||||
//
|
||||
// Author : go_developer@163.com<白茶清欢>
|
||||
|
Reference in New Issue
Block a user