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
1420183a
Commit
1420183a
authored
Dec 23, 2020
by
mcb
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
no message
parent
deb7e862
Changes
29
Show whitespace changes
Inline
Side-by-side
Showing
29 changed files
with
2297 additions
and
4 deletions
+2297
-4
OfflineSynchController.java
...es/controller/DataIntegration/OfflineSynchController.java
+13
-1
SoureAndTargetColumnsReq.java
...roller/DataIntegration/bean/SoureAndTargetColumnsReq.java
+94
-0
DmpTableColumnController.java
...m/jz/dmp/modules/controller/DmpTableColumnController.java
+38
-0
DmpTableController.java
...ava/com/jz/dmp/modules/controller/DmpTableController.java
+37
-0
DmpTableFieldMappingController.java
...mp/modules/controller/DmpTableFieldMappingController.java
+38
-0
DmpTableFieldSchemaController.java
...dmp/modules/controller/DmpTableFieldSchemaController.java
+38
-0
DmpTableColumnDao.java
src/main/java/com/jz/dmp/modules/dao/DmpTableColumnDao.java
+82
-0
DmpTableDao.java
src/main/java/com/jz/dmp/modules/dao/DmpTableDao.java
+85
-0
DmpTableFieldMappingDao.java
.../java/com/jz/dmp/modules/dao/DmpTableFieldMappingDao.java
+82
-0
DmpTableFieldSchemaDao.java
...n/java/com/jz/dmp/modules/dao/DmpTableFieldSchemaDao.java
+82
-0
OfflineSynchDao.java
src/main/java/com/jz/dmp/modules/dao/OfflineSynchDao.java
+1
-1
DmpTable.java
src/main/java/com/jz/dmp/modules/model/DmpTable.java
+218
-0
DmpTableColumn.java
src/main/java/com/jz/dmp/modules/model/DmpTableColumn.java
+194
-0
DmpTableFieldMapping.java
...n/java/com/jz/dmp/modules/model/DmpTableFieldMapping.java
+51
-0
DmpTableFieldSchema.java
...in/java/com/jz/dmp/modules/model/DmpTableFieldSchema.java
+75
-0
DmpTableColumnService.java
...ava/com/jz/dmp/modules/service/DmpTableColumnService.java
+56
-0
DmpTableFieldMappingService.java
...m/jz/dmp/modules/service/DmpTableFieldMappingService.java
+56
-0
DmpTableFieldSchemaService.java
...om/jz/dmp/modules/service/DmpTableFieldSchemaService.java
+56
-0
DmpTableService.java
...main/java/com/jz/dmp/modules/service/DmpTableService.java
+56
-0
OfflineSynchService.java
.../java/com/jz/dmp/modules/service/OfflineSynchService.java
+3
-1
DmpTableColumnServiceImpl.java
...z/dmp/modules/service/impl/DmpTableColumnServiceImpl.java
+80
-0
DmpTableFieldMappingServiceImpl.java
...modules/service/impl/DmpTableFieldMappingServiceImpl.java
+79
-0
DmpTableFieldSchemaServiceImpl.java
.../modules/service/impl/DmpTableFieldSchemaServiceImpl.java
+80
-0
DmpTableServiceImpl.java
.../com/jz/dmp/modules/service/impl/DmpTableServiceImpl.java
+80
-0
OfflineSynchServiceImpl.java
.../jz/dmp/modules/service/impl/OfflineSynchServiceImpl.java
+38
-1
DmpTableColumnDao.xml
src/main/resources/mapper/dmp/DmpTableColumnDao.xml
+183
-0
DmpTableDao.xml
src/main/resources/mapper/dmp/DmpTableDao.xml
+211
-0
DmpTableFieldMappingDao.xml
src/main/resources/mapper/dmp/DmpTableFieldMappingDao.xml
+88
-0
DmpTableFieldSchemaDao.xml
src/main/resources/mapper/dmp/DmpTableFieldSchemaDao.xml
+103
-0
No files found.
src/main/java/com/jz/dmp/modules/controller/DataIntegration/OfflineSynchController.java
View file @
1420183a
...
@@ -71,7 +71,7 @@ public class OfflineSynchController {
...
@@ -71,7 +71,7 @@ public class OfflineSynchController {
@ApiOperation
(
value
=
"根据源数据库id,获取源数据表-下拉框"
,
notes
=
"根据源数据库id,获取源数据表"
)
@ApiOperation
(
value
=
"根据源数据库id,获取源数据表-下拉框"
,
notes
=
"根据源数据库id,获取源数据表"
)
@GetMapping
(
value
=
"/sourceTableList"
)
@GetMapping
(
value
=
"/sourceTableList"
)
@ApiImplicitParam
(
name
=
"sourceDbId"
,
value
=
"源数据库id"
)
@ApiImplicitParam
(
name
=
"sourceDbId"
,
value
=
"源数据库id"
)
public
JsonResult
getSourceTableList
(
@RequestParam
Integer
sourceDbId
,
@RequestParam
(
value
=
"targetName"
,
required
=
false
)
String
targetName
)
throws
Exception
{
public
JsonResult
getSourceTableList
(
@RequestParam
Long
sourceDbId
,
@RequestParam
(
value
=
"targetName"
,
required
=
false
)
String
targetName
)
throws
Exception
{
JsonResult
list
=
offlineSynchService
.
querygSourceTableList
(
sourceDbId
,
targetName
);
JsonResult
list
=
offlineSynchService
.
querygSourceTableList
(
sourceDbId
,
targetName
);
return
list
;
return
list
;
}
}
...
@@ -138,4 +138,16 @@ public class OfflineSynchController {
...
@@ -138,4 +138,16 @@ public class OfflineSynchController {
}
}
return
pageInfo
;
return
pageInfo
;
}
}
/**
* 获取源表和目标表的字段
* @return
*/
@ApiOperation
(
value
=
"删除任务"
,
notes
=
"删除任务"
)
@GetMapping
(
value
=
"/getSoureAndTargetColumns"
)
@ApiImplicitParam
(
name
=
"taskId"
,
value
=
"任务id"
)
public
JsonResult
getSoureAndTargetColumns
(
@RequestBody
@Validated
SoureAndTargetColumnsReq
soureAndTargetColumnsReq
)
throws
Exception
{
JsonResult
list
=
offlineSynchService
.
querySoureAndTargetColumnsByParams
(
soureAndTargetColumnsReq
);
return
list
;
}
}
}
src/main/java/com/jz/dmp/modules/controller/DataIntegration/bean/SoureAndTargetColumnsReq.java
0 → 100644
View file @
1420183a
package
com
.
jz
.
dmp
.
modules
.
controller
.
DataIntegration
.
bean
;
import
com.jz.common.page.BasePageBean
;
import
io.swagger.annotations.ApiModel
;
import
io.swagger.annotations.ApiModelProperty
;
import
javax.validation.constraints.NotEmpty
;
import
javax.validation.constraints.NotNull
;
import
java.io.Serializable
;
/**
* @ClassName: SoureAndTargetColumnsReq
* @Description: 获取源表和目标表的字段
* @Author:Bellamy
* @Date 2020/12/21
* @Version 1.0
*/
@ApiModel
(
value
=
"获取源表和目标表的字段-请求参数对象"
,
description
=
"获取源表和目标表的字段-请求参数对象"
)
public
class
SoureAndTargetColumnsReq
implements
Serializable
{
private
static
final
long
serialVersionUID
=
-
2235510265678437967L
;
/*
* 源数据库ID
* */
@NotNull
(
message
=
"源数据库ID不能为空"
)
@NotEmpty
(
message
=
"源数据库ID不能为空"
)
@ApiModelProperty
(
value
=
"源数据库ID"
)
private
Long
sourceDbId
;
@NotNull
(
message
=
"目标数据库ID不能为空"
)
@NotEmpty
(
message
=
"目标数据库ID不能为空"
)
@ApiModelProperty
(
value
=
"目标数据库ID"
)
private
Long
targetDbId
;
@NotNull
(
message
=
"目标表名称不能为空"
)
@NotEmpty
(
message
=
"目标表名称不能为空"
)
@ApiModelProperty
(
value
=
"目标表名称"
)
private
String
targetTableName
;
@ApiModelProperty
(
value
=
"源字段类型"
)
private
String
fileType
;
private
String
csvDelimiter
;
private
String
csvIsHaveHeader
;
public
Long
getSourceDbId
()
{
return
sourceDbId
;
}
public
void
setSourceDbId
(
Long
sourceDbId
)
{
this
.
sourceDbId
=
sourceDbId
;
}
public
Long
getTargetDbId
()
{
return
targetDbId
;
}
public
void
setTargetDbId
(
Long
targetDbId
)
{
this
.
targetDbId
=
targetDbId
;
}
public
String
getTargetTableName
()
{
return
targetTableName
;
}
public
void
setTargetTableName
(
String
targetTableName
)
{
this
.
targetTableName
=
targetTableName
;
}
public
String
getFileType
()
{
return
fileType
;
}
public
void
setFileType
(
String
fileType
)
{
this
.
fileType
=
fileType
;
}
public
String
getCsvDelimiter
()
{
return
csvDelimiter
;
}
public
void
setCsvDelimiter
(
String
csvDelimiter
)
{
this
.
csvDelimiter
=
csvDelimiter
;
}
public
String
getCsvIsHaveHeader
()
{
return
csvIsHaveHeader
;
}
public
void
setCsvIsHaveHeader
(
String
csvIsHaveHeader
)
{
this
.
csvIsHaveHeader
=
csvIsHaveHeader
;
}
}
src/main/java/com/jz/dmp/modules/controller/DmpTableColumnController.java
0 → 100644
View file @
1420183a
package
com
.
jz
.
dmp
.
modules
.
controller
;
import
com.jz.dmp.modules.model.DmpTableColumn
;
import
com.jz.dmp.modules.service.DmpTableColumnService
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.web.bind.annotation.GetMapping
;
import
org.springframework.web.bind.annotation.RequestMapping
;
import
org.springframework.web.bind.annotation.RestController
;
import
javax.annotation.Resource
;
/**
* 项目表字段(DmpTableColumn)表控制层
*
* @author Bellamy
* @since 2020-12-23 16:34:56
*/
@RestController
@RequestMapping
(
"/dmpTableColumn"
)
public
class
DmpTableColumnController
{
/**
* 服务对象
*/
@Autowired
private
DmpTableColumnService
dmpTableColumnService
;
/**
* 通过主键查询单条数据
*
* @param id 主键
* @return 单条数据
*/
@GetMapping
(
"selectOne"
)
public
DmpTableColumn
selectOne
(
Integer
id
)
{
return
this
.
dmpTableColumnService
.
queryById
(
id
);
}
}
\ No newline at end of file
src/main/java/com/jz/dmp/modules/controller/DmpTableController.java
0 → 100644
View file @
1420183a
package
com
.
jz
.
dmp
.
modules
.
controller
;
import
com.jz.dmp.modules.model.DmpTable
;
import
com.jz.dmp.modules.service.DmpTableService
;
import
org.springframework.web.bind.annotation.GetMapping
;
import
org.springframework.web.bind.annotation.RequestMapping
;
import
org.springframework.web.bind.annotation.RestController
;
import
javax.annotation.Resource
;
/**
* 项目表信息(DmpTable)表控制层
*
* @author Bellamy
* @since 2020-12-23 15:32:57
*/
@RestController
@RequestMapping
(
"dmpTable"
)
public
class
DmpTableController
{
/**
* 服务对象
*/
@Resource
private
DmpTableService
dmpTableService
;
/**
* 通过主键查询单条数据
*
* @param id 主键
* @return 单条数据
*/
@GetMapping
(
"selectOne"
)
public
DmpTable
selectOne
(
Integer
id
)
{
return
this
.
dmpTableService
.
queryById
(
id
);
}
}
\ No newline at end of file
src/main/java/com/jz/dmp/modules/controller/DmpTableFieldMappingController.java
0 → 100644
View file @
1420183a
package
com
.
jz
.
dmp
.
modules
.
controller
;
import
com.jz.dmp.modules.model.DmpTableFieldMapping
;
import
com.jz.dmp.modules.service.DmpTableFieldMappingService
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.web.bind.annotation.GetMapping
;
import
org.springframework.web.bind.annotation.RequestMapping
;
import
org.springframework.web.bind.annotation.RestController
;
import
javax.annotation.Resource
;
/**
* 项目表字段类型映射(DmpTableFieldMapping)表控制层
*
* @author Bellamy
* @since 2020-12-23 16:34:55
*/
@RestController
@RequestMapping
(
"dmpTableFieldMapping"
)
public
class
DmpTableFieldMappingController
{
/**
* 服务对象
*/
@Autowired
private
DmpTableFieldMappingService
dmpTableFieldMappingService
;
/**
* 通过主键查询单条数据
*
* @param id 主键
* @return 单条数据
*/
@GetMapping
(
"selectOne"
)
public
DmpTableFieldMapping
selectOne
(
Integer
id
)
{
return
this
.
dmpTableFieldMappingService
.
queryById
(
id
);
}
}
\ No newline at end of file
src/main/java/com/jz/dmp/modules/controller/DmpTableFieldSchemaController.java
0 → 100644
View file @
1420183a
package
com
.
jz
.
dmp
.
modules
.
controller
;
import
com.jz.dmp.modules.model.DmpTableFieldSchema
;
import
com.jz.dmp.modules.service.DmpTableFieldSchemaService
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.web.bind.annotation.GetMapping
;
import
org.springframework.web.bind.annotation.RequestMapping
;
import
org.springframework.web.bind.annotation.RestController
;
import
javax.annotation.Resource
;
/**
* 项目表字段类型(DmpTableFieldSchema)表控制层
*
* @author Bellamy
* @since 2020-12-23 16:34:56
*/
@RestController
@RequestMapping
(
"dmpTableFieldSchema"
)
public
class
DmpTableFieldSchemaController
{
/**
* 服务对象
*/
@Autowired
private
DmpTableFieldSchemaService
dmpTableFieldSchemaService
;
/**
* 通过主键查询单条数据
*
* @param id 主键
* @return 单条数据
*/
@GetMapping
(
"selectOne"
)
public
DmpTableFieldSchema
selectOne
(
Integer
id
)
{
return
this
.
dmpTableFieldSchemaService
.
queryById
(
id
);
}
}
\ No newline at end of file
src/main/java/com/jz/dmp/modules/dao/DmpTableColumnDao.java
0 → 100644
View file @
1420183a
package
com
.
jz
.
dmp
.
modules
.
dao
;
import
com.jz.dmp.modules.model.DmpTableColumn
;
import
org.apache.ibatis.annotations.Param
;
import
java.util.List
;
/**
* 项目表字段(DmpTableColumn)表数据库访问层
*
* @author Bellamy
* @since 2020-12-23 16:34:56
*/
public
interface
DmpTableColumnDao
{
/**
* 通过ID查询单条数据
*
* @param id 主键
* @return 实例对象
*/
DmpTableColumn
queryById
(
Integer
id
);
/**
* 查询指定行数据
*
* @param offset 查询起始位置
* @param limit 查询条数
* @return 对象列表
*/
List
<
DmpTableColumn
>
queryAllByLimit
(
@Param
(
"offset"
)
int
offset
,
@Param
(
"limit"
)
int
limit
);
/**
* 通过实体作为筛选条件查询
*
* @param dmpTableColumn 实例对象
* @return 对象列表
*/
List
<
DmpTableColumn
>
queryAll
(
DmpTableColumn
dmpTableColumn
);
/**
* 新增数据
*
* @param dmpTableColumn 实例对象
* @return 影响行数
*/
int
insert
(
DmpTableColumn
dmpTableColumn
);
/**
* 批量新增数据(MyBatis原生foreach方法)
*
* @param entities List<DmpTableColumn> 实例对象列表
* @return 影响行数
*/
int
insertBatch
(
@Param
(
"entities"
)
List
<
DmpTableColumn
>
entities
);
/**
* 批量新增或按主键更新数据(MyBatis原生foreach方法)
*
* @param entities List<DmpTableColumn> 实例对象列表
* @return 影响行数
*/
int
insertOrUpdateBatch
(
@Param
(
"entities"
)
List
<
DmpTableColumn
>
entities
);
/**
* 修改数据
*
* @param dmpTableColumn 实例对象
* @return 影响行数
*/
int
update
(
DmpTableColumn
dmpTableColumn
);
/**
* 通过主键删除数据
*
* @param id 主键
* @return 影响行数
*/
int
deleteById
(
Integer
id
);
}
\ No newline at end of file
src/main/java/com/jz/dmp/modules/dao/DmpTableDao.java
0 → 100644
View file @
1420183a
package
com
.
jz
.
dmp
.
modules
.
dao
;
import
com.jz.dmp.modules.model.DmpTable
;
import
org.apache.ibatis.annotations.Param
;
import
java.util.List
;
/**
* 项目表信息(DmpTable)表数据库访问层
*
* @author Bellamy
* @since 2020-12-23 15:32:55
*/
public
interface
DmpTableDao
{
/**
* 通过ID查询单条数据
*
* @param id 主键
* @return 实例对象
*/
DmpTable
queryById
(
Integer
id
);
/**
* 查询指定行数据
*
* @param offset 查询起始位置
* @param limit 查询条数
* @return 对象列表
*/
List
<
DmpTable
>
queryAllByLimit
(
@Param
(
"offset"
)
int
offset
,
@Param
(
"limit"
)
int
limit
);
/**
* 通过实体作为筛选条件查询
*
* @param dmpTable 实例对象
* @return 对象列表
*/
List
<
DmpTable
>
queryAll
(
DmpTable
dmpTable
);
/**
* 新增数据
*
* @param dmpTable 实例对象
* @return 影响行数
*/
int
insert
(
DmpTable
dmpTable
);
/**
* 批量新增数据(MyBatis原生foreach方法)
*
* @param entities List<DmpTable> 实例对象列表
* @return 影响行数
*/
int
insertBatch
(
@Param
(
"entities"
)
List
<
DmpTable
>
entities
);
/**
* 批量新增或按主键更新数据(MyBatis原生foreach方法)
*
* @param entities List<DmpTable> 实例对象列表
* @return 影响行数
*/
int
insertOrUpdateBatch
(
@Param
(
"entities"
)
List
<
DmpTable
>
entities
);
/**
* 修改数据
*
* @param dmpTable 实例对象
* @return 影响行数
*/
int
update
(
DmpTable
dmpTable
);
/**
* 通过主键删除数据
*
* @param id 主键
* @return 影响行数
*/
int
deleteById
(
Integer
id
);
int
deleteTableColumnByName
(
DmpTable
table
);
int
deleteTableByName
(
DmpTable
table
);
}
\ No newline at end of file
src/main/java/com/jz/dmp/modules/dao/DmpTableFieldMappingDao.java
0 → 100644
View file @
1420183a
package
com
.
jz
.
dmp
.
modules
.
dao
;
import
com.jz.dmp.modules.model.DmpTableFieldMapping
;
import
org.apache.ibatis.annotations.Param
;
import
java.util.List
;
/**
* 项目表字段类型映射(DmpTableFieldMapping)表数据库访问层
*
* @author Bellamy
* @since 2020-12-23 16:34:55
*/
public
interface
DmpTableFieldMappingDao
{
/**
* 通过ID查询单条数据
*
* @param id 主键
* @return 实例对象
*/
DmpTableFieldMapping
queryById
(
Integer
id
);
/**
* 查询指定行数据
*
* @param offset 查询起始位置
* @param limit 查询条数
* @return 对象列表
*/
List
<
DmpTableFieldMapping
>
queryAllByLimit
(
@Param
(
"offset"
)
int
offset
,
@Param
(
"limit"
)
int
limit
);
/**
* 通过实体作为筛选条件查询
*
* @param dmpTableFieldMapping 实例对象
* @return 对象列表
*/
List
<
DmpTableFieldMapping
>
queryAll
(
DmpTableFieldMapping
dmpTableFieldMapping
);
/**
* 新增数据
*
* @param dmpTableFieldMapping 实例对象
* @return 影响行数
*/
int
insert
(
DmpTableFieldMapping
dmpTableFieldMapping
);
/**
* 批量新增数据(MyBatis原生foreach方法)
*
* @param entities List<DmpTableFieldMapping> 实例对象列表
* @return 影响行数
*/
int
insertBatch
(
@Param
(
"entities"
)
List
<
DmpTableFieldMapping
>
entities
);
/**
* 批量新增或按主键更新数据(MyBatis原生foreach方法)
*
* @param entities List<DmpTableFieldMapping> 实例对象列表
* @return 影响行数
*/
int
insertOrUpdateBatch
(
@Param
(
"entities"
)
List
<
DmpTableFieldMapping
>
entities
);
/**
* 修改数据
*
* @param dmpTableFieldMapping 实例对象
* @return 影响行数
*/
int
update
(
DmpTableFieldMapping
dmpTableFieldMapping
);
/**
* 通过主键删除数据
*
* @param id 主键
* @return 影响行数
*/
int
deleteById
(
Integer
id
);
}
\ No newline at end of file
src/main/java/com/jz/dmp/modules/dao/DmpTableFieldSchemaDao.java
0 → 100644
View file @
1420183a
package
com
.
jz
.
dmp
.
modules
.
dao
;
import
com.jz.dmp.modules.model.DmpTableFieldSchema
;
import
org.apache.ibatis.annotations.Param
;
import
java.util.List
;
/**
* 项目表字段类型(DmpTableFieldSchema)表数据库访问层
*
* @author Bellamy
* @since 2020-12-23 16:34:55
*/
public
interface
DmpTableFieldSchemaDao
{
/**
* 通过ID查询单条数据
*
* @param id 主键
* @return 实例对象
*/
DmpTableFieldSchema
queryById
(
Integer
id
);
/**
* 查询指定行数据
*
* @param offset 查询起始位置
* @param limit 查询条数
* @return 对象列表
*/
List
<
DmpTableFieldSchema
>
queryAllByLimit
(
@Param
(
"offset"
)
int
offset
,
@Param
(
"limit"
)
int
limit
);
/**
* 通过实体作为筛选条件查询
*
* @param dmpTableFieldSchema 实例对象
* @return 对象列表
*/
List
<
DmpTableFieldSchema
>
queryAll
(
DmpTableFieldSchema
dmpTableFieldSchema
);
/**
* 新增数据
*
* @param dmpTableFieldSchema 实例对象
* @return 影响行数
*/
int
insert
(
DmpTableFieldSchema
dmpTableFieldSchema
);
/**
* 批量新增数据(MyBatis原生foreach方法)
*
* @param entities List<DmpTableFieldSchema> 实例对象列表
* @return 影响行数
*/
int
insertBatch
(
@Param
(
"entities"
)
List
<
DmpTableFieldSchema
>
entities
);
/**
* 批量新增或按主键更新数据(MyBatis原生foreach方法)
*
* @param entities List<DmpTableFieldSchema> 实例对象列表
* @return 影响行数
*/
int
insertOrUpdateBatch
(
@Param
(
"entities"
)
List
<
DmpTableFieldSchema
>
entities
);
/**
* 修改数据
*
* @param dmpTableFieldSchema 实例对象
* @return 影响行数
*/
int
update
(
DmpTableFieldSchema
dmpTableFieldSchema
);
/**
* 通过主键删除数据
*
* @param id 主键
* @return 影响行数
*/
int
deleteById
(
Integer
id
);
}
\ No newline at end of file
src/main/java/com/jz/dmp/modules/dao/OfflineSynchDao.java
View file @
1420183a
...
@@ -23,7 +23,7 @@ public interface OfflineSynchDao {
...
@@ -23,7 +23,7 @@ public interface OfflineSynchDao {
DmpSyncingDatasource
queryDmpSyncingDatasource
(
@Param
(
"sourceDbId"
)
Integer
sourceDbId
)
throws
Exception
;
DmpSyncingDatasource
queryDmpSyncingDatasource
(
@Param
(
"sourceDbId"
)
Integer
sourceDbId
)
throws
Exception
;
DmpAgentDatasourceInfo
querySourceDbInfoBySourceId
(
@Param
(
"sourceDbId"
)
Integer
sourceDbId
)
throws
Exception
;
DmpAgentDatasourceInfo
querySourceDbInfoBySourceId
(
@Param
(
"sourceDbId"
)
Long
sourceDbId
)
throws
Exception
;
Map
<
String
,
Object
>
selectNavigationTreeByTaskId
(
String
taskId
)
throws
Exception
;
Map
<
String
,
Object
>
selectNavigationTreeByTaskId
(
String
taskId
)
throws
Exception
;
...
...
src/main/java/com/jz/dmp/modules/model/DmpTable.java
0 → 100644
View file @
1420183a
package
com
.
jz
.
dmp
.
modules
.
model
;
import
java.io.Serializable
;
import
java.util.Date
;
/**
* 项目表信息(DmpTable)实体类
*
* @author makejava
* @since 2020-12-23 15:32:53
*/
public
class
DmpTable
implements
Serializable
{
private
static
final
long
serialVersionUID
=
371273010310876339L
;
/**
* ID
*/
private
Integer
id
;
/**
* 表名
*/
private
String
name
;
/**
* 中文名
*/
private
String
cnName
;
/**
* 是否隐藏
*/
private
String
isShow
;
/**
* 负责人
*/
private
String
ownerUser
;
/**
* 描述
*/
private
String
tableDesc
;
/**
* 物理存储量
*/
private
Integer
storeSize
;
/**
* 生命周期
*/
private
Integer
period
;
/**
* 是否分区表
*/
private
String
isPartition
;
/**
* DDL变更时间
*/
private
Date
ddlTime
;
/**
* 数据状态
*/
private
String
dataStatus
;
/**
* 创建用户ID
*/
private
String
createUserId
;
/**
* 数据创建时间
*/
private
Date
createTime
;
/**
* 创建用户ID
*/
private
String
updateUserId
;
/**
* 数据更新时间
*/
private
Date
updateTime
;
/**
* category ID
*/
private
Integer
categoryId
;
private
String
tableMode
;
public
Integer
getId
()
{
return
id
;
}
public
void
setId
(
Integer
id
)
{
this
.
id
=
id
;
}
public
String
getName
()
{
return
name
;
}
public
void
setName
(
String
name
)
{
this
.
name
=
name
;
}
public
String
getCnName
()
{
return
cnName
;
}
public
void
setCnName
(
String
cnName
)
{
this
.
cnName
=
cnName
;
}
public
String
getIsShow
()
{
return
isShow
;
}
public
void
setIsShow
(
String
isShow
)
{
this
.
isShow
=
isShow
;
}
public
String
getOwnerUser
()
{
return
ownerUser
;
}
public
void
setOwnerUser
(
String
ownerUser
)
{
this
.
ownerUser
=
ownerUser
;
}
public
String
getTableDesc
()
{
return
tableDesc
;
}
public
void
setTableDesc
(
String
tableDesc
)
{
this
.
tableDesc
=
tableDesc
;
}
public
Integer
getStoreSize
()
{
return
storeSize
;
}
public
void
setStoreSize
(
Integer
storeSize
)
{
this
.
storeSize
=
storeSize
;
}
public
Integer
getPeriod
()
{
return
period
;
}
public
void
setPeriod
(
Integer
period
)
{
this
.
period
=
period
;
}
public
String
getIsPartition
()
{
return
isPartition
;
}
public
void
setIsPartition
(
String
isPartition
)
{
this
.
isPartition
=
isPartition
;
}
public
Date
getDdlTime
()
{
return
ddlTime
;
}
public
void
setDdlTime
(
Date
ddlTime
)
{
this
.
ddlTime
=
ddlTime
;
}
public
String
getDataStatus
()
{
return
dataStatus
;
}
public
void
setDataStatus
(
String
dataStatus
)
{
this
.
dataStatus
=
dataStatus
;
}
public
String
getCreateUserId
()
{
return
createUserId
;
}
public
void
setCreateUserId
(
String
createUserId
)
{
this
.
createUserId
=
createUserId
;
}
public
Date
getCreateTime
()
{
return
createTime
;
}
public
void
setCreateTime
(
Date
createTime
)
{
this
.
createTime
=
createTime
;
}
public
String
getUpdateUserId
()
{
return
updateUserId
;
}
public
void
setUpdateUserId
(
String
updateUserId
)
{
this
.
updateUserId
=
updateUserId
;
}
public
Date
getUpdateTime
()
{
return
updateTime
;
}
public
void
setUpdateTime
(
Date
updateTime
)
{
this
.
updateTime
=
updateTime
;
}
public
Integer
getCategoryId
()
{
return
categoryId
;
}
public
void
setCategoryId
(
Integer
categoryId
)
{
this
.
categoryId
=
categoryId
;
}
public
String
getTableMode
()
{
return
tableMode
;
}
public
void
setTableMode
(
String
tableMode
)
{
this
.
tableMode
=
tableMode
;
}
}
\ No newline at end of file
src/main/java/com/jz/dmp/modules/model/DmpTableColumn.java
0 → 100644
View file @
1420183a
package
com
.
jz
.
dmp
.
modules
.
model
;
import
java.io.Serializable
;
import
java.util.Date
;
/**
* 项目表字段(DmpTableColumn)实体类
*
* @author Bellamy
* @since 2020-12-23 16:34:56
*/
public
class
DmpTableColumn
implements
Serializable
{
private
static
final
long
serialVersionUID
=
398656823482829399L
;
/**
* ID
*/
private
Integer
id
;
/**
* 字段
*/
private
String
field
;
/**
* 类型
*/
private
Integer
type
;
/**
* 大小
*/
private
Integer
size
;
/**
* 经度
*/
private
Integer
scale
;
/**
* 是否可为空
*/
private
String
nullable
;
/**
* 默认值
*/
private
String
defaultValue
;
/**
* 模式
*/
private
String
mode
;
/**
* 数据状态
*/
private
String
dataStatus
;
/**
* 创建用户ID
*/
private
String
createUserId
;
/**
* 数据创建时间
*/
private
Date
createTime
;
/**
* 创建用户ID
*/
private
String
updateUserId
;
/**
* 数据更新时间
*/
private
Date
updateTime
;
/**
* table ID
*/
private
Integer
tableId
;
private
String
comment
;
public
Integer
getId
()
{
return
id
;
}
public
void
setId
(
Integer
id
)
{
this
.
id
=
id
;
}
public
String
getField
()
{
return
field
;
}
public
void
setField
(
String
field
)
{
this
.
field
=
field
;
}
public
Integer
getType
()
{
return
type
;
}
public
void
setType
(
Integer
type
)
{
this
.
type
=
type
;
}
public
Integer
getSize
()
{
return
size
;
}
public
void
setSize
(
Integer
size
)
{
this
.
size
=
size
;
}
public
Integer
getScale
()
{
return
scale
;
}
public
void
setScale
(
Integer
scale
)
{
this
.
scale
=
scale
;
}
public
String
getNullable
()
{
return
nullable
;
}
public
void
setNullable
(
String
nullable
)
{
this
.
nullable
=
nullable
;
}
public
String
getDefaultValue
()
{
return
defaultValue
;
}
public
void
setDefaultValue
(
String
defaultValue
)
{
this
.
defaultValue
=
defaultValue
;
}
public
String
getMode
()
{
return
mode
;
}
public
void
setMode
(
String
mode
)
{
this
.
mode
=
mode
;
}
public
String
getDataStatus
()
{
return
dataStatus
;
}
public
void
setDataStatus
(
String
dataStatus
)
{
this
.
dataStatus
=
dataStatus
;
}
public
String
getCreateUserId
()
{
return
createUserId
;
}
public
void
setCreateUserId
(
String
createUserId
)
{
this
.
createUserId
=
createUserId
;
}
public
Date
getCreateTime
()
{
return
createTime
;
}
public
void
setCreateTime
(
Date
createTime
)
{
this
.
createTime
=
createTime
;
}
public
String
getUpdateUserId
()
{
return
updateUserId
;
}
public
void
setUpdateUserId
(
String
updateUserId
)
{
this
.
updateUserId
=
updateUserId
;
}
public
Date
getUpdateTime
()
{
return
updateTime
;
}
public
void
setUpdateTime
(
Date
updateTime
)
{
this
.
updateTime
=
updateTime
;
}
public
Integer
getTableId
()
{
return
tableId
;
}
public
void
setTableId
(
Integer
tableId
)
{
this
.
tableId
=
tableId
;
}
public
String
getComment
()
{
return
comment
;
}
public
void
setComment
(
String
comment
)
{
this
.
comment
=
comment
;
}
}
\ No newline at end of file
src/main/java/com/jz/dmp/modules/model/DmpTableFieldMapping.java
0 → 100644
View file @
1420183a
package
com
.
jz
.
dmp
.
modules
.
model
;
import
java.io.Serializable
;
/**
* 项目表字段类型映射(DmpTableFieldMapping)实体类
*
* @author Bellamy
* @since 2020-12-23 16:34:53
*/
public
class
DmpTableFieldMapping
implements
Serializable
{
private
static
final
long
serialVersionUID
=
-
42355742330479740L
;
/**
* ID
*/
private
Integer
id
;
/**
* 源表类型
*/
private
Integer
sourceId
;
/**
* 目标表类型
*/
private
Integer
targetId
;
public
Integer
getId
()
{
return
id
;
}
public
void
setId
(
Integer
id
)
{
this
.
id
=
id
;
}
public
Integer
getSourceId
()
{
return
sourceId
;
}
public
void
setSourceId
(
Integer
sourceId
)
{
this
.
sourceId
=
sourceId
;
}
public
Integer
getTargetId
()
{
return
targetId
;
}
public
void
setTargetId
(
Integer
targetId
)
{
this
.
targetId
=
targetId
;
}
}
\ No newline at end of file
src/main/java/com/jz/dmp/modules/model/DmpTableFieldSchema.java
0 → 100644
View file @
1420183a
package
com
.
jz
.
dmp
.
modules
.
model
;
import
java.io.Serializable
;
/**
* 项目表字段类型(DmpTableFieldSchema)实体类
*
* @author Bellamy
* @since 2020-12-23 16:34:55
*/
public
class
DmpTableFieldSchema
implements
Serializable
{
private
static
final
long
serialVersionUID
=
-
87822309382730514L
;
/**
* ID
*/
private
Integer
id
;
/**
* DS ID
*/
private
Integer
dsId
;
/**
* 类型类别
*/
private
String
typeCategory
;
/**
* 字段类型
*/
private
String
fieldType
;
/**
* 是否类别的默认映射
*/
private
String
isCatDefault
;
public
Integer
getId
()
{
return
id
;
}
public
void
setId
(
Integer
id
)
{
this
.
id
=
id
;
}
public
Integer
getDsId
()
{
return
dsId
;
}
public
void
setDsId
(
Integer
dsId
)
{
this
.
dsId
=
dsId
;
}
public
String
getTypeCategory
()
{
return
typeCategory
;
}
public
void
setTypeCategory
(
String
typeCategory
)
{
this
.
typeCategory
=
typeCategory
;
}
public
String
getFieldType
()
{
return
fieldType
;
}
public
void
setFieldType
(
String
fieldType
)
{
this
.
fieldType
=
fieldType
;
}
public
String
getIsCatDefault
()
{
return
isCatDefault
;
}
public
void
setIsCatDefault
(
String
isCatDefault
)
{
this
.
isCatDefault
=
isCatDefault
;
}
}
\ No newline at end of file
src/main/java/com/jz/dmp/modules/service/DmpTableColumnService.java
0 → 100644
View file @
1420183a
package
com
.
jz
.
dmp
.
modules
.
service
;
import
com.jz.dmp.modules.model.DmpTableColumn
;
import
java.util.List
;
/**
* 项目表字段(DmpTableColumn)表服务接口
*
* @author Bellamy
* @since 2020-12-23 16:34:56
*/
public
interface
DmpTableColumnService
{
/**
* 通过ID查询单条数据
*
* @param id 主键
* @return 实例对象
*/
DmpTableColumn
queryById
(
Integer
id
);
/**
* 查询多条数据
*
* @param offset 查询起始位置
* @param limit 查询条数
* @return 对象列表
*/
List
<
DmpTableColumn
>
queryAllByLimit
(
int
offset
,
int
limit
);
/**
* 新增数据
*
* @param dmpTableColumn 实例对象
* @return 实例对象
*/
DmpTableColumn
insert
(
DmpTableColumn
dmpTableColumn
);
/**
* 修改数据
*
* @param dmpTableColumn 实例对象
* @return 实例对象
*/
DmpTableColumn
update
(
DmpTableColumn
dmpTableColumn
);
/**
* 通过主键删除数据
*
* @param id 主键
* @return 是否成功
*/
boolean
deleteById
(
Integer
id
);
}
\ No newline at end of file
src/main/java/com/jz/dmp/modules/service/DmpTableFieldMappingService.java
0 → 100644
View file @
1420183a
package
com
.
jz
.
dmp
.
modules
.
service
;
import
com.jz.dmp.modules.model.DmpTableFieldMapping
;
import
java.util.List
;
/**
* 项目表字段类型映射(DmpTableFieldMapping)表服务接口
*
* @author Bellamy
* @since 2020-12-23 16:34:55
*/
public
interface
DmpTableFieldMappingService
{
/**
* 通过ID查询单条数据
*
* @param id 主键
* @return 实例对象
*/
DmpTableFieldMapping
queryById
(
Integer
id
);
/**
* 查询多条数据
*
* @param offset 查询起始位置
* @param limit 查询条数
* @return 对象列表
*/
List
<
DmpTableFieldMapping
>
queryAllByLimit
(
int
offset
,
int
limit
);
/**
* 新增数据
*
* @param dmpTableFieldMapping 实例对象
* @return 实例对象
*/
DmpTableFieldMapping
insert
(
DmpTableFieldMapping
dmpTableFieldMapping
);
/**
* 修改数据
*
* @param dmpTableFieldMapping 实例对象
* @return 实例对象
*/
DmpTableFieldMapping
update
(
DmpTableFieldMapping
dmpTableFieldMapping
);
/**
* 通过主键删除数据
*
* @param id 主键
* @return 是否成功
*/
boolean
deleteById
(
Integer
id
);
}
\ No newline at end of file
src/main/java/com/jz/dmp/modules/service/DmpTableFieldSchemaService.java
0 → 100644
View file @
1420183a
package
com
.
jz
.
dmp
.
modules
.
service
;
import
com.jz.dmp.modules.model.DmpTableFieldSchema
;
import
java.util.List
;
/**
* 项目表字段类型(DmpTableFieldSchema)表服务接口
*
* @author Bellamy
* @since 2020-12-23 16:34:55
*/
public
interface
DmpTableFieldSchemaService
{
/**
* 通过ID查询单条数据
*
* @param id 主键
* @return 实例对象
*/
DmpTableFieldSchema
queryById
(
Integer
id
);
/**
* 查询多条数据
*
* @param offset 查询起始位置
* @param limit 查询条数
* @return 对象列表
*/
List
<
DmpTableFieldSchema
>
queryAllByLimit
(
int
offset
,
int
limit
);
/**
* 新增数据
*
* @param dmpTableFieldSchema 实例对象
* @return 实例对象
*/
DmpTableFieldSchema
insert
(
DmpTableFieldSchema
dmpTableFieldSchema
);
/**
* 修改数据
*
* @param dmpTableFieldSchema 实例对象
* @return 实例对象
*/
DmpTableFieldSchema
update
(
DmpTableFieldSchema
dmpTableFieldSchema
);
/**
* 通过主键删除数据
*
* @param id 主键
* @return 是否成功
*/
boolean
deleteById
(
Integer
id
);
}
\ No newline at end of file
src/main/java/com/jz/dmp/modules/service/DmpTableService.java
0 → 100644
View file @
1420183a
package
com
.
jz
.
dmp
.
modules
.
service
;
import
com.jz.dmp.modules.model.DmpTable
;
import
java.util.List
;
/**
* 项目表信息(DmpTable)表服务接口
*
* @author Bellamy
* @since 2020-12-23 15:32:56
*/
public
interface
DmpTableService
{
/**
* 通过ID查询单条数据
*
* @param id 主键
* @return 实例对象
*/
DmpTable
queryById
(
Integer
id
);
/**
* 查询多条数据
*
* @param offset 查询起始位置
* @param limit 查询条数
* @return 对象列表
*/
List
<
DmpTable
>
queryAllByLimit
(
int
offset
,
int
limit
);
/**
* 新增数据
*
* @param dmpTable 实例对象
* @return 实例对象
*/
DmpTable
insert
(
DmpTable
dmpTable
);
/**
* 修改数据
*
* @param dmpTable 实例对象
* @return 实例对象
*/
DmpTable
update
(
DmpTable
dmpTable
);
/**
* 通过主键删除数据
*
* @param id 主键
* @return 是否成功
*/
boolean
deleteById
(
Integer
id
);
}
\ No newline at end of file
src/main/java/com/jz/dmp/modules/service/OfflineSynchService.java
View file @
1420183a
...
@@ -20,7 +20,7 @@ public interface OfflineSynchService {
...
@@ -20,7 +20,7 @@ public interface OfflineSynchService {
JsonResult
querygSourceDbList
(
Integer
projectId
)
throws
Exception
;
JsonResult
querygSourceDbList
(
Integer
projectId
)
throws
Exception
;
JsonResult
querygSourceTableList
(
Integer
sourceDbId
,
String
targetName
)
throws
Exception
;
JsonResult
querygSourceTableList
(
Long
sourceDbId
,
String
targetName
)
throws
Exception
;
JsonResult
taskRunNowByTaskId
(
String
taskId
)
throws
Exception
;
JsonResult
taskRunNowByTaskId
(
String
taskId
)
throws
Exception
;
...
@@ -29,4 +29,6 @@ public interface OfflineSynchService {
...
@@ -29,4 +29,6 @@ public interface OfflineSynchService {
JsonResult
<
List
<
CheckTaskStatusPageDto
>>
queryCheckTaskStatusListPage
(
CheckTaskStatusPageReq
checkTaskStatusPageReq
)
throws
Exception
;
JsonResult
<
List
<
CheckTaskStatusPageDto
>>
queryCheckTaskStatusListPage
(
CheckTaskStatusPageReq
checkTaskStatusPageReq
)
throws
Exception
;
PageInfoResponse
<
CheckJyRlueStatusDto
>
selectCheckJyStatusInfo
(
CheckJyRlueStatusReq
checkJyRlueStatusReq
)
throws
Exception
;
PageInfoResponse
<
CheckJyRlueStatusDto
>
selectCheckJyStatusInfo
(
CheckJyRlueStatusReq
checkJyRlueStatusReq
)
throws
Exception
;
JsonResult
querySoureAndTargetColumnsByParams
(
SoureAndTargetColumnsReq
soureAndTargetColumnsReq
)
throws
Exception
;
}
}
src/main/java/com/jz/dmp/modules/service/impl/DmpTableColumnServiceImpl.java
0 → 100644
View file @
1420183a
package
com
.
jz
.
dmp
.
modules
.
service
.
impl
;
import
com.jz.dmp.modules.dao.DmpTableColumnDao
;
import
com.jz.dmp.modules.model.DmpTableColumn
;
import
com.jz.dmp.modules.service.DmpTableColumnService
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Service
;
import
javax.annotation.Resource
;
import
java.util.List
;
/**
* 项目表字段(DmpTableColumn)表服务实现类
*
* @author Bellamy
* @since 2020-12-23 16:34:56
*/
@Service
(
"dmpTableColumnService"
)
public
class
DmpTableColumnServiceImpl
implements
DmpTableColumnService
{
@Autowired
private
DmpTableColumnDao
dmpTableColumnDao
;
/**
* 通过ID查询单条数据
*
* @param id 主键
* @return 实例对象
*/
@Override
public
DmpTableColumn
queryById
(
Integer
id
)
{
return
this
.
dmpTableColumnDao
.
queryById
(
id
);
}
/**
* 查询多条数据
*
* @param offset 查询起始位置
* @param limit 查询条数
* @return 对象列表
*/
@Override
public
List
<
DmpTableColumn
>
queryAllByLimit
(
int
offset
,
int
limit
)
{
return
this
.
dmpTableColumnDao
.
queryAllByLimit
(
offset
,
limit
);
}
/**
* 新增数据
*
* @param dmpTableColumn 实例对象
* @return 实例对象
*/
@Override
public
DmpTableColumn
insert
(
DmpTableColumn
dmpTableColumn
)
{
this
.
dmpTableColumnDao
.
insert
(
dmpTableColumn
);
return
dmpTableColumn
;
}
/**
* 修改数据
*
* @param dmpTableColumn 实例对象
* @return 实例对象
*/
@Override
public
DmpTableColumn
update
(
DmpTableColumn
dmpTableColumn
)
{
this
.
dmpTableColumnDao
.
update
(
dmpTableColumn
);
return
this
.
queryById
(
dmpTableColumn
.
getId
());
}
/**
* 通过主键删除数据
*
* @param id 主键
* @return 是否成功
*/
@Override
public
boolean
deleteById
(
Integer
id
)
{
return
this
.
dmpTableColumnDao
.
deleteById
(
id
)
>
0
;
}
}
\ No newline at end of file
src/main/java/com/jz/dmp/modules/service/impl/DmpTableFieldMappingServiceImpl.java
0 → 100644
View file @
1420183a
package
com
.
jz
.
dmp
.
modules
.
service
.
impl
;
import
com.jz.dmp.modules.dao.DmpTableFieldMappingDao
;
import
com.jz.dmp.modules.model.DmpTableFieldMapping
;
import
com.jz.dmp.modules.service.DmpTableFieldMappingService
;
import
org.springframework.stereotype.Service
;
import
javax.annotation.Resource
;
import
java.util.List
;
/**
* 项目表字段类型映射(DmpTableFieldMapping)表服务实现类
*
* @author Bellamy
* @since 2020-12-23 16:34:55
*/
@Service
(
"dmpTableFieldMappingService"
)
public
class
DmpTableFieldMappingServiceImpl
implements
DmpTableFieldMappingService
{
@Resource
private
DmpTableFieldMappingDao
dmpTableFieldMappingDao
;
/**
* 通过ID查询单条数据
*
* @param id 主键
* @return 实例对象
*/
@Override
public
DmpTableFieldMapping
queryById
(
Integer
id
)
{
return
this
.
dmpTableFieldMappingDao
.
queryById
(
id
);
}
/**
* 查询多条数据
*
* @param offset 查询起始位置
* @param limit 查询条数
* @return 对象列表
*/
@Override
public
List
<
DmpTableFieldMapping
>
queryAllByLimit
(
int
offset
,
int
limit
)
{
return
this
.
dmpTableFieldMappingDao
.
queryAllByLimit
(
offset
,
limit
);
}
/**
* 新增数据
*
* @param dmpTableFieldMapping 实例对象
* @return 实例对象
*/
@Override
public
DmpTableFieldMapping
insert
(
DmpTableFieldMapping
dmpTableFieldMapping
)
{
this
.
dmpTableFieldMappingDao
.
insert
(
dmpTableFieldMapping
);
return
dmpTableFieldMapping
;
}
/**
* 修改数据
*
* @param dmpTableFieldMapping 实例对象
* @return 实例对象
*/
@Override
public
DmpTableFieldMapping
update
(
DmpTableFieldMapping
dmpTableFieldMapping
)
{
this
.
dmpTableFieldMappingDao
.
update
(
dmpTableFieldMapping
);
return
this
.
queryById
(
dmpTableFieldMapping
.
getId
());
}
/**
* 通过主键删除数据
*
* @param id 主键
* @return 是否成功
*/
@Override
public
boolean
deleteById
(
Integer
id
)
{
return
this
.
dmpTableFieldMappingDao
.
deleteById
(
id
)
>
0
;
}
}
\ No newline at end of file
src/main/java/com/jz/dmp/modules/service/impl/DmpTableFieldSchemaServiceImpl.java
0 → 100644
View file @
1420183a
package
com
.
jz
.
dmp
.
modules
.
service
.
impl
;
import
com.jz.dmp.modules.dao.DmpTableFieldSchemaDao
;
import
com.jz.dmp.modules.model.DmpTableFieldSchema
;
import
com.jz.dmp.modules.service.DmpTableFieldSchemaService
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Service
;
import
javax.annotation.Resource
;
import
java.util.List
;
/**
* 项目表字段类型(DmpTableFieldSchema)表服务实现类
*
* @author Bellamy
* @since 2020-12-23 16:34:55
*/
@Service
(
"dmpTableFieldSchemaService"
)
public
class
DmpTableFieldSchemaServiceImpl
implements
DmpTableFieldSchemaService
{
@Autowired
private
DmpTableFieldSchemaDao
dmpTableFieldSchemaDao
;
/**
* 通过ID查询单条数据
*
* @param id 主键
* @return 实例对象
*/
@Override
public
DmpTableFieldSchema
queryById
(
Integer
id
)
{
return
this
.
dmpTableFieldSchemaDao
.
queryById
(
id
);
}
/**
* 查询多条数据
*
* @param offset 查询起始位置
* @param limit 查询条数
* @return 对象列表
*/
@Override
public
List
<
DmpTableFieldSchema
>
queryAllByLimit
(
int
offset
,
int
limit
)
{
return
this
.
dmpTableFieldSchemaDao
.
queryAllByLimit
(
offset
,
limit
);
}
/**
* 新增数据
*
* @param dmpTableFieldSchema 实例对象
* @return 实例对象
*/
@Override
public
DmpTableFieldSchema
insert
(
DmpTableFieldSchema
dmpTableFieldSchema
)
{
this
.
dmpTableFieldSchemaDao
.
insert
(
dmpTableFieldSchema
);
return
dmpTableFieldSchema
;
}
/**
* 修改数据
*
* @param dmpTableFieldSchema 实例对象
* @return 实例对象
*/
@Override
public
DmpTableFieldSchema
update
(
DmpTableFieldSchema
dmpTableFieldSchema
)
{
this
.
dmpTableFieldSchemaDao
.
update
(
dmpTableFieldSchema
);
return
this
.
queryById
(
dmpTableFieldSchema
.
getId
());
}
/**
* 通过主键删除数据
*
* @param id 主键
* @return 是否成功
*/
@Override
public
boolean
deleteById
(
Integer
id
)
{
return
this
.
dmpTableFieldSchemaDao
.
deleteById
(
id
)
>
0
;
}
}
\ No newline at end of file
src/main/java/com/jz/dmp/modules/service/impl/DmpTableServiceImpl.java
0 → 100644
View file @
1420183a
package
com
.
jz
.
dmp
.
modules
.
service
.
impl
;
import
com.jz.dmp.modules.dao.DmpTableDao
;
import
com.jz.dmp.modules.model.DmpTable
;
import
com.jz.dmp.modules.service.DmpTableService
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Service
;
import
javax.annotation.Resource
;
import
java.util.List
;
/**
* 项目表信息(DmpTable)表服务实现类
*
* @author Bellamy
* @since 2020-12-23 15:32:56
*/
@Service
(
"dmpTableService"
)
public
class
DmpTableServiceImpl
implements
DmpTableService
{
@Autowired
private
DmpTableDao
dmpTableDao
;
/**
* 通过ID查询单条数据
*
* @param id 主键
* @return 实例对象
*/
@Override
public
DmpTable
queryById
(
Integer
id
)
{
return
this
.
dmpTableDao
.
queryById
(
id
);
}
/**
* 查询多条数据
*
* @param offset 查询起始位置
* @param limit 查询条数
* @return 对象列表
*/
@Override
public
List
<
DmpTable
>
queryAllByLimit
(
int
offset
,
int
limit
)
{
return
this
.
dmpTableDao
.
queryAllByLimit
(
offset
,
limit
);
}
/**
* 新增数据
*
* @param dmpTable 实例对象
* @return 实例对象
*/
@Override
public
DmpTable
insert
(
DmpTable
dmpTable
)
{
this
.
dmpTableDao
.
insert
(
dmpTable
);
return
dmpTable
;
}
/**
* 修改数据
*
* @param dmpTable 实例对象
* @return 实例对象
*/
@Override
public
DmpTable
update
(
DmpTable
dmpTable
)
{
this
.
dmpTableDao
.
update
(
dmpTable
);
return
this
.
queryById
(
dmpTable
.
getId
());
}
/**
* 通过主键删除数据
*
* @param id 主键
* @return 是否成功
*/
@Override
public
boolean
deleteById
(
Integer
id
)
{
return
this
.
dmpTableDao
.
deleteById
(
id
)
>
0
;
}
}
\ No newline at end of file
src/main/java/com/jz/dmp/modules/service/impl/OfflineSynchServiceImpl.java
View file @
1420183a
...
@@ -16,10 +16,12 @@ import com.jz.dmp.modules.controller.DataIntegration.bean.*;
...
@@ -16,10 +16,12 @@ import com.jz.dmp.modules.controller.DataIntegration.bean.*;
import
com.jz.dmp.modules.controller.DataIntegration.bean.flow.FlowExecution
;
import
com.jz.dmp.modules.controller.DataIntegration.bean.flow.FlowExecution
;
import
com.jz.dmp.modules.dao.DmpDevelopTaskDao
;
import
com.jz.dmp.modules.dao.DmpDevelopTaskDao
;
import
com.jz.dmp.modules.dao.DmpProjectDao
;
import
com.jz.dmp.modules.dao.DmpProjectDao
;
import
com.jz.dmp.modules.dao.DmpTableDao
;
import
com.jz.dmp.modules.dao.OfflineSynchDao
;
import
com.jz.dmp.modules.dao.OfflineSynchDao
;
import
com.jz.dmp.modules.model.DmpAgentDatasourceInfo
;
import
com.jz.dmp.modules.model.DmpAgentDatasourceInfo
;
import
com.jz.dmp.modules.model.DmpProjectSystemInfo
;
import
com.jz.dmp.modules.model.DmpProjectSystemInfo
;
import
com.jz.dmp.modules.model.DmpSyncingDatasource
;
import
com.jz.dmp.modules.model.DmpSyncingDatasource
;
import
com.jz.dmp.modules.model.DmpTable
;
import
com.jz.dmp.modules.service.OfflineSynchService
;
import
com.jz.dmp.modules.service.OfflineSynchService
;
import
org.apache.commons.lang3.StringUtils
;
import
org.apache.commons.lang3.StringUtils
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Autowired
;
...
@@ -58,6 +60,9 @@ public class OfflineSynchServiceImpl implements OfflineSynchService {
...
@@ -58,6 +60,9 @@ public class OfflineSynchServiceImpl implements OfflineSynchService {
@Autowired
@Autowired
private
DmpDsAgentService
dmpDsAgentServiceImp
;
private
DmpDsAgentService
dmpDsAgentServiceImp
;
@Autowired
private
DmpTableDao
dmpTableDao
;
@Override
@Override
public
PageInfoResponse
<
TaskListPageDto
>
queryTaskListPage
(
TaskListPageReq
taskListPageReq
)
throws
Exception
{
public
PageInfoResponse
<
TaskListPageDto
>
queryTaskListPage
(
TaskListPageReq
taskListPageReq
)
throws
Exception
{
PageInfoResponse
<
TaskListPageDto
>
pageInfoResponse
=
new
PageInfoResponse
<>();
PageInfoResponse
<
TaskListPageDto
>
pageInfoResponse
=
new
PageInfoResponse
<>();
...
@@ -92,7 +97,7 @@ public class OfflineSynchServiceImpl implements OfflineSynchService {
...
@@ -92,7 +97,7 @@ public class OfflineSynchServiceImpl implements OfflineSynchService {
* 根据源数据库id,获取源数据表——下拉框
* 根据源数据库id,获取源数据表——下拉框
*/
*/
@Override
@Override
public
JsonResult
querygSourceTableList
(
Integer
sourceDbId
,
String
targetName
)
throws
Exception
{
public
JsonResult
querygSourceTableList
(
Long
sourceDbId
,
String
targetName
)
throws
Exception
{
//通过源数据库id ,查询数据源配置
//通过源数据库id ,查询数据源配置
DmpAgentDatasourceInfo
dsInfo
=
offlineSynchDao
.
querySourceDbInfoBySourceId
(
sourceDbId
);
DmpAgentDatasourceInfo
dsInfo
=
offlineSynchDao
.
querySourceDbInfoBySourceId
(
sourceDbId
);
//解码源数据库密码
//解码源数据库密码
...
@@ -263,4 +268,36 @@ public class OfflineSynchServiceImpl implements OfflineSynchService {
...
@@ -263,4 +268,36 @@ public class OfflineSynchServiceImpl implements OfflineSynchService {
return
pageInfoResponse
;
return
pageInfoResponse
;
}
}
@Override
public
JsonResult
querySoureAndTargetColumnsByParams
(
SoureAndTargetColumnsReq
soureAndTargetColumnsReq
)
throws
Exception
{
//通过源数据库id ,查询数据源配置
DmpAgentDatasourceInfo
dsInfo
=
offlineSynchDao
.
querySourceDbInfoBySourceId
(
soureAndTargetColumnsReq
.
getSourceDbId
());
//dsInfo.setHdfsUserName(body.getAccessId()); // 专为HDFS CLIENT提供
dsInfo
.
setFileType
(
soureAndTargetColumnsReq
.
getFileType
());
dsInfo
.
setDelimiter
(
soureAndTargetColumnsReq
.
getCsvDelimiter
());
dsInfo
.
setIsHaveHeader
(
soureAndTargetColumnsReq
.
getCsvIsHaveHeader
());
//创建jdbc,获取源数据表字段
DmpAgentResult
rst
=
dmpDsAgentServiceImp
.
getTableColumnList
(
dsInfo
,
soureAndTargetColumnsReq
.
getTargetTableName
());
if
(!
rst
.
getCode
().
val
().
equals
(
"200"
))
{
return
new
JsonResult
(
rst
.
getCode
(),
rst
.
getMessage
());
}
List
<
Map
<
String
,
Object
>>
cols
=
(
List
<
Map
<
String
,
Object
>>)
JsonMapper
.
fromJsonString
(
rst
.
getMessage
(),
List
.
class
);
if
(
cols
==
null
||
cols
.
size
()
==
0
)
{
return
new
JsonResult
(
ResultCode
.
INTERNAL_SERVER_ERROR
,
"获取不到对应数据源的数据"
);
}
DmpTable
table
=
new
DmpTable
();
//项目表信息
table
.
setTableMode
(
dsInfo
.
getDatasourceType
());
//数据源类型ID
table
.
setCnName
(
soureAndTargetColumnsReq
.
getTargetTableName
());
//中文名
table
.
setIsShow
(
"0"
);
//是否隐藏
table
.
setName
(
soureAndTargetColumnsReq
.
getTargetTableName
());
//表名
table
.
setTableDesc
(
"数据同步-源表"
);
//描述
dmpTableDao
.
deleteTableColumnByName
(
table
);
dmpTableDao
.
deleteTableByName
(
table
);
dmpTableDao
.
insert
(
table
);
return
null
;
}
}
}
src/main/resources/mapper/dmp/DmpTableColumnDao.xml
0 → 100644
View file @
1420183a
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper
namespace=
"com.jz.dmp.modules.dao.DmpTableColumnDao"
>
<resultMap
type=
"com.jz.dmp.modules.model.DmpTableColumn"
id=
"DmpTableColumnMap"
>
<result
property=
"id"
column=
"ID"
jdbcType=
"INTEGER"
/>
<result
property=
"field"
column=
"FIELD"
jdbcType=
"VARCHAR"
/>
<result
property=
"type"
column=
"TYPE"
jdbcType=
"INTEGER"
/>
<result
property=
"size"
column=
"SIZE"
jdbcType=
"INTEGER"
/>
<result
property=
"scale"
column=
"SCALE"
jdbcType=
"INTEGER"
/>
<result
property=
"nullable"
column=
"NULLABLE"
jdbcType=
"VARCHAR"
/>
<result
property=
"defaultValue"
column=
"DEFAULT_VALUE"
jdbcType=
"VARCHAR"
/>
<result
property=
"mode"
column=
"MODE"
jdbcType=
"VARCHAR"
/>
<result
property=
"dataStatus"
column=
"DATA_STATUS"
jdbcType=
"VARCHAR"
/>
<result
property=
"createUserId"
column=
"CREATE_USER_ID"
jdbcType=
"VARCHAR"
/>
<result
property=
"createTime"
column=
"CREATE_TIME"
jdbcType=
"TIMESTAMP"
/>
<result
property=
"updateUserId"
column=
"UPDATE_USER_ID"
jdbcType=
"VARCHAR"
/>
<result
property=
"updateTime"
column=
"UPDATE_TIME"
jdbcType=
"TIMESTAMP"
/>
<result
property=
"tableId"
column=
"TABLE_ID"
jdbcType=
"INTEGER"
/>
<result
property=
"comment"
column=
"COMMENT"
jdbcType=
"VARCHAR"
/>
</resultMap>
<!--查询单个-->
<select
id=
"queryById"
resultMap=
"DmpTableColumnMap"
>
select
ID, FIELD, TYPE, SIZE, SCALE, NULLABLE, DEFAULT_VALUE, MODE, DATA_STATUS, CREATE_USER_ID, CREATE_TIME, UPDATE_USER_ID, UPDATE_TIME, TABLE_ID, COMMENT
from dmp_web.dmp_table_column
where ID = #{id}
</select>
<!--查询指定行数据-->
<select
id=
"queryAllByLimit"
resultMap=
"DmpTableColumnMap"
>
select
ID, FIELD, TYPE, SIZE, SCALE, NULLABLE, DEFAULT_VALUE, MODE, DATA_STATUS, CREATE_USER_ID, CREATE_TIME, UPDATE_USER_ID, UPDATE_TIME, TABLE_ID, COMMENT
from dmp_web.dmp_table_column
limit #{offset}, #{limit}
</select>
<!--通过实体作为筛选条件查询-->
<select
id=
"queryAll"
resultMap=
"DmpTableColumnMap"
>
select
ID, FIELD, TYPE, SIZE, SCALE, NULLABLE, DEFAULT_VALUE, MODE, DATA_STATUS, CREATE_USER_ID, CREATE_TIME,
UPDATE_USER_ID, UPDATE_TIME, TABLE_ID, COMMENT
from dmp_web.dmp_table_column
<where>
<if
test=
"id != null"
>
and ID = #{id}
</if>
<if
test=
"field != null and field != ''"
>
and FIELD = #{field}
</if>
<if
test=
"type != null"
>
and TYPE = #{type}
</if>
<if
test=
"size != null"
>
and SIZE = #{size}
</if>
<if
test=
"scale != null"
>
and SCALE = #{scale}
</if>
<if
test=
"nullable != null and nullable != ''"
>
and NULLABLE = #{nullable}
</if>
<if
test=
"defaultValue != null and defaultValue != ''"
>
and DEFAULT_VALUE = #{defaultValue}
</if>
<if
test=
"mode != null and mode != ''"
>
and MODE = #{mode}
</if>
<if
test=
"dataStatus != null and dataStatus != ''"
>
and DATA_STATUS = #{dataStatus}
</if>
<if
test=
"createUserId != null and createUserId != ''"
>
and CREATE_USER_ID = #{createUserId}
</if>
<if
test=
"createTime != null"
>
and CREATE_TIME = #{createTime}
</if>
<if
test=
"updateUserId != null and updateUserId != ''"
>
and UPDATE_USER_ID = #{updateUserId}
</if>
<if
test=
"updateTime != null"
>
and UPDATE_TIME = #{updateTime}
</if>
<if
test=
"tableId != null"
>
and TABLE_ID = #{tableId}
</if>
<if
test=
"comment != null and comment != ''"
>
and COMMENT = #{comment}
</if>
</where>
</select>
<!--新增所有列-->
<insert
id=
"insert"
keyProperty=
"id"
useGeneratedKeys=
"true"
>
insert into dmp_web.dmp_table_column(FIELD, TYPE, SIZE, SCALE, NULLABLE, DEFAULT_VALUE, MODE, DATA_STATUS, CREATE_USER_ID, CREATE_TIME, UPDATE_USER_ID, UPDATE_TIME, TABLE_ID, COMMENT)
values (#{field}, #{type}, #{size}, #{scale}, #{nullable}, #{defaultValue}, #{mode}, #{dataStatus}, #{createUserId}, #{createTime}, #{updateUserId}, #{updateTime}, #{tableId}, #{comment})
</insert>
<insert
id=
"insertBatch"
keyProperty=
"id"
useGeneratedKeys=
"true"
>
insert into dmp_web.dmp_table_column(FIELD, TYPE, SIZE, SCALE, NULLABLE, DEFAULT_VALUE, MODE, DATA_STATUS,
CREATE_USER_ID, CREATE_TIME, UPDATE_USER_ID, UPDATE_TIME, TABLE_ID, COMMENT)
values
<foreach
collection=
"entities"
item=
"entity"
separator=
","
>
(#{entity.field}, #{entity.type}, #{entity.size}, #{entity.scale}, #{entity.nullable},
#{entity.defaultValue}, #{entity.mode}, #{entity.dataStatus}, #{entity.createUserId}, #{entity.createTime},
#{entity.updateUserId}, #{entity.updateTime}, #{entity.tableId}, #{entity.comment})
</foreach>
</insert>
<insert
id=
"insertOrUpdateBatch"
keyProperty=
"id"
useGeneratedKeys=
"true"
>
insert into dmp_web.dmp_table_column(FIELD, TYPE, SIZE, SCALE, NULLABLE, DEFAULT_VALUE, MODE, DATA_STATUS,
CREATE_USER_ID, CREATE_TIME, UPDATE_USER_ID, UPDATE_TIME, TABLE_ID, COMMENT)
values
<foreach
collection=
"entities"
item=
"entity"
separator=
","
>
(#{entity.field}, #{entity.type}, #{entity.size}, #{entity.scale}, #{entity.nullable},
#{entity.defaultValue}, #{entity.mode}, #{entity.dataStatus}, #{entity.createUserId}, #{entity.createTime},
#{entity.updateUserId}, #{entity.updateTime}, #{entity.tableId}, #{entity.comment})
</foreach>
on duplicate key update
FIELD = values(FIELD) , TYPE = values(TYPE) , SIZE = values(SIZE) , SCALE = values(SCALE) , NULLABLE =
values(NULLABLE) , DEFAULT_VALUE = values(DEFAULT_VALUE) , MODE = values(MODE) , DATA_STATUS =
values(DATA_STATUS) , CREATE_USER_ID = values(CREATE_USER_ID) , CREATE_TIME = values(CREATE_TIME) ,
UPDATE_USER_ID = values(UPDATE_USER_ID) , UPDATE_TIME = values(UPDATE_TIME) , TABLE_ID = values(TABLE_ID) ,
COMMENT = values(COMMENT)
</insert>
<!--通过主键修改数据-->
<update
id=
"update"
>
update dmp_web.dmp_table_column
<set>
<if
test=
"field != null and field != ''"
>
FIELD = #{field},
</if>
<if
test=
"type != null"
>
TYPE = #{type},
</if>
<if
test=
"size != null"
>
SIZE = #{size},
</if>
<if
test=
"scale != null"
>
SCALE = #{scale},
</if>
<if
test=
"nullable != null and nullable != ''"
>
NULLABLE = #{nullable},
</if>
<if
test=
"defaultValue != null and defaultValue != ''"
>
DEFAULT_VALUE = #{defaultValue},
</if>
<if
test=
"mode != null and mode != ''"
>
MODE = #{mode},
</if>
<if
test=
"dataStatus != null and dataStatus != ''"
>
DATA_STATUS = #{dataStatus},
</if>
<if
test=
"createUserId != null and createUserId != ''"
>
CREATE_USER_ID = #{createUserId},
</if>
<if
test=
"createTime != null"
>
CREATE_TIME = #{createTime},
</if>
<if
test=
"updateUserId != null and updateUserId != ''"
>
UPDATE_USER_ID = #{updateUserId},
</if>
<if
test=
"updateTime != null"
>
UPDATE_TIME = #{updateTime},
</if>
<if
test=
"tableId != null"
>
TABLE_ID = #{tableId},
</if>
<if
test=
"comment != null and comment != ''"
>
COMMENT = #{comment},
</if>
</set>
where ID = #{id}
</update>
<!--通过主键删除-->
<delete
id=
"deleteById"
>
delete from dmp_web.dmp_table_column where ID = #{id}
</delete>
</mapper>
\ No newline at end of file
src/main/resources/mapper/dmp/DmpTableDao.xml
0 → 100644
View file @
1420183a
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper
namespace=
"com.jz.dmp.modules.dao.DmpTableDao"
>
<resultMap
type=
"com.jz.dmp.modules.model.DmpTable"
id=
"DmpTableMap"
>
<result
property=
"id"
column=
"ID"
jdbcType=
"INTEGER"
/>
<result
property=
"name"
column=
"NAME"
jdbcType=
"VARCHAR"
/>
<result
property=
"cnName"
column=
"CN_NAME"
jdbcType=
"VARCHAR"
/>
<result
property=
"isShow"
column=
"IS_SHOW"
jdbcType=
"VARCHAR"
/>
<result
property=
"ownerUser"
column=
"OWNER_USER"
jdbcType=
"VARCHAR"
/>
<result
property=
"tableDesc"
column=
"TABLE_DESC"
jdbcType=
"VARCHAR"
/>
<result
property=
"storeSize"
column=
"STORE_SIZE"
jdbcType=
"INTEGER"
/>
<result
property=
"period"
column=
"PERIOD"
jdbcType=
"INTEGER"
/>
<result
property=
"isPartition"
column=
"IS_PARTITION"
jdbcType=
"VARCHAR"
/>
<result
property=
"ddlTime"
column=
"DDL_TIME"
jdbcType=
"TIMESTAMP"
/>
<result
property=
"dataStatus"
column=
"DATA_STATUS"
jdbcType=
"VARCHAR"
/>
<result
property=
"createUserId"
column=
"CREATE_USER_ID"
jdbcType=
"VARCHAR"
/>
<result
property=
"createTime"
column=
"CREATE_TIME"
jdbcType=
"TIMESTAMP"
/>
<result
property=
"updateUserId"
column=
"UPDATE_USER_ID"
jdbcType=
"VARCHAR"
/>
<result
property=
"updateTime"
column=
"UPDATE_TIME"
jdbcType=
"TIMESTAMP"
/>
<result
property=
"categoryId"
column=
"CATEGORY_ID"
jdbcType=
"INTEGER"
/>
<result
property=
"tableMode"
column=
"TABLE_MODE"
jdbcType=
"VARCHAR"
/>
</resultMap>
<!--查询单个-->
<select
id=
"queryById"
resultMap=
"DmpTableMap"
>
select
ID, NAME, CN_NAME, IS_SHOW, OWNER_USER, TABLE_DESC, STORE_SIZE, PERIOD, IS_PARTITION, DDL_TIME, DATA_STATUS, CREATE_USER_ID, CREATE_TIME, UPDATE_USER_ID, UPDATE_TIME, CATEGORY_ID, TABLE_MODE
from dmp_table
where ID = #{id}
</select>
<!--查询指定行数据-->
<select
id=
"queryAllByLimit"
resultMap=
"DmpTableMap"
>
select
ID, NAME, CN_NAME, IS_SHOW, OWNER_USER, TABLE_DESC, STORE_SIZE, PERIOD, IS_PARTITION, DDL_TIME, DATA_STATUS, CREATE_USER_ID, CREATE_TIME, UPDATE_USER_ID, UPDATE_TIME, CATEGORY_ID, TABLE_MODE
from dmp_table
limit #{offset}, #{limit}
</select>
<!--通过实体作为筛选条件查询-->
<select
id=
"queryAll"
resultMap=
"DmpTableMap"
>
select
ID, NAME, CN_NAME, IS_SHOW, OWNER_USER, TABLE_DESC, STORE_SIZE, PERIOD, IS_PARTITION, DDL_TIME, DATA_STATUS,
CREATE_USER_ID, CREATE_TIME, UPDATE_USER_ID, UPDATE_TIME, CATEGORY_ID, TABLE_MODE
from dmp_table
<where>
<if
test=
"id != null"
>
and ID = #{id}
</if>
<if
test=
"name != null and name != ''"
>
and NAME = #{name}
</if>
<if
test=
"cnName != null and cnName != ''"
>
and CN_NAME = #{cnName}
</if>
<if
test=
"isShow != null and isShow != ''"
>
and IS_SHOW = #{isShow}
</if>
<if
test=
"ownerUser != null and ownerUser != ''"
>
and OWNER_USER = #{ownerUser}
</if>
<if
test=
"tableDesc != null and tableDesc != ''"
>
and TABLE_DESC = #{tableDesc}
</if>
<if
test=
"storeSize != null"
>
and STORE_SIZE = #{storeSize}
</if>
<if
test=
"period != null"
>
and PERIOD = #{period}
</if>
<if
test=
"isPartition != null and isPartition != ''"
>
and IS_PARTITION = #{isPartition}
</if>
<if
test=
"ddlTime != null"
>
and DDL_TIME = #{ddlTime}
</if>
<if
test=
"dataStatus != null and dataStatus != ''"
>
and DATA_STATUS = #{dataStatus}
</if>
<if
test=
"createUserId != null and createUserId != ''"
>
and CREATE_USER_ID = #{createUserId}
</if>
<if
test=
"createTime != null"
>
and CREATE_TIME = #{createTime}
</if>
<if
test=
"updateUserId != null and updateUserId != ''"
>
and UPDATE_USER_ID = #{updateUserId}
</if>
<if
test=
"updateTime != null"
>
and UPDATE_TIME = #{updateTime}
</if>
<if
test=
"categoryId != null"
>
and CATEGORY_ID = #{categoryId}
</if>
<if
test=
"tableMode != null and tableMode != ''"
>
and TABLE_MODE = #{tableMode}
</if>
</where>
</select>
<!--新增所有列-->
<insert
id=
"insert"
keyProperty=
"id"
useGeneratedKeys=
"true"
>
insert into dmp_table(NAME, CN_NAME, IS_SHOW, OWNER_USER, TABLE_DESC, STORE_SIZE, PERIOD, IS_PARTITION, DDL_TIME, DATA_STATUS, CREATE_USER_ID, CREATE_TIME, UPDATE_USER_ID, UPDATE_TIME, CATEGORY_ID, TABLE_MODE)
values (#{name}, #{cnName}, #{isShow}, #{ownerUser}, #{tableDesc}, #{storeSize}, #{period}, #{isPartition}, #{ddlTime}, #{dataStatus}, #{createUserId}, #{createTime}, #{updateUserId}, #{updateTime}, #{categoryId}, #{tableMode})
</insert>
<insert
id=
"insertBatch"
keyProperty=
"id"
useGeneratedKeys=
"true"
>
insert into dmp_table(NAME, CN_NAME, IS_SHOW, OWNER_USER, TABLE_DESC, STORE_SIZE, PERIOD, IS_PARTITION,
DDL_TIME, DATA_STATUS, CREATE_USER_ID, CREATE_TIME, UPDATE_USER_ID, UPDATE_TIME, CATEGORY_ID, TABLE_MODE)
values
<foreach
collection=
"entities"
item=
"entity"
separator=
","
>
(#{entity.name}, #{entity.cnName}, #{entity.isShow}, #{entity.ownerUser}, #{entity.tableDesc},
#{entity.storeSize}, #{entity.period}, #{entity.isPartition}, #{entity.ddlTime}, #{entity.dataStatus},
#{entity.createUserId}, #{entity.createTime}, #{entity.updateUserId}, #{entity.updateTime},
#{entity.categoryId}, #{entity.tableMode})
</foreach>
</insert>
<insert
id=
"insertOrUpdateBatch"
keyProperty=
"id"
useGeneratedKeys=
"true"
>
insert into dmp_table(NAME, CN_NAME, IS_SHOW, OWNER_USER, TABLE_DESC, STORE_SIZE, PERIOD, IS_PARTITION,
DDL_TIME, DATA_STATUS, CREATE_USER_ID, CREATE_TIME, UPDATE_USER_ID, UPDATE_TIME, CATEGORY_ID, TABLE_MODE)
values
<foreach
collection=
"entities"
item=
"entity"
separator=
","
>
(#{entity.name}, #{entity.cnName}, #{entity.isShow}, #{entity.ownerUser}, #{entity.tableDesc},
#{entity.storeSize}, #{entity.period}, #{entity.isPartition}, #{entity.ddlTime}, #{entity.dataStatus},
#{entity.createUserId}, #{entity.createTime}, #{entity.updateUserId}, #{entity.updateTime},
#{entity.categoryId}, #{entity.tableMode})
</foreach>
on duplicate key update
NAME = values(NAME) , CN_NAME = values(CN_NAME) , IS_SHOW = values(IS_SHOW) , OWNER_USER = values(OWNER_USER) ,
TABLE_DESC = values(TABLE_DESC) , STORE_SIZE = values(STORE_SIZE) , PERIOD = values(PERIOD) , IS_PARTITION =
values(IS_PARTITION) , DDL_TIME = values(DDL_TIME) , DATA_STATUS = values(DATA_STATUS) , CREATE_USER_ID =
values(CREATE_USER_ID) , CREATE_TIME = values(CREATE_TIME) , UPDATE_USER_ID = values(UPDATE_USER_ID) ,
UPDATE_TIME = values(UPDATE_TIME) , CATEGORY_ID = values(CATEGORY_ID) , TABLE_MODE = values(TABLE_MODE)
</insert>
<!--通过主键修改数据-->
<update
id=
"update"
>
update dmp_table
<set>
<if
test=
"name != null and name != ''"
>
NAME = #{name},
</if>
<if
test=
"cnName != null and cnName != ''"
>
CN_NAME = #{cnName},
</if>
<if
test=
"isShow != null and isShow != ''"
>
IS_SHOW = #{isShow},
</if>
<if
test=
"ownerUser != null and ownerUser != ''"
>
OWNER_USER = #{ownerUser},
</if>
<if
test=
"tableDesc != null and tableDesc != ''"
>
TABLE_DESC = #{tableDesc},
</if>
<if
test=
"storeSize != null"
>
STORE_SIZE = #{storeSize},
</if>
<if
test=
"period != null"
>
PERIOD = #{period},
</if>
<if
test=
"isPartition != null and isPartition != ''"
>
IS_PARTITION = #{isPartition},
</if>
<if
test=
"ddlTime != null"
>
DDL_TIME = #{ddlTime},
</if>
<if
test=
"dataStatus != null and dataStatus != ''"
>
DATA_STATUS = #{dataStatus},
</if>
<if
test=
"createUserId != null and createUserId != ''"
>
CREATE_USER_ID = #{createUserId},
</if>
<if
test=
"createTime != null"
>
CREATE_TIME = #{createTime},
</if>
<if
test=
"updateUserId != null and updateUserId != ''"
>
UPDATE_USER_ID = #{updateUserId},
</if>
<if
test=
"updateTime != null"
>
UPDATE_TIME = #{updateTime},
</if>
<if
test=
"categoryId != null"
>
CATEGORY_ID = #{categoryId},
</if>
<if
test=
"tableMode != null and tableMode != ''"
>
TABLE_MODE = #{tableMode},
</if>
</set>
where ID = #{id}
</update>
<!--通过主键删除-->
<delete
id=
"deleteById"
>
delete from dmp_table where ID = #{id}
</delete>
<delete
id=
"deleteTableColumnByName"
parameterType=
"dmpTable"
>
delete dmp_table,dmp_table_column
from dmp_table_column
inner join dmp_table on dmp_table.id = dmp_table_column.table_id
and dmp_table.name = #{name}
and dmp_table.table_mode = #{tableMode}
</delete>
<delete
id=
"deleteTableByName"
parameterType=
"dmpTable"
>
delete from dmp_table where name = #{name} and table_mode = #{tableMode}
</delete>
</mapper>
\ No newline at end of file
src/main/resources/mapper/dmp/DmpTableFieldMappingDao.xml
0 → 100644
View file @
1420183a
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper
namespace=
"com.jz.dmp.modules.dao.DmpTableFieldMappingDao"
>
<resultMap
type=
"com.jz.dmp.modules.model.DmpTableFieldMapping"
id=
"DmpTableFieldMappingMap"
>
<result
property=
"id"
column=
"ID"
jdbcType=
"INTEGER"
/>
<result
property=
"sourceId"
column=
"SOURCE_ID"
jdbcType=
"INTEGER"
/>
<result
property=
"targetId"
column=
"TARGET_ID"
jdbcType=
"INTEGER"
/>
</resultMap>
<!--查询单个-->
<select
id=
"queryById"
resultMap=
"DmpTableFieldMappingMap"
>
select
ID, SOURCE_ID, TARGET_ID
from dmp_web.dmp_table_field_mapping
where ID = #{id}
</select>
<!--查询指定行数据-->
<select
id=
"queryAllByLimit"
resultMap=
"DmpTableFieldMappingMap"
>
select
ID, SOURCE_ID, TARGET_ID
from dmp_web.dmp_table_field_mapping
limit #{offset}, #{limit}
</select>
<!--通过实体作为筛选条件查询-->
<select
id=
"queryAll"
resultMap=
"DmpTableFieldMappingMap"
>
select
ID, SOURCE_ID, TARGET_ID
from dmp_web.dmp_table_field_mapping
<where>
<if
test=
"id != null"
>
and ID = #{id}
</if>
<if
test=
"sourceId != null"
>
and SOURCE_ID = #{sourceId}
</if>
<if
test=
"targetId != null"
>
and TARGET_ID = #{targetId}
</if>
</where>
</select>
<!--新增所有列-->
<insert
id=
"insert"
keyProperty=
"id"
useGeneratedKeys=
"true"
>
insert into dmp_web.dmp_table_field_mapping(SOURCE_ID, TARGET_ID)
values (#{sourceId}, #{targetId})
</insert>
<insert
id=
"insertBatch"
keyProperty=
"id"
useGeneratedKeys=
"true"
>
insert into dmp_web.dmp_table_field_mapping(SOURCE_ID, TARGET_ID)
values
<foreach
collection=
"entities"
item=
"entity"
separator=
","
>
(#{entity.sourceId}, #{entity.targetId})
</foreach>
</insert>
<insert
id=
"insertOrUpdateBatch"
keyProperty=
"id"
useGeneratedKeys=
"true"
>
insert into dmp_web.dmp_table_field_mapping(SOURCE_ID, TARGET_ID)
values
<foreach
collection=
"entities"
item=
"entity"
separator=
","
>
(#{entity.sourceId}, #{entity.targetId})
</foreach>
on duplicate key update
SOURCE_ID = values(SOURCE_ID) , TARGET_ID = values(TARGET_ID)
</insert>
<!--通过主键修改数据-->
<update
id=
"update"
>
update dmp_web.dmp_table_field_mapping
<set>
<if
test=
"sourceId != null"
>
SOURCE_ID = #{sourceId},
</if>
<if
test=
"targetId != null"
>
TARGET_ID = #{targetId},
</if>
</set>
where ID = #{id}
</update>
<!--通过主键删除-->
<delete
id=
"deleteById"
>
delete from dmp_web.dmp_table_field_mapping where ID = #{id}
</delete>
</mapper>
\ No newline at end of file
src/main/resources/mapper/dmp/DmpTableFieldSchemaDao.xml
0 → 100644
View file @
1420183a
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper
namespace=
"com.jz.dmp.modules.dao.DmpTableFieldSchemaDao"
>
<resultMap
type=
"com.jz.dmp.modules.model.DmpTableFieldSchema"
id=
"DmpTableFieldSchemaMap"
>
<result
property=
"id"
column=
"ID"
jdbcType=
"INTEGER"
/>
<result
property=
"dsId"
column=
"DS_ID"
jdbcType=
"INTEGER"
/>
<result
property=
"typeCategory"
column=
"TYPE_CATEGORY"
jdbcType=
"VARCHAR"
/>
<result
property=
"fieldType"
column=
"FIELD_TYPE"
jdbcType=
"VARCHAR"
/>
<result
property=
"isCatDefault"
column=
"IS_CAT_DEFAULT"
jdbcType=
"VARCHAR"
/>
</resultMap>
<!--查询单个-->
<select
id=
"queryById"
resultMap=
"DmpTableFieldSchemaMap"
>
select
ID, DS_ID, TYPE_CATEGORY, FIELD_TYPE, IS_CAT_DEFAULT
from dmp_web.dmp_table_field_schema
where ID = #{id}
</select>
<!--查询指定行数据-->
<select
id=
"queryAllByLimit"
resultMap=
"DmpTableFieldSchemaMap"
>
select
ID, DS_ID, TYPE_CATEGORY, FIELD_TYPE, IS_CAT_DEFAULT
from dmp_web.dmp_table_field_schema
limit #{offset}, #{limit}
</select>
<!--通过实体作为筛选条件查询-->
<select
id=
"queryAll"
resultMap=
"DmpTableFieldSchemaMap"
>
select
ID, DS_ID, TYPE_CATEGORY, FIELD_TYPE, IS_CAT_DEFAULT
from dmp_web.dmp_table_field_schema
<where>
<if
test=
"id != null"
>
and ID = #{id}
</if>
<if
test=
"dsId != null"
>
and DS_ID = #{dsId}
</if>
<if
test=
"typeCategory != null and typeCategory != ''"
>
and TYPE_CATEGORY = #{typeCategory}
</if>
<if
test=
"fieldType != null and fieldType != ''"
>
and FIELD_TYPE = #{fieldType}
</if>
<if
test=
"isCatDefault != null and isCatDefault != ''"
>
and IS_CAT_DEFAULT = #{isCatDefault}
</if>
</where>
</select>
<!--新增所有列-->
<insert
id=
"insert"
keyProperty=
"id"
useGeneratedKeys=
"true"
>
insert into dmp_web.dmp_table_field_schema(DS_ID, TYPE_CATEGORY, FIELD_TYPE, IS_CAT_DEFAULT)
values (#{dsId}, #{typeCategory}, #{fieldType}, #{isCatDefault})
</insert>
<insert
id=
"insertBatch"
keyProperty=
"id"
useGeneratedKeys=
"true"
>
insert into dmp_web.dmp_table_field_schema(DS_ID, TYPE_CATEGORY, FIELD_TYPE, IS_CAT_DEFAULT)
values
<foreach
collection=
"entities"
item=
"entity"
separator=
","
>
(#{entity.dsId}, #{entity.typeCategory}, #{entity.fieldType}, #{entity.isCatDefault})
</foreach>
</insert>
<insert
id=
"insertOrUpdateBatch"
keyProperty=
"id"
useGeneratedKeys=
"true"
>
insert into dmp_web.dmp_table_field_schema(DS_ID, TYPE_CATEGORY, FIELD_TYPE, IS_CAT_DEFAULT)
values
<foreach
collection=
"entities"
item=
"entity"
separator=
","
>
(#{entity.dsId}, #{entity.typeCategory}, #{entity.fieldType}, #{entity.isCatDefault})
</foreach>
on duplicate key update
DS_ID = values(DS_ID) , TYPE_CATEGORY = values(TYPE_CATEGORY) , FIELD_TYPE = values(FIELD_TYPE) , IS_CAT_DEFAULT
= values(IS_CAT_DEFAULT)
</insert>
<!--通过主键修改数据-->
<update
id=
"update"
>
update dmp_web.dmp_table_field_schema
<set>
<if
test=
"dsId != null"
>
DS_ID = #{dsId},
</if>
<if
test=
"typeCategory != null and typeCategory != ''"
>
TYPE_CATEGORY = #{typeCategory},
</if>
<if
test=
"fieldType != null and fieldType != ''"
>
FIELD_TYPE = #{fieldType},
</if>
<if
test=
"isCatDefault != null and isCatDefault != ''"
>
IS_CAT_DEFAULT = #{isCatDefault},
</if>
</set>
where ID = #{id}
</update>
<!--通过主键删除-->
<delete
id=
"deleteById"
>
delete from dmp_web.dmp_table_field_schema where ID = #{id}
</delete>
</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