Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
W
workflow-core
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
图表
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
黄夏豪
workflow-core
Commits
0c2fda2e
提交
0c2fda2e
authored
3月 11, 2021
作者:
黄夏豪
浏览文件
操作
浏览文件
下载
差异文件
Merge remote-tracking branch 'origin/master'
上级
aa2283ba
3b6f14f0
隐藏空白字符变更
内嵌
并排
正在显示
3 个修改的文件
包含
65 行增加
和
11 行删除
+65
-11
ModelController.java
.../workflowcore/model_layer/controller/ModelController.java
+22
-3
ModelService.java
...m/tykj/workflowcore/model_layer/service/ModelService.java
+3
-0
ModelImpl.java
...tykj/workflowcore/model_layer/service/impl/ModelImpl.java
+40
-8
没有找到文件。
src/main/java/com/tykj/workflowcore/model_layer/controller/ModelController.java
浏览文件 @
0c2fda2e
...
@@ -2,15 +2,15 @@ package com.tykj.workflowcore.model_layer.controller;
...
@@ -2,15 +2,15 @@ package com.tykj.workflowcore.model_layer.controller;
import
com.tykj.workflowcore.base.result.ResultUtil
;
import
com.tykj.workflowcore.base.result.ResultUtil
;
import
com.tykj.workflowcore.model_layer.model.ColumnInfo
;
import
com.tykj.workflowcore.model_layer.model.QueryCondition
;
import
com.tykj.workflowcore.model_layer.model.TableInfo
;
import
com.tykj.workflowcore.model_layer.model.TableInfo
;
import
com.tykj.workflowcore.model_layer.model.TableVO
;
import
com.tykj.workflowcore.model_layer.model.TableVO
;
import
com.tykj.workflowcore.model_layer.service.ModelService
;
import
com.tykj.workflowcore.model_layer.service.ModelService
;
import
io.swagger.annotations.Api
;
import
io.swagger.annotations.Api
;
import
io.swagger.annotations.ApiModel
;
import
io.swagger.annotations.ApiOperation
;
import
io.swagger.annotations.ApiOperation
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.http.HttpStatus
;
import
org.springframework.http.ResponseEntity
;
import
org.springframework.http.ResponseEntity
;
import
org.springframework.web.bind.annotation.*
;
import
org.springframework.web.bind.annotation.*
;
...
@@ -128,4 +128,23 @@ public class ModelController {
...
@@ -128,4 +128,23 @@ public class ModelController {
}
}
return
ResultUtil
.
success
(
null
,
"获取失败"
);
return
ResultUtil
.
success
(
null
,
"获取失败"
);
}
}
/**
* @Author WWW
* @Description 复杂查询
* @Date 11:03 2021/3/11
* @param tableName
* @param queryConditions
* @return org.springframework.http.ResponseEntity
**/
@ApiOperation
(
"复杂查询"
)
@GetMapping
(
"/complexQuery"
)
public
ResponseEntity
complexQuery
(
String
tableName
,
List
<
QueryCondition
>
queryConditions
)
{
List
list
=
modelService
.
complexquery
(
tableName
,
queryConditions
);
if
(
list
!=
null
){
return
ResultUtil
.
success
(
list
,
"查询成功"
);
}
return
ResultUtil
.
success
(
null
,
"没有数据"
);
}
}
}
src/main/java/com/tykj/workflowcore/model_layer/service/ModelService.java
浏览文件 @
0c2fda2e
...
@@ -4,6 +4,7 @@ package com.tykj.workflowcore.model_layer.service;
...
@@ -4,6 +4,7 @@ package com.tykj.workflowcore.model_layer.service;
import
com.fasterxml.jackson.core.JsonProcessingException
;
import
com.fasterxml.jackson.core.JsonProcessingException
;
import
com.tykj.workflowcore.model_layer.model.ColumnInfo
;
import
com.tykj.workflowcore.model_layer.model.ColumnInfo
;
import
com.tykj.workflowcore.model_layer.model.QueryCondition
;
import
com.tykj.workflowcore.model_layer.model.TableInfo
;
import
com.tykj.workflowcore.model_layer.model.TableInfo
;
import
com.tykj.workflowcore.model_layer.model.TableVO
;
import
com.tykj.workflowcore.model_layer.model.TableVO
;
import
org.springframework.stereotype.Service
;
import
org.springframework.stereotype.Service
;
...
@@ -39,4 +40,6 @@ public interface ModelService {
...
@@ -39,4 +40,6 @@ public interface ModelService {
void
swaggerScan
(
List
<
Class
<?>>
classList
);
void
swaggerScan
(
List
<
Class
<?>>
classList
);
List
findAllByName
(
String
name
)
throws
SQLException
;
List
findAllByName
(
String
name
)
throws
SQLException
;
List
complexquery
(
String
tableName
,
List
<
QueryCondition
>
queryConditions
);
}
}
src/main/java/com/tykj/workflowcore/model_layer/service/impl/ModelImpl.java
浏览文件 @
0c2fda2e
...
@@ -8,10 +8,7 @@ import com.fasterxml.jackson.databind.ObjectMapper;
...
@@ -8,10 +8,7 @@ import com.fasterxml.jackson.databind.ObjectMapper;
import
com.tykj.workflowcore.model_layer.annotatiion.WorkFlowCoreNoScan
;
import
com.tykj.workflowcore.model_layer.annotatiion.WorkFlowCoreNoScan
;
import
com.tykj.workflowcore.model_layer.dao.ColumnInfoDao
;
import
com.tykj.workflowcore.model_layer.dao.ColumnInfoDao
;
import
com.tykj.workflowcore.model_layer.dao.TableInfoDao
;
import
com.tykj.workflowcore.model_layer.dao.TableInfoDao
;
import
com.tykj.workflowcore.model_layer.model.ColumnInfo
;
import
com.tykj.workflowcore.model_layer.model.*
;
import
com.tykj.workflowcore.model_layer.model.ColumnVO
;
import
com.tykj.workflowcore.model_layer.model.TableInfo
;
import
com.tykj.workflowcore.model_layer.model.TableVO
;
import
com.tykj.workflowcore.model_layer.service.ModelService
;
import
com.tykj.workflowcore.model_layer.service.ModelService
;
import
com.tykj.workflowcore.model_layer.utils.CreatTableUtil
;
import
com.tykj.workflowcore.model_layer.utils.CreatTableUtil
;
import
io.swagger.annotations.ApiModel
;
import
io.swagger.annotations.ApiModel
;
...
@@ -44,6 +41,7 @@ import java.text.SimpleDateFormat;
...
@@ -44,6 +41,7 @@ import java.text.SimpleDateFormat;
import
java.util.*
;
import
java.util.*
;
import
static
com
.
tykj
.
workflowcore
.
model_layer
.
utils
.
CreatTableUtil
.*;
import
static
com
.
tykj
.
workflowcore
.
model_layer
.
utils
.
CreatTableUtil
.*;
import
static
com
.
tykj
.
workflowcore
.
model_layer
.
utils
.
HqlUtil
.
createQuery
;
/**
/**
...
@@ -347,7 +345,13 @@ public class ModelImpl implements ModelService {
...
@@ -347,7 +345,13 @@ public class ModelImpl implements ModelService {
}
}
}
}
}
}
/**
* @Author WWW
* @Description 判重
* @Date 10:50 2021/3/11
* @param tableName
* @return boolean
**/
public
boolean
checkRepeat
(
String
tableName
)
{
public
boolean
checkRepeat
(
String
tableName
)
{
Specification
spec
=
(
Specification
)
(
root
,
criteriaQuery
,
criteriaBuilder
)
->
{
Specification
spec
=
(
Specification
)
(
root
,
criteriaQuery
,
criteriaBuilder
)
->
{
Path
name
=
root
.
get
(
"name"
);
Path
name
=
root
.
get
(
"name"
);
...
@@ -365,12 +369,40 @@ public class ModelImpl implements ModelService {
...
@@ -365,12 +369,40 @@ public class ModelImpl implements ModelService {
return
true
;
return
true
;
}
}
/**
* @Author WWW
* @Description 通过表名查询所有信息
* @Date 10:51 2021/3/11
* @param name
* @return java.util.List
**/
@Override
@Override
public
List
findAllByName
(
String
name
)
throws
SQLException
{
public
List
findAllByName
(
String
name
)
{
if
(
name
!=
null
&&
name
!=
""
){
if
(
name
!=
null
&&
name
!=
""
){
return
Db
.
use
().
findAll
(
name
);
try
{
return
Db
.
use
().
findAll
(
name
);
}
catch
(
SQLException
throwables
)
{
throwables
.
printStackTrace
();
}
}
}
return
null
;
return
null
;
}
}
@Override
public
List
complexQuery
(
String
tableName
,
List
<
QueryCondition
>
queryConditions
)
{
List
<
cn
.
hutool
.
db
.
Entity
>
list
=
null
;
if
(!
tableName
.
equals
(
""
)){
String
query
=
createQuery
(
tableName
,
queryConditions
);
try
{
list
=
Db
.
use
().
query
(
query
);
}
catch
(
SQLException
throwables
)
{
throwables
.
printStackTrace
();
}
}
else
{
return
null
;
}
return
list
;
}
}
}
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论