package com.hys.app.model.system.dos;

import java.io.Serializable;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.hys.app.framework.database.annotation.PrimaryKeyField;

import com.fasterxml.jackson.annotation.JsonIgnore;
import com.fasterxml.jackson.databind.PropertyNamingStrategy;
import com.fasterxml.jackson.databind.annotation.JsonNaming;

import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

import javax.validation.constraints.NotNull;


/**
 * 平台管理员实体
 *
 * @author zh
 * @version v7.0
 * @since v7.0.0
 * 2018-06-20 20:38:26
 */
@TableName("erp_company_user")
@ApiModel
@JsonNaming(value = PropertyNamingStrategy.SnakeCaseStrategy.class)
@Data
public class AdminUser implements Serializable {

    private static final long serialVersionUID = 9076352194131639L;

    /**
     * 平台管理员id
     */
    @TableId(type= IdType.ASSIGN_ID)
    @ApiModelProperty(hidden = false)
    private Long id;
    /**
     * 管理员名称
     */
    @ApiModelProperty(name = "username", value = "管理员名称", required = false)
    private String username;
    /**
     * 管理员密码
     */
    @ApiModelProperty(name = "password", value = "管理员密码", required = false)
    private String password;
    /**
     * 部门
     */
    @ApiModelProperty(name = "department", value = "部门", required = false)
    private String department;
    /**
     * 权限id
     */
    @ApiModelProperty(name = "role_id", value = "权限id", required = false)
    private Long roleId;
    /**
     * 创建日期
     */
    @ApiModelProperty(name = "date_line", value = "创建日期", required = false)
    private Long dateLine;
    /**
     * 备注
     */
    @ApiModelProperty(name = "remark", value = "备注", required = false)
    private String remark;
    /**
     * 是否删除
     */
    @ApiModelProperty(name = "user_state", value = "是否删除,0为正常,-1为删除状态", required = false)
    private Integer userState;
    /**
     * 管理员真实姓名
     */
    @ApiModelProperty(name = "real_name", value = "管理员真实姓名", required = false)
    private String realName;
    /**
     * 头像
     */
    @ApiModelProperty(name = "face", value = "头像", required = false)
    private String face;
    /**
     * 是否为超级管理员
     */
    @ApiModelProperty(name = "founder", value = "是否为超级管理员,1为超级管理员,0为其他", required = false)
    private Integer founder;
    /**
     * 用户编号
     */
    @ApiModelProperty(name = "sn", value = "用户编号", required = false)
    private String sn;
    /**
     * 所属部门id
     */
    @ApiModelProperty(name = "dept_id", value = "所属部门id", required = false)
    private Long deptId;

    @ApiModelProperty(name = "dept_id", value = "是否是部门主管", required = false)
    private Boolean hasDeptManager;
    /**
     * 所属岗位id
     */
    @ApiModelProperty(name = "post_id", value = "所属岗位id", required = false)
    private Long postId;
    /**
     * 顺序
     */
    @ApiModelProperty(name = "nickname", value = "顺序", required = false)
    private Integer sort;
    /**
     * 昵称
     */
    @ApiModelProperty(name = "nickname", value = "昵称", required = false)
    private String nickname;

    @ApiModelProperty(name = "nickname", value = "公司id", required = false)
    private Long companyId;


    @ApiModelProperty(name = "openid", value = "openid", required = false)
    private String openid;

    private String firstPassword;

    private String phone;

    private String email;

    @ApiModelProperty(name = "auth_ids", value = "角色介绍", required = false)
    private String authIds;

    @Override
    public boolean equals(Object o) {
        if (this == o) {
            return true;
        }
        if (o == null || getClass() != o.getClass()) {
            return false;
        }
        AdminUser that = (AdminUser) o;
        if (id != null ? !id.equals(that.id) : that.id != null) {
            return false;
        }
        if (username != null ? !username.equals(that.username) : that.username != null) {
            return false;
        }
        if (password != null ? !password.equals(that.password) : that.password != null) {
            return false;
        }
        if (department != null ? !department.equals(that.department) : that.department != null) {
            return false;
        }
        if (roleId != null ? !roleId.equals(that.roleId) : that.roleId != null) {
            return false;
        }
        if (dateLine != null ? !dateLine.equals(that.dateLine) : that.dateLine != null) {
            return false;
        }
        if (remark != null ? !remark.equals(that.remark) : that.remark != null) {
            return false;
        }
        if (userState != null ? !userState.equals(that.userState) : that.userState != null) {
            return false;
        }
        if (realName != null ? !realName.equals(that.realName) : that.realName != null) {
            return false;
        }
        if (face != null ? !face.equals(that.face) : that.face != null) {
            return false;
        }
        return founder != null ? founder.equals(that.founder) : that.founder == null;
    }

    @Override
    public int hashCode() {
        int result = 0;
        result = 31 * result + (id != null ? id.hashCode() : 0);
        result = 31 * result + (username != null ? username.hashCode() : 0);
        result = 31 * result + (password != null ? password.hashCode() : 0);
        result = 31 * result + (department != null ? department.hashCode() : 0);
        result = 31 * result + (roleId != null ? roleId.hashCode() : 0);
        result = 31 * result + (dateLine != null ? dateLine.hashCode() : 0);
        result = 31 * result + (remark != null ? remark.hashCode() : 0);
        result = 31 * result + (userState != null ? userState.hashCode() : 0);
        result = 31 * result + (realName != null ? realName.hashCode() : 0);
        result = 31 * result + (face != null ? face.hashCode() : 0);
        result = 31 * result + (founder != null ? founder.hashCode() : 0);
        return result;
    }
}
