package com.bocloud.ims.entity.common;

import com.bocloud.entity.annotations.Column;
import com.bocloud.entity.annotations.IgnoreAll;
import com.bocloud.entity.annotations.IgnoreUpdate;
import com.bocloud.entity.annotations.PK;
import com.bocloud.entity.annotations.Table;
import com.bocloud.entity.bean.GenericEntity;
import com.bocloud.entity.meta.PKStrategy;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.NoArgsConstructor;

import java.util.List;

/**
 * 组织机构管理
 *
 * @author dongkai
 */
@Data
@NoArgsConstructor
@AllArgsConstructor
@EqualsAndHashCode(callSuper = true)
@Table("department")
public class Department extends GenericEntity {

    @PK(value = PKStrategy.AUTO)
    private Long id; // ID
    @Column("parent_id")
    @IgnoreUpdate
    private Long parentId; // 父节点
    @Column("tenant_id")
    private Long tenantId; // 租户ID
    @Column("origin")
    private String origin;
    @IgnoreAll
    private String children;
    @IgnoreAll
    private List<Department> childs;
    @IgnoreAll
    private List<User> users;
}
