package com.sa.ibiz.demo.demo.domain;

import java.sql.Timestamp;
import java.util.ArrayList;
import java.util.List;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonIgnore;
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.annotation.JsonProperty.Access;
import lombok.Data;
import org.springframework.beans.BeanUtils;
import org.springframework.cglib.beans.BeanMap;
import org.springframework.cglib.beans.BeanGenerator;
import com.baomidou.mybatisplus.annotation.TableLogic;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.FieldFill;
import java.util.Map;
import java.util.HashMap;
import org.springframework.util.StringUtils;
import com.sa.ibiz.demo.ibizutil.security.AuthenticationUser;
import java.util.Date;
import javax.validation.constraints.NotBlank;
import javax.validation.constraints.Size;
import org.springframework.util.DigestUtils;
import org.springframework.util.StringUtils;
import java.util.UUID;
import javax.validation.constraints.NotNull;
import java.io.Serializable;
import org.springframework.cglib.beans.BeanCopier;
import com.sa.ibiz.demo.ibizutil.annotation.Dict;
import com.sa.ibiz.demo.ibizutil.domain.EntityBase;
import java.io.Serializable;
import com.baomidou.mybatisplus.core.toolkit.IdWorker;
import java.math.BigInteger;
import com.sa.ibiz.demo.ibizutil.enums.FillMode;
import com.sa.ibiz.demo.ibizutil.enums.PredefinedType;
import com.sa.ibiz.demo.ibizutil.annotation.PreField;
import com.alibaba.fastjson.annotation.JSONField;

import com.sa.ibiz.demo.demo.domain.LoginAccount;

/**
 * 实体[LoginLog] 数据对象
 */
@TableName(value = "T_SRFLOGINLOG",resultMap = "LoginLogResultMap")
@JsonIgnoreProperties(ignoreUnknown = true)
@Data
public class LoginLog extends EntityBase implements Serializable{

