cooperation_contract_relevant.go
3.4 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
package domain
import "time"
// CooperationContractRelevant 共创合约相关人
type CooperationContractRelevant struct {
// 共创合约相关人id
CooperationContractRelevantId int64 `json:"cooperationContractRelevantId,string"`
// 共创合约编号
CooperationContractNumber string `json:"cooperationContractNumber"`
// 相关人
Relevant *Relevant `json:"relevant"`
// 更新时间
UpdatedAt time.Time `json:"updatedAt"`
// 删除时间
DeletedAt time.Time `json:"deletedAt"`
// 创建时间
CreatedAt time.Time `json:"createdAt"`
}
type CooperationContractRelevantRepository interface {
Save(cooperationContractRelevant *CooperationContractRelevant) (*CooperationContractRelevant, error)
Remove(cooperationContractRelevant *CooperationContractRelevant) (*CooperationContractRelevant, error)
FindOne(queryOptions map[string]interface{}) (*CooperationContractRelevant, error)
Find(queryOptions map[string]interface{}) (int64, []*CooperationContractRelevant, error)
}
func (cooperationContractRelevant *CooperationContractRelevant) Identify() interface{} {
if cooperationContractRelevant.CooperationContractRelevantId == 0 {
return nil
}
return cooperationContractRelevant.CooperationContractRelevantId
}
func (cooperationContractRelevant *CooperationContractRelevant) Update(data map[string]interface{}) error {
if cooperationContractRelevantId, ok := data["cooperationContractRelevantId"]; ok {
cooperationContractRelevant.CooperationContractRelevantId = cooperationContractRelevantId.(int64)
}
if cooperationContractNumber, ok := data["cooperationContractNumber"]; ok {
cooperationContractRelevant.CooperationContractNumber = cooperationContractNumber.(string)
}
if userId, ok := data["userId"]; ok {
cooperationContractRelevant.Relevant.UserId = userId.(int64)
}
if userBaseId, ok := data["userBaseId"]; ok {
cooperationContractRelevant.Relevant.UserBaseId = userBaseId.(int64)
}
if orgId, ok := data["orgId"]; ok {
cooperationContractRelevant.Relevant.Org.OrgId = orgId.(int64)
}
if orgName, ok := data["orgName"]; ok {
cooperationContractRelevant.Relevant.Org.OrgName = orgName.(string)
}
if companyId, ok := data["companyId"]; ok {
cooperationContractRelevant.Relevant.Org.Company.CompanyId = companyId.(int64)
}
if companyLogo, ok := data["companyLogo"]; ok {
cooperationContractRelevant.Relevant.Org.Company.CompanyLogo = companyLogo.(string)
}
if companyName, ok := data["companyName"]; ok {
cooperationContractRelevant.Relevant.Org.Company.CompanyName = companyName.(string)
}
if userAvatar, ok := data["userAvatar"]; ok {
cooperationContractRelevant.Relevant.UserInfo.UserAvatar = userAvatar.(string)
}
if userEmail, ok := data["userEmail"]; ok {
cooperationContractRelevant.Relevant.UserInfo.UserEmail = userEmail.(string)
}
if userName, ok := data["userName"]; ok {
cooperationContractRelevant.Relevant.UserInfo.UserName = userName.(string)
}
if userPhone, ok := data["userPhone"]; ok {
cooperationContractRelevant.Relevant.UserInfo.UserPhone = userPhone.(string)
}
if userAccount, ok := data["userAccount"]; ok {
cooperationContractRelevant.Relevant.UserInfo.UserAccount = userAccount.(string)
}
if userType, ok := data["userType"]; ok {
cooperationContractRelevant.Relevant.UserType = userType.(int32)
}
if status, ok := data["status"]; ok {
cooperationContractRelevant.Relevant.Status = status.(int32)
}
cooperationContractRelevant.UpdatedAt = time.Now()
return nil
}