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


import com.jeelowcode.framework.plus.build.ISQLExpression;
import com.jeelowcode.framework.plus.build.build.dql.BuildPublicSql;
import com.jeelowcode.framework.plus.build.build.dql.BuildSelect;
import com.jeelowcode.framework.plus.build.buildmodel.SqlInfoBaseModel;
import com.jeelowcode.framework.plus.core.model.SqlFormatModel;

/**
 * 通用sql
 */
public class SqlInfoPublicModel<T> extends SqlInfoBaseModel {

    private String sql;

    public static Builder builder(){
        return new Builder();
    }


    public static class Builder {
        private SqlInfoPublicModel selectModel = new SqlInfoPublicModel();

        public Builder setSql(String sql) {
            selectModel.sql = sql;
            return this;
        }

        public SqlInfoPublicModel<BuildSelect> build() {
            ISQLExpression<SqlFormatModel> expression = new BuildPublicSql();
            selectModel.setSqlExpression(expression);
            return selectModel;
        }
    }

    public String getSql() {
        return sql;
    }
}
