SysOrg.java 1.33 KB
package com.youjia.system.entity;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.youjia.common.entity.BaseEntity;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.EqualsAndHashCode;
import lombok.Getter;
import lombok.Setter;

/**
 * 组织表(sys_org,树型)。优加主体为根节点,其下为线上运营部、财务部等。
 */
@Getter
@Setter
@EqualsAndHashCode(callSuper = true)
@TableName("sys_org")
@Schema(description = "组织")
public class SysOrg extends BaseEntity {

    @TableId(value = "org_id", type = IdType.AUTO)
    @Schema(description = "组织 ID")
    private Long orgId;

    @Schema(description = "父级组织 ID,根为 0")
    private Long parentId;

    @Schema(description = "组织名称")
    private String orgName;

    @Schema(description = "组织编码")
    private String orgCode;

    @Schema(description = "负责人用户 ID")
    private Long leaderUserId;

    @Schema(description = "层级,从 1 开始")
    private Integer level;

    @Schema(description = "路径,形如 /1/2/3/")
    private String path;

    @Schema(description = "显示排序")
    private Integer sort;

    @Schema(description = "状态:1-启用 0-停用")
    private Integer status;
}