mirror of
https://github.com/gohouse/gorose.git
synced 2025-12-24 12:47:55 +08:00
26 lines
492 B
Go
26 lines
492 B
Go
package gorose
|
|
|
|
type TypeGroupItem struct {
|
|
Column string
|
|
IsRaw bool
|
|
}
|
|
type GroupClause struct {
|
|
Groups []TypeGroupItem
|
|
}
|
|
// GroupBy 添加 GROUP BY 子句
|
|
func (db *GroupClause) GroupBy(columns ...string) {
|
|
for _, col := range columns {
|
|
db.Groups = append(db.Groups, TypeGroupItem{
|
|
Column: col,
|
|
})
|
|
}
|
|
}
|
|
func (db *GroupClause) GroupByRaw(columns ...string) {
|
|
for _, col := range columns {
|
|
db.Groups = append(db.Groups, TypeGroupItem{
|
|
Column: col,
|
|
IsRaw: true,
|
|
})
|
|
}
|
|
}
|