package com.jy.framework.mybatis.join;

import lombok.AccessLevel;
import lombok.RequiredArgsConstructor;

@RequiredArgsConstructor(access = AccessLevel.PROTECTED)
public class Compute extends AbstractSql {

    /**
     * 计算类型（ + - * / % ）
     */
    private final String computeType;

    /**
     * 计算值
     */
    private final Object value;

    @Override
    protected String format() {
        return computeType + (value instanceof AbstractSql abstractSql ? abstractSql.format() : value.toString());
    }

}
