package com.sa.ibiz.demo.mob.controller.demo.vo;

import java.sql.Timestamp;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.annotation.JsonProperty.Access;
import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotEmpty;
import javax.validation.constraints.NotNull;
import java.util.ArrayList;
import java.util.List;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import lombok.Data;
import com.sa.ibiz.demo.demo.domain.OrgUser;
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;

@Data
@JsonIgnoreProperties(ignoreUnknown = true)
public class OrgUser_MOBMDCTRL_Mob{
    private String reserver;
    private String orgsectorname;
    private String reserver2;
    private String orgusername;
    private String srfkey;
    private String srfmajortext;
    private String orgid;
    private String orgsectorid;
    private String orgsecusertypeid;
    private String orguserlevelid;

     public  void fromOrgUser(OrgUser sourceEntity)  {
	    this.setReserver(String.format("%s",sourceEntity.getReserver()));
	    this.setOrgsectorname(String.format("%s",sourceEntity.getOrgsectorname()));
	    this.setReserver2(String.format("%s",sourceEntity.getReserver2()));
	    this.setOrgusername(String.format("%s",sourceEntity.getOrgusername()));
	    this.setSrfkey(String.format("%s",sourceEntity.getOrguserid()));
	    this.setSrfmajortext(String.format("%s",sourceEntity.getOrgusername()));
	    this.setOrgid(String.format("%s",sourceEntity.getOrgid()));
	    this.setOrgsectorid(String.format("%s",sourceEntity.getOrgsectorid()));
	    this.setOrgsecusertypeid(String.format("%s",sourceEntity.getOrgsecusertypeid()));
	    this.setOrguserlevelid(String.format("%s",sourceEntity.getOrguserlevelid()));
	}

	public static Page<OrgUser_MOBMDCTRL_Mob> fromOrgUser(Page<OrgUser> sourcePage)   {
        if(sourcePage==null)
            return null;
        Page<OrgUser_MOBMDCTRL_Mob> targetpage=new Page<OrgUser_MOBMDCTRL_Mob>(sourcePage.getCurrent(),sourcePage.getSize(),sourcePage.getTotal(),sourcePage.isSearchCount());
        List<OrgUser_MOBMDCTRL_Mob> records=new ArrayList<OrgUser_MOBMDCTRL_Mob>();
        for(OrgUser source:sourcePage.getRecords()) {
    OrgUser_MOBMDCTRL_Mob target=new OrgUser_MOBMDCTRL_Mob();
            target.fromOrgUser(source);
            records.add(target);
        }
        targetpage.setAsc(sourcePage.ascs());
        targetpage.setDesc(sourcePage.descs());
        targetpage.setOptimizeCountSql(sourcePage.optimizeCountSql());
        targetpage.setRecords(records);
        return targetpage;
    }

}