package cn.ibizlab.humanresource.core.humanresource.domain;

import java.sql.Timestamp;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
import java.math.BigInteger;
import java.util.HashMap;
import java.math.BigDecimal;
import java.text.SimpleDateFormat;
import com.alibaba.fastjson.annotation.JSONField;
import com.fasterxml.jackson.annotation.JsonIgnore;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.annotation.JsonFormat;
import org.springframework.util.ObjectUtils;
import org.springframework.util.DigestUtils;
import cn.ibizlab.humanresource.util.domain.EntityBase;
import cn.ibizlab.humanresource.util.annotation.DEField;
import cn.ibizlab.humanresource.util.enums.DEPredefinedFieldType;
import cn.ibizlab.humanresource.util.enums.DEFieldDefaultValueType;
import java.io.Serializable;
import lombok.*;
import org.springframework.data.annotation.Transient;
import cn.ibizlab.humanresource.util.annotation.Audit;


import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import com.baomidou.mybatisplus.annotation.*;
import cn.ibizlab.humanresource.util.domain.EntityMP;

/**
 * 实体[家庭情况]
 */
@Getter
@Setter
@NoArgsConstructor
@JsonIgnoreProperties(value = "handler")
@TableName(value = "T_HRFAMILY",resultMap = "HRFamilyResultMap")
public class HRFamily extends EntityMP implements Serializable {

    private static final long serialVersionUID = 1L;

    /**
     * 建立时间
     */
    @DEField(preType = DEPredefinedFieldType.CREATEDATE)
    @TableField(value = "createdate" , fill = FieldFill.INSERT)
    @JsonFormat(pattern="yyyy-MM-dd HH:mm:ss", locale = "zh" , timezone="GMT+8")
    @JSONField(name = "createdate" , format="yyyy-MM-dd HH:mm:ss")
    @JsonProperty("createdate")
    private Timestamp createdate;
    /**
     * 姓名
     */
    @TableField(value = "hrfamilyname")
    @JSONField(name = "hrfamilyname")
    @JsonProperty("hrfamilyname")
    private String hrfamilyname;
    /**
     * 建立人
     */
    @DEField(preType = DEPredefinedFieldType.CREATEMAN)
    @TableField(value = "createman" , fill = FieldFill.INSERT)
    @JSONField(name = "createman")
    @JsonProperty("createman")
    private String createman;
    /**
     * 更新人
     */
    @DEField(preType = DEPredefinedFieldType.UPDATEMAN)
    @TableField(value = "updateman")
    @JSONField(name = "updateman")
    @JsonProperty("updateman")
    private String updateman;
    /**
     * 家庭情况标识
     */
    @DEField(isKeyField=true)
    @TableId(value= "hrfamilyid",type=IdType.ASSIGN_UUID)
    @JSONField(name = "hrfamilyid")
    @JsonProperty("hrfamilyid")
    private String hrfamilyid;
    /**
     * 更新时间
     */
    @DEField(preType = DEPredefinedFieldType.UPDATEDATE)
    @TableField(value = "updatedate")
    @JsonFormat(pattern="yyyy-MM-dd HH:mm:ss", locale = "zh" , timezone="GMT+8")
    @JSONField(name = "updatedate" , format="yyyy-MM-dd HH:mm:ss")
    @JsonProperty("updatedate")
    private Timestamp updatedate;
    /**
     * 员工标识
     */
    @TableField(value = "hremployeeid")
    @JSONField(name = "hremployeeid")
    @JsonProperty("hremployeeid")
    private String hremployeeid;
    /**
     * 员工姓名
     */
    @TableField(exist = false)
    @JSONField(name = "hremployeename")
    @JsonProperty("hremployeename")
    private String hremployeename;
    /**
     * 与本人关系
     */
    @TableField(value = "relationship")
    @JSONField(name = "relationship")
    @JsonProperty("relationship")
    private String relationship;
    /**
     * 证件类型
     */
    @TableField(value = "certtype")
    @JSONField(name = "certtype")
    @JsonProperty("certtype")
    private String certtype;
    /**
     * 证件号码
     */
    @TableField(value = "certnum")
    @JSONField(name = "certnum")
    @JsonProperty("certnum")
    private String certnum;
    /**
     * 性别
     */
    @TableField(value = "sex")
    @JSONField(name = "sex")
    @JsonProperty("sex")
    private String sex;
    /**
     * 出生日期
     */
    @TableField(value = "birthday")
    @JsonFormat(pattern="yyyy-MM-dd", locale = "zh" , timezone="GMT+8")
    @JSONField(name = "birthday" , format="yyyy-MM-dd")
    @JsonProperty("birthday")
    private Timestamp birthday;
    /**
     * 年龄
     */
    @TableField(exist = false)
    @JSONField(name = "age")
    @JsonProperty("age")
    private String age;
    /**
     * 工作单位
     */
    @TableField(value = "workorganization")
    @JSONField(name = "workorganization")
    @JsonProperty("workorganization")
    private String workorganization;
    /**
     * 职务
     */
    @TableField(value = "duty")
    @JSONField(name = "duty")
    @JsonProperty("duty")
    private String duty;
    /**
     * 政治面貌
     */
    @TableField(value = "political")
    @JSONField(name = "political")
    @JsonProperty("political")
    private String political;
    /**
     * 是否紧急联系人
     */
    @TableField(value = "emergencyflag")
    @JSONField(name = "emergencyflag")
    @JsonProperty("emergencyflag")
    private Integer emergencyflag;

