package com.mortals.xhx.module.workman.model;

import com.fasterxml.jackson.annotation.JsonIgnore;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.mortals.xhx.module.workman.model.vo.WorkmanVo;
import lombok.Data;
/**
 * 工作人员实体对象
 *
 * @author zxfei
 * @date 2023-05-25
 */
@Data
public class WorkmanEntity extends WorkmanVo {
    private static final long serialVersionUID = 1L;

    /**
     * 所属房间id
     */
    private Long roomId;
    /**
     * 所属房间名称
     */
    private String roomName;
    /**
     * 所属部门
     */
    private String deptName;
    /**
     * 姓名
     */
    private String name;
    /**
     * 性别(0.男,1.女)
     */
    private Integer sex;
    /**
     * 职务
     */
    private String userPost;
    /**
     * 电话
     */
    private String phone;
    /**
     * 手机
     */
    private String mobile;
    /**
     * 简介
     */
    private String summary;
    /**
     * 照片
     */
    private String photoPath;
    /**
     * 工作状态，来源基础设置
     */
    private String workStatus;
    /**
     * 登录用户名
     */
    private String loginName;
    /**
     * 密码
     */
    @JsonProperty(access = JsonProperty.Access.WRITE_ONLY)
    private String loginPwd;
    @Override
    public int hashCode() {
        return this.getId().hashCode();
    }
    @Override
    public boolean equals(Object obj) {
        if (obj == null) return false;
        if (obj instanceof WorkmanEntity) {
            WorkmanEntity tmp = (WorkmanEntity) obj;
            if (this.getId() == tmp.getId()) {
                return true;
            }
        }
        return false;
    }

    public void initAttrValue(){

        this.roomId = null;

        this.roomName = "";

        this.deptName = "";

        this.name = "";

        this.sex = 0;

        this.userPost = "";

        this.phone = "";

        this.mobile = "";

        this.summary = "";

        this.photoPath = "";

        this.workStatus = "";

        this.loginName = "";

        this.loginPwd = "";
    }
}