Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
J
jz-dmp-service
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
姚本章
jz-dmp-service
Commits
cbd215fb
Commit
cbd215fb
authored
Dec 21, 2020
by
mcb
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
离线同步任务列表
parent
c8ead692
Changes
5
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
160 additions
and
78 deletions
+160
-78
update.sql
database/mcb/update.sql
+5
-0
OfflineSynchController.java
...es/controller/DataIntegration/OfflineSynchController.java
+0
-2
TaskListPageDto.java
...ules/controller/DataIntegration/bean/TaskListPageDto.java
+88
-18
TaskListPageReq.java
...ules/controller/DataIntegration/bean/TaskListPageReq.java
+40
-24
OfflineSynchMapper.xml
src/main/resources/mapper/dmp/OfflineSynchMapper.xml
+27
-34
No files found.
database/mcb/update.sql
0 → 100644
View file @
cbd215fb
alter
table
dmp_develop_task
add
SOURCE_DB_ID
varchar
(
64
)
default
NULL
COMMENT
'源数据库ID'
;
alter
table
dmp_develop_task
add
SOURCE_DB_NAME
varchar
(
64
)
default
NULL
COMMENT
'源数据库名称'
;
alter
table
dmp_develop_task
add
SOURCE_TABLE_NAME
varchar
(
64
)
default
NULL
COMMENT
'源数据表名称'
;
alter
table
dmp_develop_task
add
TARGET_DB_NAME
varchar
(
64
)
default
NULL
COMMENT
'目标数据库名称'
;
alter
table
dmp_develop_task
add
TARGET_TABLE_NAME
varchar
(
64
)
default
NULL
COMMENT
'目标数据表名称'
;
\ No newline at end of file
src/main/java/com/jz/dmp/modules/controller/DataIntegration/OfflineSynchController.java
View file @
cbd215fb
...
@@ -47,8 +47,6 @@ public class OfflineSynchController {
...
@@ -47,8 +47,6 @@ public class OfflineSynchController {
pageInfo
.
setCode
(
ResultCode
.
INTERNAL_SERVER_ERROR
);
pageInfo
.
setCode
(
ResultCode
.
INTERNAL_SERVER_ERROR
);
e
.
printStackTrace
();
e
.
printStackTrace
();
}
}
return
pageInfo
;
return
pageInfo
;
}
}
}
}
src/main/java/com/jz/dmp/modules/controller/DataIntegration/bean/TaskListPageDto.java
View file @
cbd215fb
...
@@ -6,7 +6,7 @@ import io.swagger.annotations.ApiModelProperty;
...
@@ -6,7 +6,7 @@ import io.swagger.annotations.ApiModelProperty;
/**
/**
* @ClassName: TaskListPageDto
* @ClassName: TaskListPageDto
* @Description: 离线同步任务列表返回参数
* @Description: 离线同步任务列表返回参数
* @Author
* @Author
:Bellamy
* @Date 2020/12/21
* @Date 2020/12/21
* @Version 1.0
* @Version 1.0
*/
*/
...
@@ -14,10 +14,10 @@ import io.swagger.annotations.ApiModelProperty;
...
@@ -14,10 +14,10 @@ import io.swagger.annotations.ApiModelProperty;
public
class
TaskListPageDto
{
public
class
TaskListPageDto
{
/*
/*
*
i
d
*
taskI
d
* */
* */
@ApiModelProperty
(
value
=
"
i
d"
)
@ApiModelProperty
(
value
=
"
任务taskI
d"
)
String
i
d
;
String
taskI
d
;
/*
/*
* treeId
* treeId
...
@@ -50,12 +50,42 @@ public class TaskListPageDto {
...
@@ -50,12 +50,42 @@ public class TaskListPageDto {
* 创建时间
* 创建时间
* */
* */
@ApiModelProperty
(
value
=
"创建时间"
)
@ApiModelProperty
(
value
=
"创建时间"
)
String
creTime
;
String
cre
ate
Time
;
/*
/*
* 更改时间
* 更改时间
* */
* */
@ApiModelProperty
(
value
=
"更改时间"
)
@ApiModelProperty
(
value
=
"更改时间"
)
String
uptTime
;
String
updateTime
;
/*
* 源数据库名称
* */
@ApiModelProperty
(
value
=
"源数据库名称"
)
String
sourceDbName
;
/*
* 源数据库表名称
* */
@ApiModelProperty
(
value
=
"源数据表名称"
)
String
sourceTableName
;
/*
* 目标数据库名称
* */
@ApiModelProperty
(
value
=
"目标数据库名称"
)
String
targetDbName
;
/*
* 目标数据库表名称
* */
@ApiModelProperty
(
value
=
"目标数据表名称"
)
String
targetTableName
;
/*
* 目标数据库类型
* */
@ApiModelProperty
(
value
=
"目标数据库类型"
)
String
targetDbType
;
public
String
getSyncTime
()
{
public
String
getSyncTime
()
{
return
syncTime
;
return
syncTime
;
...
@@ -89,28 +119,28 @@ public class TaskListPageDto {
...
@@ -89,28 +119,28 @@ public class TaskListPageDto {
this
.
chkTime
=
chkTime
;
this
.
chkTime
=
chkTime
;
}
}
public
String
getCreTime
()
{
public
String
getCre
ate
Time
()
{
return
creTime
;
return
cre
ate
Time
;
}
}
public
void
setCre
Time
(
String
cr
eTime
)
{
public
void
setCre
ateTime
(
String
creat
eTime
)
{
this
.
cre
Time
=
cr
eTime
;
this
.
cre
ateTime
=
creat
eTime
;
}
}
public
String
getUp
t
Time
()
{
public
String
getUp
date
Time
()
{
return
up
t
Time
;
return
up
date
Time
;
}
}
public
void
setUp
tTime
(
String
upt
Time
)
{
public
void
setUp
dateTime
(
String
update
Time
)
{
this
.
up
tTime
=
upt
Time
;
this
.
up
dateTime
=
update
Time
;
}
}
public
String
getId
()
{
public
String
get
Task
Id
()
{
return
i
d
;
return
taskI
d
;
}
}
public
void
set
Id
(
String
i
d
)
{
public
void
set
TaskId
(
String
taskI
d
)
{
this
.
id
=
i
d
;
this
.
taskId
=
taskI
d
;
}
}
public
String
getTreeId
()
{
public
String
getTreeId
()
{
...
@@ -120,4 +150,44 @@ public class TaskListPageDto {
...
@@ -120,4 +150,44 @@ public class TaskListPageDto {
public
void
setTreeId
(
String
treeId
)
{
public
void
setTreeId
(
String
treeId
)
{
this
.
treeId
=
treeId
;
this
.
treeId
=
treeId
;
}
}
public
String
getSourceDbName
()
{
return
sourceDbName
;
}
public
void
setSourceDbName
(
String
sourceDbName
)
{
this
.
sourceDbName
=
sourceDbName
;
}
public
String
getTargetDbName
()
{
return
targetDbName
;
}
public
void
setTargetDbName
(
String
targetDbName
)
{
this
.
targetDbName
=
targetDbName
;
}
public
String
getTargetDbType
()
{
return
targetDbType
;
}
public
void
setTargetDbType
(
String
targetDbType
)
{
this
.
targetDbType
=
targetDbType
;
}
public
String
getSourceTableName
()
{
return
sourceTableName
;
}
public
void
setSourceTableName
(
String
sourceTableName
)
{
this
.
sourceTableName
=
sourceTableName
;
}
public
String
getTargetTableName
()
{
return
targetTableName
;
}
public
void
setTargetTableName
(
String
targetTableName
)
{
this
.
targetTableName
=
targetTableName
;
}
}
}
src/main/java/com/jz/dmp/modules/controller/DataIntegration/bean/TaskListPageReq.java
View file @
cbd215fb
...
@@ -6,6 +6,7 @@ import io.swagger.annotations.Api;
...
@@ -6,6 +6,7 @@ import io.swagger.annotations.Api;
import
io.swagger.annotations.ApiModel
;
import
io.swagger.annotations.ApiModel
;
import
io.swagger.annotations.ApiModelProperty
;
import
io.swagger.annotations.ApiModelProperty
;
import
javax.validation.constraints.NotEmpty
;
import
javax.validation.constraints.NotNull
;
import
javax.validation.constraints.NotNull
;
/**
/**
...
@@ -21,6 +22,7 @@ public class TaskListPageReq extends BasePageBean {
...
@@ -21,6 +22,7 @@ public class TaskListPageReq extends BasePageBean {
* 项目ID
* 项目ID
* */
* */
@NotNull
(
message
=
"项目ID不能空"
)
@NotNull
(
message
=
"项目ID不能空"
)
@NotEmpty
(
message
=
"项目ID不能空"
)
@ApiModelProperty
(
value
=
"项目ID"
)
@ApiModelProperty
(
value
=
"项目ID"
)
private
String
projectId
;
private
String
projectId
;
...
@@ -32,28 +34,34 @@ public class TaskListPageReq extends BasePageBean {
...
@@ -32,28 +34,34 @@ public class TaskListPageReq extends BasePageBean {
private
String
parentId
;
private
String
parentId
;
/*
/*
* 源数据id
* 源数据
库
id
* */
* */
@ApiModelProperty
(
value
=
"源数据id"
)
@ApiModelProperty
(
value
=
"源数据
库
id"
)
private
String
sourceDb
;
private
String
sourceDb
Id
;
/*
/*
* 目标数据库id
* 目标数据库id
* */
* */
@ApiModelProperty
(
value
=
"目标数据库id"
)
@ApiModelProperty
(
value
=
"目标数据库id"
)
private
String
targetDb
;
private
String
targetDb
Id
;
/*
/*
* 源数据库表
* 目标数据库名称
* */
@ApiModelProperty
(
value
=
"目标数据库名称"
)
private
String
targetDbName
;
/*
* 源数据库表名称
* */
* */
@ApiModelProperty
(
value
=
"源数据库表"
)
@ApiModelProperty
(
value
=
"源数据库表"
)
private
String
sourceTable
;
private
String
sourceTable
Name
;
/*
/*
* 目标数据库表
* 目标数据库表
名称
* */
* */
@ApiModelProperty
(
value
=
"目标数据库表"
)
@ApiModelProperty
(
value
=
"目标数据库表"
)
private
String
targetTable
;
private
String
targetTable
Name
;
public
String
getProjectId
()
{
public
String
getProjectId
()
{
return
projectId
;
return
projectId
;
...
@@ -71,35 +79,43 @@ public class TaskListPageReq extends BasePageBean {
...
@@ -71,35 +79,43 @@ public class TaskListPageReq extends BasePageBean {
this
.
parentId
=
parentId
;
this
.
parentId
=
parentId
;
}
}
public
String
getSourceDb
()
{
public
String
getSourceDbId
()
{
return
sourceDb
;
return
sourceDbId
;
}
public
void
setSourceDbId
(
String
sourceDbId
)
{
this
.
sourceDbId
=
sourceDbId
;
}
public
String
getTargetDbId
()
{
return
targetDbId
;
}
}
public
void
set
SourceDb
(
String
sourceDb
)
{
public
void
set
TargetDbId
(
String
targetDbId
)
{
this
.
sourceDb
=
sourceDb
;
this
.
targetDbId
=
targetDbId
;
}
}
public
String
getTargetDb
()
{
public
String
getTargetDb
Name
()
{
return
targetDb
;
return
targetDb
Name
;
}
}
public
void
setTargetDb
(
String
targetDb
)
{
public
void
setTargetDb
Name
(
String
targetDbName
)
{
this
.
targetDb
=
targetDb
;
this
.
targetDb
Name
=
targetDbName
;
}
}
public
String
getSourceTable
()
{
public
String
getSourceTable
Name
()
{
return
sourceTable
;
return
sourceTable
Name
;
}
}
public
void
setSourceTable
(
String
sourceTabl
e
)
{
public
void
setSourceTable
Name
(
String
sourceTableNam
e
)
{
this
.
sourceTable
=
sourceTabl
e
;
this
.
sourceTable
Name
=
sourceTableNam
e
;
}
}
public
String
getTargetTable
()
{
public
String
getTargetTable
Name
()
{
return
targetTable
;
return
targetTable
Name
;
}
}
public
void
setTargetTable
(
String
targetTabl
e
)
{
public
void
setTargetTable
Name
(
String
targetTableNam
e
)
{
this
.
targetTable
=
targetTabl
e
;
this
.
targetTable
Name
=
targetTableNam
e
;
}
}
}
}
src/main/resources/mapper/dmp/OfflineSynchMapper.xml
View file @
cbd215fb
...
@@ -4,43 +4,36 @@
...
@@ -4,43 +4,36 @@
<select
id=
"queryTaskListPage"
resultType=
"com.jz.dmp.modules.controller.DataIntegration.bean.TaskListPageDto"
<select
id=
"queryTaskListPage"
resultType=
"com.jz.dmp.modules.controller.DataIntegration.bean.TaskListPageDto"
parameterType=
"com.jz.dmp.modules.controller.DataIntegration.bean.TaskListPageReq"
>
parameterType=
"com.jz.dmp.modules.controller.DataIntegration.bean.TaskListPageReq"
>
SELECT * FROM (
SELECT
SELECT cast(ddt.script AS char) AS script,
ddt.chk_result AS chkResult,
ddt.chk_result AS chkResult,
ddt.sync_result AS syncResult,
ddt.sync_result AS syncResult,
ddt.id AS
i
d,
ddt.id AS
taskI
d,
ddt.tree_id AS treeId,
ddt.tree_id AS treeId,
dnt.name AS treeName,
dnt.NAME AS treeName,
DATE_FORMAT(ddt.create_time,'%Y-%m-%d %H:%i:%s') AS createTime,
DATE_FORMAT( ddt.create_time, '%Y-%m-%d %H:%i:%s' ) AS createTime,
DATE_FORMAT(ddt.update_time ,'%Y-%m-%d %H:%i:%s') AS updateTime,
DATE_FORMAT( ddt.update_time, '%Y-%m-%d %H:%i:%s' ) AS updateTime,
DATE_FORMAT(ddt.chk_time,'%Y-%m-%d %H:%i:%s') AS chkTime,
DATE_FORMAT( ddt.chk_time, '%Y-%m-%d %H:%i:%s' ) AS chkTime,
DATE_FORMAT(ddt.sync_time,'%Y-%m-%d %H:%i:%s') AS syncTime,
DATE_FORMAT( ddt.sync_time, '%Y-%m-%d %H:%i:%s' ) AS syncTime,
dsdt.datasource_type AS dbType
ddt.source_db_id as sourceDbId,
ddt.source_db_name as sourceDbName,
ddt.source_table_name as sourceTableName,
ddt.target_db_name as targetDbName,
ddt.target_table_name as targetTableName,
dsdt.datasource_type AS targetDbType
FROM dmp_develop_task AS ddt
FROM dmp_develop_task AS ddt
INNER JOIN dmp_navigation_tree AS dnt ON ddt.TREE_ID = dnt.ID
INNER JOIN dmp_navigation_tree AS dnt ON ddt.TREE_ID = dnt.ID
LEFT JOIN dmp_syncing_datasource AS dsd ON
LEFT JOIN dmp_syncing_datasource AS dsd ON instr(script,concat('"targetDbConnection":"',dsd.datasource_name,'"'))>0
instr(script,concat('"targetDbConnection":"',dsd.datasource_name,'"'))>0
LEFT JOIN dmp_syncing_datasource_type AS dsdt ON dsd.datasource_type = dsdt.id
LEFT JOIN dmp_syncing_datasource_type AS dsdt ON dsd.datasource_type = dsdt.id
WHERE ddt.data_status ='1' AND ddt.TYPE='3' AND ddt.TASK_TYPE ='2'
WHERE ddt.data_status ='1' AND ddt.TYPE='3' AND ddt.TASK_TYPE ='2'
AND dnt.CATEGORY='2' AND dnt.TYPE ='3'
AND dnt.CATEGORY='2' AND dnt.TYPE ='3'
AND dnt.IS_LEVEL ='1'
AND dnt.IS_LEVEL ='1'
AND dnt.PROJECT_ID =#{projectId}
AND dnt.PROJECT_ID =#{projectId}
AND dsd.PROJECT_ID=#{projectId}
AND dsd.PROJECT_ID=#{projectId}
) AS a
<if
test=
"sourceDbId != null and sourceDbId !=''"
>
and ddt.source_db_id=#{sourceDbId}
</if>
WHERE 1=1
<if
test=
"sourceTableName != null and sourceTableName !=''"
>
and ddt.source_table_name like concat('%',#{sourceTableName},'%')
</if>
<if
test=
"sourceDb !=null and sourceDb !=''"
>
<if
test=
"targetDbName != null and targetDbName !=''"
>
and ddt.target_db_name like concat('%',#{targetDbName},'%')
</if>
AND a.SCRIPT LIKE CONCAT('%','"dbConnection":','"',#{sourceDb},'"','%')
<if
test=
"targetTableName != null and targetTableName !=''"
>
and ddt.target_table_name like concat('%',#{targetTableName},'%')
</if>
</if>
ORDER BY ddt.create_time DESC
<if
test=
"targetDb !=null and targetDb !=''"
>
AND a.SCRIPT LIKE CONCAT('%','"targetDbConnection":','"',#{targetDb},'"','%')
</if>
<if
test=
"sourceTable !=null and sourceTable !=''"
>
AND a.SCRIPT LIKE CONCAT('%','"registerTableName":','"',#{sourceTable},'"','%')
</if>
<if
test=
"targetTable !=null and targetTable !=''"
>
AND a.SCRIPT LIKE CONCAT('%','"targetTable":','"',#{targetTable},'"','%')
</if>
ORDER BY a.createTime DESC
</select>
</select>
</mapper>
</mapper>
\ No newline at end of file
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment