package com.crunii.micro.domain.entity.main;

import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.EqualsAndHashCode;
import lombok.Getter;
import lombok.Setter;
import lombok.ToString;
import org.hibernate.annotations.DynamicInsert;
import org.hibernate.annotations.DynamicUpdate;

import javax.persistence.*;
import java.io.Serializable;
import java.util.Date;
import java.math.BigInteger;

@Entity
@Table(name = "tsm_org")
@NamedQuery(name = "TsmOrg.findAll", query = "SELECT t FROM TsmOrg t")
@DynamicInsert
@DynamicUpdate
@Getter
@Setter
@ToString
@EqualsAndHashCode(of = { "orgId" })
@ApiModel(description = "组织表")
public class TsmOrg implements Serializable {

	private static final long serialVersionUID = 1L;

	@Id
	@SequenceGenerator(name = "tsm_org_org_id_seq", sequenceName = "tsm_org_org_id_seq", allocationSize = 1)
	@GeneratedValue(strategy = GenerationType.SEQUENCE, generator = "tsm_org_org_id_seq")
	@Column(name = "org_id")
	@ApiModelProperty(value = "组织id")
	private Long orgId;

	@Column(name = "org_code")
	@ApiModelProperty(value = "组织编码，按规律生成，体现上下级关系")
	private String orgCode;

	@Column(name = "org_name")
	@ApiModelProperty(value = "组织名称")
	private String orgName;

	@Column(name = "org_full_name")
	@ApiModelProperty(value = "组织全称")
	private String orgFullName;

	@Column(name = "org_desc")
	@ApiModelProperty(value = "组织描述")
	private String orgDesc;

	@Column(name = "parent_org_id")
	@ApiModelProperty(value = "父组织ID,根组织id为0")
	private Long parentOrgId;

	@Column(name = "parent_org_code")
	@ApiModelProperty(value = "父组织编码")
	private String parentOrgCode;

	@Column(name = "create_time")
	@ApiModelProperty(value = "创建时间")
	private Date createTime;

	@Column(name = "update_time")
	@ApiModelProperty(value = "更新时间")
	private Date updateTime;

	@Column(name = "sort_id")
	@ApiModelProperty(value = "排序")
	private Long sortId;

	@Column(name = "state")
	@ApiModelProperty(value = "0无效，1有效")
	private Integer state;

	@Column(name = "manage_people")
	@ApiModelProperty(value = "组织管理员")
	private Integer managePeople;

	@Column(name = "org_level")
	@ApiModelProperty(value = "组织等级")
	private String orgLevel;

	@Column(name = "data_sources")
	@ApiModelProperty(value = "数据来源")
	private String dataSources;

	@Column(name = "region")
	@ApiModelProperty(value = "所属级别")
	private String region;

	@ApiModelProperty(value = "所属区域")
	private String zone;

	@Column(name = "industry_category")
	@ApiModelProperty(value = "所属行业类别")
	private String industryCategory;

	@Column(name = "org_category_tree")
	@ApiModelProperty(value = "组织类别树")
	private String orgCategoryTree;

	@Column(name = "ocyl_industry_category")
	@ApiModelProperty(value = "所属行业类别(团组织)")
	private String ocylIndustryCategory;

	@Column(name = "ocyl_org_category")
	@ApiModelProperty(value = "组织类别(团组织)")
	private String ocylOrgCategory;

	@Column(name = "ocyl_is_xztw")
	@ApiModelProperty(value = "是否乡镇团委(团组织)")
	private Integer ocylIsXztw;

	@Column(name = "telephone")
	@ApiModelProperty(value = "联系电话(团组织)")
	private String telephone;

	@Column(name = "whether_jurisdiction")
	@ApiModelProperty(value = "是否直属所在区域 0不是 1是")
	private Integer whetherJurisdiction;


	@Column(name = "zone_id")
	@ApiModelProperty(value = "所属区域id")
	private Integer zoneId;


	@Column(name = "org_short_called")
	@ApiModelProperty(value = "组织简称")
	private String orgShortCalled;

	@Column(name = "org_secretary")
	@ApiModelProperty(value = "组织书记")
	private String orgSecretary;

	@Column(name = "org_email")
	@ApiModelProperty(value = "电子邮箱")
	private String orgEmail;

	@Column(name = "is_leaf")
	@ApiModelProperty(value = "true 是叶子节点 false 不是叶子节点")
	private Boolean isLeaf;

	@Column(name = "update_user_id")
	@ApiModelProperty(value = "更新时间")
	private Integer updateUserId;

	@Column(name = "affiliating_system")
	@ApiModelProperty(value = "所属系统(团组织)")
	private String affiliatingSystem;

	@Column(name = "registration_system_type")
	private Integer registrationSystemType;
}
