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.userrole.*;
import cn.ibizlab.r7.runtime.core.r7rt_base.domain.UserRole;
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对象[UserRoleDTO]
 */
public class UserRoleDTO implements Serializable {

	private static final long serialVersionUID = 1L;

    /**
     * 属性 [MEMO]
     *
     */
    @UserRoleMemoDefault(info = "默认规则")
    private String memo;

    @JsonIgnore
    private boolean memoDirtyFlag;

    /**
     * 属性 [USERROLEID]
     *
     */
    @UserRoleUserRoleIdDefault(info = "默认规则")
    private String userRoleId;

    @JsonIgnore
    private boolean userRoleIdDirtyFlag;

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

    @JsonIgnore
    private boolean updateManDirtyFlag;

    /**
     * 属性 [DATASOURCETYPE]
     *
     */
    @UserRoleDataSourceTypeDefault(info = "默认规则")
    private String dataSourceType;

    @JsonIgnore
    private boolean dataSourceTypeDirtyFlag;

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

    @JsonIgnore
    private boolean createManDirtyFlag;

    /**
     * 属性 [USERROLENAME]
     *
     */
    @UserRoleUserRoleNameDefault(info = "默认规则")
    private String userRoleName;

    @JsonIgnore
    private boolean userRoleNameDirtyFlag;

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

    @JsonIgnore
    private boolean createDateDirtyFlag;

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

    @JsonIgnore
    private boolean updateDateDirtyFlag;

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

    @JsonIgnore
    private boolean enableDirtyFlag;

    /**
     * 属性 [USERROLETYPE]
     *
     */
    @UserRoleUserRoleTypeDefault(info = "默认规则")
    private String userRoleType;

    @JsonIgnore
    private boolean userRoleTypeDirtyFlag;

    /**
     * 属性 [SYSTEMNAME]
     *
     */
    @UserRoleSystemNameDefault(info = "默认规则")
    private String systemName;

    @JsonIgnore
    private boolean systemNameDirtyFlag;

    /**
     * 属性 [SYSTEMID]
     *
     */
    @UserRoleSystemIdDefault(info = "默认规则")
    private String systemId;

    @JsonIgnore
    private boolean systemIdDirtyFlag;


    /**
     * 获取 [MEMO]
     */
    @JsonProperty("memo")
    public String getMemo(){
        return memo ;
    }

    /**
     * 设置 [MEMO]
     */
    @JsonProperty("memo")
    public void setMemo(String  memo){
        this.memo = memo ;
        this.memoDirtyFlag = true ;
    }

    /**
     * 获取 [MEMO]脏标记
     */
    @JsonIgnore
    public boolean getMemoDirtyFlag(){
        return memoDirtyFlag ;
    }

    /**
     * 获取 [USERROLEID]
     */
    @JsonProperty("userroleid")
    public String getUserRoleId(){
        return userRoleId ;
    }

    /**
     * 设置 [USERROLEID]
     */
    @JsonProperty("userroleid")
    public void setUserRoleId(String  userRoleId){
        this.userRoleId = userRoleId ;
        this.userRoleIdDirtyFlag = true ;
    }

    /**
     * 获取 [USERROLEID]脏标记
     */
    @JsonIgnore
    public boolean getUserRoleIdDirtyFlag(){
        return userRoleIdDirtyFlag ;
    }

    /**
     * 获取 [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 ;
    }

    /**
     * 获取 [DATASOURCETYPE]
     */
    @JsonProperty("datasourcetype")
    public String getDataSourceType(){
        return dataSourceType ;
    }

    /**
     * 设置 [DATASOURCETYPE]
     */
    @JsonProperty("datasourcetype")
    public void setDataSourceType(String  dataSourceType){
        this.dataSourceType = dataSourceType ;
        this.dataSourceTypeDirtyFlag = true ;
    }

    /**
     * 获取 [DATASOURCETYPE]脏标记
     */
    @JsonIgnore
    public boolean getDataSourceTypeDirtyFlag(){
        return dataSourceTypeDirtyFlag ;
    }

    /**
     * 获取 [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 ;
    }

    /**
     * 获取 [USERROLENAME]
     */
    @JsonProperty("userrolename")
    public String getUserRoleName(){
        return userRoleName ;
    }

    /**
     * 设置 [USERROLENAME]
     */
    @JsonProperty("userrolename")
    public void setUserRoleName(String  userRoleName){
        this.userRoleName = userRoleName ;
        this.userRoleNameDirtyFlag = true ;
    }

    /**
     * 获取 [USERROLENAME]脏标记
     */
    @JsonIgnore
    public boolean getUserRoleNameDirtyFlag(){
        return userRoleNameDirtyFlag ;
    }

