package com.njcn.pojo.user;

import com.njcn.pojo.configuration.DicData;
import com.njcn.sso.pojo.user.User;

import javax.persistence.Column;
import javax.persistence.Id;
import javax.persistence.Table;
import javax.persistence.Transient;
import javax.sql.DataSource;
import java.util.Date;
import java.util.List;

/**
 * PQS_Depts部门表。根据本表能够生成一颗部门树，
 */
@Table(name = "PQS_DEPTS")
public class Depts {

    @Id
    @Column(name = "DEPTS_INDEX")
    private String deptsIndex;

    @Column(name = "DEPTSNAME")
    private String deptsName;


    @Column(name = "PARENTNODEID")
    private String parentNodeId;

    @Column(name = "DEPTS_DESC")
    private Integer deptsDesc;

    @Column(name = "USER_INDEX")
    private String userIndex;

    @Column(name = "UPDATETIME")
    private Date updateTime;

    @Column(name = "DEPTS_DESCRIPTION")
    private String deptsDescription;

    @Column(name = "CUSTOM_DEPT")
    private Integer customDept;

    private String area;

    //修改部门时需要的行政
    @Transient
    private List<DicData> areas;

    public List<DicData> getAreas() {
        return areas;
    }

    public void setAreas(List<DicData> areas) {
        this.areas = areas;
    }

    @Column(name = "STATE")
    private Integer state;

    @Transient
    private User uID;

    @Transient
    private String areaName;

    public String getDeptsIndex() {
        return deptsIndex;
    }

    public void setDeptsIndex(String deptsIndex) {
        this.deptsIndex = deptsIndex;
    }

    public String getDeptsName() {
        return deptsName;
    }

    public void setDeptsName(String deptsName) {
        this.deptsName = deptsName;
    }

    public String getParentNodeId() {
        return parentNodeId;
    }

    public void setParentNodeId(String parentNodeId) {
        this.parentNodeId = parentNodeId;
    }

    public Integer getDeptsDesc() {
        return deptsDesc;
    }

    public void setDeptsDesc(Integer deptsDesc) {
        this.deptsDesc = deptsDesc;
    }

    public String getUserIndex() {
        return userIndex;
    }

    public void setUserIndex(String userIndex) {
        this.userIndex = userIndex;
    }

    public Date getUpdateTime() {
        return updateTime;
    }

    public void setUpdateTime(Date updateTime) {
        this.updateTime = updateTime;
    }

    public String getDeptsDescription() {
        return deptsDescription;
    }

    public void setDeptsDescription(String deptsDescription) {
        this.deptsDescription = deptsDescription;
    }

    public Integer getCustomDept() {
        return customDept;
    }

    public void setCustomDept(Integer customDept) {
        this.customDept = customDept;
    }

    public String getArea() {
        return area;
    }

    public void setArea(String area) {
        this.area = area;
    }

    public Integer getState() {
        return state;
    }

    public void setState(Integer state) {
        this.state = state;
    }

    public User getuID() {
        return uID;
    }

    public void setuID(User uID) {
        this.uID = uID;
    }

    public String getAreaName() {
        return areaName;
    }

    public void setAreaName(String areaName) {
        this.areaName = areaName;
    }

    @Override
    public String toString() {
        return "Depts{" +
                "deptsIndex='" + deptsIndex + '\'' +
                ", deptsName='" + deptsName + '\'' +
                ", parentNodeId='" + parentNodeId + '\'' +
                ", deptsDesc=" + deptsDesc +
                ", userIndex='" + userIndex + '\'' +
                ", updateTime=" + updateTime +
                ", deptsDescription='" + deptsDescription + '\'' +
                ", customDept=" + customDept +
                ", area='" + area + '\'' +
                ", areas=" + areas +
                ", state=" + state +
                ", uID=" + uID +
                ", areaName='" + areaName + '\'' +
                '}';
    }
}
