package com.jwipc.sys.model.query;

import com.jwipc.query.BasePageQuery;
import lombok.Data;
import org.apache.commons.lang3.StringUtils;

/**
 * @author Al
 * @create 2024-01-29 16:51
 */
@Data
public class PurchaseGroupQuery extends BasePageQuery {
    /**
     * 采购组编码
     */
    private String pgCode;

    /**
     * 采购组名称
     */
    private String pgName;
    /**
     * 是否查询当前用户
     */
    private Integer isAuthority;
    /**
     * 所属组织
     */
    private String orgCodeOrName;
    private Long id;
    private Long userId;
    /**
     * 组织机构编码
     */
    private String orgCode;
    public String getPgCodeLike(){
        return StringUtils.isEmpty(this.pgCode) ? null : "%" + this.pgCode + "%";
    }

    public String getPgNameLike(){
        return StringUtils.isEmpty(this.pgName) ? null : "%" + this.pgName + "%";
    }

    public String getOrgCodeOrNameLike(){
        return StringUtils.isEmpty(this.orgCodeOrName) ? null : "%" + this.orgCodeOrName + "%";
    }
}
