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.UniRes;
import com.sa.ibiz.demo.demo.domain.UserRole;

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

    @JSONField(serialize = false)
    @JsonIgnore
    @TableField(exist = false)//关系主表数据
    private UniRes unires;
    @JSONField(serialize = false)
    @JsonIgnore
    @TableField(exist = false)//关系主表数据
    private UserRole userrole;
    @PreField(fill= FillMode.INSERT,preType = PredefinedType.CREATEDATE)
    private Timestamp createdate;
    @PreField(fill= FillMode.INSERT,preType = PredefinedType.CREATEMAN)
    @Dict(dictName = "ionicdemo_SysOperatorCodeList")
    private String createman;
    @Dict(dictName = "ionicdemo_YesNoCodeList")
    private Integer isallow;
    private String reserver;
    private String reserver2;
    private String reserver3;
    private String reserver4;
    private String uniresid;
    @TableField(exist = false)//逻辑属性
    private String uniresname;
    @TableField(exist = false)//逻辑属性
    @Dict(dictName = "ionicdemo_CodeList16CodeList")
    private String unirestype;
    @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 userroleid;
    @TableField(exist = false)//逻辑属性
    private String userrolename;
    @TableId(value= "userroleresid",type=IdType.UUID)//指定主键生成策略
    private String userroleresid;
    private String userroleresname;
    /**
     *  设置属性值[建立时间]
     *  @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;
    }
    /**
     *  设置属性值[允许模式]
     *  @param isallow
     */
    public void setIsallow(Integer isallow){
        this.isallow = isallow;
        this.set("isallowdirtyflag",true);
    }
    /**
     *  获取属性值[允许模式]
     */
    public Integer getIsallow(){
        return this.isallow;
    }
    /**
     *  重置属性值[允许模式]
     */
    public void resetIsallow(){
        this.set("isallowdirtyflag",false);
        this.isallow = null;
    }
    /**
     *  设置属性值[保留字段]
     *  @param reserver
     */
    public void setReserver(String reserver){
        if(StringUtils.isEmpty(reserver))
            reserver=null;
        this.reserver = reserver;
        this.set("reserverdirtyflag",true);
    }
    /**
     *  获取属性值[保留字段]
     */
    public String getReserver(){
        return this.reserver;
    }
    /**
     *  重置属性值[保留字段]
     */
    public void resetReserver(){
        this.set("reserverdirtyflag",false);
        this.reserver = null;
    }
    /**
     *  设置属性值[保留字段2]
     *  @param reserver2
     */
    public void setReserver2(String reserver2){
        if(StringUtils.isEmpty(reserver2))
            reserver2=null;
        this.reserver2 = reserver2;
        this.set("reserver2dirtyflag",true);
    }
    /**
     *  获取属性值[保留字段2]
     */
    public String getReserver2(){
        return this.reserver2;
    }
    /**
     *  重置属性值[保留字段2]
     */
    public void resetReserver2(){
        this.set("reserver2dirtyflag",false);
        this.reserver2 = null;
    }
    /**
     *  设置属性值[保留字段3]
     *  @param reserver3
     */
    public void setReserver3(String reserver3){
        if(StringUtils.isEmpty(reserver3))
            reserver3=null;
        this.reserver3 = reserver3;
        this.set("reserver3dirtyflag",true);
    }
    /**
     *  获取属性值[保留字段3]
     */
    public String getReserver3(){
        return this.reserver3;
    }
    /**
     *  重置属性值[保留字段3]
     */
    public void resetReserver3(){
        this.set("reserver3dirtyflag",false);
        this.reserver3 = null;
    }
    /**
     *  设置属性值[保留字段4]
     *  @param reserver4
     */
    public void setReserver4(String reserver4){
        if(StringUtils.isEmpty(reserver4))
            reserver4=null;
        this.reserver4 = reserver4;
        this.set("reserver4dirtyflag",true);
    }
    /**
     *  获取属性值[保留字段4]
     */
    public String getReserver4(){
        return this.reserver4;
    }
    /**
     *  重置属性值[保留字段4]
     */
    public void resetReserver4(){
        this.set("reserver4dirtyflag",false);
        this.reserver4 = null;
    }
    /**
     *  设置属性值[统一资源]
     *  @param uniresid
     */
    public void setUniresid(String uniresid){
        if(StringUtils.isEmpty(uniresid))
            uniresid=null;
        this.uniresid = uniresid;
        this.set("uniresiddirtyflag",true);
    }
    /**
     *  获取属性值[统一资源]
     */
    public String getUniresid(){
        return this.uniresid;
    }
    /**
     *  重置属性值[统一资源]
     */
    public void resetUniresid(){
        this.set("uniresiddirtyflag",false);
        this.uniresid = null;
    }
    /**
     *  设置属性值[资源]
     *  @param uniresname
     */
    public void setUniresname(String uniresname){
        if(StringUtils.isEmpty(uniresname))
            uniresname=null;
        this.uniresname = uniresname;
        this.set("uniresnamedirtyflag",true);
    }
    /**
     *  获取属性值[资源]
     */
    public String getUniresname(){
        return this.uniresname;
    }
    /**
     *  重置属性值[资源]
     */
    public void resetUniresname(){
        this.set("uniresnamedirtyflag",false);
        this.uniresname = null;
    }
    /**
     *  设置属性值[资源类型]
     *  @param unirestype
     */
    public void setUnirestype(String unirestype){
        if(StringUtils.isEmpty(unirestype))
            unirestype=null;
        this.unirestype = unirestype;
        this.set("unirestypedirtyflag",true);
    }
    /**
     *  获取属性值[资源类型]
     */
    public String getUnirestype(){
        return this.unirestype;
    }
    /**
     *  重置属性值[资源类型]
     */
    public void resetUnirestype(){
        this.set("unirestypedirtyflag",false);
        this.unirestype = 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 userroleid
     */
    public void setUserroleid(String userroleid){
        if(StringUtils.isEmpty(userroleid))
            userroleid=null;
        this.userroleid = userroleid;
        this.set("userroleiddirtyflag",true);
    }
    /**
     *  获取属性值[用户角色]
     */
    public String getUserroleid(){
        return this.userroleid;
    }
    /**
     *  重置属性值[用户角色]
     */
    public void resetUserroleid(){
        this.set("userroleiddirtyflag",false);
        this.userroleid = null;
    }
    /**
     *  设置属性值[用户角色]
     *  @param userrolename
     */
    public void setUserrolename(String userrolename){
        if(StringUtils.isEmpty(userrolename))
            userrolename=null;
        this.userrolename = userrolename;
        this.set("userrolenamedirtyflag",true);
    }
    /**
     *  获取属性值[用户角色]
     */
    public String getUserrolename(){
        return this.userrolename;
    }
    /**
     *  重置属性值[用户角色]
     */
    public void resetUserrolename(){
        this.set("userrolenamedirtyflag",false);
        this.userrolename = null;
    }
    /**
     *  设置属性值[用户角色资源能力标识]
     *  @param userroleresid
     */
    public void setUserroleresid(String userroleresid){
        if(StringUtils.isEmpty(userroleresid))
            userroleresid=null;
        this.userroleresid = userroleresid;
        this.set("userroleresiddirtyflag",true);
    }
    /**
     *  获取属性值[用户角色资源能力标识]
     */
    public String getUserroleresid(){
        return this.userroleresid;
    }
    /**
     *  重置属性值[用户角色资源能力标识]
     */
    public void resetUserroleresid(){
        this.set("userroleresiddirtyflag",false);
        this.userroleresid = null;
    }
    /**
     *  设置属性值[用户角色资源能力名称]
     *  @param userroleresname
     */
    public void setUserroleresname(String userroleresname){
        if(StringUtils.isEmpty(userroleresname))
            userroleresname=null;
        this.userroleresname = userroleresname;
        this.set("userroleresnamedirtyflag",true);
    }
    /**
     *  获取属性值[用户角色资源能力名称]
     */
    public String getUserroleresname(){
        return this.userroleresname;
    }
    /**
     *  重置属性值[用户角色资源能力名称]
     */
    public void resetUserroleresname(){
        this.set("userroleresnamedirtyflag",false);
        this.userroleresname = null;
    }
     /**
     *  获取主实体关联数据[UniRes]
     */
    public UniRes getUnires() {
        return unires;
    }
    /**
     *  设置主实体关联数据[UniRes]
     */
    public void setUnires(UniRes unires) {
        this.unires = unires;
    }

     /**
     *  获取主实体关联数据[UserRole]
     */
    public UserRole getUserrole() {
        return userrole;
    }
    /**
     *  设置主实体关联数据[UserRole]
     */
    public void setUserrole(UserRole userrole) {
        this.userrole = userrole;
    }

    /**
     * 重置当前数据对象属性值
     */
    public  void reset(){
        resetCreatedate();
        resetCreateman();
        resetIsallow();
        resetReserver();
        resetReserver2();
        resetReserver3();
        resetReserver4();
        resetUniresid();
        resetUniresname();
        resetUnirestype();
        resetUpdatedate();
        resetUpdateman();
        resetUserroleid();
        resetUserrolename();
        resetUserroleresid();
        resetUserroleresname();
    }
     /**
     * 获取数据主键（普通主键与联合主键）
     * @return
     */
    @JsonIgnore
    public Serializable getDefaultPrimaryKey()
    {
    	//联合主键
        String primaryKey ="";
        primaryKey+=this.getUserroleid();
        primaryKey+="||";
        primaryKey+=this.getUniresid();
        return  DigestUtils.md5DigestAsHex(primaryKey.getBytes());
    }
     /**
     * 复制当前对象数据到目标对象(粘贴重置)
     *
     * @throws Exception
     */
    public UserRoleRes copyTo(UserRoleRes targetEntity)
	{
		BeanCopier copier=BeanCopier.create(UserRoleRes.class, UserRoleRes.class, false);
		copier.copy(this, targetEntity, null);
        targetEntity.resetUserroleresid();
		return targetEntity;
	}
}