    /**
     * 获取 [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 ;
    }

    /**
     * 获取 [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 ;
    }

    /**
     * 获取 [USERROLETYPE]
     */
    @JsonProperty("userroletype")
    public String getUserRoleType(){
        return userRoleType ;
    }

    /**
     * 设置 [USERROLETYPE]
     */
    @JsonProperty("userroletype")
    public void setUserRoleType(String  userRoleType){
        this.userRoleType = userRoleType ;
        this.userRoleTypeDirtyFlag = true ;
    }

    /**
     * 获取 [USERROLETYPE]脏标记
     */
    @JsonIgnore
    public boolean getUserRoleTypeDirtyFlag(){
        return userRoleTypeDirtyFlag ;
    }

    /**
     * 获取 [SYSTEMNAME]
     */
    @JsonProperty("systemname")
    public String getSystemName(){
        return systemName ;
    }

    /**
     * 设置 [SYSTEMNAME]
     */
    @JsonProperty("systemname")
    public void setSystemName(String  systemName){
        this.systemName = systemName ;
        this.systemNameDirtyFlag = true ;
    }

    /**
     * 获取 [SYSTEMNAME]脏标记
     */
    @JsonIgnore
    public boolean getSystemNameDirtyFlag(){
        return systemNameDirtyFlag ;
    }

    /**
     * 获取 [SYSTEMID]
     */
    @JsonProperty("systemid")
    public String getSystemId(){
        return systemId ;
    }

    /**
     * 设置 [SYSTEMID]
     */
    @JsonProperty("systemid")
    public void setSystemId(String  systemId){
        this.systemId = systemId ;
        this.systemIdDirtyFlag = true ;
    }

    /**
     * 获取 [SYSTEMID]脏标记
     */
    @JsonIgnore
    public boolean getSystemIdDirtyFlag(){
        return systemIdDirtyFlag ;
    }



    public UserRole toDO() {
        UserRole srfdomain = new UserRole();
        if(getMemoDirtyFlag())
            srfdomain.setMemo(memo);
        if(getUserRoleIdDirtyFlag())
            srfdomain.setUserRoleId(userRoleId);
        if(getUpdateManDirtyFlag())
            srfdomain.setUpdateMan(updateMan);
        if(getDataSourceTypeDirtyFlag())
            srfdomain.setDataSourceType(dataSourceType);
        if(getCreateManDirtyFlag())
            srfdomain.setCreateMan(createMan);
        if(getUserRoleNameDirtyFlag())
            srfdomain.setUserRoleName(userRoleName);
        if(getCreateDateDirtyFlag())
            srfdomain.setCreateDate(createDate);
        if(getUpdateDateDirtyFlag())
            srfdomain.setUpdateDate(updateDate);
        if(getEnableDirtyFlag())
            srfdomain.setEnable(enable);
        if(getUserRoleTypeDirtyFlag())
            srfdomain.setUserRoleType(userRoleType);
        if(getSystemNameDirtyFlag())
            srfdomain.setSystemName(systemName);
        if(getSystemIdDirtyFlag())
            srfdomain.setSystemId(systemId);

        return srfdomain;
    }

    public void fromDO(UserRole srfdomain) {
        if(srfdomain == null )
          return ;
        if(srfdomain.getMemoDirtyFlag())
            this.setMemo(srfdomain.getMemo());
        if(srfdomain.getUserRoleIdDirtyFlag())
            this.setUserRoleId(srfdomain.getUserRoleId());
        if(srfdomain.getUpdateManDirtyFlag())
            this.setUpdateMan(srfdomain.getUpdateMan());
        if(srfdomain.getDataSourceTypeDirtyFlag())
            this.setDataSourceType(srfdomain.getDataSourceType());
        if(srfdomain.getCreateManDirtyFlag())
            this.setCreateMan(srfdomain.getCreateMan());
        if(srfdomain.getUserRoleNameDirtyFlag())
            this.setUserRoleName(srfdomain.getUserRoleName());
        if(srfdomain.getCreateDateDirtyFlag())
            this.setCreateDate(srfdomain.getCreateDate());
        if(srfdomain.getUpdateDateDirtyFlag())
            this.setUpdateDate(srfdomain.getUpdateDate());
        if(srfdomain.getEnableDirtyFlag())
            this.setEnable(srfdomain.getEnable());
        if(srfdomain.getUserRoleTypeDirtyFlag())
            this.setUserRoleType(srfdomain.getUserRoleType());
        if(srfdomain.getSystemNameDirtyFlag())
            this.setSystemName(srfdomain.getSystemName());
        if(srfdomain.getSystemIdDirtyFlag())
            this.setSystemId(srfdomain.getSystemId());

    }

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

