
package com.jeelowcode.framework.plus.build.buildmodel.dql;


import com.jeelowcode.framework.plus.build.ISQLExpression;
import com.jeelowcode.framework.plus.build.build.dql.BuildDelete;
import com.jeelowcode.framework.plus.build.build.dql.BuildGroupBy;
import com.jeelowcode.framework.plus.build.buildmodel.SqlInfoBaseModel;
import com.jeelowcode.framework.plus.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;
        }
    }
}
