
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.BuildPublicSql;
import com.lideeyunji.tool.framework.sql.build.build.dql.BuildSelect;
import com.lideeyunji.tool.framework.sql.build.buildmodel.SqlInfoBaseModel;
import com.lideeyunji.tool.framework.sql.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;
    }
}
