package com.jwipc.supplier.model.query;

import com.baomidou.mybatisplus.core.enums.SqlLike;
import com.baomidou.mybatisplus.core.toolkit.sql.SqlUtils;
import com.jwipc.query.BasePageQuery;
import lombok.Data;
import org.apache.commons.lang3.StringUtils;

import java.io.Serial;

/**
 * <p> </p>
 *
 * @author ZhangJie
 * @version 1.0
 * @since JDK 1.8
 */
@Data
public class SupplierInvitationQuery extends BasePageQuery {
    @Serial
    private static final long serialVersionUID = -1722137088314778000L;
    private String shortName;
    private Integer infoState;
    private Integer registerType;
    private Integer signUpThrough;
    private String purchaseGroupCode;
    private String userName;
    private Long supplierId;

    public String getLikeShortName() {
        if (StringUtils.isNotEmpty(this.shortName)) {
            return SqlUtils.concatLike(this.shortName, SqlLike.DEFAULT);
        }
        return this.shortName;
    }
}
