Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
D
datax-cloud
Overview
Overview
Details
Activity
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
黄营
datax-cloud
Commits
d82a9467
Commit
d82a9467
authored
May 19, 2020
by
yuwei
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
2.0.0项目初始化
parent
096eafad
Hide whitespace changes
Inline
Side-by-side
Showing
12 changed files
with
571 additions
and
0 deletions
+571
-0
pom.xml
datax-tools/datax-tool-codegen/pom.xml
+42
-0
GenTableController.java
.../cn/datax/tool/codegen/controller/GenTableController.java
+121
-0
GenTableDao.java
.../src/main/java/cn/datax/tool/codegen/dao/GenTableDao.java
+18
-0
GenColumnDto.java
...src/main/java/cn/datax/tool/codegen/dto/GenColumnDto.java
+62
-0
GenTableDto.java
.../src/main/java/cn/datax/tool/codegen/dto/GenTableDto.java
+62
-0
GenTableEntity.java
...ain/java/cn/datax/tool/codegen/entity/GenTableEntity.java
+77
-0
GenTableMapper.java
.../java/cn/datax/tool/codegen/mapstruct/GenTableMapper.java
+20
-0
GenTableQuery.java
.../main/java/cn/datax/tool/codegen/query/GenTableQuery.java
+20
-0
GenTableService.java
...n/java/cn/datax/tool/codegen/service/GenTableService.java
+24
-0
GenTableServiceImpl.java
.../datax/tool/codegen/service/impl/GenTableServiceImpl.java
+51
-0
GenTableVo.java
...en/src/main/java/cn/datax/tool/codegen/vo/GenTableVo.java
+38
-0
GenTableMapper.xml
...tool-codegen/src/main/resources/mapper/GenTableMapper.xml
+36
-0
No files found.
datax-tools/datax-tool-codegen/pom.xml
View file @
d82a9467
...
@@ -13,6 +13,48 @@
...
@@ -13,6 +13,48 @@
<dependencies>
<dependencies>
<dependency>
<dependency>
<groupId>
io.springfox
</groupId>
<artifactId>
springfox-swagger2
</artifactId>
<version>
${swagger2.version}
</version>
</dependency>
<dependency>
<groupId>
io.springfox
</groupId>
<artifactId>
springfox-bean-validators
</artifactId>
<version>
${swagger2.version}
</version>
</dependency>
<dependency>
<groupId>
io.springfox
</groupId>
<artifactId>
springfox-swagger-ui
</artifactId>
<version>
${swagger2.version}
</version>
</dependency>
<!--web 模块-->
<dependency>
<groupId>
org.springframework.boot
</groupId>
<artifactId>
spring-boot-starter-web
</artifactId>
<exclusions>
<exclusion>
<artifactId>
spring-boot-starter-tomcat
</artifactId>
<groupId>
org.springframework.boot
</groupId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>
org.springframework.boot
</groupId>
<artifactId>
spring-boot-starter-undertow
</artifactId>
</dependency>
<dependency>
<groupId>
org.mapstruct
</groupId>
<artifactId>
mapstruct
</artifactId>
<version>
${mapstruct.version}
</version>
<scope>
provided
</scope>
</dependency>
<dependency>
<groupId>
org.mapstruct
</groupId>
<artifactId>
mapstruct-processor
</artifactId>
<version>
${mapstruct.version}
</version>
<scope>
provided
</scope>
</dependency>
<dependency>
<groupId>
com.baomidou
</groupId>
<groupId>
com.baomidou
</groupId>
<artifactId>
mybatis-plus-generator
</artifactId>
<artifactId>
mybatis-plus-generator
</artifactId>
<version>
${mybatis-plus.version}
</version>
<version>
${mybatis-plus.version}
</version>
...
...
datax-tools/datax-tool-codegen/src/main/java/cn/datax/tool/codegen/controller/GenTableController.java
0 → 100644
View file @
d82a9467
package
cn
.
datax
.
tool
.
codegen
.
controller
;
import
cn.datax.common.core.JsonPage
;
import
cn.datax.common.core.R
;
import
cn.datax.common.validate.ValidationGroups
;
import
cn.datax.tool.codegen.dto.GenTableDto
;
import
cn.datax.tool.codegen.entity.GenTableEntity
;
import
cn.datax.tool.codegen.vo.GenTableVo
;
import
cn.datax.tool.codegen.query.GenTableQuery
;
import
cn.datax.tool.codegen.mapstruct.GenTableMapper
;
import
cn.datax.tool.codegen.service.GenTableService
;
import
com.baomidou.mybatisplus.core.conditions.query.QueryWrapper
;
import
com.baomidou.mybatisplus.core.metadata.IPage
;
import
com.baomidou.mybatisplus.extension.plugins.pagination.Page
;
import
io.swagger.annotations.Api
;
import
io.swagger.annotations.ApiImplicitParam
;
import
io.swagger.annotations.ApiImplicitParams
;
import
io.swagger.annotations.ApiOperation
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.validation.annotation.Validated
;
import
org.springframework.web.bind.annotation.*
;
import
cn.datax.common.base.BaseController
;
import
java.util.List
;
import
java.util.stream.Collectors
;
/**
* <p>
* 代码生成信息表 前端控制器
* </p>
*
* @author yuwei
* @since 2020-05-19
*/
@Api
(
tags
=
{
"代码生成信息表"
})
@RestController
@RequestMapping
(
"/codegen/genTable"
)
public
class
GenTableController
extends
BaseController
{
@Autowired
private
GenTableService
genTableService
;
@Autowired
private
GenTableMapper
genTableMapper
;
/**
* 通过ID查询信息
*
* @param id
* @return
*/
@ApiOperation
(
value
=
"获取详细信息"
,
notes
=
"根据url的id来获取详细信息"
)
@ApiImplicitParam
(
name
=
"id"
,
value
=
"ID"
,
required
=
true
,
dataType
=
"String"
,
paramType
=
"path"
)
@GetMapping
(
"/{id}"
)
public
R
getGenTableById
(
@PathVariable
String
id
)
{
GenTableEntity
genTableEntity
=
genTableService
.
getGenTableById
(
id
);
return
R
.
ok
().
setData
(
genTableMapper
.
toVO
(
genTableEntity
));
}
/**
* 分页查询信息
*
* @param genTableQuery
* @return
*/
@ApiOperation
(
value
=
"分页查询"
,
notes
=
""
)
@ApiImplicitParams
({
@ApiImplicitParam
(
name
=
"genTableQuery"
,
value
=
"查询实体genTableQuery"
,
required
=
true
,
dataTypeClass
=
GenTableQuery
.
class
)
})
@GetMapping
(
"/page"
)
public
R
getGenTablePage
(
GenTableQuery
genTableQuery
)
{
QueryWrapper
<
GenTableEntity
>
queryWrapper
=
new
QueryWrapper
<>();
IPage
<
GenTableEntity
>
page
=
genTableService
.
page
(
new
Page
<>(
genTableQuery
.
getPageNum
(),
genTableQuery
.
getPageSize
()),
queryWrapper
);
List
<
GenTableVo
>
collect
=
page
.
getRecords
().
stream
().
map
(
genTableMapper:
:
toVO
).
collect
(
Collectors
.
toList
());
JsonPage
<
GenTableVo
>
jsonPage
=
new
JsonPage
<>(
page
.
getCurrent
(),
page
.
getSize
(),
page
.
getTotal
(),
collect
);
return
R
.
ok
().
setData
(
jsonPage
);
}
/**
* 添加
* @param genTable
* @return
*/
@ApiOperation
(
value
=
"添加信息"
,
notes
=
"根据genTable对象添加信息"
)
@ApiImplicitParam
(
name
=
"genTable"
,
value
=
"详细实体genTable"
,
required
=
true
,
dataType
=
"GenTableDto"
)
@PostMapping
()
public
R
saveGenTable
(
@RequestBody
@Validated
({
ValidationGroups
.
Insert
.
class
})
GenTableDto
genTable
)
{
genTableService
.
saveGenTable
(
genTable
);
return
R
.
ok
();
}
/**
* 修改
* @param genTable
* @return
*/
@ApiOperation
(
value
=
"修改信息"
,
notes
=
"根据url的id来指定修改对象,并根据传过来的信息来修改详细信息"
)
@ApiImplicitParams
({
@ApiImplicitParam
(
name
=
"id"
,
value
=
"ID"
,
required
=
true
,
dataType
=
"String"
,
paramType
=
"path"
),
@ApiImplicitParam
(
name
=
"genTable"
,
value
=
"详细实体genTable"
,
required
=
true
,
dataType
=
"GenTableDto"
)
})
@PutMapping
(
"/{id}"
)
public
R
updateGenTable
(
@PathVariable
String
id
,
@RequestBody
@Validated
({
ValidationGroups
.
Update
.
class
})
GenTableDto
genTable
)
{
genTableService
.
updateGenTable
(
genTable
);
return
R
.
ok
();
}
/**
* 删除
* @param id
* @return
*/
@ApiOperation
(
value
=
"删除"
,
notes
=
"根据url的id来指定删除对象"
)
@ApiImplicitParam
(
name
=
"id"
,
value
=
"ID"
,
required
=
true
,
dataType
=
"String"
,
paramType
=
"path"
)
@DeleteMapping
(
"/{id}"
)
public
R
deleteGenTableById
(
@PathVariable
String
id
)
{
genTableService
.
deleteGenTableById
(
id
);
return
R
.
ok
();
}
}
datax-tools/datax-tool-codegen/src/main/java/cn/datax/tool/codegen/dao/GenTableDao.java
0 → 100644
View file @
d82a9467
package
cn
.
datax
.
tool
.
codegen
.
dao
;
import
cn.datax.common.base.BaseDao
;
import
cn.datax.tool.codegen.entity.GenTableEntity
;
import
org.apache.ibatis.annotations.Mapper
;
/**
* <p>
* 代码生成信息表 Mapper 接口
* </p>
*
* @author yuwei
* @since 2020-05-19
*/
@Mapper
public
interface
GenTableDao
extends
BaseDao
<
GenTableEntity
>
{
}
datax-tools/datax-tool-codegen/src/main/java/cn/datax/tool/codegen/dto/GenColumnDto.java
0 → 100644
View file @
d82a9467
package
cn
.
datax
.
tool
.
codegen
.
dto
;
import
cn.datax.common.validate.ValidationGroups
;
import
io.swagger.annotations.ApiModelProperty
;
import
lombok.Data
;
import
javax.validation.constraints.NotBlank
;
import
javax.validation.constraints.NotNull
;
import
java.io.Serializable
;
@Data
public
class
GenColumnDto
implements
Serializable
{
private
static
final
long
serialVersionUID
=
1L
;
@ApiModelProperty
(
value
=
"列名称"
)
@NotBlank
(
message
=
"列名称不能为空"
,
groups
=
{
ValidationGroups
.
Insert
.
class
,
ValidationGroups
.
Update
.
class
})
private
String
columnName
;
@ApiModelProperty
(
value
=
"列描述"
)
@NotBlank
(
message
=
"列描述不能为空"
,
groups
=
{
ValidationGroups
.
Insert
.
class
,
ValidationGroups
.
Update
.
class
})
private
String
columnComment
;
@ApiModelProperty
(
value
=
"列类型"
)
@NotBlank
(
message
=
"列类型不能为空"
,
groups
=
{
ValidationGroups
.
Insert
.
class
,
ValidationGroups
.
Update
.
class
})
private
String
columnType
;
@ApiModelProperty
(
value
=
"JAVA类型"
)
@NotBlank
(
message
=
"JAVA类型不能为空"
,
groups
=
{
ValidationGroups
.
Insert
.
class
,
ValidationGroups
.
Update
.
class
})
private
String
javaType
;
@ApiModelProperty
(
value
=
"JAVA字段名"
)
@NotBlank
(
message
=
"JAVA字段名不能为空"
,
groups
=
{
ValidationGroups
.
Insert
.
class
,
ValidationGroups
.
Update
.
class
})
private
String
javaField
;
@ApiModelProperty
(
value
=
"是否主键(0否1是)"
)
@NotNull
(
message
=
"是否主键不能为空"
,
groups
=
{
ValidationGroups
.
Insert
.
class
,
ValidationGroups
.
Update
.
class
})
private
Integer
isPk
;
@ApiModelProperty
(
value
=
"是否自增(0否1是)"
)
@NotNull
(
message
=
"是否自增不能为空"
,
groups
=
{
ValidationGroups
.
Insert
.
class
,
ValidationGroups
.
Update
.
class
})
private
Integer
isIncrement
;
@ApiModelProperty
(
value
=
"是否必填(0否1是)"
)
@NotNull
(
message
=
"是否必填不能为空"
,
groups
=
{
ValidationGroups
.
Insert
.
class
,
ValidationGroups
.
Update
.
class
})
private
Integer
isRequired
;
@ApiModelProperty
(
value
=
"是否为插入字段(0否1是)"
)
@NotNull
(
message
=
"是否为插入字段不能为空"
,
groups
=
{
ValidationGroups
.
Insert
.
class
,
ValidationGroups
.
Update
.
class
})
private
Integer
isInsert
;
@ApiModelProperty
(
value
=
"是否编辑字段(0否1是)"
)
@NotNull
(
message
=
"是否编辑字段不能为空"
,
groups
=
{
ValidationGroups
.
Insert
.
class
,
ValidationGroups
.
Update
.
class
})
private
Integer
isEdit
;
@ApiModelProperty
(
value
=
"是否列表字段(0否1是)"
)
@NotNull
(
message
=
"是否列表字段不能为空"
,
groups
=
{
ValidationGroups
.
Insert
.
class
,
ValidationGroups
.
Update
.
class
})
private
Integer
isList
;
@ApiModelProperty
(
value
=
"是否查询字段(0否1是)"
)
@NotNull
(
message
=
"是否查询字段不能为空"
,
groups
=
{
ValidationGroups
.
Insert
.
class
,
ValidationGroups
.
Update
.
class
})
private
Integer
isQuery
;
@ApiModelProperty
(
value
=
"查询方式(EQ等于、NE不等于、GT大于、LT小于、LIKE模糊、BETWEEN范围)"
)
@NotBlank
(
message
=
"查询方式不能为空"
,
groups
=
{
ValidationGroups
.
Insert
.
class
,
ValidationGroups
.
Update
.
class
})
private
String
queryType
;
@ApiModelProperty
(
value
=
"显示类型(input文本框、textarea文本域、select下拉框、checkbox复选框、radio单选框、datetime日期控件)"
)
@NotBlank
(
message
=
"显示类型不能为空"
,
groups
=
{
ValidationGroups
.
Insert
.
class
,
ValidationGroups
.
Update
.
class
})
private
String
htmlType
;
@ApiModelProperty
(
value
=
"字典类型"
)
private
String
dictType
;
@ApiModelProperty
(
value
=
"排序"
)
private
Integer
sort
;
}
datax-tools/datax-tool-codegen/src/main/java/cn/datax/tool/codegen/dto/GenTableDto.java
0 → 100644
View file @
d82a9467
package
cn
.
datax
.
tool
.
codegen
.
dto
;
import
cn.datax.common.validate.ValidationGroups
;
import
io.swagger.annotations.ApiModel
;
import
io.swagger.annotations.ApiModelProperty
;
import
lombok.Data
;
import
javax.validation.Valid
;
import
javax.validation.constraints.NotBlank
;
import
javax.validation.constraints.NotEmpty
;
import
javax.validation.constraints.Size
;
import
java.io.Serializable
;
import
java.util.List
;
/**
* <p>
* 代码生成信息表 实体DTO
* </p>
*
* @author yuwei
* @since 2020-05-19
*/
@ApiModel
(
value
=
"代码生成信息表Model"
)
@Data
public
class
GenTableDto
implements
Serializable
{
private
static
final
long
serialVersionUID
=
1L
;
@ApiModelProperty
(
value
=
"主键ID"
)
@NotBlank
(
message
=
"主键ID不能为空"
,
groups
=
{
ValidationGroups
.
Update
.
class
})
private
String
id
;
@ApiModelProperty
(
value
=
"表名称"
)
@NotBlank
(
message
=
"表名称不能为空"
,
groups
=
{
ValidationGroups
.
Insert
.
class
,
ValidationGroups
.
Update
.
class
})
private
String
tableName
;
@ApiModelProperty
(
value
=
"表描述"
)
@NotBlank
(
message
=
"表描述不能为空"
,
groups
=
{
ValidationGroups
.
Insert
.
class
,
ValidationGroups
.
Update
.
class
})
private
String
tableComment
;
@ApiModelProperty
(
value
=
"实体类名称"
)
@NotBlank
(
message
=
"实体类名称不能为空"
,
groups
=
{
ValidationGroups
.
Insert
.
class
,
ValidationGroups
.
Update
.
class
})
private
String
className
;
@ApiModelProperty
(
value
=
"生成包路径"
)
@NotBlank
(
message
=
"生成包路径不能为空"
,
groups
=
{
ValidationGroups
.
Insert
.
class
,
ValidationGroups
.
Update
.
class
})
private
String
packageName
;
@ApiModelProperty
(
value
=
"生成模块名"
)
@NotBlank
(
message
=
"生成模块名不能为空"
,
groups
=
{
ValidationGroups
.
Insert
.
class
,
ValidationGroups
.
Update
.
class
})
private
String
moduleName
;
@ApiModelProperty
(
value
=
"生成业务名"
)
@NotBlank
(
message
=
"生成业务名不能为空"
,
groups
=
{
ValidationGroups
.
Insert
.
class
,
ValidationGroups
.
Update
.
class
})
private
String
businessName
;
@ApiModelProperty
(
value
=
"生成功能名"
)
@NotBlank
(
message
=
"生成功能名不能为空"
,
groups
=
{
ValidationGroups
.
Insert
.
class
,
ValidationGroups
.
Update
.
class
})
private
String
functionName
;
@ApiModelProperty
(
value
=
"生成功能作者"
)
@NotBlank
(
message
=
"生成功能作者不能为空"
,
groups
=
{
ValidationGroups
.
Insert
.
class
,
ValidationGroups
.
Update
.
class
})
private
String
functionAuthor
;
@ApiModelProperty
(
value
=
"主键信息"
)
private
GenColumnDto
pkColumn
;
@Valid
@NotEmpty
(
message
=
"表字段不能为空"
,
groups
=
{
ValidationGroups
.
Insert
.
class
,
ValidationGroups
.
Update
.
class
})
@Size
(
min
=
1
,
message
=
"表字段长度不能少于{min}位"
)
private
List
<
GenColumnDto
>
columns
;
}
datax-tools/datax-tool-codegen/src/main/java/cn/datax/tool/codegen/entity/GenTableEntity.java
0 → 100644
View file @
d82a9467
package
cn
.
datax
.
tool
.
codegen
.
entity
;
import
cn.datax.tool.codegen.dto.GenColumnDto
;
import
com.baomidou.mybatisplus.annotation.TableField
;
import
com.baomidou.mybatisplus.annotation.TableName
;
import
com.baomidou.mybatisplus.annotation.IdType
;
import
com.baomidou.mybatisplus.annotation.TableId
;
import
cn.datax.common.base.BaseEntity
;
import
com.baomidou.mybatisplus.extension.handlers.JacksonTypeHandler
;
import
lombok.Data
;
import
lombok.EqualsAndHashCode
;
import
lombok.experimental.Accessors
;
import
java.util.List
;
/**
* <p>
* 代码生成信息表
* </p>
*
* @author yuwei
* @since 2020-05-19
*/
@Data
@EqualsAndHashCode
(
callSuper
=
true
)
@Accessors
(
chain
=
true
)
@TableName
(
"gen_table"
)
public
class
GenTableEntity
extends
BaseEntity
{
private
static
final
long
serialVersionUID
=
1L
;
/**
* 表名称
*/
private
String
tableName
;
/**
* 表描述
*/
private
String
tableComment
;
/**
* 实体类名称
*/
private
String
className
;
/**
* 生成包路径
*/
private
String
packageName
;
/**
* 生成模块名
*/
private
String
moduleName
;
/**
* 生成业务名
*/
private
String
businessName
;
/**
* 生成功能名
*/
private
String
functionName
;
/**
* 生成功能作者
*/
private
String
functionAuthor
;
/**
* 表字段
*/
@TableField
(
value
=
"column_json"
,
typeHandler
=
JacksonTypeHandler
.
class
)
private
List
<
GenColumnDto
>
columns
;
}
datax-tools/datax-tool-codegen/src/main/java/cn/datax/tool/codegen/mapstruct/GenTableMapper.java
0 → 100644
View file @
d82a9467
package
cn
.
datax
.
tool
.
codegen
.
mapstruct
;
import
cn.datax.common.mapstruct.EntityMapper
;
import
cn.datax.tool.codegen.dto.GenTableDto
;
import
cn.datax.tool.codegen.entity.GenTableEntity
;
import
cn.datax.tool.codegen.vo.GenTableVo
;
import
org.mapstruct.Mapper
;
/**
* <p>
* 代码生成信息表 Mapper 实体映射
* </p>
*
* @author yuwei
* @since 2020-05-19
*/
@Mapper
(
componentModel
=
"spring"
)
public
interface
GenTableMapper
extends
EntityMapper
<
GenTableDto
,
GenTableEntity
,
GenTableVo
>
{
}
datax-tools/datax-tool-codegen/src/main/java/cn/datax/tool/codegen/query/GenTableQuery.java
0 → 100644
View file @
d82a9467
package
cn
.
datax
.
tool
.
codegen
.
query
;
import
cn.datax.common.base.BaseQueryParams
;
import
lombok.Data
;
import
lombok.EqualsAndHashCode
;
/**
* <p>
* 代码生成信息表 查询实体
* </p>
*
* @author yuwei
* @since 2020-05-19
*/
@Data
@EqualsAndHashCode
(
callSuper
=
true
)
public
class
GenTableQuery
extends
BaseQueryParams
{
private
static
final
long
serialVersionUID
=
1L
;
}
datax-tools/datax-tool-codegen/src/main/java/cn/datax/tool/codegen/service/GenTableService.java
0 → 100644
View file @
d82a9467
package
cn
.
datax
.
tool
.
codegen
.
service
;
import
cn.datax.tool.codegen.entity.GenTableEntity
;
import
cn.datax.tool.codegen.dto.GenTableDto
;
import
cn.datax.common.base.BaseService
;
/**
* <p>
* 代码生成信息表 服务类
* </p>
*
* @author yuwei
* @since 2020-05-19
*/
public
interface
GenTableService
extends
BaseService
<
GenTableEntity
>
{
void
saveGenTable
(
GenTableDto
genTable
);
void
updateGenTable
(
GenTableDto
genTable
);
GenTableEntity
getGenTableById
(
String
id
);
void
deleteGenTableById
(
String
id
);
}
datax-tools/datax-tool-codegen/src/main/java/cn/datax/tool/codegen/service/impl/GenTableServiceImpl.java
0 → 100644
View file @
d82a9467
package
cn
.
datax
.
tool
.
codegen
.
service
.
impl
;
import
cn.datax.tool.codegen.entity.GenTableEntity
;
import
cn.datax.tool.codegen.dto.GenTableDto
;
import
cn.datax.tool.codegen.service.GenTableService
;
import
cn.datax.tool.codegen.mapstruct.GenTableMapper
;
import
cn.datax.tool.codegen.dao.GenTableDao
;
import
cn.datax.common.base.BaseServiceImpl
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Service
;
/**
* <p>
* 代码生成信息表 服务实现类
* </p>
*
* @author yuwei
* @since 2020-05-19
*/
@Service
public
class
GenTableServiceImpl
extends
BaseServiceImpl
<
GenTableDao
,
GenTableEntity
>
implements
GenTableService
{
@Autowired
private
GenTableDao
genTableDao
;
@Autowired
private
GenTableMapper
genTableMapper
;
@Override
public
void
saveGenTable
(
GenTableDto
genTableDto
)
{
GenTableEntity
genTable
=
genTableMapper
.
toEntity
(
genTableDto
);
genTableDao
.
insert
(
genTable
);
}
@Override
public
void
updateGenTable
(
GenTableDto
genTableDto
)
{
GenTableEntity
genTable
=
genTableMapper
.
toEntity
(
genTableDto
);
genTableDao
.
updateById
(
genTable
);
}
@Override
public
GenTableEntity
getGenTableById
(
String
id
)
{
GenTableEntity
genTableEntity
=
super
.
getById
(
id
);
return
genTableEntity
;
}
@Override
public
void
deleteGenTableById
(
String
id
)
{
genTableDao
.
deleteById
(
id
);
}
}
datax-tools/datax-tool-codegen/src/main/java/cn/datax/tool/codegen/vo/GenTableVo.java
0 → 100644
View file @
d82a9467
package
cn
.
datax
.
tool
.
codegen
.
vo
;
import
cn.datax.tool.codegen.dto.GenColumnDto
;
import
com.fasterxml.jackson.annotation.JsonFormat
;
import
lombok.Data
;
import
java.io.Serializable
;
import
java.time.LocalDateTime
;
import
java.util.List
;
/**
* <p>
* 代码生成信息表 实体VO
* </p>
*
* @author yuwei
* @since 2020-05-19
*/
@Data
public
class
GenTableVo
implements
Serializable
{
private
static
final
long
serialVersionUID
=
1L
;
private
String
id
;
private
Integer
status
;
@JsonFormat
(
pattern
=
"yyyy-MM-dd HH:mm:ss"
,
timezone
=
"GMT+8"
)
private
LocalDateTime
createTime
;
private
String
remark
;
private
String
tableName
;
private
String
tableComment
;
private
String
className
;
private
String
packageName
;
private
String
moduleName
;
private
String
businessName
;
private
String
functionName
;
private
String
functionAuthor
;
private
List
<
GenColumnDto
>
columns
;
}
datax-tools/datax-tool-codegen/src/main/resources/mapper/GenTableMapper.xml
0 → 100644
View file @
d82a9467
<?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=
"cn.datax.tool.codegen.dao.GenTableDao"
>
<!-- 通用查询映射结果 -->
<resultMap
id=
"BaseResultMap"
type=
"cn.datax.tool.codegen.entity.GenTableEntity"
>
<result
column=
"id"
property=
"id"
/>
<result
column=
"status"
property=
"status"
/>
<result
column=
"create_by"
property=
"createBy"
/>
<result
column=
"create_time"
property=
"createTime"
/>
<result
column=
"update_by"
property=
"updateBy"
/>
<result
column=
"update_time"
property=
"updateTime"
/>
<result
column=
"remark"
property=
"remark"
/>
<result
column=
"table_name"
property=
"tableName"
/>
<result
column=
"table_comment"
property=
"tableComment"
/>
<result
column=
"class_name"
property=
"className"
/>
<result
column=
"package_name"
property=
"packageName"
/>
<result
column=
"module_name"
property=
"moduleName"
/>
<result
column=
"business_name"
property=
"businessName"
/>
<result
column=
"function_name"
property=
"functionName"
/>
<result
column=
"function_author"
property=
"functionAuthor"
/>
<result
column=
"column_json"
property=
"columns"
typeHandler=
"com.baomidou.mybatisplus.extension.handlers.JacksonTypeHandler"
/>
</resultMap>
<!-- 通用查询结果列 -->
<sql
id=
"Base_Column_List"
>
id,
status,
create_by,
create_time,
update_by,
update_time,
remark, table_name, table_comment, class_name, package_name, module_name, business_name, function_name, function_author, column_json
</sql>
</mapper>
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