mirror of https://gitee.com/stylefeng/roses
修改及新增oracle,pgsql,mssql查询,及删除表空间修改
parent
8980f29206
commit
b220a6bbd9
|
@ -0,0 +1,34 @@
|
|||
package cn.stylefeng.roses.kernel.config.modular.data;
|
||||
|
||||
import cn.hutool.db.Entity;
|
||||
import cn.hutool.db.handler.EntityListHandler;
|
||||
import cn.hutool.db.sql.SqlExecutor;
|
||||
import cn.stylefeng.roses.kernel.config.api.SysConfigDataApi;
|
||||
import cn.stylefeng.roses.kernel.rule.enums.StatusEnum;
|
||||
import cn.stylefeng.roses.kernel.rule.enums.YesOrNotEnum;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
|
||||
import java.sql.Connection;
|
||||
import java.sql.SQLException;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* Mssql数据库的系统配置表获取
|
||||
*
|
||||
* @author AndrewFeng
|
||||
* @date 2021/5/14 21:18
|
||||
*/
|
||||
@Slf4j
|
||||
public class MssqlSysConfigData implements SysConfigDataApi {
|
||||
|
||||
@Override
|
||||
public List<Entity> getConfigs(Connection conn) throws SQLException {
|
||||
return SqlExecutor.query(conn, getConfigListSql(), new EntityListHandler(), StatusEnum.ENABLE.getCode(), YesOrNotEnum.N.getCode());
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getConfigListSql() {
|
||||
return "select config_code, config_value from sys_config where status_flag = ? and del_flag = ?";
|
||||
}
|
||||
|
||||
}
|
|
@ -0,0 +1,34 @@
|
|||
package cn.stylefeng.roses.kernel.config.modular.data;
|
||||
|
||||
import cn.hutool.db.Entity;
|
||||
import cn.hutool.db.handler.EntityListHandler;
|
||||
import cn.hutool.db.sql.SqlExecutor;
|
||||
import cn.stylefeng.roses.kernel.config.api.SysConfigDataApi;
|
||||
import cn.stylefeng.roses.kernel.rule.enums.StatusEnum;
|
||||
import cn.stylefeng.roses.kernel.rule.enums.YesOrNotEnum;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
|
||||
import java.sql.Connection;
|
||||
import java.sql.SQLException;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* Oracle数据库的系统配置表获取
|
||||
*
|
||||
* @author AndrewFeng
|
||||
* @date 2021/5/14 21:18
|
||||
*/
|
||||
@Slf4j
|
||||
public class OracleSysConfigData implements SysConfigDataApi {
|
||||
|
||||
@Override
|
||||
public List<Entity> getConfigs(Connection conn) throws SQLException {
|
||||
return SqlExecutor.query(conn, getConfigListSql(), new EntityListHandler(), StatusEnum.ENABLE.getCode(), YesOrNotEnum.N.getCode());
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getConfigListSql() {
|
||||
return "select config_code, config_value from sys_config where status_flag = ? and del_flag = ?";
|
||||
}
|
||||
|
||||
}
|
|
@ -13,7 +13,7 @@ import java.sql.SQLException;
|
|||
import java.util.List;
|
||||
|
||||
/**
|
||||
* Mysql数据库的系统配置表获取
|
||||
* Pgsql数据库的系统配置表获取
|
||||
*
|
||||
* @author AndrewFeng
|
||||
* @date 2021/5/14 21:18
|
||||
|
|
|
@ -1,7 +1,9 @@
|
|||
package cn.stylefeng.roses.kernel.config.modular.factory;
|
||||
|
||||
import cn.stylefeng.roses.kernel.config.api.SysConfigDataApi;
|
||||
import cn.stylefeng.roses.kernel.config.modular.data.MssqlSysConfigData;
|
||||
import cn.stylefeng.roses.kernel.config.modular.data.MysqlSysConfigData;
|
||||
import cn.stylefeng.roses.kernel.config.modular.data.OracleSysConfigData;
|
||||
import cn.stylefeng.roses.kernel.config.modular.data.PgsqlSysConfigData;
|
||||
import cn.stylefeng.roses.kernel.rule.enums.DbTypeEnum;
|
||||
import cn.stylefeng.roses.kernel.rule.util.DatabaseTypeUtil;
|
||||
|
@ -27,9 +29,9 @@ public class SysConfigDataFactory {
|
|||
} else if (DbTypeEnum.PG_SQL.equals(dbType)) {
|
||||
return new PgsqlSysConfigData();
|
||||
} else if (DbTypeEnum.MS_SQL.equals(dbType)) {
|
||||
// todo
|
||||
return new MssqlSysConfigData();
|
||||
} else if (DbTypeEnum.ORACLE.equals(dbType)) {
|
||||
// todo
|
||||
return new OracleSysConfigData();
|
||||
}
|
||||
return new MysqlSysConfigData();
|
||||
}
|
||||
|
|
|
@ -47,11 +47,11 @@ public class DropDatabaseSql extends AbstractSql {
|
|||
|
||||
@Override
|
||||
protected String pgSql() {
|
||||
return "";
|
||||
return "DROP DATABASE ?;";
|
||||
}
|
||||
|
||||
@Override
|
||||
protected String oracle() {
|
||||
return "DROP DATABASE ?;";
|
||||
return "DROP DATASPACE ?;";
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue