package cn.ibizlab.r7.runtime.service.runtimemgr.dto;

import java.sql.Timestamp;
import java.util.ArrayList;
import java.util.List;
import java.math.BigInteger;
import java.util.Map;
import java.util.HashMap;
import java.io.Serializable;
import java.math.BigDecimal;
import cn.ibizlab.r7.runtime.core.r7rt_base.valuerule.anno.userroledatascope.*;
import cn.ibizlab.r7.runtime.core.r7rt_base.domain.UserRoleDataScope;
import org.springframework.cglib.beans.BeanCopier;

import com.fasterxml.jackson.annotation.JsonAutoDetect;
import com.fasterxml.jackson.annotation.JsonIgnore;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.annotation.JsonFormat;

/**
 * 服务DTO对象[UserRoleDataScopeDTO]
 */
public class UserRoleDataScopeDTO implements Serializable {

	private static final long serialVersionUID = 1L;

    /**
     * 属性 [USERROLEDATASCOPEID]
     *
     */
    @UserRoleDataScopeUserRoleDataScopeIdDefault(info = "默认规则")
    private String userRoleDataScopeId;

    @JsonIgnore
    private boolean userRoleDataScopeIdDirtyFlag;

    /**
     * 属性 [USERROLEDATASCOPENAME]
     *
     */
    @UserRoleDataScopeUserRoleDataScopeNameDefault(info = "默认规则")
    private String userRoleDataScopeName;

    @JsonIgnore
    private boolean userRoleDataScopeNameDirtyFlag;

    /**
     * 属性 [CREATEDATE]
     *
     */
    @UserRoleDataScopeCreateDateDefault(info = "默认规则")
    @JsonFormat(pattern="yyyy-MM-dd HH:mm:ss", locale = "zh" , timezone="GMT+8")
    private Timestamp createDate;

    @JsonIgnore
    private boolean createDateDirtyFlag;

    /**
     * 属性 [UPDATEDATE]
     *
     */
    @UserRoleDataScopeUpdateDateDefault(info = "默认规则")
    @JsonFormat(pattern="yyyy-MM-dd HH:mm:ss", locale = "zh" , timezone="GMT+8")
    private Timestamp updateDate;

    @JsonIgnore
    private boolean updateDateDirtyFlag;

    /**
     * 属性 [UPDATEMAN]
     *
     */
    @UserRoleDataScopeUpdateManDefault(info = "默认规则")
    private String updateMan;

    @JsonIgnore
    private boolean updateManDirtyFlag;

    /**
     * 属性 [CREATEMAN]
     *
     */
    @UserRoleDataScopeCreateManDefault(info = "默认规则")
    private String createMan;

    @JsonIgnore
    private boolean createManDirtyFlag;

    /**
     * 属性 [ENABLE]
     *
     */
    @UserRoleDataScopeEnableDefault(info = "默认规则")
    private Integer enable;

    @JsonIgnore
    private boolean enableDirtyFlag;

    /**
     * 属性 [USERROLEDATAID]
     *
     */
    @UserRoleDataScopeUserRoleDataIdDefault(info = "默认规则")
    private String userRoleDataId;

    @JsonIgnore
    private boolean userRoleDataIdDirtyFlag;


    /**
     * 获取 [USERROLEDATASCOPEID]
     */
    @JsonProperty("userroledatascopeid")
    public String getUserRoleDataScopeId(){
        return userRoleDataScopeId ;
    }

    /**
     * 设置 [USERROLEDATASCOPEID]
     */
    @JsonProperty("userroledatascopeid")
    public void setUserRoleDataScopeId(String  userRoleDataScopeId){
        this.userRoleDataScopeId = userRoleDataScopeId ;
        this.userRoleDataScopeIdDirtyFlag = true ;
    }

    /**
     * 获取 [USERROLEDATASCOPEID]脏标记
     */
    @JsonIgnore
    public boolean getUserRoleDataScopeIdDirtyFlag(){
        return userRoleDataScopeIdDirtyFlag ;
    }

    /**
     * 获取 [USERROLEDATASCOPENAME]
     */
    @JsonProperty("userroledatascopename")
    public String getUserRoleDataScopeName(){
        return userRoleDataScopeName ;
    }

    /**
     * 设置 [USERROLEDATASCOPENAME]
     */
    @JsonProperty("userroledatascopename")
    public void setUserRoleDataScopeName(String  userRoleDataScopeName){
        this.userRoleDataScopeName = userRoleDataScopeName ;
        this.userRoleDataScopeNameDirtyFlag = true ;
    }

    /**
     * 获取 [USERROLEDATASCOPENAME]脏标记
     */
    @JsonIgnore
    public boolean getUserRoleDataScopeNameDirtyFlag(){
        return userRoleDataScopeNameDirtyFlag ;
    }

    /**
     * 获取 [CREATEDATE]
     */
    @JsonProperty("createdate")
    public Timestamp getCreateDate(){
        return createDate ;
    }

    /**
     * 设置 [CREATEDATE]
     */
    @JsonProperty("createdate")
    public void setCreateDate(Timestamp  createDate){
        this.createDate = createDate ;
        this.createDateDirtyFlag = true ;
    }

    /**
     * 获取 [CREATEDATE]脏标记
     */
    @JsonIgnore
    public boolean getCreateDateDirtyFlag(){
        return createDateDirtyFlag ;
    }

    /**
     * 获取 [UPDATEDATE]
     */
    @JsonProperty("updatedate")
    public Timestamp getUpdateDate(){
        return updateDate ;
    }

    /**
     * 设置 [UPDATEDATE]
     */
    @JsonProperty("updatedate")
    public void setUpdateDate(Timestamp  updateDate){
        this.updateDate = updateDate ;
        this.updateDateDirtyFlag = true ;
    }

    /**
     * 获取 [UPDATEDATE]脏标记
     */
    @JsonIgnore
    public boolean getUpdateDateDirtyFlag(){
        return updateDateDirtyFlag ;
    }

    /**
     * 获取 [UPDATEMAN]
     */
    @JsonProperty("updateman")
    public String getUpdateMan(){
        return updateMan ;
    }

    /**
     * 设置 [UPDATEMAN]
     */
    @JsonProperty("updateman")
    public void setUpdateMan(String  updateMan){
        this.updateMan = updateMan ;
        this.updateManDirtyFlag = true ;
    }

    /**
     * 获取 [UPDATEMAN]脏标记
     */
    @JsonIgnore
    public boolean getUpdateManDirtyFlag(){
        return updateManDirtyFlag ;
    }

    /**
     * 获取 [CREATEMAN]
     */
    @JsonProperty("createman")
    public String getCreateMan(){
        return createMan ;
    }

    /**
     * 设置 [CREATEMAN]
     */
    @JsonProperty("createman")
    public void setCreateMan(String  createMan){
        this.createMan = createMan ;
        this.createManDirtyFlag = true ;
    }

    /**
     * 获取 [CREATEMAN]脏标记
     */
    @JsonIgnore
    public boolean getCreateManDirtyFlag(){
        return createManDirtyFlag ;
    }

    /**
     * 获取 [ENABLE]
     */
    @JsonProperty("enable")
    public Integer getEnable(){
        return enable ;
    }

    /**
     * 设置 [ENABLE]
     */
    @JsonProperty("enable")
    public void setEnable(Integer  enable){
        this.enable = enable ;
        this.enableDirtyFlag = true ;
    }

    /**
     * 获取 [ENABLE]脏标记
     */
    @JsonIgnore
    public boolean getEnableDirtyFlag(){
        return enableDirtyFlag ;
    }

    /**
     * 获取 [USERROLEDATAID]
     */
    @JsonProperty("userroledataid")
    public String getUserRoleDataId(){
        return userRoleDataId ;
    }

    /**
     * 设置 [USERROLEDATAID]
     */
    @JsonProperty("userroledataid")
    public void setUserRoleDataId(String  userRoleDataId){
        this.userRoleDataId = userRoleDataId ;
        this.userRoleDataIdDirtyFlag = true ;
    }

    /**
     * 获取 [USERROLEDATAID]脏标记
     */
    @JsonIgnore
    public boolean getUserRoleDataIdDirtyFlag(){
        return userRoleDataIdDirtyFlag ;
    }



    public UserRoleDataScope toDO() {
        UserRoleDataScope srfdomain = new UserRoleDataScope();
        if(getUserRoleDataScopeIdDirtyFlag())
            srfdomain.setUserRoleDataScopeId(userRoleDataScopeId);
        if(getUserRoleDataScopeNameDirtyFlag())
            srfdomain.setUserRoleDataScopeName(userRoleDataScopeName);
        if(getCreateDateDirtyFlag())
            srfdomain.setCreateDate(createDate);
        if(getUpdateDateDirtyFlag())
            srfdomain.setUpdateDate(updateDate);
        if(getUpdateManDirtyFlag())
            srfdomain.setUpdateMan(updateMan);
        if(getCreateManDirtyFlag())
            srfdomain.setCreateMan(createMan);
        if(getEnableDirtyFlag())
            srfdomain.setEnable(enable);
        if(getUserRoleDataIdDirtyFlag())
            srfdomain.setUserRoleDataId(userRoleDataId);

        return srfdomain;
    }

    public void fromDO(UserRoleDataScope srfdomain) {
        if(srfdomain == null )
          return ;
        if(srfdomain.getUserRoleDataScopeIdDirtyFlag())
            this.setUserRoleDataScopeId(srfdomain.getUserRoleDataScopeId());
        if(srfdomain.getUserRoleDataScopeNameDirtyFlag())
            this.setUserRoleDataScopeName(srfdomain.getUserRoleDataScopeName());
        if(srfdomain.getCreateDateDirtyFlag())
            this.setCreateDate(srfdomain.getCreateDate());
        if(srfdomain.getUpdateDateDirtyFlag())
            this.setUpdateDate(srfdomain.getUpdateDate());
        if(srfdomain.getUpdateManDirtyFlag())
            this.setUpdateMan(srfdomain.getUpdateMan());
        if(srfdomain.getCreateManDirtyFlag())
            this.setCreateMan(srfdomain.getCreateMan());
        if(srfdomain.getEnableDirtyFlag())
            this.setEnable(srfdomain.getEnable());
        if(srfdomain.getUserRoleDataIdDirtyFlag())
            this.setUserRoleDataId(srfdomain.getUserRoleDataId());

    }

    public List<UserRoleDataScopeDTO> fromDOPage(List<UserRoleDataScope> poPage)   {
        if(poPage == null)
            return null;
        List<UserRoleDataScopeDTO> dtos=new ArrayList<UserRoleDataScopeDTO>();
        for(UserRoleDataScope domain : poPage) {
            UserRoleDataScopeDTO dto = new UserRoleDataScopeDTO();
            dto.fromDO(domain);
            dtos.add(dto);
        }
        return dtos;
    }
}

