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

@Data
@JsonIgnoreProperties(ignoreUnknown = true)
public class QJ_MOBMDCTRL_Mob{
    private String kssj;
    private String jssj;
    private String qjts;
    private String qjwfstate;
    private String srfmajortext;
    private String qjwfstatevalue;
    private String srfkey;
    private String wfstep;
    private String wfversion;

     public  void fromQJ(QJ sourceEntity)  {
	    this.setKssj(String.format("%s",sourceEntity.getKssj()));
	    this.setJssj(String.format("%s",sourceEntity.getJssj()));
	    this.setQjts(String.format("%s",sourceEntity.getQjts()));
	    this.setQjwfstate(String.format("%s",sourceEntity.getQjwfstate()));
	    this.setSrfmajortext(String.format("%s",sourceEntity.getQjname()));
	    this.setQjwfstatevalue(String.format("%s",sourceEntity.getQjwfstate()));
	    this.setSrfkey(String.format("%s",sourceEntity.getQjid()));
	    this.setWfstep(String.format("%s",sourceEntity.getWfstep()));
	    this.setWfversion(String.format("%s",sourceEntity.getWfversion()));
	}

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

}