sys_user_department.go
1.6 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
package domain
import (
"context"
"gitlab.fjmaimaimai.com/allied-creation/su-micro/pkg/transaction"
)
type SysUserDepartment struct {
Id int64 `json:",omitempty"` // 唯一标识
CompanyId int64 `json:",omitempty"` // 公司ID
UserId int64 `json:",omitempty"` // 用户ID
EmployeeId int64 `json:",omitempty"` // 职工ID
DepartmentId int64 `json:",omitempty"` // 部门ID
CreatedAt int64 `json:",omitempty"`
}
type SysUserDepartmentRepository interface {
/*
Delete(ctx context.Context, conn transaction.Conn, dm *SysUserDepartment) (*SysUserDepartment, error)
FindOne(ctx context.Context, conn transaction.Conn, id int64) (*SysUserDepartment, error)
Update(ctx context.Context, conn transaction.Conn, dm *SysUserDepartment) (*SysUserDepartment, error)
UpdateWithVersion(ctx context.Context, conn transaction.Conn, dm *SysUserDepartment) (*SysUserDepartment, error)
*/
Insert(ctx context.Context, conn transaction.Conn, dm *SysUserDepartment) (*SysUserDepartment, error)
Find(ctx context.Context, conn transaction.Conn, queryOptions map[string]interface{}) (int64, []*SysUserDepartment, error)
FindByUser(ctx context.Context, conn transaction.Conn, companyId int64, userId []int64) (int64, []*SysUserDepartment, error)
// ResetByUser 重置用户部门
ResetByUser(ctx context.Context, conn transaction.Conn, companyId, userId, employeeId int64, departments []int64) error
// DeleteByDepartment 删除部门用户
DeleteByDepartment(ctx context.Context, conn transaction.Conn, companyId int64, departments []int64) error
}
func (m *SysUserDepartment) Identify() interface{} {
if m.Id == 0 {
return nil
}
return m.Id
}