| package com.xzx.gc.entity;  | 
|   | 
|   | 
| import com.xzx.gc.annotation.Dict;  | 
| import com.xzx.gc.util.ValidateConfig;  | 
| import com.xzx.gc.util.enums.CoreDictType;  | 
| import io.swagger.annotations.ApiModelProperty;  | 
| import lombok.Data;  | 
|   | 
| import javax.persistence.GeneratedValue;  | 
| import javax.persistence.GenerationType;  | 
| import javax.persistence.Id;  | 
| import javax.persistence.Table;  | 
| import javax.validation.constraints.NotBlank;  | 
| import javax.validation.constraints.NotNull;  | 
| import java.util.Date;  | 
|   | 
|   | 
| /**  | 
|  * 机构对象,  | 
|  * 有母公司,一个系统只有一个母公司,多个集团,集团下可以有多个公司,子公司,部门。如果系统不符合这个设定,需要修改·  | 
|  *   | 
|  * <br/>  | 
|  * 映射了上级机构,可以通过org.parentOrg.xxx取上级机构的属性  | 
|  */  | 
| @Table(name = "core_org")  | 
| @Data  | 
| public class CoreOrg extends BaseEntity {  | 
|       | 
|     // 自增id  | 
|     @NotNull(message = "ID不能为空", groups = ValidateConfig.UPDATE.class)  | 
|     @Id  | 
|     @GeneratedValue(strategy = GenerationType.IDENTITY)  | 
|     private Long id;  | 
|   | 
|     //删除标识  | 
|     @NotBlank(message = "删除标识", groups = ValidateConfig.ADD.class)  | 
|     private Integer delFlag= 0;  | 
|     //创建时间  | 
|     private Date createTime;  | 
|   | 
|     // 机构编号  | 
|     @NotBlank(message = "组织编号不能为空", groups = ValidateConfig.ADD.class)  | 
|     private String code;  | 
|   | 
|     // 机构名称  | 
|     @NotBlank(message = "组织名称不能为空", groups = {ValidateConfig.ADD.class, ValidateConfig.UPDATE.class})  | 
|     private String name;  | 
|   | 
|     // 上层机构id  | 
|     private Long parentOrgId;  | 
|   | 
|     // 机构类型 1 集团 2 公司,3 部门,4 小组  | 
|     @Dict(type = CoreDictType.ORG_TYPE)  | 
|     @NotBlank(message = "组织类型不能为空", groups = ValidateConfig.class)  | 
|     private String type;  | 
|     @ApiModelProperty(hidden = true)  | 
|     transient String typeText;  | 
|     @ApiModelProperty(hidden = true)  | 
|     transient String parentOrgText;  | 
|     transient String createTimeStr;  | 
| }  |