Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
W
workflow-core
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
图表
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
黄夏豪
workflow-core
Commits
ad9f5fdc
提交
ad9f5fdc
authored
3月 12, 2021
作者:
ww1xhqc
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
model layer 继承BaseEntity
上级
2bf38c9f
显示空白字符变更
内嵌
并排
正在显示
4 个修改的文件
包含
78 行增加
和
53 行删除
+78
-53
ModelController.java
.../workflowcore/model_layer/controller/ModelController.java
+50
-24
ColumnInfo.java
...a/com/tykj/workflowcore/model_layer/model/ColumnInfo.java
+14
-12
TableInfo.java
...va/com/tykj/workflowcore/model_layer/model/TableInfo.java
+13
-16
TableVO.java
...java/com/tykj/workflowcore/model_layer/model/TableVO.java
+1
-1
没有找到文件。
src/main/java/com/tykj/workflowcore/model_layer/controller/ModelController.java
浏览文件 @
ad9f5fdc
...
@@ -53,7 +53,7 @@ public class ModelController {
...
@@ -53,7 +53,7 @@ public class ModelController {
throwables
.
printStackTrace
();
throwables
.
printStackTrace
();
}
}
return
ResultUtil
.
success
(
tableInfos
,
""
);
return
ResultUtil
.
success
(
tableInfos
,
""
);
}
}
/**
/**
...
@@ -69,7 +69,7 @@ public class ModelController {
...
@@ -69,7 +69,7 @@ public class ModelController {
if
(
tableName
!=
null
&&
tableName
!=
""
)
{
if
(
tableName
!=
null
&&
tableName
!=
""
)
{
return
ResultUtil
.
failed
(
"表名不存在"
);
return
ResultUtil
.
failed
(
"表名不存在"
);
}
}
return
ResultUtil
.
success
(
modelService
.
showModelFields
(
tableName
),
""
);
return
ResultUtil
.
success
(
modelService
.
showModelFields
(
tableName
),
""
);
}
}
/**
/**
...
@@ -89,7 +89,7 @@ public class ModelController {
...
@@ -89,7 +89,7 @@ public class ModelController {
}
}
}
}
modelService
.
newTable
(
tableVO
);
modelService
.
newTable
(
tableVO
);
return
ResultUtil
.
success
(
""
,
"新建成功"
);
return
ResultUtil
.
success
(
""
,
"新建成功"
);
}
}
...
@@ -105,43 +105,69 @@ public class ModelController {
...
@@ -105,43 +105,69 @@ public class ModelController {
@PostMapping
(
"/insertValues"
)
@PostMapping
(
"/insertValues"
)
public
ResponseEntity
insertValues
(
@RequestBody
Map
<
String
,
Object
>
map
)
{
public
ResponseEntity
insertValues
(
@RequestBody
Map
<
String
,
Object
>
map
)
{
modelService
.
putValueByEntityName
(
map
);
modelService
.
putValueByEntityName
(
map
);
return
ResultUtil
.
success
(
"数据插入成功"
,
""
);
return
ResultUtil
.
success
(
"数据插入成功"
,
""
);
}
}
/**
* @Author WWW
/**
* @Description 根据表名查询所有数据
* @param tableName
* @Date 9:30 2021/3/11
* @return org.springframework.http.ResponseEntity
* @param tableName
* @Author WWW
* @return org.springframework.http.ResponseEntity
* @Description 根据表名查询所有数据
**/
* @Date 9:30 2021/3/11
**/
@ApiOperation
(
"根据表名查询所有数据"
)
@ApiOperation
(
"根据表名查询所有数据"
)
@GetMapping
(
"/getAll"
)
@GetMapping
(
"/getAll"
)
public
ResponseEntity
getAll
(
String
tableName
)
{
public
ResponseEntity
getAll
(
String
tableName
)
{
try
{
try
{
return
ResultUtil
.
success
(
modelService
.
findAllByName
(
tableName
),
""
);
return
ResultUtil
.
success
(
modelService
.
findAllByName
(
tableName
),
""
);
}
catch
(
SQLException
throwables
)
{
}
catch
(
SQLException
throwables
)
{
throwables
.
printStackTrace
();
throwables
.
printStackTrace
();
}
}
return
ResultUtil
.
success
(
null
,
"获取失败"
);
return
ResultUtil
.
success
(
null
,
"获取失败"
);
}
}
/**
* @Author WWW
/**
* @Description 复杂查询
* @param tableName
* @Date 11:03 2021/3/11
* @return org.springframework.http.ResponseEntity
* @param tableName
* @Author WWW
* @param queryConditions
* @Description 判断表名是否重复
* @return org.springframework.http.ResponseEntity
* @Date 10:26 2021/3/12
**/
**/
@ApiOperation
(
"判断表名是否重复"
)
@GetMapping
(
"/checkTable"
)
public
ResponseEntity
check
(
String
tableName
)
{
List
<
TableInfo
>
tableInfos
=
null
;
try
{
tableInfos
=
modelService
.
listAllEntities
();
}
catch
(
SQLException
throwables
)
{
throwables
.
printStackTrace
();
}
for
(
TableInfo
tableInfo
:
tableInfos
)
{
if
(
tableName
.
equals
(
tableInfo
.
getName
()))
{
return
ResultUtil
.
failed
(
"表已经存在!"
);
}
}
return
ResultUtil
.
success
(
"表不存在新建成功!"
);
}
/**
* @param tableName
* @param queryConditions
* @return org.springframework.http.ResponseEntity
* @Author WWW
* @Description 复杂查询
* @Date 11:03 2021/3/11
**/
@ApiOperation
(
"复杂查询"
)
@ApiOperation
(
"复杂查询"
)
@GetMapping
(
"/complexQuery"
)
@GetMapping
(
"/complexQuery"
)
public
ResponseEntity
complexQuery
(
String
tableName
,
List
<
QueryCondition
>
queryConditions
)
{
public
ResponseEntity
complexQuery
(
String
tableName
,
List
<
QueryCondition
>
queryConditions
)
{
List
list
=
modelService
.
complexQuery
(
tableName
,
queryConditions
);
List
list
=
modelService
.
complexQuery
(
tableName
,
queryConditions
);
if
(
list
!=
null
)
{
if
(
list
!=
null
)
{
return
ResultUtil
.
success
(
list
,
"查询成功"
);
return
ResultUtil
.
success
(
list
,
"查询成功"
);
}
}
return
ResultUtil
.
success
(
null
,
"没有数据"
);
return
ResultUtil
.
success
(
null
,
"没有数据"
);
}
}
}
}
src/main/java/com/tykj/workflowcore/model_layer/model/ColumnInfo.java
浏览文件 @
ad9f5fdc
package
com
.
tykj
.
workflowcore
.
model_layer
.
model
;
package
com
.
tykj
.
workflowcore
.
model_layer
.
model
;
import
com.tykj.workflowcore.base.entity.BaseEntity
;
import
com.tykj.workflowcore.model_layer.annotatiion.WorkFlowCoreNoScan
;
import
com.tykj.workflowcore.model_layer.annotatiion.WorkFlowCoreNoScan
;
import
io.swagger.annotations.ApiModelProperty
;
import
lombok.Data
;
import
lombok.Data
;
import
javax.persistence.*
;
import
javax.persistence.*
;
...
@@ -18,30 +20,30 @@ import javax.persistence.*;
...
@@ -18,30 +20,30 @@ import javax.persistence.*;
@Entity
@Entity
@Table
(
name
=
"column_info"
)
@Table
(
name
=
"column_info"
)
@Data
@Data
public
class
ColumnInfo
{
public
class
ColumnInfo
extends
BaseEntity
{
@Id
@Id
@GeneratedValue
(
strategy
=
GenerationType
.
IDENTITY
)
@GeneratedValue
(
strategy
=
GenerationType
.
IDENTITY
)
@Column
(
name
=
"id"
)
private
long
id
;
private
long
id
;
@ApiModelProperty
(
"是否主键"
)
/**
/**
* 0是,1否
*
是否primary key,
0是,1否
*/
*/
@Column
(
name
=
"primary_key"
)
@Column
(
name
=
"primary_key"
)
private
Integer
primarykey
;
private
Integer
primaryKey
;
@Column
(
name
=
"name"
)
@ApiModelProperty
(
"列名"
)
private
String
name
;
private
String
name
;
@
Column
(
name
=
"cn_name
"
)
@
ApiModelProperty
(
"列名中文描述
"
)
private
String
cnName
;
private
String
cnName
;
@
Column
(
name
=
"type
"
)
@
ApiModelProperty
(
"列类型
"
)
private
String
type
;
private
String
type
;
@
Column
(
name
=
"length
"
)
@
ApiModelProperty
(
"长度
"
)
private
int
length
;
private
int
length
;
@
Column
(
name
=
"db_name
"
)
@
ApiModelProperty
(
"所属表名
"
)
private
String
dbName
;
private
String
dbName
;
@ApiModelProperty
(
"所属表id"
)
@Column
(
name
=
"db_id"
)
private
Long
dbId
;
private
Long
dbId
;
...
...
src/main/java/com/tykj/workflowcore/model_layer/model/TableInfo.java
浏览文件 @
ad9f5fdc
package
com
.
tykj
.
workflowcore
.
model_layer
.
model
;
package
com
.
tykj
.
workflowcore
.
model_layer
.
model
;
import
com.tykj.workflowcore.base.entity.BaseEntity
;
import
com.tykj.workflowcore.model_layer.annotatiion.WorkFlowCoreNoScan
;
import
com.tykj.workflowcore.model_layer.annotatiion.WorkFlowCoreNoScan
;
import
io.swagger.annotations.ApiModelProperty
;
import
lombok.Data
;
import
lombok.Data
;
import
org.hibernate.annotations.CreationTimestamp
;
import
org.hibernate.annotations.CreationTimestamp
;
import
org.hibernate.annotations.DynamicUpdate
;
import
org.hibernate.annotations.DynamicUpdate
;
...
@@ -27,40 +29,35 @@ import java.util.Date;
...
@@ -27,40 +29,35 @@ import java.util.Date;
@EntityListeners
(
AuditingEntityListener
.
class
)
@EntityListeners
(
AuditingEntityListener
.
class
)
@Table
(
name
=
"table_info"
)
@Table
(
name
=
"table_info"
)
@Data
@Data
public
class
TableInfo
implements
Serializable
{
public
class
TableInfo
extends
BaseEntity
implements
Serializable
{
@Id
@Id
@GeneratedValue
(
strategy
=
GenerationType
.
IDENTITY
)
@GeneratedValue
(
strategy
=
GenerationType
.
IDENTITY
)
@Column
(
name
=
"id"
)
@Column
(
name
=
"id"
)
private
long
id
;
private
long
id
;
@ApiModelProperty
(
"表名,不能为空"
)
@Column
(
nullable
=
false
,
name
=
"name"
)
@Column
(
nullable
=
false
)
private
String
name
;
private
String
name
;
@ApiModelProperty
(
"表中文名,不能为空"
)
@Column
(
nullable
=
false
,
name
=
"cn_name"
)
@Column
(
nullable
=
false
)
private
String
cnName
;
private
String
cnName
;
@Column
(
name
=
"description"
)
@ApiModelProperty
(
"详细描述"
)
private
String
desc
;
private
String
description
;
/**
/**
*0是扫描,1是自建
*0是扫描,1是自建
*/
*/
@
Column
(
name
=
"type
"
)
@
ApiModelProperty
(
"建表类型
"
)
private
Integer
type
;
private
Integer
type
;
@
Column
(
name
=
"reviser
"
)
@
ApiModelProperty
(
"执行人保留字段
"
)
private
String
reviser
;
private
String
reviser
;
@Lob
@Lob
@
Column
(
name
=
"
xml"
)
@
ApiModelProperty
(
"表对应hbm.
xml"
)
private
String
xml
;
private
String
xml
;
@Column
(
name
=
"update_time"
)
private
Date
updateTime
;
@Column
(
name
=
"create_time"
)
private
Date
createTime
;
}
}
src/main/java/com/tykj/workflowcore/model_layer/model/TableVO.java
浏览文件 @
ad9f5fdc
package
com
.
tykj
.
workflowcore
.
model_layer
.
model
;
package
com
.
tykj
.
workflowcore
.
model_layer
.
model
;
import
com.tykj.workflowcore.model_layer.annotatiion.WorkFlowCoreNoScan
;
import
lombok.Data
;
import
lombok.Data
;
import
java.util.List
;
import
java.util.List
;
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论