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.LoginAccountSearchFilter;
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 LoginAccount_SearchForm_Default{

    private Map<String,String> srfparentdata;

    private String n_loginaccountname_like;
    private String n_username_like;
    private Integer n_isenable_eq;
    private Page page;
    private Page getPage(){
        if(this.page==null)
            this.page=new Page(1,20,true);
        return this.page;
    }

    public  void fromLoginAccountSearchFilter(LoginAccountSearchFilter sourceSearchFilter)  {
        this.setN_loginaccountname_like(sourceSearchFilter.getN_loginaccountname_like());
        this.setN_username_like(sourceSearchFilter.getN_username_like());
        this.setN_isenable_eq(sourceSearchFilter.getN_isenable_eq());
        this.setPage(sourceSearchFilter.getPage());
	}
    public  LoginAccountSearchFilter toLoginAccountSearchFilter()  {
        LoginAccountSearchFilter targetSearchFilter=new LoginAccountSearchFilter();
        if(targetSearchFilter.getN_loginaccountname_like()==null)
            targetSearchFilter.setN_loginaccountname_like(this.getN_loginaccountname_like());
        if(targetSearchFilter.getN_username_like()==null)
            targetSearchFilter.setN_username_like(this.getN_username_like());
        if(targetSearchFilter.getN_isenable_eq()==null)
            targetSearchFilter.setN_isenable_eq(this.getN_isenable_eq());
        targetSearchFilter.setPage(this.getPage());
        return targetSearchFilter;
	}


}