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/model"
|
|
|
|
|
)
|
|
|
|
|
|
2024-01-21 22:52:20 +08:00
|
|
|
type machineCronJobRepoImpl struct {
|
2023-10-26 17:15:49 +08:00
|
|
|
base.RepoImpl[*entity.MachineCronJob]
|
|
|
|
|
}
|
2023-07-20 22:41:13 +08:00
|
|
|
|
|
|
|
|
func newMachineCronJobRepo() repository.MachineCronJob {
|
2024-01-21 22:52:20 +08:00
|
|
|
return &machineCronJobRepoImpl{base.RepoImpl[*entity.MachineCronJob]{M: new(entity.MachineCronJob)}}
|
2023-07-20 22:41:13 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// 分页获取机器信息列表
|
2024-01-21 22:52:20 +08:00
|
|
|
func (m *machineCronJobRepoImpl) GetPageList(condition *entity.MachineCronJob, pageParam *model.PageParam, toEntity any, orderBy ...string) (*model.PageResult[any], error) {
|
2024-04-28 23:45:57 +08:00
|
|
|
qd := model.NewCond().Like("name", condition.Name).Eq("status", condition.Status).OrderBy(orderBy...)
|
2024-05-05 14:53:30 +08:00
|
|
|
return m.PageByCondToAny(qd, pageParam, toEntity)
|
2023-07-20 22:41:13 +08:00
|
|
|
}
|