2 Star 1 Fork 1

mosache / YFrame

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
克隆/下载
aggregate.go 728 Bytes
一键复制 编辑 原始数据 按行查看 历史
ヤ沒脩袮兲︶ 提交于 2023-06-21 18:32 . temp
package orm
// Aggregate 聚合函数
type Aggregate struct {
Fn string
Arg string
Alias string
}
func (a Aggregate) Select() {}
func (a Aggregate) expr() {}
func Avg(col string) Aggregate {
return Aggregate{
Fn: "AVG",
Arg: col,
}
}
func (a Aggregate) As(alias string) Aggregate {
return Aggregate{
Fn: a.Fn,
Arg: a.Arg,
Alias: alias,
}
}
func (a Aggregate) Eq(arg any) Predicate {
return Predicate{
left: a,
op: opEq,
right: valueOf(arg),
}
}
func (a Aggregate) GT(arg any) Predicate {
return Predicate{
left: a,
op: opGt,
right: valueOf(arg),
}
}
func (a Aggregate) LT(arg any) Predicate {
return Predicate{
left: a,
op: opLt,
right: valueOf(arg),
}
}
Go
1
https://gitee.com/mosache/YFrame.git
git@gitee.com:mosache/YFrame.git
mosache
YFrame
YFrame
v0.1.76

搜索帮助