package com.ruoyi.common.utils.wrapper;

import com.baomidou.mybatisplus.core.toolkit.support.SFunction;
import lombok.Getter;

@Getter
@SuppressWarnings("unused")
public class SqlField {

    private final String name;

    public SqlField(String name) {
        this.name = name;
    }

    public <K, V> SqlField(SFunction<K, V> function) {
        this.name = IWrapper.getSqlFieldName(function);
    }

    public <K, V> SqlField(String alias, SFunction<K, V> function) {
        this.name = IWrapper.getSqlFieldName(alias, function);
    }

}
