package com.jy.framework.mybatis.join;

import com.baomidou.mybatisplus.core.toolkit.StringPool;
import lombok.RequiredArgsConstructor;

@RequiredArgsConstructor
public class QueryColumn extends AbstractQueryColumn {

    /**
     * 表别名
     */
    private final String tableAlias;

    /**
     * 字段
     */
    private final String field;

    @Override
    protected QueryColumn copy() {
        return new QueryColumn(this.tableAlias, this.field);
    }

    @Override
    protected String format() {
        String sql = tableAlias + StringPool.DOT + field;
        return spliceCompute(sql);
    }

}
