Organization.java
4.96 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
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
package com.erry.iclear.dateInterface.entity;
import com.erry.iclear.dateInterface.common.BaseModel;
import com.fasterxml.jackson.annotation.JsonIgnore;
import javax.persistence.*;
import java.util.Date;
import java.util.Objects;
/**
* 组织结构表
*
* @author Created by Erry 2019/7/1.
*/
@Entity
@Table(name = "T_AU_ORGANIZATION")
public class Organization extends BaseModel {
private static final long serialVersionUID = 2693103610036977383L;
/**
* 表ID,自动增加
*/
@Id
@GeneratedValue
@Column(name = "ID")
private Long id;
// @Version
// @Column(name = "VERSION")
// private Integer version;
/**
* 编码
*/
@Column(name = "CODE")
private String code;
/**
* 名称
*/
@Column(name = "NAME")
private String name;
/**
* 组织架构类型 (和用户类型、角色类型对应的是同一个数据字典)
* <p>
* 客户
* 速递员
* 站点
* RDE
* 口岸
* 总部
*/
@JsonIgnore
@ManyToOne(targetEntity = DictionaryEntries.class)
@JoinColumn(name = "TYPE_ID")
private DictionaryEntries type;
/**
* 上级组织
*/
@JsonIgnore
@ManyToOne(targetEntity = Organization.class)
@JoinColumn(name = "PARENT_ID")
private Organization parent;
/**
* 级别
*/
@Column(name = "LEVEL")
private Long LEVEL;
/**
* 创建人
*/
@JsonIgnore
@ManyToOne(targetEntity = SysUser.class)
@JoinColumn(name = "CREATE_USER_ID")
private SysUser createUser;
/**
* 创建时间
*/
@Column(name = "CREATE_TIME")
private Date createTime;
/**
* 最后修改人
*/
@JsonIgnore
@ManyToOne(targetEntity = SysUser.class)
@JoinColumn(name = "LAST_MODIFY_USER_ID")
private SysUser lastModifyUser;
/**
* 最后修改时间
*/
@Column(name = "LAST_MODIFY_TIME")
private Date lastModifyTime;
@Override
public Long getId() {
return id;
}
@Override
public void setId(Long id) {
this.id = id;
}
public String getCode() {
return code;
}
public void setCode(String code) {
this.code = code;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public DictionaryEntries getType() {
return type;
}
public void setType(DictionaryEntries type) {
this.type = type;
}
public Organization getParent() {
return parent;
}
public void setParent(Organization parent) {
this.parent = parent;
}
public Long getLEVEL() {
return LEVEL;
}
public void setLEVEL(Long LEVEL) {
this.LEVEL = LEVEL;
}
public Date getCreateTime() {
return createTime;
}
public void setCreateTime(Date createTime) {
this.createTime = createTime;
}
public SysUser getCreateUser() {
return createUser;
}
public void setCreateUser(SysUser createUser) {
this.createUser = createUser;
}
public SysUser getLastModifyUser() {
return lastModifyUser;
}
public void setLastModifyUser(SysUser lastModifyUser) {
this.lastModifyUser = lastModifyUser;
}
public Date getLastModifyTime() {
return lastModifyTime;
}
public void setLastModifyTime(Date lastModifyTime) {
this.lastModifyTime = lastModifyTime;
}
@Override
public boolean equals(Object o) {
if (this == o) {
return true;
}
if (o == null || getClass() != o.getClass()) {
return false;
}
Organization that = (Organization) o;
return Objects.equals(id, that.id) &&
Objects.equals(code, that.code) &&
Objects.equals(name, that.name) &&
Objects.equals(type, that.type) &&
Objects.equals(parent, that.parent) &&
Objects.equals(LEVEL, that.LEVEL) &&
Objects.equals(createUser, that.createUser) &&
Objects.equals(createTime, that.createTime) &&
Objects.equals(lastModifyUser, that.lastModifyUser) &&
Objects.equals(lastModifyTime, that.lastModifyTime);
}
@Override
public int hashCode() {
return Objects.hash(id, code, name, type, parent, LEVEL, createUser, createTime, lastModifyUser, lastModifyTime);
}
@Override
public String toString() {
return "Organization{" +
"id=" + id +
", code='" + code + '\'' +
", name='" + name + '\'' +
", type=" + type +
", parent=" + parent +
", LEVEL=" + LEVEL +
", createUser=" + createUser +
", createTime=" + createTime +
", lastModifyUser=" + lastModifyUser +
", lastModifyTime=" + lastModifyTime +
'}';
}
}