    @JSONField(serialize = false)
    @JsonIgnore
    @TableField(exist = false)//关系主表数据
    private LoginAccount loginaccount;
    @PreField(fill= FillMode.INSERT,preType = PredefinedType.CREATEDATE)
    private Timestamp createdate;
    @PreField(fill= FillMode.INSERT,preType = PredefinedType.CREATEMAN)
    @Dict(dictName = "ionicdemo_SysOperatorCodeList")
    private String createman;
    private String ipaddress;
    private String loginaccountid;
    private String loginaccountname;
    @TableId(value= "loginlogid",type=IdType.UUID)//指定主键生成策略
    private String loginlogid;
    private String loginlogname;
    private Timestamp logintime;
    private Timestamp logouttime;
    private String serveraddr;
    @PreField(fill= FillMode.INSERT_UPDATE,preType = PredefinedType.UPDATEDATE)
    private Timestamp updatedate;
    @PreField(fill= FillMode.INSERT_UPDATE,preType = PredefinedType.UPDATEMAN)
    @Dict(dictName = "ionicdemo_SysOperatorCodeList")
    private String updateman;
    private String useragent;
    /**
     *  设置属性值[建立时间]
     *  @param createdate
     */
    public void setCreatedate(Timestamp createdate){
        this.createdate = createdate;
        this.set("createdatedirtyflag",true);
    }
    /**
     *  获取属性值[建立时间]
     */
    public Timestamp getCreatedate(){
        return this.createdate;
    }
    /**
     *  重置属性值[建立时间]
     */
    public void resetCreatedate(){
        this.set("createdatedirtyflag",false);
        this.createdate = null;
    }
    /**
     *  设置属性值[建立人]
     *  @param createman
     */
    public void setCreateman(String createman){
        if(StringUtils.isEmpty(createman))
            createman=null;
        this.createman = createman;
        this.set("createmandirtyflag",true);
    }
    /**
     *  获取属性值[建立人]
     */
    public String getCreateman(){
        return this.createman;
    }
    /**
     *  重置属性值[建立人]
     */
    public void resetCreateman(){
        this.set("createmandirtyflag",false);
        this.createman = null;
    }
    /**
     *  设置属性值[IP地址]
     *  @param ipaddress
     */
    public void setIpaddress(String ipaddress){
        if(StringUtils.isEmpty(ipaddress))
            ipaddress=null;
        this.ipaddress = ipaddress;
        this.set("ipaddressdirtyflag",true);
    }
    /**
     *  获取属性值[IP地址]
     */
    public String getIpaddress(){
        return this.ipaddress;
    }
    /**
     *  重置属性值[IP地址]
     */
    public void resetIpaddress(){
        this.set("ipaddressdirtyflag",false);
        this.ipaddress = null;
    }
    /**
     *  设置属性值[登录帐户]
     *  @param loginaccountid
     */
    public void setLoginaccountid(String loginaccountid){
        if(StringUtils.isEmpty(loginaccountid))
            loginaccountid=null;
        this.loginaccountid = loginaccountid;
        this.set("loginaccountiddirtyflag",true);
    }
    /**
     *  获取属性值[登录帐户]
     */
    public String getLoginaccountid(){
        return this.loginaccountid;
    }
    /**
     *  重置属性值[登录帐户]
     */
    public void resetLoginaccountid(){
        this.set("loginaccountiddirtyflag",false);
        this.loginaccountid = null;
    }
    /**
     *  设置属性值[登录帐户]
     *  @param loginaccountname
     */
    public void setLoginaccountname(String loginaccountname){
        if(StringUtils.isEmpty(loginaccountname))
            loginaccountname=null;
        this.loginaccountname = loginaccountname;
        this.set("loginaccountnamedirtyflag",true);
    }
    /**
     *  获取属性值[登录帐户]
     */
    public String getLoginaccountname(){
        //填充物理化的外键值附加数据
        if(StringUtils.isEmpty(this.loginaccountname)&&(!StringUtils.isEmpty(this.getLoginaccountid())) && this.getLoginaccount()!=null)
        {
            this.loginaccountname = this.getLoginaccount().getLoginaccountname();
            this.set("loginaccountnamedirtyflag",true);
        }
        return this.loginaccountname;
    }
    /**
     *  重置属性值[登录帐户]
     */
    public void resetLoginaccountname(){
        this.set("loginaccountnamedirtyflag",false);
        this.loginaccountname = null;
    }
    /**
     *  设置属性值[帐户使用记录标识]
     *  @param loginlogid
     */
    public void setLoginlogid(String loginlogid){
        if(StringUtils.isEmpty(loginlogid))
            loginlogid=null;
        this.loginlogid = loginlogid;
        this.set("loginlogiddirtyflag",true);
    }
    /**
     *  获取属性值[帐户使用记录标识]
     */
    public String getLoginlogid(){
        return this.loginlogid;
    }
    /**
     *  重置属性值[帐户使用记录标识]
     */
    public void resetLoginlogid(){
        this.set("loginlogiddirtyflag",false);
        this.loginlogid = null;
    }
    /**
     *  设置属性值[帐户使用记录名称]
     *  @param loginlogname
     */
    public void setLoginlogname(String loginlogname){
        if(StringUtils.isEmpty(loginlogname))
            loginlogname=null;
        this.loginlogname = loginlogname;
        this.set("loginlognamedirtyflag",true);
    }
    /**
     *  获取属性值[帐户使用记录名称]
     */
    public String getLoginlogname(){
        return this.loginlogname;
    }
    /**
     *  重置属性值[帐户使用记录名称]
     */
    public void resetLoginlogname(){
        this.set("loginlognamedirtyflag",false);
        this.loginlogname = null;
    }
    /**
     *  设置属性值[登录时间]
     *  @param logintime
     */
    public void setLogintime(Timestamp logintime){
        this.logintime = logintime;
        this.set("logintimedirtyflag",true);
    }
    /**
     *  获取属性值[登录时间]
     */
    public Timestamp getLogintime(){
        return this.logintime;
    }
    /**
     *  重置属性值[登录时间]
     */
    public void resetLogintime(){
        this.set("logintimedirtyflag",false);
        this.logintime = null;
    }
    /**
     *  设置属性值[注销时间]
     *  @param logouttime
     */
    public void setLogouttime(Timestamp logouttime){
        this.logouttime = logouttime;
        this.set("logouttimedirtyflag",true);
    }
    /**
     *  获取属性值[注销时间]
     */
    public Timestamp getLogouttime(){
        return this.logouttime;
    }
    /**
     *  重置属性值[注销时间]
     */
    public void resetLogouttime(){
        this.set("logouttimedirtyflag",false);
        this.logouttime = null;
    }
    /**
     *  设置属性值[服务器地址]
     *  @param serveraddr
     */
    public void setServeraddr(String serveraddr){
        if(StringUtils.isEmpty(serveraddr))
            serveraddr=null;
        this.serveraddr = serveraddr;
        this.set("serveraddrdirtyflag",true);
    }
    /**
     *  获取属性值[服务器地址]
     */
    public String getServeraddr(){
        return this.serveraddr;
    }
    /**
     *  重置属性值[服务器地址]
     */
    public void resetServeraddr(){
        this.set("serveraddrdirtyflag",false);
        this.serveraddr = null;
    }
    /**
     *  设置属性值[更新时间]
     *  @param updatedate
     */
    public void setUpdatedate(Timestamp updatedate){
        this.updatedate = updatedate;
        this.set("updatedatedirtyflag",true);
    }
    /**
     *  获取属性值[更新时间]
     */
    public Timestamp getUpdatedate(){
        return this.updatedate;
    }
    /**
     *  重置属性值[更新时间]
     */
    public void resetUpdatedate(){
        this.set("updatedatedirtyflag",false);
        this.updatedate = null;
    }
    /**
     *  设置属性值[更新人]
     *  @param updateman
     */
    public void setUpdateman(String updateman){
        if(StringUtils.isEmpty(updateman))
            updateman=null;
        this.updateman = updateman;
        this.set("updatemandirtyflag",true);
    }
    /**
     *  获取属性值[更新人]
     */
    public String getUpdateman(){
        return this.updateman;
    }
    /**
     *  重置属性值[更新人]
     */
    public void resetUpdateman(){
        this.set("updatemandirtyflag",false);
        this.updateman = null;
    }
    /**
     *  设置属性值[客户端标识]
     *  @param useragent
     */
    public void setUseragent(String useragent){
        if(StringUtils.isEmpty(useragent))
            useragent=null;
        this.useragent = useragent;
        this.set("useragentdirtyflag",true);
    }
    /**
     *  获取属性值[客户端标识]
     */
    public String getUseragent(){
        return this.useragent;
    }
    /**
     *  重置属性值[客户端标识]
     */
    public void resetUseragent(){
        this.set("useragentdirtyflag",false);
        this.useragent = null;
    }
     /**
     *  获取主实体关联数据[LoginAccount]
     */
    public LoginAccount getLoginaccount() {
        return loginaccount;
    }
    /**
     *  设置主实体关联数据[LoginAccount]
     */
    public void setLoginaccount(LoginAccount loginaccount) {
        this.loginaccount = loginaccount;
    }

    /**
     * 重置当前数据对象属性值
     */
    public  void reset(){
        resetCreatedate();
        resetCreateman();
        resetIpaddress();
        resetLoginaccountid();
        resetLoginaccountname();
        resetLoginlogid();
        resetLoginlogname();
        resetLogintime();
        resetLogouttime();
        resetServeraddr();
        resetUpdatedate();
        resetUpdateman();
        resetUseragent();
    }
     /**
     * 获取数据主键（普通主键与联合主键）
     * @return
     */
    @JsonIgnore
    public Serializable getDefaultPrimaryKey()
    {
	    //随机生成主键
         return  IdWorker.get32UUID();

    }
     /**
     * 复制当前对象数据到目标对象(粘贴重置)
     *
     * @throws Exception
     */
    public LoginLog copyTo(LoginLog targetEntity)
	{
		BeanCopier copier=BeanCopier.create(LoginLog.class, LoginLog.class, false);
		copier.copy(this, targetEntity, null);
        targetEntity.resetLoginlogid();
		return targetEntity;
	}
}