feat: 新增数据库postgres 与 客户端整codemirror 在线代码编辑器
parent
7aa8e7559e
commit
55c4dc4838
|
@ -199,7 +199,7 @@ public class KvtController extends BaseController {
|
||||||
|
|
||||||
//查询字典
|
//查询字典
|
||||||
@PostMapping("/selectDictionaryy")
|
@PostMapping("/selectDictionaryy")
|
||||||
public Result<List<Diction>> selectDictionaryy(@RequestParam Integer id){
|
public Result<List<Diction>> selectDictionaryy( Integer id){
|
||||||
List<Diction> list= kvtService.selectDictionaryy(id);
|
List<Diction> list= kvtService.selectDictionaryy(id);
|
||||||
return Result.success(list);
|
return Result.success(list);
|
||||||
}
|
}
|
||||||
|
@ -259,4 +259,10 @@ public class KvtController extends BaseController {
|
||||||
List<DataDisplay> list= kvtService.listResult();
|
List<DataDisplay> list= kvtService.listResult();
|
||||||
return Result.success(list);
|
return Result.success(list);
|
||||||
}
|
}
|
||||||
|
//根据库名查询资产展示
|
||||||
|
@PostMapping("/selectDataDisplayName")
|
||||||
|
public Result<List<DataDisplay>> listResult(String name ){
|
||||||
|
List<DataDisplay> list= kvtService.selectDataDisplayName(name);
|
||||||
|
return Result.success(list);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -93,4 +93,5 @@ public interface KvtMapper extends BaseMapper<Kvt> {
|
||||||
|
|
||||||
List<DataDisplay> listResult();
|
List<DataDisplay> listResult();
|
||||||
|
|
||||||
|
List<DataDisplay> selectDataDisplayName(@Param("name") String name);
|
||||||
}
|
}
|
||||||
|
|
|
@ -67,4 +67,5 @@ public interface KvtService extends IService<Kvt> {
|
||||||
|
|
||||||
List<DataDisplay> listResult();
|
List<DataDisplay> listResult();
|
||||||
|
|
||||||
|
List<DataDisplay> selectDataDisplayName(String name);
|
||||||
}
|
}
|
||||||
|
|
|
@ -356,64 +356,131 @@ public class KvtServiceImpl extends ServiceImpl<KvtMapper, Kvt> implements KvtSe
|
||||||
*/
|
*/
|
||||||
private void dataStructureAdd(Connection connection,Kvt kvt,String tableName){
|
private void dataStructureAdd(Connection connection,Kvt kvt,String tableName){
|
||||||
try{
|
try{
|
||||||
//执行一个预编译的 SQL 查询
|
PreparedStatement preparedStatement = null;
|
||||||
PreparedStatement preparedStatement = connection.prepareStatement(this.sql()
|
DataStructure build = null;
|
||||||
+ " TABLE_SCHEMA = ?\n"
|
if (kvt.getType()==1){
|
||||||
+ " AND TABLE_NAME = ?");
|
//执行一个预编译的 SQL 查询
|
||||||
preparedStatement.setString(1, kvt.getDatabaseName()); // 设置第一个参数的值
|
preparedStatement = connection.prepareStatement(this.sql()
|
||||||
preparedStatement.setString(2, tableName); // 设置第二个参数的值
|
+ " TABLE_SCHEMA = ?\n"
|
||||||
|
+ " AND TABLE_NAME = ?");
|
||||||
|
preparedStatement.setString(1, kvt.getDatabaseName()); // 设置第一个参数的值
|
||||||
|
preparedStatement.setString(2, tableName); // 设置第二个参数的值
|
||||||
|
}
|
||||||
|
if (kvt.getType()==2){
|
||||||
|
//执行一个预编译的 SQL 查询
|
||||||
|
preparedStatement = connection.prepareStatement(this.sql4()
|
||||||
|
+ " information_schema.columns.table_name = '"+ tableName+" ' ");
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
ResultSet executeQuery = preparedStatement.executeQuery();
|
ResultSet executeQuery = preparedStatement.executeQuery();
|
||||||
while (executeQuery.next()) {
|
while (executeQuery.next()) {
|
||||||
|
if (kvt.getType()==1){
|
||||||
|
String name = executeQuery.getString("name");
|
||||||
|
/**
|
||||||
|
* 注释
|
||||||
|
*/
|
||||||
|
String comment = executeQuery.getString("comment");
|
||||||
|
/**
|
||||||
|
* 是否主键
|
||||||
|
*/
|
||||||
|
String isPrimaryKey = executeQuery.getString("isPrimaryKey");
|
||||||
|
/**
|
||||||
|
* 类型
|
||||||
|
*/
|
||||||
|
String type = executeQuery.getString("type");
|
||||||
|
/**
|
||||||
|
* 映射类型
|
||||||
|
*/
|
||||||
|
String mappingType = executeQuery.getString("mappingType");
|
||||||
|
/**
|
||||||
|
* 长度
|
||||||
|
*/
|
||||||
|
String length = executeQuery.getString("length");
|
||||||
|
/**
|
||||||
|
* 小数位
|
||||||
|
*/
|
||||||
|
String decimalPlaces = executeQuery.getString("decimalPlaces");
|
||||||
|
/**
|
||||||
|
* 是否为空
|
||||||
|
*/
|
||||||
|
String isNull = executeQuery.getString("isNull");
|
||||||
|
/**
|
||||||
|
* 默认值
|
||||||
|
*/
|
||||||
|
String defaultValue = executeQuery.getString("defaultValue");
|
||||||
|
|
||||||
|
build = DataStructure.builder()
|
||||||
|
.tableName(tableName)
|
||||||
|
.warName(kvt.getDatabaseName())
|
||||||
|
.name(name)
|
||||||
|
.comment(comment)
|
||||||
|
.isPrimaryKey(isPrimaryKey)
|
||||||
|
.type(type)
|
||||||
|
.mappingType(mappingType)
|
||||||
|
.length(length)
|
||||||
|
.decimalPlaces(null)
|
||||||
|
.isNull(isNull)
|
||||||
|
.defaultValue(defaultValue)
|
||||||
|
.isDict(null)
|
||||||
|
.dictKey(null)
|
||||||
|
.build();
|
||||||
|
}
|
||||||
|
|
||||||
|
if (kvt.getType() == 2){
|
||||||
|
//名称
|
||||||
|
String name = executeQuery.getString(1);
|
||||||
|
/**
|
||||||
|
* 注释
|
||||||
|
*/
|
||||||
|
String comment = executeQuery.getString(2);
|
||||||
|
/**
|
||||||
|
* 类型
|
||||||
|
*/
|
||||||
|
String type = executeQuery.getString(3);
|
||||||
|
/**
|
||||||
|
* 长度
|
||||||
|
*/
|
||||||
|
String length = executeQuery.getString(4);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 映射类型
|
||||||
|
*/
|
||||||
|
String mappingType = executeQuery.getString(5);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 默认值
|
||||||
|
*/
|
||||||
|
String defaultValue = executeQuery.getString(6);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 是否为空
|
||||||
|
*/
|
||||||
|
String isNull = executeQuery.getString(7);
|
||||||
|
/**
|
||||||
|
* 是否主键
|
||||||
|
*/
|
||||||
|
String isPrimaryKey = executeQuery.getString(8);
|
||||||
|
build = DataStructure.builder()
|
||||||
|
.tableName(tableName)
|
||||||
|
.warName(kvt.getDatabaseName())
|
||||||
|
.name(name)
|
||||||
|
.comment(comment)
|
||||||
|
.isPrimaryKey(isPrimaryKey)
|
||||||
|
.type(type)
|
||||||
|
.mappingType(mappingType)
|
||||||
|
.length(length)
|
||||||
|
.decimalPlaces(null)
|
||||||
|
.isNull(isNull)
|
||||||
|
.defaultValue(defaultValue)
|
||||||
|
.isDict(null)
|
||||||
|
.dictKey(null)
|
||||||
|
.build();
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
String name = executeQuery.getString("name");
|
|
||||||
/**
|
|
||||||
* 注释
|
|
||||||
*/
|
|
||||||
String comment = executeQuery.getString("comment");
|
|
||||||
/**
|
|
||||||
* 是否主键
|
|
||||||
*/
|
|
||||||
String isPrimaryKey = executeQuery.getString("isPrimaryKey");
|
|
||||||
/**
|
|
||||||
* 类型
|
|
||||||
*/
|
|
||||||
String type = executeQuery.getString("type");
|
|
||||||
/**
|
|
||||||
* 映射类型
|
|
||||||
*/
|
|
||||||
String mappingType = executeQuery.getString("mappingType");
|
|
||||||
/**
|
|
||||||
* 长度
|
|
||||||
*/
|
|
||||||
String length = executeQuery.getString("length");
|
|
||||||
/**
|
|
||||||
* 小数位
|
|
||||||
*/
|
|
||||||
String decimalPlaces = executeQuery.getString("decimalPlaces");
|
|
||||||
/**
|
|
||||||
* 是否为空
|
|
||||||
*/
|
|
||||||
String isNull = executeQuery.getString("isNull");
|
|
||||||
/**
|
|
||||||
* 默认值
|
|
||||||
*/
|
|
||||||
String defaultValue = executeQuery.getString("defaultValue");
|
|
||||||
|
|
||||||
DataStructure build = DataStructure.builder()
|
|
||||||
.tableName(tableName)
|
|
||||||
.warName(kvt.getDatabaseName())
|
|
||||||
.name(name)
|
|
||||||
.comment(comment)
|
|
||||||
.isPrimaryKey(isPrimaryKey)
|
|
||||||
.type(type)
|
|
||||||
.mappingType(mappingType)
|
|
||||||
.length(length)
|
|
||||||
.decimalPlaces(decimalPlaces)
|
|
||||||
.isNull(isNull)
|
|
||||||
.defaultValue(defaultValue)
|
|
||||||
.isDict(null)
|
|
||||||
.dictKey(null)
|
|
||||||
.build();
|
|
||||||
baseMapper.add(build);
|
baseMapper.add(build);
|
||||||
}
|
}
|
||||||
executeQuery.close();
|
executeQuery.close();
|
||||||
|
@ -431,16 +498,37 @@ public class KvtServiceImpl extends ServiceImpl<KvtMapper, Kvt> implements KvtSe
|
||||||
*/
|
*/
|
||||||
public void selectDatabaseName(Connection connection,Kvt kvt){
|
public void selectDatabaseName(Connection connection,Kvt kvt){
|
||||||
try {
|
try {
|
||||||
//查询总条数
|
PreparedStatement preparedStatement2 = null;
|
||||||
String sql2 = "SELECT\n" +
|
if (kvt.getType() ==1 ){
|
||||||
" TABLE_NAME as 'name',\n" +
|
//查询总条数
|
||||||
" TABLE_COMMENT as 'as',\n" +
|
String sql2 = "SELECT\n" +
|
||||||
" TABLE_ROWS as 'dataTotal'\n" +
|
" TABLE_NAME as 'name',\n" +
|
||||||
" FROM INFORMATION_SCHEMA.TABLES\n" +
|
" TABLE_COMMENT as 'as',\n" +
|
||||||
" WHERE\n" +
|
" TABLE_ROWS as 'dataTotal'\n" +
|
||||||
" TABLE_SCHEMA = ?";
|
" FROM INFORMATION_SCHEMA.TABLES\n" +
|
||||||
PreparedStatement preparedStatement2 = connection.prepareStatement(sql2);
|
" WHERE\n" +
|
||||||
preparedStatement2.setString(1, kvt.getDatabaseName()); // 设置第一个参数的值
|
" TABLE_SCHEMA = ?";
|
||||||
|
preparedStatement2= connection.prepareStatement(sql2);
|
||||||
|
preparedStatement2.setString(1, kvt.getDatabaseName()); // 设置第一个参数的值
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
if (kvt.getType() ==2 ){
|
||||||
|
String sql5 = "SELECT \n" +
|
||||||
|
" c.relname AS \"name\", \n" +
|
||||||
|
" d.description AS \"as\", \n" +
|
||||||
|
" COALESCE(s.n_live_tup, 0) AS \"dataTotal\" \n" +
|
||||||
|
"FROM \n" +
|
||||||
|
" pg_catalog.pg_class c \n" +
|
||||||
|
" JOIN pg_catalog.pg_namespace n ON n.oid = c.relnamespace \n" +
|
||||||
|
" LEFT JOIN pg_catalog.pg_description d ON d.objoid = c.oid AND d.objsubid = 0 \n" +
|
||||||
|
" LEFT JOIN pg_catalog.pg_stat_user_tables s ON s.relid = c.oid \n" +
|
||||||
|
"WHERE \n" +
|
||||||
|
" n.nspname = 'public' \n" +
|
||||||
|
" AND c.relkind = 'r'";
|
||||||
|
preparedStatement2= connection.prepareStatement(sql5);
|
||||||
|
}
|
||||||
|
|
||||||
ResultSet query = preparedStatement2.executeQuery();
|
ResultSet query = preparedStatement2.executeQuery();
|
||||||
while (query.next()) {
|
while (query.next()) {
|
||||||
//表名
|
//表名
|
||||||
|
@ -467,7 +555,7 @@ public class KvtServiceImpl extends ServiceImpl<KvtMapper, Kvt> implements KvtSe
|
||||||
|
|
||||||
public Result postgres(Kvt kvt) {
|
public Result postgres(Kvt kvt) {
|
||||||
Connection connection = null;
|
Connection connection = null;
|
||||||
Statement stmt = null;
|
|
||||||
try {
|
try {
|
||||||
// 加载 PostgreSQL 驱动类
|
// 加载 PostgreSQL 驱动类
|
||||||
Class.forName("org.postgresql.Driver");
|
Class.forName("org.postgresql.Driver");
|
||||||
|
@ -479,25 +567,33 @@ public class KvtServiceImpl extends ServiceImpl<KvtMapper, Kvt> implements KvtSe
|
||||||
connection = DriverManager.getConnection(url, user, password);
|
connection = DriverManager.getConnection(url, user, password);
|
||||||
|
|
||||||
Statement statement = connection.createStatement();
|
Statement statement = connection.createStatement();
|
||||||
ResultSet resultSet = stmt.executeQuery("SELECT table_name FROM information_schema.tables WHERE table_schema = 'public';");
|
String sql = "SELECT table_name FROM information_schema.tables WHERE table_schema = 'public'";
|
||||||
|
ResultSet resultSet = statement.executeQuery(sql);
|
||||||
|
|
||||||
while (resultSet.next()) {
|
while (resultSet.next()) {
|
||||||
String name = resultSet.getString("name");
|
String tableName = resultSet.getString("table_name");
|
||||||
System.out.println("name" + name);
|
//添加资产展示数据
|
||||||
|
this.dataDisplayAdd(tableName,connection,kvt);
|
||||||
|
//添加数据结构
|
||||||
|
this.dataStructureAdd(connection,kvt,tableName);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
this.selectDatabaseName(connection, kvt);
|
||||||
|
|
||||||
|
|
||||||
|
Result<SysUser> sysUserResult = remoteUserSer.selectUserId(SecurityUtils.getUserId());
|
||||||
|
SysUser data = sysUserResult.getData();
|
||||||
|
DeptUserKvt build = DeptUserKvt.builder()
|
||||||
|
.userId(SecurityUtils.getUserId())
|
||||||
|
.kvtId(kvt.getId())
|
||||||
|
.deptId(data.getDeptId()).build();
|
||||||
|
baseMapper.DeptUserKvtAdd(build);
|
||||||
|
|
||||||
resultSet.close();
|
resultSet.close();
|
||||||
statement.close();
|
statement.close();
|
||||||
connection.close();
|
connection.close();
|
||||||
} catch (ClassNotFoundException | SQLException e) {
|
} catch (ClassNotFoundException | SQLException e) {
|
||||||
e.printStackTrace();
|
throw new RuntimeException("postgres同步失败",e);
|
||||||
} finally {
|
|
||||||
try {
|
|
||||||
if (connection != null) {
|
|
||||||
connection.close();
|
|
||||||
}
|
|
||||||
} catch (SQLException e) {
|
|
||||||
e.printStackTrace();
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
return Result.success("postgres同步成功");
|
return Result.success("postgres同步成功");
|
||||||
}
|
}
|
||||||
|
@ -512,7 +608,9 @@ public class KvtServiceImpl extends ServiceImpl<KvtMapper, Kvt> implements KvtSe
|
||||||
//先判断哪种数据库
|
//先判断哪种数据库
|
||||||
if (kvt.getType() == 1) {
|
if (kvt.getType() == 1) {
|
||||||
mysql(kvt);
|
mysql(kvt);
|
||||||
} else {
|
}
|
||||||
|
|
||||||
|
if (kvt.getType() ==2 ){
|
||||||
postgres(kvt);
|
postgres(kvt);
|
||||||
}
|
}
|
||||||
return Result.success("同步成功");
|
return Result.success("同步成功");
|
||||||
|
@ -562,6 +660,11 @@ public class KvtServiceImpl extends ServiceImpl<KvtMapper, Kvt> implements KvtSe
|
||||||
return baseMapper.listResult();
|
return baseMapper.listResult();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public List<DataDisplay> selectDataDisplayName(String name) {
|
||||||
|
return baseMapper.selectDataDisplayName(name);
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 查询 根据库名跟表名查询字段信息
|
* 查询 根据库名跟表名查询字段信息
|
||||||
* @return
|
* @return
|
||||||
|
@ -592,4 +695,38 @@ public class KvtServiceImpl extends ServiceImpl<KvtMapper, Kvt> implements KvtSe
|
||||||
" INFORMATION_SCHEMA.COLUMNS\n" +
|
" INFORMATION_SCHEMA.COLUMNS\n" +
|
||||||
" WHERE\n";
|
" WHERE\n";
|
||||||
}
|
}
|
||||||
|
public String sql4(){
|
||||||
|
return "SELECT\n" +
|
||||||
|
" information_schema.columns.column_name,\n" +
|
||||||
|
" col_description(t1.oid, t2.attnum) AS column_description,\n" +
|
||||||
|
" information_schema.columns.data_type,\n" +
|
||||||
|
" COALESCE(numeric_precision, datetime_precision) AS precision,\n" +
|
||||||
|
" CASE\n" +
|
||||||
|
" WHEN information_schema.columns.data_type = 'numeric' THEN numeric_scale\n" +
|
||||||
|
" ELSE NULL\n" +
|
||||||
|
" END AS numeric_scale,\n" +
|
||||||
|
" CASE\n" +
|
||||||
|
" WHEN EXISTS (\n" +
|
||||||
|
" SELECT 1\n" +
|
||||||
|
" FROM pg_attrdef ad\n" +
|
||||||
|
" JOIN pg_attribute a ON ad.adrelid = a.attrelid AND ad.adnum = a.attnum\n" +
|
||||||
|
" WHERE a.attrelid = t1.oid AND a.attnum = t2.attnum\n" +
|
||||||
|
" ) THEN (SELECT pg_get_expr(adbin, adrelid) FROM pg_attrdef WHERE adrelid = t1.oid AND adnum = t2.attnum)\n" +
|
||||||
|
" ELSE NULL\n" +
|
||||||
|
" END AS default_value,\n" +
|
||||||
|
" CASE\n" +
|
||||||
|
" WHEN information_schema.columns.is_nullable = 'NO' THEN '0'\n" +
|
||||||
|
" ELSE '1'\n" +
|
||||||
|
" END AS is_nullable,\n" +
|
||||||
|
" CASE\n" +
|
||||||
|
" WHEN kcu.column_name IS NOT NULL THEN '1'\n" +
|
||||||
|
" ELSE '0'\n" +
|
||||||
|
" END AS is_primary_key\n" +
|
||||||
|
"FROM\n" +
|
||||||
|
" information_schema.columns\n" +
|
||||||
|
"JOIN pg_class t1 ON t1.relname = information_schema.columns.table_name\n" +
|
||||||
|
"JOIN pg_attribute t2 ON t2.attname = information_schema.columns.column_name AND t1.oid = t2.attrelid\n" +
|
||||||
|
"LEFT JOIN information_schema.key_column_usage kcu ON kcu.table_name = information_schema.columns.table_name AND kcu.column_name = information_schema.columns.column_name\n" +
|
||||||
|
"WHERE\n";
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -77,7 +77,10 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||||
select * from synchronization
|
select * from synchronization
|
||||||
</select>
|
</select>
|
||||||
<select id="selectDepartment" resultType="com.muyu.kvt.domain.ChildrenList">
|
<select id="selectDepartment" resultType="com.muyu.kvt.domain.ChildrenList">
|
||||||
SELECT
|
|
||||||
|
|
||||||
|
|
||||||
|
SELECT
|
||||||
TABLE_NAME as 'name',
|
TABLE_NAME as 'name',
|
||||||
TABLE_COMMENT as 'as',
|
TABLE_COMMENT as 'as',
|
||||||
TABLE_ROWS as 'dataTotal'
|
TABLE_ROWS as 'dataTotal'
|
||||||
|
@ -90,6 +93,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||||
select * from kvt where database_name =#{databaseName}
|
select * from kvt where database_name =#{databaseName}
|
||||||
</select>
|
</select>
|
||||||
<select id="selectDataStructure" resultType="com.muyu.kvt.domain.DataStructure">
|
<select id="selectDataStructure" resultType="com.muyu.kvt.domain.DataStructure">
|
||||||
|
|
||||||
SELECT
|
SELECT
|
||||||
TABLE_NAME AS 'tableName',
|
TABLE_NAME AS 'tableName',
|
||||||
COLUMN_NAME AS 'name',
|
COLUMN_NAME AS 'name',
|
||||||
|
@ -99,9 +103,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||||
CASE
|
CASE
|
||||||
WHEN DATA_TYPE = 'int' THEN 'Integer'
|
WHEN DATA_TYPE = 'int' THEN 'Integer'
|
||||||
WHEN DATA_TYPE = 'varchar' THEN 'String'
|
WHEN DATA_TYPE = 'varchar' THEN 'String'
|
||||||
WHEN DATA_TYPE = 'decimal' THEN 'BigDecimal'
|
WHEN DATA_TYPE = 'decimal'THEN 'BigDecimal'
|
||||||
WHEN DATA_TYPE = 'tinyint' AND COLUMN_TYPE = 'tinyint(1)' THEN 'Boolean'
|
WHEN DATA_TYPE = 'tinyint' AND COLUMN_TYPE = 'tinyint(1)' THEN 'Boolean'
|
||||||
|
|
||||||
ELSE DATA_TYPE
|
ELSE DATA_TYPE
|
||||||
END AS 'type',
|
END AS 'type',
|
||||||
DATA_TYPE AS 'mappingType',
|
DATA_TYPE AS 'mappingType',
|
||||||
|
@ -113,8 +116,33 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||||
FROM
|
FROM
|
||||||
INFORMATION_SCHEMA.COLUMNS
|
INFORMATION_SCHEMA.COLUMNS
|
||||||
WHERE
|
WHERE
|
||||||
TABLE_SCHEMA = #{databaseName}
|
TABLE_SCHEMA = #{databaseName} AND TABLE_NAME = #{name}
|
||||||
AND TABLE_NAME = #{name}
|
-- mysql
|
||||||
|
-- SELECT
|
||||||
|
-- TABLE_NAME AS 'tableName',
|
||||||
|
-- COLUMN_NAME AS 'name',
|
||||||
|
-- COLUMN_COMMENT AS 'comment',
|
||||||
|
-- CASE WHEN COLUMN_KEY = 'PRI' THEN '是' ELSE '否' END AS 'isPrimaryKey',
|
||||||
|
--
|
||||||
|
-- CASE
|
||||||
|
-- WHEN DATA_TYPE = 'int' THEN 'Integer'
|
||||||
|
-- WHEN DATA_TYPE = 'varchar' THEN 'String'
|
||||||
|
-- WHEN DATA_TYPE = 'decimal' THEN 'BigDecimal'
|
||||||
|
-- WHEN DATA_TYPE = 'tinyint' AND COLUMN_TYPE = 'tinyint(1)' THEN 'Boolean'
|
||||||
|
--
|
||||||
|
-- ELSE DATA_TYPE
|
||||||
|
-- END AS 'type',
|
||||||
|
-- DATA_TYPE AS 'mappingType',
|
||||||
|
-- COLUMN_TYPE AS 'detailType',
|
||||||
|
-- CHARACTER_MAXIMUM_LENGTH AS 'length',
|
||||||
|
-- NUMERIC_SCALE AS 'decimalPlaces',
|
||||||
|
-- IS_NULLABLE AS 'isNull',
|
||||||
|
-- COLUMN_DEFAULT AS 'defaultValue'
|
||||||
|
-- FROM
|
||||||
|
-- INFORMATION_SCHEMA.COLUMNS
|
||||||
|
-- WHERE
|
||||||
|
-- TABLE_SCHEMA = #{databaseName}
|
||||||
|
-- AND TABLE_NAME = #{name}
|
||||||
|
|
||||||
</select>
|
</select>
|
||||||
<select id="selectDataStur" resultType="com.muyu.kvt.domain.DataStructure">
|
<select id="selectDataStur" resultType="com.muyu.kvt.domain.DataStructure">
|
||||||
|
@ -171,6 +199,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||||
<select id="listResult" resultType="com.muyu.kvt.datadisplay.DataDisplay">
|
<select id="listResult" resultType="com.muyu.kvt.datadisplay.DataDisplay">
|
||||||
select * from data_display
|
select * from data_display
|
||||||
</select>
|
</select>
|
||||||
|
<select id="selectDataDisplayName" resultType="com.muyu.kvt.datadisplay.DataDisplay">
|
||||||
|
SELECT * FROM data_display WHERE war_name LIKE CONCAT('%', #{name}, '%');
|
||||||
|
</select>
|
||||||
|
|
||||||
|
|
||||||
<insert id="synchronizationAdd">
|
<insert id="synchronizationAdd">
|
||||||
|
|
|
@ -0,0 +1,26 @@
|
||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<project xmlns="http://maven.apache.org/POM/4.0.0"
|
||||||
|
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||||
|
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
|
||||||
|
<modelVersion>4.0.0</modelVersion>
|
||||||
|
<parent>
|
||||||
|
<groupId>com.muyu</groupId>
|
||||||
|
<artifactId>muyu-rule-engine</artifactId>
|
||||||
|
<version>3.6.3</version>
|
||||||
|
</parent>
|
||||||
|
|
||||||
|
<artifactId>muyu-rule-engine-common</artifactId>
|
||||||
|
|
||||||
|
<properties>
|
||||||
|
<maven.compiler.source>17</maven.compiler.source>
|
||||||
|
<maven.compiler.target>17</maven.compiler.target>
|
||||||
|
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
|
||||||
|
</properties>
|
||||||
|
|
||||||
|
<dependencies>
|
||||||
|
<dependency>
|
||||||
|
<groupId>com.muyu</groupId>
|
||||||
|
<artifactId>muyu-common-core</artifactId>
|
||||||
|
</dependency>
|
||||||
|
</dependencies>
|
||||||
|
</project>
|
|
@ -0,0 +1,20 @@
|
||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<project xmlns="http://maven.apache.org/POM/4.0.0"
|
||||||
|
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||||
|
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
|
||||||
|
<modelVersion>4.0.0</modelVersion>
|
||||||
|
<parent>
|
||||||
|
<groupId>com.muyu</groupId>
|
||||||
|
<artifactId>muyu-rule-engine</artifactId>
|
||||||
|
<version>3.6.3</version>
|
||||||
|
</parent>
|
||||||
|
|
||||||
|
<artifactId>muyu-rule-engine-remote</artifactId>
|
||||||
|
|
||||||
|
<properties>
|
||||||
|
<maven.compiler.source>17</maven.compiler.source>
|
||||||
|
<maven.compiler.target>17</maven.compiler.target>
|
||||||
|
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
|
||||||
|
</properties>
|
||||||
|
|
||||||
|
</project>
|
|
@ -0,0 +1,114 @@
|
||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<project xmlns="http://maven.apache.org/POM/4.0.0"
|
||||||
|
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||||
|
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
|
||||||
|
<modelVersion>4.0.0</modelVersion>
|
||||||
|
<parent>
|
||||||
|
<groupId>com.muyu</groupId>
|
||||||
|
<artifactId>muyu-rule-engine</artifactId>
|
||||||
|
<version>3.6.3</version>
|
||||||
|
</parent>
|
||||||
|
|
||||||
|
<artifactId>muyu-rule-engine-server</artifactId>
|
||||||
|
|
||||||
|
<properties>
|
||||||
|
<maven.compiler.source>17</maven.compiler.source>
|
||||||
|
<maven.compiler.target>17</maven.compiler.target>
|
||||||
|
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
|
||||||
|
</properties>
|
||||||
|
<dependencies>
|
||||||
|
<!-- SpringCloud Alibaba Nacos -->
|
||||||
|
<dependency>
|
||||||
|
<groupId>com.alibaba.cloud</groupId>
|
||||||
|
<artifactId>spring-cloud-starter-alibaba-nacos-discovery</artifactId>
|
||||||
|
</dependency>
|
||||||
|
|
||||||
|
<!-- SpringCloud Alibaba Nacos Config -->
|
||||||
|
<dependency>
|
||||||
|
<groupId>com.alibaba.cloud</groupId>
|
||||||
|
<artifactId>spring-cloud-starter-alibaba-nacos-config</artifactId>
|
||||||
|
</dependency>
|
||||||
|
|
||||||
|
<!-- SpringCloud Alibaba Sentinel -->
|
||||||
|
<dependency>
|
||||||
|
<groupId>com.alibaba.cloud</groupId>
|
||||||
|
<artifactId>spring-cloud-starter-alibaba-sentinel</artifactId>
|
||||||
|
</dependency>
|
||||||
|
|
||||||
|
<!-- SpringBoot Actuator -->
|
||||||
|
<dependency>
|
||||||
|
<groupId>org.springframework.boot</groupId>
|
||||||
|
<artifactId>spring-boot-starter-actuator</artifactId>
|
||||||
|
</dependency>
|
||||||
|
|
||||||
|
<!-- Swagger UI -->
|
||||||
|
<dependency>
|
||||||
|
<groupId>io.springfox</groupId>
|
||||||
|
<artifactId>springfox-swagger-ui</artifactId>
|
||||||
|
<version>${swagger.fox.version}</version>
|
||||||
|
</dependency>
|
||||||
|
|
||||||
|
<!-- Mysql Connector -->
|
||||||
|
<dependency>
|
||||||
|
<groupId>com.mysql</groupId>
|
||||||
|
<artifactId>mysql-connector-j</artifactId>
|
||||||
|
</dependency>
|
||||||
|
|
||||||
|
<!-- MuYu Common DataSource -->
|
||||||
|
<dependency>
|
||||||
|
<groupId>com.muyu</groupId>
|
||||||
|
<artifactId>muyu-common-datasource</artifactId>
|
||||||
|
</dependency>
|
||||||
|
|
||||||
|
<!-- MuYu Common DataScope -->
|
||||||
|
<dependency>
|
||||||
|
<groupId>com.muyu</groupId>
|
||||||
|
<artifactId>muyu-common-datascope</artifactId>
|
||||||
|
</dependency>
|
||||||
|
|
||||||
|
<!-- MuYu Common Log -->
|
||||||
|
<dependency>
|
||||||
|
<groupId>com.muyu</groupId>
|
||||||
|
<artifactId>muyu-common-log</artifactId>
|
||||||
|
</dependency>
|
||||||
|
|
||||||
|
<!-- MuYu Common Swagger -->
|
||||||
|
<dependency>
|
||||||
|
<groupId>com.muyu</groupId>
|
||||||
|
<artifactId>muyu-common-swagger</artifactId>
|
||||||
|
</dependency>
|
||||||
|
|
||||||
|
<dependency>
|
||||||
|
<groupId>com.muyu</groupId>
|
||||||
|
<artifactId>muyu-rule-engine-common</artifactId>
|
||||||
|
<version>3.6.3</version>
|
||||||
|
</dependency>
|
||||||
|
|
||||||
|
</dependencies>
|
||||||
|
|
||||||
|
<build>
|
||||||
|
<finalName>${project.artifactId}</finalName>
|
||||||
|
<plugins>
|
||||||
|
<plugin>
|
||||||
|
<groupId>org.springframework.boot</groupId>
|
||||||
|
<artifactId>spring-boot-maven-plugin</artifactId>
|
||||||
|
<executions>
|
||||||
|
<execution>
|
||||||
|
<goals>
|
||||||
|
<goal>repackage</goal>
|
||||||
|
</goals>
|
||||||
|
</execution>
|
||||||
|
</executions>
|
||||||
|
</plugin>
|
||||||
|
<!-- 加入maven deploy插件,当在deploy时,忽略些model-->
|
||||||
|
<plugin>
|
||||||
|
<groupId>org.apache.maven.plugins</groupId>
|
||||||
|
<artifactId>maven-deploy-plugin</artifactId>
|
||||||
|
<configuration>
|
||||||
|
<skip>true</skip>
|
||||||
|
</configuration>
|
||||||
|
</plugin>
|
||||||
|
</plugins>
|
||||||
|
</build>
|
||||||
|
|
||||||
|
</project>
|
|
@ -0,0 +1,26 @@
|
||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<project xmlns="http://maven.apache.org/POM/4.0.0"
|
||||||
|
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||||
|
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
|
||||||
|
<modelVersion>4.0.0</modelVersion>
|
||||||
|
<parent>
|
||||||
|
<groupId>com.muyu</groupId>
|
||||||
|
<artifactId>muyu-modules</artifactId>
|
||||||
|
<version>3.6.3</version>
|
||||||
|
</parent>
|
||||||
|
|
||||||
|
<artifactId>muyu-rule-engine</artifactId>
|
||||||
|
<packaging>pom</packaging>
|
||||||
|
<modules>
|
||||||
|
<module>muyu-rule-engine-common</module>
|
||||||
|
<module>muyu-rule-engine-remote</module>
|
||||||
|
<module>muyu-rule-engine-server</module>
|
||||||
|
</modules>
|
||||||
|
|
||||||
|
<properties>
|
||||||
|
<maven.compiler.source>17</maven.compiler.source>
|
||||||
|
<maven.compiler.target>17</maven.compiler.target>
|
||||||
|
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
|
||||||
|
</properties>
|
||||||
|
|
||||||
|
</project>
|
|
@ -14,6 +14,7 @@
|
||||||
<module>muyu-job</module>
|
<module>muyu-job</module>
|
||||||
<module>muyu-file</module>
|
<module>muyu-file</module>
|
||||||
<module>muyu-kvt</module>
|
<module>muyu-kvt</module>
|
||||||
|
<module>muyu-rule-engine</module>
|
||||||
</modules>
|
</modules>
|
||||||
|
|
||||||
<artifactId>muyu-modules</artifactId>
|
<artifactId>muyu-modules</artifactId>
|
||||||
|
|
Loading…
Reference in New Issue