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 {
pageInfo
.
setCode
(
ResultCode
.
INTERNAL_SERVER_ERROR
);
e
.
printStackTrace
();
}
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;
/**
* @ClassName: TaskListPageDto
* @Description: 离线同步任务列表返回参数
* @Author
* @Author
:Bellamy
* @Date 2020/12/21
* @Version 1.0
*/
...
...
@@ -14,10 +14,10 @@ import io.swagger.annotations.ApiModelProperty;
public
class
TaskListPageDto
{
/*
*
i
d
*
taskI
d
* */
@ApiModelProperty
(
value
=
"
i
d"
)
String
i
d
;
@ApiModelProperty
(
value
=
"
任务taskI
d"
)
String
taskI
d
;
/*
* treeId
...
...
@@ -50,12 +50,42 @@ public class TaskListPageDto {
* 创建时间
* */
@ApiModelProperty
(
value
=
"创建时间"
)
String
creTime
;
String
cre
ate
Time
;
/*
* 更改时间
* */
@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
()
{
return
syncTime
;
...
...
@@ -89,28 +119,28 @@ public class TaskListPageDto {
this
.
chkTime
=
chkTime
;
}
public
String
getCreTime
()
{
return
creTime
;
public
String
getCre
ate
Time
()
{
return
cre
ate
Time
;
}
public
void
setCre
Time
(
String
cr
eTime
)
{
this
.
cre
Time
=
cr
eTime
;
public
void
setCre
ateTime
(
String
creat
eTime
)
{
this
.
cre
ateTime
=
creat
eTime
;
}
public
String
getUp
t
Time
()
{
return
up
t
Time
;
public
String
getUp
date
Time
()
{
return
up
date
Time
;
}
public
void
setUp
tTime
(
String
upt
Time
)
{
this
.
up
tTime
=
upt
Time
;
public
void
setUp
dateTime
(
String
update
Time
)
{
this
.
up
dateTime
=
update
Time
;
}
public
String
getId
()
{
return
i
d
;
public
String
get
Task
Id
()
{
return
taskI
d
;
}
public
void
set
Id
(
String
i
d
)
{
this
.
id
=
i
d
;
public
void
set
TaskId
(
String
taskI
d
)
{
this
.
taskId
=
taskI
d
;
}
public
String
getTreeId
()
{
...
...
@@ -120,4 +150,44 @@ public class TaskListPageDto {
public
void
setTreeId
(
String
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;
import
io.swagger.annotations.ApiModel
;
import
io.swagger.annotations.ApiModelProperty
;
import
javax.validation.constraints.NotEmpty
;
import
javax.validation.constraints.NotNull
;
/**
...
...
@@ -21,6 +22,7 @@ public class TaskListPageReq extends BasePageBean {
* 项目ID
* */
@NotNull
(
message
=
"项目ID不能空"
)
@NotEmpty
(
message
=
"项目ID不能空"
)
@ApiModelProperty
(
value
=
"项目ID"
)
private
String
projectId
;
...
...
@@ -32,28 +34,34 @@ public class TaskListPageReq extends BasePageBean {
private
String
parentId
;
/*
* 源数据id
* 源数据
库
id
* */
@ApiModelProperty
(
value
=
"源数据id"
)
private
String
sourceDb
;
@ApiModelProperty
(
value
=
"源数据
库
id"
)
private
String
sourceDb
Id
;
/*
* 目标数据库id
* */
@ApiModelProperty
(
value
=
"目标数据库id"
)
private
String
targetDb
;
private
String
targetDb
Id
;
/*
* 源数据库表
* 目标数据库名称
* */
@ApiModelProperty
(
value
=
"目标数据库名称"
)
private
String
targetDbName
;
/*
* 源数据库表名称
* */
@ApiModelProperty
(
value
=
"源数据库表"
)
private
String
sourceTable
;
private
String
sourceTable
Name
;
/*
* 目标数据库表
* 目标数据库表
名称
* */
@ApiModelProperty
(
value
=
"目标数据库表"
)
private
String
targetTable
;
private
String
targetTable
Name
;
public
String
getProjectId
()
{
return
projectId
;
...
...
@@ -71,35 +79,43 @@ public class TaskListPageReq extends BasePageBean {
this
.
parentId
=
parentId
;
}
public
String
getSourceDb
()
{
return
sourceDb
;
public
String
getSourceDbId
()
{
return
sourceDbId
;
}
public
void
setSourceDbId
(
String
sourceDbId
)
{
this
.
sourceDbId
=
sourceDbId
;
}
public
String
getTargetDbId
()
{
return
targetDbId
;
}
public
void
set
SourceDb
(
String
sourceDb
)
{
this
.
sourceDb
=
sourceDb
;
public
void
set
TargetDbId
(
String
targetDbId
)
{
this
.
targetDbId
=
targetDbId
;
}
public
String
getTargetDb
()
{
return
targetDb
;
public
String
getTargetDb
Name
()
{
return
targetDb
Name
;
}
public
void
setTargetDb
(
String
targetDb
)
{
this
.
targetDb
=
targetDb
;
public
void
setTargetDb
Name
(
String
targetDbName
)
{
this
.
targetDb
Name
=
targetDbName
;
}
public
String
getSourceTable
()
{
return
sourceTable
;
public
String
getSourceTable
Name
()
{
return
sourceTable
Name
;
}
public
void
setSourceTable
(
String
sourceTabl
e
)
{
this
.
sourceTable
=
sourceTabl
e
;
public
void
setSourceTable
Name
(
String
sourceTableNam
e
)
{
this
.
sourceTable
Name
=
sourceTableNam
e
;
}
public
String
getTargetTable
()
{
return
targetTable
;
public
String
getTargetTable
Name
()
{
return
targetTable
Name
;
}
public
void
setTargetTable
(
String
targetTabl
e
)
{
this
.
targetTable
=
targetTabl
e
;
public
void
setTargetTable
Name
(
String
targetTableNam
e
)
{
this
.
targetTable
Name
=
targetTableNam
e
;
}
}
src/main/resources/mapper/dmp/OfflineSynchMapper.xml
View file @
cbd215fb
...
...
@@ -4,43 +4,36 @@
<select
id=
"queryTaskListPage"
resultType=
"com.jz.dmp.modules.controller.DataIntegration.bean.TaskListPageDto"
parameterType=
"com.jz.dmp.modules.controller.DataIntegration.bean.TaskListPageReq"
>
SELECT * FROM (
SELECT cast(ddt.script AS char) AS script,
SELECT
ddt.chk_result AS chkResult,
ddt.sync_result AS syncResult,
ddt.id AS
i
d,
ddt.id AS
taskI
d,
ddt.tree_id AS treeId,
dnt.name AS treeName,
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.chk_time,'%Y-%m-%d %H:%i:%s') AS chkTime,
DATE_FORMAT(ddt.sync_time,'%Y-%m-%d %H:%i:%s') AS syncTime,
dsdt.datasource_type AS dbType
dnt.NAME AS treeName,
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.chk_time, '%Y-%m-%d %H:%i:%s' ) AS chkTime,
DATE_FORMAT( ddt.sync_time, '%Y-%m-%d %H:%i:%s' ) AS syncTime,
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
INNER JOIN dmp_navigation_tree AS dnt ON ddt.TREE_ID = dnt.ID
LEFT JOIN dmp_syncing_datasource AS dsd ON
instr(script,concat('"targetDbConnection":"',dsd.datasource_name,'"'))>0
LEFT JOIN dmp_syncing_datasource AS dsd ON instr(script,concat('"targetDbConnection":"',dsd.datasource_name,'"'))>0
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'
AND dnt.CATEGORY='2' AND dnt.TYPE ='3'
AND dnt.IS_LEVEL ='1'
AND dnt.PROJECT_ID =#{projectId}
AND dsd.PROJECT_ID=#{projectId}
) AS a
WHERE 1=1
<if
test=
"sourceDb !=null and sourceDb !=''"
>
AND a.SCRIPT LIKE CONCAT('%','"dbConnection":','"',#{sourceDb},'"','%')
</if>
<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
<if
test=
"sourceDbId != null and sourceDbId !=''"
>
and ddt.source_db_id=#{sourceDbId}
</if>
<if
test=
"sourceTableName != null and sourceTableName !=''"
>
and ddt.source_table_name like concat('%',#{sourceTableName},'%')
</if>
<if
test=
"targetDbName != null and targetDbName !=''"
>
and ddt.target_db_name like concat('%',#{targetDbName},'%')
</if>
<if
test=
"targetTableName != null and targetTableName !=''"
>
and ddt.target_table_name like concat('%',#{targetTableName},'%')
</if>
ORDER BY ddt.create_time DESC
</select>
</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