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.HT;
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;

@Data
@JsonIgnoreProperties(ignoreUnknown = true)
public class HT_MOBMDCTRL_Mob{
    private String srfkey;
    private String srfmajortext;
    private String xmid;

     public  void fromHT(HT sourceEntity)  {
	    this.setSrfkey(String.format("%s",sourceEntity.getHtid()));
	    this.setSrfmajortext(String.format("%s",sourceEntity.getHtname()));
	    this.setXmid(String.format("%s",sourceEntity.getXmid()));
	}

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

}