
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.buildmodel.SqlInfoBaseModel;
import com.lideeyunji.tool.framework.sql.core.model.SqlFormatModel;

public class SqlInfoDeleteModel<T> extends SqlInfoBaseModel {
    private String tableName;

    private Boolean isReal;

    private SqlInfoDeleteModel(){}

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


    public static class Builder {

        private SqlInfoDeleteModel sqlInfoDeleteModel = new SqlInfoDeleteModel();

        public Builder setTableName(String tableName) {
            sqlInfoDeleteModel.tableName = tableName;
            sqlInfoDeleteModel.isReal=false;//逻辑删除
            return this;
        }

        public Builder setTableName(String tableName,boolean isReal) {
            sqlInfoDeleteModel.tableName = tableName;
            sqlInfoDeleteModel.isReal=isReal;
            return this;
        }

        public SqlInfoDeleteModel<BuildDelete> build(){
            ISQLExpression<SqlFormatModel> expression = new BuildDelete();
            sqlInfoDeleteModel.setSqlExpression(expression);
            return sqlInfoDeleteModel;
        }
    }

    public String getTableName() {
        return tableName;
    }

    public Boolean getReal() {
        return isReal;
    }
}
