package com.qxueyou.scc.org.model;
|
|
import java.io.Serializable;
|
import java.util.Date;
|
import java.util.List;
|
import java.util.Map;
|
|
//import javax.persistence.CascadeType;
|
import javax.persistence.Column;
|
import javax.persistence.Entity;
|
import javax.persistence.FetchType;
|
import javax.persistence.Id;
|
//import javax.persistence.JoinColumn;
|
//import javax.persistence.ManyToOne;
|
import javax.persistence.NamedQuery;
|
import javax.persistence.OneToMany;
|
import javax.persistence.Table;
|
import javax.persistence.Temporal;
|
import javax.persistence.TemporalType;
|
import javax.persistence.Transient;
|
|
import org.springframework.format.annotation.DateTimeFormat;
|
|
import com.fasterxml.jackson.annotation.JsonIgnore;
|
import com.fasterxml.jackson.annotation.JsonManagedReference;
|
|
|
/**
|
* The persistent class for the organization database table.
|
*
|
*/
|
@Entity
|
@Table(name="organization")
|
@NamedQuery(name="Organization.findAll", query="SELECT o FROM Organization o")
|
public class Organization implements Serializable {
|
|
private static final long serialVersionUID = 1L;
|
|
/** 用户类型(1,职业培训;2,学历教育;3,企业内训;4,活动沙龙;5,代理机构) */
|
public static final short ORG_TYPE_JOB_TRAINING = 1;
|
|
public static final short ORG_TYPE_DEGREE_EDUCATION = 2;
|
|
public static final short ORG_TYPE_ORG_CORPORATE_TRAINING = 3;
|
|
public static final short ORG_TYPE_ACTIVITY_SALON = 4;
|
|
public static final short ORG_TYPE_CLASS_AGENCY = 5;
|
/** level (1:学校 2:系 3:学院) */
|
public static final short ORG_LEVEL_SCHOOL = 1;
|
public static final short ORG_LEVEL_SYSTEM = 2;
|
public static final short ORG_LEVEL_COURTYARD = 3;
|
|
@Id
|
@Column(name="ORGANIZATION_ID", unique=true, nullable=false, length=32)
|
private String organizationId;
|
|
@Column(name="PARENT_ORGANIZATION_ID", length=32)
|
private String parentOrganizationId;
|
|
@Column(name="ORG_CODE", length=64)
|
private String orgCode;
|
|
@Column(name="CREATE_ID", nullable=false, length=32)
|
@JsonIgnore
|
private String createId;
|
|
@Column(name="CREATE_TIME", nullable=false)
|
@Temporal(TemporalType.TIMESTAMP)
|
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
@JsonIgnore
|
private Date createTime;
|
|
@Column(name="CREATOR", nullable=false, length=100)
|
@JsonIgnore
|
private String creator;
|
|
@Column(name="TEL", length=32)
|
private String tel;
|
|
@Column(name="LOGO_PATH", length=255)
|
private String logoPath;
|
|
@Column(name="DELETE_FLAG", nullable=false)
|
@JsonIgnore
|
private String deleteFlag;
|
|
@Column(name="UPDATE_ID", length=32)
|
@JsonIgnore
|
private String updateId;
|
|
@Column(name="UPDATE_TIME", nullable=false)
|
@Temporal(TemporalType.TIMESTAMP)
|
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
@JsonIgnore
|
private Date updateTime;
|
|
@Column(name="UPDATOR", length=100)
|
@JsonIgnore
|
private String updator;
|
|
|
@Column(name="CODE",length=32)
|
private String code;
|
|
@Column(name="SHORT_NAME", length=150)
|
private String shortName;
|
|
@Column(name="NAME", length=150)
|
private String name;
|
|
@Column(name="SERVER_URL", length=150)
|
private String serverUrl;
|
|
/** 类型:(1.职业培训 2.学历教育3.企业内训 4.活动沙龙5.代理机构) */
|
@Column(name="TYPE", length=6)
|
private String type;
|
|
@OneToMany(fetch = FetchType.LAZY, mappedBy = "org")
|
@JsonManagedReference
|
private List<OrgCollegeCourse> courses;
|
|
@OneToMany(fetch = FetchType.LAZY, mappedBy = "topOrg")
|
@JsonManagedReference
|
private List<OrgCollegeCourse> topCourses;
|
|
@OneToMany(fetch = FetchType.LAZY, mappedBy = "organization")
|
@JsonIgnore
|
private List<OrgAdmin> admins;
|
|
@OneToMany(fetch = FetchType.LAZY, mappedBy = "organization")
|
@JsonIgnore
|
private List<OrgCharger> chargers;
|
|
@OneToMany(fetch = FetchType.LAZY, mappedBy = "organization")
|
@JsonIgnore
|
private List<OrgSalesman> salesmans;
|
|
@OneToMany(fetch = FetchType.LAZY, mappedBy = "organization")
|
@JsonIgnore
|
private List<OrgTeacher> teachers;
|
|
@OneToMany(fetch = FetchType.LAZY, mappedBy = "organization")
|
@JsonManagedReference
|
private List<OrgPhotoalbum> photoalbum;
|
|
|
// @ManyToOne(cascade={CascadeType.ALL})
|
// @JoinColumn(name="PARENT_ORGANIZATION_ID",referencedColumnName="ORGANIZATION_ID",updatable=false,insertable=false)
|
// @JsonIgnore
|
// private Organization parent;
|
//
|
// @OneToMany(fetch = FetchType.LAZY,mappedBy="parent")
|
// @JsonIgnore
|
// private List<Organization> children;
|
|
|
@Transient
|
private String topOrganizationId;
|
|
@Transient
|
private Map<String,Object> classData;
|
|
@Transient
|
private short level;
|
|
@Transient
|
private Boolean isParent ;
|
|
public Map<String, Object> getClassData() {
|
return classData;
|
}
|
|
public void setClassData(Map<String, Object> classData) {
|
this.classData = classData;
|
}
|
|
public Organization() {
|
}
|
|
|
public String getTel() {
|
return tel;
|
}
|
|
public void setTel(String tel) {
|
this.tel = tel;
|
}
|
|
public String getLogoPath() {
|
return logoPath;
|
}
|
|
public void setLogoPath(String logoPath) {
|
this.logoPath = logoPath;
|
}
|
|
public String getOrganizationId() {
|
return this.organizationId;
|
}
|
|
public void setOrganizationId(String organizationId) {
|
this.organizationId = organizationId;
|
}
|
|
public String getCode() {
|
return this.code;
|
}
|
|
public void setCode(String code) {
|
this.code = code;
|
}
|
|
public String getCreateId() {
|
return this.createId;
|
}
|
|
public void setCreateId(String createId) {
|
this.createId = createId;
|
}
|
|
public Date getCreateTime() {
|
return this.createTime;
|
}
|
|
public void setCreateTime(Date createTime) {
|
this.createTime = createTime;
|
}
|
|
public String getCreator() {
|
return this.creator;
|
}
|
|
public void setCreator(String creator) {
|
this.creator = creator;
|
}
|
|
public String getDeleteFlag() {
|
return this.deleteFlag;
|
}
|
|
public void setDeleteFlag(String deleteFlag) {
|
this.deleteFlag = deleteFlag;
|
}
|
|
public String getName() {
|
return this.name;
|
}
|
|
public void setName(String name) {
|
this.name = name;
|
}
|
|
public String getUpdateId() {
|
return this.updateId;
|
}
|
|
public void setUpdateId(String updateId) {
|
this.updateId = updateId;
|
}
|
|
public Date getUpdateTime() {
|
return this.updateTime;
|
}
|
|
public void setUpdateTime(Date updateTime) {
|
this.updateTime = updateTime;
|
}
|
|
public String getUpdator() {
|
return this.updator;
|
}
|
|
public void setUpdator(String updator) {
|
this.updator = updator;
|
}
|
|
public String getShortName() {
|
return shortName;
|
}
|
|
public void setShortName(String shortName) {
|
this.shortName = shortName;
|
}
|
|
public String getParentOrganizationId() {
|
return parentOrganizationId;
|
}
|
|
public void setParentOrganizationId(String parentOrganizationId) {
|
this.parentOrganizationId = parentOrganizationId;
|
}
|
|
public String getOrgCode() {
|
return orgCode;
|
}
|
|
public void setOrgCode(String orgCode) {
|
this.orgCode = orgCode;
|
}
|
|
public List<OrgPhotoalbum> getPhotoalbum() {
|
return photoalbum;
|
}
|
|
public void setPhotoalbum(List<OrgPhotoalbum> photoalbum) {
|
this.photoalbum = photoalbum;
|
}
|
|
|
public List<OrgCollegeCourse> getCourses() {
|
return courses;
|
}
|
|
public void setCourses(List<OrgCollegeCourse> courses) {
|
this.courses = courses;
|
}
|
|
public List<OrgAdmin> getAdmins() {
|
return admins;
|
}
|
|
public void setAdmins(List<OrgAdmin> admins) {
|
this.admins = admins;
|
}
|
|
public List<OrgCharger> getChargers() {
|
return chargers;
|
}
|
|
public void setChargers(List<OrgCharger> chargers) {
|
this.chargers = chargers;
|
}
|
|
public List<OrgSalesman> getSalesmans() {
|
return salesmans;
|
}
|
|
public void setSalesmans(List<OrgSalesman> salesmans) {
|
this.salesmans = salesmans;
|
}
|
|
public List<OrgTeacher> getTeachers() {
|
return teachers;
|
}
|
|
public void setTeachers(List<OrgTeacher> teachers) {
|
this.teachers = teachers;
|
}
|
|
public String getType() {
|
return type;
|
}
|
|
public void setType(String type) {
|
this.type = type;
|
}
|
|
public short getLevel() {
|
return level;
|
}
|
|
public void setLevel(short level) {
|
this.level = level;
|
}
|
/*
|
public Organization getParent() {
|
return parent;
|
}
|
|
public void setParent(Organization parent) {
|
this.parent = parent;
|
}
|
|
public List<Organization> getChildren() {
|
return children;
|
}
|
|
public void setChildren(List<Organization> children) {
|
this.children = children;
|
}*/
|
|
public List<OrgCollegeCourse> getTopCourses() {
|
return topCourses;
|
}
|
|
public void setTopCourses(List<OrgCollegeCourse> topCourses) {
|
this.topCourses = topCourses;
|
}
|
|
public Boolean getIsparent() {
|
return isParent;
|
}
|
|
public void setIsparent(Boolean isParent) {
|
this.isParent = isParent;
|
}
|
|
public String getTopOrganizationId() {
|
return topOrganizationId;
|
}
|
|
public void setTopOrganizationId(String topOrganizationId) {
|
this.topOrganizationId = topOrganizationId;
|
}
|
|
public String getServerUrl() {
|
return serverUrl;
|
}
|
|
public void setServerUrl(String serverUrl) {
|
this.serverUrl = serverUrl;
|
}
|
|
}
|