mirror of
https://gitee.com/dromara/mayfly-go
synced 2025-11-09 02:40:26 +08:00
30 lines
851 B
Go
30 lines
851 B
Go
package persistence
|
|
|
|
import (
|
|
"mayfly-go/internal/db/domain/entity"
|
|
"mayfly-go/internal/db/domain/repository"
|
|
"mayfly-go/pkg/biz"
|
|
"mayfly-go/pkg/gormx"
|
|
"mayfly-go/pkg/model"
|
|
)
|
|
|
|
type dbSqlExecRepoImpl struct{}
|
|
|
|
func newDbSqlExecRepo() repository.DbSqlExec {
|
|
return new(dbSqlExecRepoImpl)
|
|
}
|
|
|
|
func (d *dbSqlExecRepoImpl) Insert(dse *entity.DbSqlExec) {
|
|
gormx.Insert(dse)
|
|
}
|
|
|
|
func (d *dbSqlExecRepoImpl) DeleteBy(condition *entity.DbSqlExec) {
|
|
biz.ErrIsNil(gormx.DeleteByCondition(condition), "删除sql执行记录失败")
|
|
}
|
|
|
|
// 分页获取
|
|
func (d *dbSqlExecRepoImpl) GetPageList(condition *entity.DbSqlExecQuery, pageParam *model.PageParam, toEntity any, orderBy ...string) *model.PageResult[any] {
|
|
qd := gormx.NewQuery(new(entity.DbSqlExec)).WithCondModel(condition).WithOrderBy(orderBy...)
|
|
return gormx.PageQuery(qd, pageParam, toEntity)
|
|
}
|