2023-07-20 22:41:13 +08:00
|
|
|
package persistence
|
|
|
|
|
|
|
|
|
|
import (
|
|
|
|
|
"mayfly-go/internal/machine/domain/entity"
|
|
|
|
|
"mayfly-go/internal/machine/domain/repository"
|
2023-10-26 17:15:49 +08:00
|
|
|
"mayfly-go/pkg/base"
|
2023-07-20 22:41:13 +08:00
|
|
|
"mayfly-go/pkg/gormx"
|
|
|
|
|
"mayfly-go/pkg/model"
|
|
|
|
|
)
|
|
|
|
|
|
2023-10-26 17:15:49 +08:00
|
|
|
type machineCropJobRepoImpl struct {
|
|
|
|
|
base.RepoImpl[*entity.MachineCronJob]
|
|
|
|
|
}
|
2023-07-20 22:41:13 +08:00
|
|
|
|
|
|
|
|
func newMachineCronJobRepo() repository.MachineCronJob {
|
2023-10-26 17:15:49 +08:00
|
|
|
return &machineCropJobRepoImpl{base.RepoImpl[*entity.MachineCronJob]{M: new(entity.MachineCronJob)}}
|
2023-07-20 22:41:13 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// 分页获取机器信息列表
|
2023-10-26 17:15:49 +08:00
|
|
|
func (m *machineCropJobRepoImpl) GetPageList(condition *entity.MachineCronJob, pageParam *model.PageParam, toEntity any, orderBy ...string) (*model.PageResult[any], error) {
|
2023-07-20 22:41:13 +08:00
|
|
|
qd := gormx.NewQuery(condition).Like("name", condition.Name).Eq("status", condition.Status).WithOrderBy(orderBy...)
|
|
|
|
|
return gormx.PageQuery(qd, pageParam, toEntity)
|
|
|
|
|
}
|