package com.sa.ibiz.demo.demoapp.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 lombok.Data;
import com.sa.ibiz.demo.demo.service.dto.UserObjectSearchFilter;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import org.springframework.util.StringUtils;
import java.util.Map;

@Data
@JsonIgnoreProperties(ignoreUnknown = true)
public class UserObject_SearchForm_Default{

    private Map<String,String> srfparentdata;

    private String n_userobjectname_like;
    private String n_userobjecttype_eq;
    private Page page;
    private Page getPage(){
        if(this.page==null)
            this.page=new Page(1,20,true);
        return this.page;
    }

    public  void fromUserObjectSearchFilter(UserObjectSearchFilter sourceSearchFilter)  {
        this.setN_userobjectname_like(sourceSearchFilter.getN_userobjectname_like());
        this.setN_userobjecttype_eq(sourceSearchFilter.getN_userobjecttype_eq());
        this.setPage(sourceSearchFilter.getPage());
	}
    public  UserObjectSearchFilter toUserObjectSearchFilter()  {
        UserObjectSearchFilter targetSearchFilter=new UserObjectSearchFilter();
        if(targetSearchFilter.getN_userobjectname_like()==null)
            targetSearchFilter.setN_userobjectname_like(this.getN_userobjectname_like());
        if(targetSearchFilter.getN_userobjecttype_eq()==null)
            targetSearchFilter.setN_userobjecttype_eq(this.getN_userobjecttype_eq());
        targetSearchFilter.setPage(this.getPage());
        return targetSearchFilter;
	}


}