
package com.lideeyunji.tool.framework.sql.build.buildmodel.dql;


import com.lideeyunji.tool.framework.sql.build.ISQLExpression;
import com.lideeyunji.tool.framework.sql.build.build.dql.BuildDelete;
import com.lideeyunji.tool.framework.sql.build.build.dql.BuildGroupBy;
import com.lideeyunji.tool.framework.sql.build.buildmodel.SqlInfoBaseModel;
import com.lideeyunji.tool.framework.sql.core.model.SqlFormatModel;

/**
 * @author JX
 * @create 2024-07-04 10:51
 * @dedescription:
 */
public class SqlInfoGroupModel<T> extends SqlInfoBaseModel {

    private String[] columns;

    public String[] getColumns() {
        return columns;
    }

    public void setColumns(String... columns) {
        this.columns = columns;
    }

    public SqlInfoGroupModel (){}

    public static Builder builder (){
        return new Builder();
    }
    public static class Builder{
        private SqlInfoGroupModel groupModel = new SqlInfoGroupModel();

        public Builder setColumns(String... columns){
            groupModel.columns = columns;
            return this;
        }

        public SqlInfoGroupModel<BuildDelete> build(){
            ISQLExpression<SqlFormatModel> expression = new BuildGroupBy();
            groupModel.setSqlExpression(expression);
            return groupModel;
        }
    }
}
