🎉 代码生成增加sqlserver判断

This commit is contained in:
smallchill 2021-01-25 12:30:17 +08:00
parent 1fcf40d917
commit d998a37903

View File

@ -25,6 +25,7 @@ import com.baomidou.mybatisplus.generator.config.*;
import com.baomidou.mybatisplus.generator.config.converts.MySqlTypeConvert; import com.baomidou.mybatisplus.generator.config.converts.MySqlTypeConvert;
import com.baomidou.mybatisplus.generator.config.converts.OracleTypeConvert; import com.baomidou.mybatisplus.generator.config.converts.OracleTypeConvert;
import com.baomidou.mybatisplus.generator.config.converts.PostgreSqlTypeConvert; import com.baomidou.mybatisplus.generator.config.converts.PostgreSqlTypeConvert;
import com.baomidou.mybatisplus.generator.config.converts.SqlServerTypeConvert;
import com.baomidou.mybatisplus.generator.config.po.TableInfo; import com.baomidou.mybatisplus.generator.config.po.TableInfo;
import com.baomidou.mybatisplus.generator.config.rules.NamingStrategy; import com.baomidou.mybatisplus.generator.config.rules.NamingStrategy;
import lombok.Data; import lombok.Data;
@ -150,6 +151,9 @@ public class BladeCodeGenerator {
} else if (StringUtil.containsAny(driverName, DbType.POSTGRE_SQL.getDb())) { } else if (StringUtil.containsAny(driverName, DbType.POSTGRE_SQL.getDb())) {
dsc.setDbType(DbType.POSTGRE_SQL); dsc.setDbType(DbType.POSTGRE_SQL);
dsc.setTypeConvert(new PostgreSqlTypeConvert()); dsc.setTypeConvert(new PostgreSqlTypeConvert());
} else if (StringUtil.containsAny(driverName, DbType.SQL_SERVER.getDb())) {
dsc.setDbType(DbType.SQL_SERVER);
dsc.setTypeConvert(new SqlServerTypeConvert());
} else { } else {
dsc.setDbType(DbType.ORACLE); dsc.setDbType(DbType.ORACLE);
dsc.setTypeConvert(new OracleTypeConvert()); dsc.setTypeConvert(new OracleTypeConvert());