2024-02-29 22:12:50 +08:00
|
|
|
package persistence
|
|
|
|
|
|
|
|
|
|
import (
|
|
|
|
|
"mayfly-go/internal/flow/domain/entity"
|
|
|
|
|
"mayfly-go/internal/flow/domain/repository"
|
|
|
|
|
"mayfly-go/pkg/base"
|
2025-04-15 21:42:31 +08:00
|
|
|
"mayfly-go/pkg/gormx"
|
2024-02-29 22:12:50 +08:00
|
|
|
"mayfly-go/pkg/model"
|
|
|
|
|
)
|
|
|
|
|
|
|
|
|
|
type procinstImpl struct {
|
|
|
|
|
base.RepoImpl[*entity.Procinst]
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
func newProcinstRepo() repository.Procinst {
|
2024-12-08 13:04:23 +08:00
|
|
|
return &procinstImpl{}
|
2024-02-29 22:12:50 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
func (p *procinstImpl) GetPageList(condition *entity.ProcinstQuery, pageParam *model.PageParam, toEntity any, orderBy ...string) (*model.PageResult[any], error) {
|
2024-04-28 23:45:57 +08:00
|
|
|
qd := model.NewModelCond(condition)
|
2024-05-05 14:53:30 +08:00
|
|
|
return p.PageByCondToAny(qd, pageParam, toEntity)
|
2024-02-29 22:12:50 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//-----------procinst task--------------
|
|
|
|
|
|
|
|
|
|
type procinstTaskImpl struct {
|
|
|
|
|
base.RepoImpl[*entity.ProcinstTask]
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
func newProcinstTaskRepo() repository.ProcinstTask {
|
2024-12-08 13:04:23 +08:00
|
|
|
return &procinstTaskImpl{}
|
2024-02-29 22:12:50 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
func (p *procinstTaskImpl) GetPageList(condition *entity.ProcinstTaskQuery, pageParam *model.PageParam, toEntity any, orderBy ...string) (*model.PageResult[any], error) {
|
2025-04-15 21:42:31 +08:00
|
|
|
qd := gormx.NewQueryWithTableName("t_flow_procinst_task t").
|
|
|
|
|
Joins("JOIN t_flow_procinst tp ON t.procinst_id = tp.id ").
|
|
|
|
|
WithCond(model.NewCond().Columns("t.*, tp.biz_key").
|
|
|
|
|
Eq("tp.biz_key", condition.BizKey).
|
|
|
|
|
Eq0("tp.is_deleted", model.ModelUndeleted).
|
|
|
|
|
Eq("tp.biz_type", condition.BizType).
|
|
|
|
|
Eq0("t.is_deleted", model.ModelUndeleted).
|
|
|
|
|
Eq("t.status", condition.Status).
|
|
|
|
|
OrderByDesc("t.id"))
|
|
|
|
|
return gormx.PageQuery(qd, pageParam, toEntity)
|
2024-02-29 22:12:50 +08:00
|
|
|
}
|