cooperation_contract_change_log.go
4.5 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
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
package domain
import "time"
// CooperationContractChangeLog 共创合约变更日志
type CooperationContractChangeLog struct {
// 共创合约变更日志
CooperationContractChangeLogId int64 `json:"cooperationContractChangeLogId,string"`
// 激励规则
IncentivesRule string `json:"incentivesRule"`
// 激励规则明细
IncentivesRuleDetail string `json:"incentivesRuleDetail"`
// 合约变更操作类型,1编辑、2暂停、3恢复
OperationType int32 `json:"operationType"`
// 共创合约编号
CooperationContractNumber string `json:"cooperationContractNumber"`
// 承接人
Undertakers string `json:"undertakers"`
// 公司
Company *Company `json:"company"`
// 操作人
Operator *User `json:"operator"`
// 更新时间
UpdatedAt time.Time `json:"updatedAt"`
// 删除时间
DeletedAt time.Time `json:"deletedAt"`
// 创建时间
CreatedAt time.Time `json:"createdAt"`
}
type CooperationContractChangeLogRepository interface {
Save(cooperationContractChangeLog *CooperationContractChangeLog) (*CooperationContractChangeLog, error)
Remove(cooperationContractChangeLog *CooperationContractChangeLog) (*CooperationContractChangeLog, error)
FindOne(queryOptions map[string]interface{}) (*CooperationContractChangeLog, error)
Find(queryOptions map[string]interface{}) (int64, []*CooperationContractChangeLog, error)
}
func (cooperationContractChangeLog *CooperationContractChangeLog) Identify() interface{} {
if cooperationContractChangeLog.CooperationContractChangeLogId == 0 {
return nil
}
return cooperationContractChangeLog.CooperationContractChangeLogId
}
func (cooperationContractChangeLog *CooperationContractChangeLog) Update(data map[string]interface{}) error {
if incentivesRule, ok := data["incentivesRule"]; ok {
cooperationContractChangeLog.IncentivesRule = incentivesRule.(string)
}
if incentivesRuleDetail, ok := data["incentivesRuleDetail"]; ok {
cooperationContractChangeLog.IncentivesRuleDetail = incentivesRuleDetail.(string)
}
if operationType, ok := data["operationType"]; ok {
cooperationContractChangeLog.OperationType = operationType.(int32)
}
if cooperationContractNumber, ok := data["cooperationContractNumber"]; ok {
cooperationContractChangeLog.CooperationContractNumber = cooperationContractNumber.(string)
}
if undertakers, ok := data["undertakers"]; ok {
cooperationContractChangeLog.Undertakers = undertakers.(string)
}
if companyId, ok := data["companyId"]; ok {
cooperationContractChangeLog.Company.CompanyId = companyId.(int64)
}
if companyLogo, ok := data["companyLogo"]; ok {
cooperationContractChangeLog.Company.CompanyLogo = companyLogo.(string)
}
if companyName, ok := data["companyName"]; ok {
cooperationContractChangeLog.Company.CompanyName = companyName.(string)
}
if userId, ok := data["userId"]; ok {
cooperationContractChangeLog.Operator.UserId = userId.(int64)
}
if userBaseId, ok := data["userBaseId"]; ok {
cooperationContractChangeLog.Operator.UserBaseId = userBaseId.(int64)
}
if orgId, ok := data["orgId"]; ok {
cooperationContractChangeLog.Operator.Org.OrgId = orgId.(int64)
}
if orgName, ok := data["orgName"]; ok {
cooperationContractChangeLog.Operator.Org.OrgName = orgName.(string)
}
if departmentId, ok := data["departmentId"]; ok {
cooperationContractChangeLog.Operator.Department.DepartmentId = departmentId.(int64)
}
if departmentName, ok := data["departmentName"]; ok {
cooperationContractChangeLog.Operator.Department.DepartmentName = departmentName.(string)
}
if departmentNumber, ok := data["departmentNumber"]; ok {
cooperationContractChangeLog.Operator.Department.DepartmentNumber = departmentNumber.(string)
}
if userAvatar, ok := data["userAvatar"]; ok {
cooperationContractChangeLog.Operator.UserInfo.UserAvatar = userAvatar.(string)
}
if userEmail, ok := data["userEmail"]; ok {
cooperationContractChangeLog.Operator.UserInfo.UserEmail = userEmail.(string)
}
if userName, ok := data["userName"]; ok {
cooperationContractChangeLog.Operator.UserInfo.UserName = userName.(string)
}
if userPhone, ok := data["userPhone"]; ok {
cooperationContractChangeLog.Operator.UserInfo.UserPhone = userPhone.(string)
}
if userAccount, ok := data["userAccount"]; ok {
cooperationContractChangeLog.Operator.UserInfo.UserAccount = userAccount.(string)
}
if userType, ok := data["userType"]; ok {
cooperationContractChangeLog.Operator.UserType = userType.(int32)
}
if status, ok := data["status"]; ok {
cooperationContractChangeLog.Operator.Status = status.(int32)
}
return nil
}