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


import com.lideeyunji.tool.framework.sql.build.ISQLExpression;
import com.lideeyunji.tool.framework.sql.build.build.ddl.BuildCreateIndex;
import com.lideeyunji.tool.framework.sql.core.model.SqlFormatModel;

import java.util.List;

/**
 * @author JX
 * @create 2024-07-05 17:09
 * @dedescription:
 */
public class SqlInfoCreateIndexModel<T> extends SqlInfoBaseDdlModel {

    String tableName;//表
    //index
    private String indexName;//索引名称

    private String indexType;//索引类型

    private List<String> indexFieldCodeList;//索引值


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

    public static class Builder{
        private SqlInfoCreateIndexModel sqlInfoCreateModel = new SqlInfoCreateIndexModel();
        ISQLExpression<List<SqlFormatModel>> expression = new BuildCreateIndex();

        public Builder setTableName(String tableName) {
            sqlInfoCreateModel.tableName = tableName;
            return this;
        }

        public Builder setIndexName(String indexName) {
            sqlInfoCreateModel.indexName = indexName;
            return this;
        }

        public Builder setIndexFieldCodeList(List<String> indexFieldCodeList) {
            sqlInfoCreateModel.indexFieldCodeList = indexFieldCodeList;
            return this;
        }

        public Builder setIndexType(String indexType) {
            sqlInfoCreateModel.indexType = indexType;
            return this;
        }

        public SqlInfoCreateIndexModel<BuildCreateIndex> build() {
            ISQLExpression<List<SqlFormatModel>> expression = new BuildCreateIndex();
            sqlInfoCreateModel.setSqlExpression(expression);
            return sqlInfoCreateModel;
        }
    }


    public String getTableName() {
        return tableName;
    }

    public void setTableName(String tableName) {
        this.tableName = tableName;
    }

    public String getIndexName() {
        return indexName;
    }

    public void setIndexName(String indexName) {
        this.indexName = indexName;
    }

    public List<String> getIndexFieldCodeList() {
        return indexFieldCodeList;
    }

    public void setIndexFieldCodeList(List<String> indexFieldCodeList) {
        this.indexFieldCodeList = indexFieldCodeList;
    }

    public String getIndexType() {
        return indexType;
    }

    public void setIndexType(String indexType) {
        this.indexType = indexType;
    }
}