    /**
     * 员工
     */
    @JsonIgnore
    @JSONField(serialize = false)
    @TableField(exist = false)
    private cn.ibizlab.humanresource.core.humanresource.domain.HREmployee hremployee;



    /**
     * 设置 [姓名]
     */
    public void setHrfamilyname(String hrfamilyname){
        this.hrfamilyname = hrfamilyname ;
        this.modify("hrfamilyname",hrfamilyname);
    }

    /**
     * 设置 [员工标识]
     */
    public void setHremployeeid(String hremployeeid){
        this.hremployeeid = hremployeeid ;
        this.modify("hremployeeid",hremployeeid);
    }

    /**
     * 设置 [与本人关系]
     */
    public void setRelationship(String relationship){
        this.relationship = relationship ;
        this.modify("relationship",relationship);
    }

    /**
     * 设置 [证件类型]
     */
    public void setCerttype(String certtype){
        this.certtype = certtype ;
        this.modify("certtype",certtype);
    }

    /**
     * 设置 [证件号码]
     */
    public void setCertnum(String certnum){
        this.certnum = certnum ;
        this.modify("certnum",certnum);
    }

    /**
     * 设置 [性别]
     */
    public void setSex(String sex){
        this.sex = sex ;
        this.modify("sex",sex);
    }

    /**
     * 设置 [出生日期]
     */
    public void setBirthday(Timestamp birthday){
        this.birthday = birthday ;
        this.modify("birthday",birthday);
    }

    /**
     * 格式化日期 [出生日期]
     */
    public String formatBirthday(){
        if (this.birthday == null) {
            return null;
        }
        SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
        return sdf.format(birthday);
    }
    /**
     * 设置 [工作单位]
     */
    public void setWorkorganization(String workorganization){
        this.workorganization = workorganization ;
        this.modify("workorganization",workorganization);
    }

    /**
     * 设置 [职务]
     */
    public void setDuty(String duty){
        this.duty = duty ;
        this.modify("duty",duty);
    }

    /**
     * 设置 [政治面貌]
     */
    public void setPolitical(String political){
        this.political = political ;
        this.modify("political",political);
    }

    /**
     * 设置 [是否紧急联系人]
     */
    public void setEmergencyflag(Integer emergencyflag){
        this.emergencyflag = emergencyflag ;
        this.modify("emergencyflag",emergencyflag);
    }


}


