mirror of
https://gitee.com/dromara/mayfly-go
synced 2025-11-27 03:20:25 +08:00
26 lines
735 B
Go
26 lines
735 B
Go
package persistence
|
|
|
|
import (
|
|
"mayfly-go/internal/sys/domain/entity"
|
|
"mayfly-go/internal/sys/domain/repository"
|
|
"mayfly-go/pkg/base"
|
|
"mayfly-go/pkg/gormx"
|
|
"mayfly-go/pkg/model"
|
|
)
|
|
|
|
type AccountRepoImpl struct {
|
|
base.RepoImpl[*entity.Account]
|
|
}
|
|
|
|
func newAccountRepo() repository.Account {
|
|
return &AccountRepoImpl{base.RepoImpl[*entity.Account]{M: new(entity.Account)}}
|
|
}
|
|
|
|
func (m *AccountRepoImpl) GetPageList(condition *entity.AccountQuery, pageParam *model.PageParam, toEntity any, orderBy ...string) (*model.PageResult[any], error) {
|
|
qd := gormx.NewQuery(new(entity.Account)).
|
|
Like("name", condition.Name).
|
|
Like("username", condition.Username).
|
|
In("id", condition.Ids)
|
|
return gormx.PageQuery(qd, pageParam, toEntity)
|
|
}
|