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 org.hibernate.annotations.GenericGenerator;

import javax.persistence.*;

@Entity
@Table(name = "YKZ_ORGANIZATION")
@NamedQuery(name = "Organization.findAll", query = "SELECT t FROM YkzOrganization t")
@DynamicInsert
@DynamicUpdate
@Getter
@Setter
@ToString
@EqualsAndHashCode(of = { "id" })
@GenericGenerator(name = "idGenerator", strategy = "com.crunii.micro.core.distributed.DistributedSnowFlakeId")
@ApiModel(description = "愉快政组织")
public class YkzOrganization {

    @Id
    @GeneratedValue(generator = "idGenerator")
    @Column(name = "id")
    @ApiModelProperty(name = "id", value = "id")
    private Long id;

    @Column(name = "organization_id")
    @ApiModelProperty(name = "organization_id", value = "机构id")
    private Long organizationId;

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

    @Column(name = "credit_code")
    @ApiModelProperty(name = "creditCode", value = "统一信用代码")
    private String creditCode;

    @Column(name = "display_order")
    @ApiModelProperty(name = "displayOrder", value = "同级排序字段")
    private Long displayOrder;

    @Column(name = "gov_address")
    @ApiModelProperty(name = "govAddress", value = "单位地址")
    private String govAddress;

    @Column(name = "gov_business_strip_codes")
    @ApiModelProperty(name = "govBusinessStripCodes", value = "条线Code列表")
    private String govBusinessStripCodes;

    @Column(name = "gov_division_code")
    @ApiModelProperty(name = "govDivisionCode", value = "行政区划Code")
    private String govDivisionCode;

    //需使用GovInstitutionLevel枚举类转换展示
    @Column(name = "gov_institution_level_code")
    @ApiModelProperty(name = "govInstitutionLevelCode", value = "机构/单位级别")
    private String govInstitutionLevelCode;

    @Column(name = "gov_short_name")
    @ApiModelProperty(name = "govShortName", value = "机构简称")
    private String govShortName;

    @Column(name = "is_deleted")
    @ApiModelProperty(name = "isDeleted", value = "删除标识 1 表示删除，0 表示未删除")
    private Integer isDeleted;

    @Column(name = "is_enable")
    @ApiModelProperty(name = "isEnable", value = "是否启用")
    private Integer isEnable;

    @Column(name = "name")
    @ApiModelProperty(name = "name", value = "机构全称")
    private String name;

    @Column(name = "org_type")
    @ApiModelProperty(name = "orgType", value = "机构类型")
    private String orgType;

    @Column(name = "organization_code")
    @ApiModelProperty(name = "organizationCode", value = "政务钉钉组织机构code")
    private String organizationCode;

    @Column(name = "parent_id")
    @ApiModelProperty(name = "parentId", value = "机构父级id")
    private Long parentId;

    @Column(name = "parent_organization_code")
    @ApiModelProperty(name = "parentOrganizationCode", value = "父组织机构code")
    private String parentOrganizationCode;

    @Column(name = "principal")
    @ApiModelProperty(name = "principal", value = "单位负责人userCode")
    private String principal;

    @Column(name = "remark")
    @ApiModelProperty(name = "remark", value = "备注")
    private String remark;

    @Column(name = "update_time")
    @ApiModelProperty(name = "updateTime", value = "更新时间搓")
    private Long updateTime;
}
