package com.yuchen.saas.manage.user.api.entity;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

import java.io.Serializable;


@Data
@TableName("nest_user_dept")
@ApiModel(value = "UserDept对象", description = "UserDept对象")
public class UserDept implements Serializable {

    private static final long serialVersionUID = 1L;


    @JsonSerialize(using = ToStringSerializer.class)
    @ApiModelProperty(value = "主键")
    @TableId(value = "id", type = IdType.ASSIGN_ID)
    private Long id;


    @JsonSerialize(using = ToStringSerializer.class)
    @ApiModelProperty(value = "用户ID")
    private Long userId;


    @JsonSerialize(using = ToStringSerializer.class)
    @ApiModelProperty(value = "部门ID")
    private Long deptId;

    @ApiModelProperty(value = "组织成员ID")
    private Long orgUserId;

    //todo 这个在Dept上,这里是绑定的关系,isCreate是跟组织的关系
    @Deprecated
    @ApiModelProperty(value = "是否是创建者0否1是")
    private Integer isCreate;

    //todo 这个是角色那边,这里是绑定的关系,isAdmin是跟组织的关系
    @Deprecated
    @ApiModelProperty(value = "是否是主管理员0否1是")
    private Integer isAdmin;

    @ApiModelProperty(value = "绑定关系是否是跟组织绑定的0否1是")
    private Integer isOrg;

    @ApiModelProperty(value = "是否是外部组织0否1是(外部关联连组织进来的绑定关系)")
    private Integer isExternalOrg;

    @ApiModelProperty(value = "直接绑定的下级组织id(建立在isexternalOrg=1时)")
    private Long childOrgId;

    @ApiModelProperty(value = "原本所在组织id(建立在isexternalOrg=1时)")
    private Long originalOrgId;

    @ApiModelProperty(value = "原本所在组织成员id(建立在isexternalOrg=1时)")
    private Long originalOrgUserId;

    //todo 考虑去掉setIsShow,有显示绑定就绑定,没显示绑定就没绑定,看用户有没有在这个组织里不看这里的绑定关系,看orgUser里面有没有存在!
    @Deprecated
    @ApiModelProperty(value = "跟组织绑定关系一定会存在,以这个字段作为是否展示0不展示1展示默认展示")
    private Integer isShow;


    @ApiModelProperty(value = "是否是部门主管")
    private Integer isDeptAdmin;

    @ApiModelProperty(value = "原绑定id(下级同步上来前)")
    private Long sourceUserDeptId;

    @ApiModelProperty(value = "原绑定部门id(下级同步上来前)")
    private Long sourceDeptId;

    @ApiModelProperty(value = "原绑定部门id(下级同步上来前)")
    private Long sourceOrgUserId;

    @ApiModelProperty(value = "原绑定部门id(下级同步上来前)")
    private Long sourceUserId;

    @ApiModelProperty(value = "部门直属组织deptId")
    private Long directlyDeptId;

    @ApiModelProperty(value = "原部门直属组织deptId")
    private Long sourceDirectlyDeptId;
}
