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_HRARCHIVESBORROW",resultMap = "HRArchivesBorrowResultMap")
public class HRArchivesBorrow extends EntityMP implements Serializable {

    private static final long serialVersionUID = 1L;

    /**
     * 建立人
     */
    @DEField(preType = DEPredefinedFieldType.CREATEMAN)
    @TableField(value = "createman" , fill = FieldFill.INSERT)
    @JSONField(name = "createman")
    @JsonProperty("createman")
    private String createman;
    /**
     * 建立时间
     */
    @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;
    /**
     * 档案借阅标识
     */
    @DEField(isKeyField=true)
    @TableId(value= "hrarchivesborrowid",type=IdType.ASSIGN_UUID)
    @JSONField(name = "hrarchivesborrowid")
    @JsonProperty("hrarchivesborrowid")
    private String hrarchivesborrowid;
    /**
     * 档案借阅名称
     */
    @TableField(value = "hrarchivesborrowname")
    @JSONField(name = "hrarchivesborrowname")
    @JsonProperty("hrarchivesborrowname")
    private String hrarchivesborrowname;
    /**
     * 更新时间
     */
    @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;
    /**
     * 更新人
     */
    @DEField(preType = DEPredefinedFieldType.UPDATEMAN)
    @TableField(value = "updateman")
    @JSONField(name = "updateman")
    @JsonProperty("updateman")
    private String updateman;
    /**
     * 档案信息标识
     */
    @TableField(value = "hrarchivesid")
    @JSONField(name = "hrarchivesid")
    @JsonProperty("hrarchivesid")
    private String hrarchivesid;
    /**
     * 借阅状态
     */
    @TableField(value = "borrowstate")
    @JSONField(name = "borrowstate")
    @JsonProperty("borrowstate")
    private String borrowstate;
    /**
     * 借阅人
     */
    @TableField(value = "borrowman")
    @JSONField(name = "borrowman")
    @JsonProperty("borrowman")
    private String borrowman;
    /**
     * 借阅时间
     */
    @TableField(value = "begintime")
    @JsonFormat(pattern="yyyy-MM-dd", locale = "zh" , timezone="GMT+8")
    @JSONField(name = "begintime" , format="yyyy-MM-dd")
    @JsonProperty("begintime")
    private Timestamp begintime;
    /**
     * 归还时间
     */
    @TableField(value = "endtime")
    @JsonFormat(pattern="yyyy-MM-dd", locale = "zh" , timezone="GMT+8")
    @JSONField(name = "endtime" , format="yyyy-MM-dd")
    @JsonProperty("endtime")
    private Timestamp endtime;
    /**
     * 审批同意人
     */
    @TableField(value = "checkman")
    @JSONField(name = "checkman")
    @JsonProperty("checkman")
    private String checkman;
    /**
     * 审批时间
     */
    @TableField(value = "checktime")
    @JsonFormat(pattern="yyyy-MM-dd", locale = "zh" , timezone="GMT+8")
    @JSONField(name = "checktime" , format="yyyy-MM-dd")
    @JsonProperty("checktime")
    private Timestamp checktime;
    /**
     * 借阅原因
     */
    @TableField(value = "borrowreason")
    @JSONField(name = "borrowreason")
    @JsonProperty("borrowreason")
    private String borrowreason;

    /**
     * 员工档案
     */
    @JsonIgnore
    @JSONField(serialize = false)
    @TableField(exist = false)
    private cn.ibizlab.humanresource.core.humanresource.domain.HRArchives hrarchives;



    /**
     * 设置 [档案借阅名称]
     */
    public void setHrarchivesborrowname(String hrarchivesborrowname){
        this.hrarchivesborrowname = hrarchivesborrowname ;
        this.modify("hrarchivesborrowname",hrarchivesborrowname);
    }

    /**
     * 设置 [档案信息标识]
     */
    public void setHrarchivesid(String hrarchivesid){
        this.hrarchivesid = hrarchivesid ;
        this.modify("hrarchivesid",hrarchivesid);
    }

    /**
     * 设置 [借阅状态]
     */
    public void setBorrowstate(String borrowstate){
        this.borrowstate = borrowstate ;
        this.modify("borrowstate",borrowstate);
    }

    /**
     * 设置 [借阅人]
     */
    public void setBorrowman(String borrowman){
        this.borrowman = borrowman ;
        this.modify("borrowman",borrowman);
    }

    /**
     * 设置 [借阅时间]
     */
    public void setBegintime(Timestamp begintime){
        this.begintime = begintime ;
        this.modify("begintime",begintime);
    }

    /**
     * 格式化日期 [借阅时间]
     */
    public String formatBegintime(){
        if (this.begintime == null) {
            return null;
        }
        SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
        return sdf.format(begintime);
    }
    /**
     * 设置 [归还时间]
     */
    public void setEndtime(Timestamp endtime){
        this.endtime = endtime ;
        this.modify("endtime",endtime);
    }

    /**
     * 格式化日期 [归还时间]
     */
    public String formatEndtime(){
        if (this.endtime == null) {
            return null;
        }
        SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
        return sdf.format(endtime);
    }
    /**
     * 设置 [审批同意人]
     */
    public void setCheckman(String checkman){
        this.checkman = checkman ;
        this.modify("checkman",checkman);
    }

    /**
     * 设置 [审批时间]
     */
    public void setChecktime(Timestamp checktime){
        this.checktime = checktime ;
        this.modify("checktime",checktime);
    }

    /**
     * 格式化日期 [审批时间]
     */
    public String formatChecktime(){
        if (this.checktime == null) {
            return null;
        }
        SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
        return sdf.format(checktime);
    }
    /**
     * 设置 [借阅原因]
     */
    public void setBorrowreason(String borrowreason){
        this.borrowreason = borrowreason ;
        this.modify("borrowreason",borrowreason);
    }


}


