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
67f2c730
Commit
67f2c730
authored
Mar 05, 2021
by
sml
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
代码提交
parent
a9073cad
Changes
10
Show whitespace changes
Inline
Side-by-side
Showing
10 changed files
with
368 additions
and
20 deletions
+368
-20
DmpTableFieldSchemaController.java
...dmp/modules/controller/DmpTableFieldSchemaController.java
+54
-0
DmpTableFieldSchemaBatch.java
...dmp/modules/controller/bean/DmpTableFieldSchemaBatch.java
+23
-0
DmpTableFieldSchemaDto.java
...z/dmp/modules/controller/bean/DmpTableFieldSchemaDto.java
+13
-0
DmpTableFieldSchemaRequest.java
...p/modules/controller/bean/DmpTableFieldSchemaRequest.java
+90
-0
MyDmpTableFieldSchemaConverter.java
...dules/controller/bean/MyDmpTableFieldSchemaConverter.java
+54
-0
DmpTableFieldSchemaDao.java
...n/java/com/jz/dmp/modules/dao/DmpTableFieldSchemaDao.java
+13
-3
DmpTableFieldSchema.java
...in/java/com/jz/dmp/modules/model/DmpTableFieldSchema.java
+9
-9
DmpTableFieldSchemaService.java
...om/jz/dmp/modules/service/DmpTableFieldSchemaService.java
+15
-2
DmpTableFieldSchemaServiceImpl.java
.../modules/service/impl/DmpTableFieldSchemaServiceImpl.java
+59
-5
DmpTableFieldSchemaMapper.xml
src/main/resources/mapper/dmp/DmpTableFieldSchemaMapper.xml
+38
-1
No files found.
src/main/java/com/jz/dmp/modules/controller/DmpTableFieldSchemaController.java
0 → 100644
View file @
67f2c730
package
com
.
jz
.
dmp
.
modules
.
controller
;
import
javax.servlet.http.HttpServletRequest
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.web.bind.annotation.RequestBody
;
import
org.springframework.web.bind.annotation.RequestMapping
;
import
org.springframework.web.bind.annotation.RequestMethod
;
import
org.springframework.web.bind.annotation.RestController
;
import
com.jz.common.annotation.MethodCallLogPrint
;
import
com.jz.common.bean.BaseBeanResponse
;
import
com.jz.common.constant.StatuConstant
;
import
com.jz.dmp.modules.controller.bean.DmpTableFieldSchemaDto
;
import
com.jz.dmp.modules.controller.bean.DmpTableFieldSchemaRequest
;
import
com.jz.dmp.modules.service.DmpTableFieldSchemaService
;
import
io.swagger.annotations.Api
;
import
io.swagger.annotations.ApiOperation
;
/**
* 项目表字段类型Controller
* @author ybz
*
*/
@RestController
@RequestMapping
(
"/dmp/table/field/schema"
)
@Api
(
tags
=
"项目表字段类型"
)
public
class
DmpTableFieldSchemaController
{
@Autowired
private
DmpTableFieldSchemaService
dmpTableFieldSchemaService
;
/**列表查询项目表字段类型
* @param dmpTableFieldSchemaRequest
* @return
*/
@MethodCallLogPrint
@RequestMapping
(
method
=
RequestMethod
.
POST
,
value
=
"/findList"
)
@ApiOperation
(
value
=
"列表查询项目表字段类型"
,
notes
=
"列表查询项目表字段类型"
)
public
BaseBeanResponse
<
DmpTableFieldSchemaDto
>
findList
(
@RequestBody
DmpTableFieldSchemaRequest
dmpTableFieldSchemaRequest
,
HttpServletRequest
httpRequest
){
BaseBeanResponse
<
DmpTableFieldSchemaDto
>
baseBeanResponse
=
new
BaseBeanResponse
<
DmpTableFieldSchemaDto
>();
try
{
baseBeanResponse
=
dmpTableFieldSchemaService
.
findList
(
dmpTableFieldSchemaRequest
,
httpRequest
);
}
catch
(
Exception
e
)
{
baseBeanResponse
.
setMessage
(
"查询失败"
);
baseBeanResponse
.
setCode
(
StatuConstant
.
FAILURE_CODE
);
e
.
printStackTrace
();
}
return
baseBeanResponse
;
}
}
src/main/java/com/jz/dmp/modules/controller/bean/DmpTableFieldSchemaBatch.java
0 → 100644
View file @
67f2c730
package
com
.
jz
.
dmp
.
modules
.
controller
.
bean
;
import
java.util.List
;
import
com.jz.dmp.modules.model.DmpTableFieldSchema
;
/**
* @author ybz
*
*/
public
class
DmpTableFieldSchemaBatch
{
private
List
<
DmpTableFieldSchema
>
dmpTableFieldSchemas
;
public
List
<
DmpTableFieldSchema
>
getDmpTableFieldSchemas
()
{
return
dmpTableFieldSchemas
;
}
public
void
setDmpTableFieldSchemas
(
List
<
DmpTableFieldSchema
>
dmpTableFieldSchemas
)
{
this
.
dmpTableFieldSchemas
=
dmpTableFieldSchemas
;
}
}
src/main/java/com/jz/dmp/modules/controller/bean/DmpTableFieldSchemaDto.java
0 → 100644
View file @
67f2c730
package
com
.
jz
.
dmp
.
modules
.
controller
.
bean
;
import
com.jz.dmp.modules.model.DmpTableFieldSchema
;
import
io.swagger.annotations.ApiModel
;
/**项目表字段类型Dto
* @author ybz
*
*/
@ApiModel
(
value
=
"项目表字段类型Dto"
,
description
=
"项目表字段类型Dto"
)
public
class
DmpTableFieldSchemaDto
extends
DmpTableFieldSchema
{
}
src/main/java/com/jz/dmp/modules/controller/bean/DmpTableFieldSchemaRequest.java
0 → 100644
View file @
67f2c730
package
com
.
jz
.
dmp
.
modules
.
controller
.
bean
;
import
com.jz.common.annotation.FieldAssist
;
import
com.jz.common.bean.BasePageBean
;
import
io.swagger.annotations.ApiModel
;
import
io.swagger.annotations.ApiModelProperty
;
/**项目表字段类型参数请求封装
* @author ybz
*
*/
@ApiModel
(
value
=
"项目表字段类型参数请求封装"
,
description
=
"项目表字段类型参数请求封装"
)
public
class
DmpTableFieldSchemaRequest
extends
BasePageBean
{
/**
* ID
*/
@ApiModelProperty
(
value
=
"ID"
)
@FieldAssist
(
orderBy
=
"_schema.ID"
)
private
Integer
id
;
/**
* 数据源类型主键
*/
@ApiModelProperty
(
value
=
"数据源类型主键"
)
@FieldAssist
(
orderBy
=
"_schema.DST_ID"
)
private
Integer
dstId
;
/**
* 类型类别
*/
@ApiModelProperty
(
value
=
"类型类别"
)
@FieldAssist
(
orderBy
=
"_schema.TYPE_CATEGORY"
)
private
String
typeCategory
;
/**
* 字段类型
*/
@ApiModelProperty
(
value
=
"字段类型"
)
@FieldAssist
(
orderBy
=
"_schema.FIELD_TYPE"
)
private
String
fieldType
;
/**
* 是否类别的默认映射
*/
@ApiModelProperty
(
value
=
"是否类别的默认映射"
)
@FieldAssist
(
orderBy
=
"_schema.IS_CAT_DEFAULT"
)
private
String
isCatDefault
;
public
Integer
getId
()
{
return
id
;
}
public
void
setId
(
Integer
id
)
{
this
.
id
=
id
;
}
public
Integer
getDstId
()
{
return
dstId
;
}
public
void
setDstId
(
Integer
dstId
)
{
this
.
dstId
=
dstId
;
}
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
;
}
}
src/main/java/com/jz/dmp/modules/controller/bean/MyDmpTableFieldSchemaConverter.java
0 → 100644
View file @
67f2c730
package
com
.
jz
.
dmp
.
modules
.
controller
.
bean
;
import
java.util.ArrayList
;
import
java.util.List
;
import
org.springframework.beans.BeanUtils
;
import
com.jz.dmp.modules.model.DmpTableFieldSchema
;
public
class
MyDmpTableFieldSchemaConverter
{
private
static
MyDmpTableFieldSchemaConverter
instance
;
private
MyDmpTableFieldSchemaConverter
()
{};
public
synchronized
static
MyDmpTableFieldSchemaConverter
INSTANCE
()
{
if
(
instance
==
null
)
{
instance
=
new
MyDmpTableFieldSchemaConverter
();
}
return
instance
;
}
public
DmpTableFieldSchemaDto
domain2dto
(
DmpTableFieldSchema
dmpTableFieldSchema
)
{
DmpTableFieldSchemaDto
dmpTableFieldSchemaDto
=
new
DmpTableFieldSchemaDto
();
BeanUtils
.
copyProperties
(
dmpTableFieldSchema
,
dmpTableFieldSchemaDto
);
return
dmpTableFieldSchemaDto
;
}
public
List
<
DmpTableFieldSchemaDto
>
domain2dto
(
List
<
DmpTableFieldSchema
>
dmpTableFieldSchemas
)
{
List
<
DmpTableFieldSchemaDto
>
dmpTableFieldSchemaDtos
=
new
ArrayList
<
DmpTableFieldSchemaDto
>();
dmpTableFieldSchemas
.
stream
().
forEach
(
x
->
{
dmpTableFieldSchemaDtos
.
add
(
domain2dto
(
x
));
});
return
dmpTableFieldSchemaDtos
;
}
public
DmpTableFieldSchema
dto2domain
(
DmpTableFieldSchemaDto
dmpTableFieldSchemaDto
)
{
DmpTableFieldSchema
dmpTableFieldSchema
=
new
DmpTableFieldSchema
();
BeanUtils
.
copyProperties
(
dmpTableFieldSchemaDto
,
dmpTableFieldSchema
);
return
dmpTableFieldSchema
;
}
public
List
<
DmpTableFieldSchema
>
dto2domain
(
List
<
DmpTableFieldSchemaDto
>
dmpTableFieldSchemaDtos
)
{
List
<
DmpTableFieldSchema
>
dmpTableFieldSchemas
=
new
ArrayList
<
DmpTableFieldSchema
>();
dmpTableFieldSchemaDtos
.
stream
().
forEach
(
x
->
{
dmpTableFieldSchemas
.
add
(
domain2dto
(
x
));
});
return
dmpTableFieldSchemas
;
}
}
src/main/java/com/jz/dmp/modules/dao/DmpTableFieldSchemaDao.java
View file @
67f2c730
package
com
.
jz
.
dmp
.
modules
.
dao
;
import
com.jz.dmp.modules.model.DmpTableFieldSchema
;
import
org.apache.ibatis.annotations.Param
;
import
java.util.List
;
import
java.util.Map
;
import
org.apache.ibatis.annotations.Param
;
import
com.jz.dmp.modules.controller.bean.DmpTableFieldSchemaDto
;
import
com.jz.dmp.modules.model.DmpTableFieldSchema
;
/**
* 项目表字段类型(DmpTableFieldSchema)表数据库访问层
*
...
...
@@ -81,4 +83,12 @@ public interface DmpTableFieldSchemaDao {
int
deleteById
(
Integer
id
);
List
<
Map
<
String
,
Object
>>
getTableFieldsMapping
(
Map
<
String
,
Object
>
params
)
throws
Exception
;
/**条件查询项目表字段类型
* @param param
* @return
* @throws Exception
*/
public
List
<
DmpTableFieldSchemaDto
>
findList
(
Map
<
String
,
Object
>
param
)
throws
Exception
;
}
\ No newline at end of file
src/main/java/com/jz/dmp/modules/model/DmpTableFieldSchema.java
View file @
67f2c730
...
...
@@ -15,9 +15,9 @@ public class DmpTableFieldSchema implements Serializable {
*/
private
Integer
id
;
/**
* DS ID
* DS
T
ID
*/
private
Integer
dsId
;
private
Integer
ds
t
Id
;
/**
* 类型类别
*/
...
...
@@ -40,12 +40,12 @@ public class DmpTableFieldSchema implements Serializable {
this
.
id
=
id
;
}
public
Integer
getDsId
()
{
return
ds
Id
;
public
Integer
getDs
t
Id
()
{
return
dst
Id
;
}
public
void
setDsId
(
Integer
ds
Id
)
{
this
.
dsId
=
ds
Id
;
public
void
setDstId
(
Integer
dst
Id
)
{
this
.
dstId
=
dst
Id
;
}
public
String
getTypeCategory
()
{
...
...
src/main/java/com/jz/dmp/modules/service/DmpTableFieldSchemaService.java
View file @
67f2c730
package
com
.
jz
.
dmp
.
modules
.
service
;
import
com.jz.dmp.modules.model.DmpTableFieldSchema
;
import
java.util.List
;
import
javax.servlet.http.HttpServletRequest
;
import
com.jz.common.bean.BaseBeanResponse
;
import
com.jz.dmp.modules.controller.bean.DmpTableFieldSchemaDto
;
import
com.jz.dmp.modules.controller.bean.DmpTableFieldSchemaRequest
;
import
com.jz.dmp.modules.model.DmpTableFieldSchema
;
/**
* 项目表字段类型(DmpTableFieldSchema)表服务接口
*
...
...
@@ -53,4 +58,12 @@ public interface DmpTableFieldSchemaService {
*/
boolean
deleteById
(
Integer
id
);
/**条件查询所有项目表字段类型
* @param dmpTableFieldSchemaRequest
* @param httpRequest
* @return
* @throws Exception
*/
public
BaseBeanResponse
<
DmpTableFieldSchemaDto
>
findList
(
DmpTableFieldSchemaRequest
dmpTableFieldSchemaRequest
,
HttpServletRequest
httpRequest
)
throws
Exception
;
}
\ No newline at end of file
src/main/java/com/jz/dmp/modules/service/impl/DmpTableFieldSchemaServiceImpl.java
View file @
67f2c730
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
java.util.HashMap
;
import
java.util.List
;
import
java.util.Map
;
import
javax.servlet.http.HttpServletRequest
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Service
;
import
org.springframework.util.StringUtils
;
import
javax.annotation.Resource
;
import
java.util.List
;
import
com.jz.common.bean.BaseBeanResponse
;
import
com.jz.common.constant.StatuConstant
;
import
com.jz.dmp.modules.controller.bean.DmpTableFieldSchemaDto
;
import
com.jz.dmp.modules.controller.bean.DmpTableFieldSchemaRequest
;
import
com.jz.dmp.modules.dao.DmpTableFieldSchemaDao
;
import
com.jz.dmp.modules.model.DmpTableFieldSchema
;
import
com.jz.dmp.modules.service.DmpTableFieldSchemaService
;
/**
* 项目表字段类型(DmpTableFieldSchema)表服务实现类
...
...
@@ -77,4 +86,49 @@ public class DmpTableFieldSchemaServiceImpl implements DmpTableFieldSchemaServic
public
boolean
deleteById
(
Integer
id
)
{
return
this
.
dmpTableFieldSchemaDao
.
deleteById
(
id
)
>
0
;
}
/*
* (non-Javadoc)
*
* @see
* com.ycxc.vmts.service.DmpTableFieldSchemaService#findList(com.ycxc.vmts.controller.
* bean.DmpTableFieldSchemaRequest, javax.servlet.http.HttpServletRequest)
*/
@Override
public
BaseBeanResponse
<
DmpTableFieldSchemaDto
>
findList
(
DmpTableFieldSchemaRequest
dmpTableFieldSchemaRequest
,
HttpServletRequest
httpRequest
)
throws
Exception
{
BaseBeanResponse
<
DmpTableFieldSchemaDto
>
baseBeanResponse
=
new
BaseBeanResponse
<>();
Map
<
String
,
Object
>
param
=
new
HashMap
<>();
//ID
if
(
dmpTableFieldSchemaRequest
.
getId
()
!=
null
)
{
param
.
put
(
"id"
,
dmpTableFieldSchemaRequest
.
getId
());
}
//数据源类型主键
if
(
dmpTableFieldSchemaRequest
.
getDstId
()
!=
null
)
{
param
.
put
(
"dstId"
,
dmpTableFieldSchemaRequest
.
getDstId
());
}
//类型类别
if
(!
StringUtils
.
isEmpty
(
dmpTableFieldSchemaRequest
.
getTypeCategory
()))
{
param
.
put
(
"typeCategory"
,
dmpTableFieldSchemaRequest
.
getTypeCategory
());
}
//字段类型
if
(!
StringUtils
.
isEmpty
(
dmpTableFieldSchemaRequest
.
getFieldType
()))
{
param
.
put
(
"fieldType"
,
dmpTableFieldSchemaRequest
.
getFieldType
());
}
//是否类别的默认映射
if
(!
StringUtils
.
isEmpty
(
dmpTableFieldSchemaRequest
.
getIsCatDefault
()))
{
param
.
put
(
"isCatDefault"
,
dmpTableFieldSchemaRequest
.
getIsCatDefault
());
}
//加上可用标识(未软删除)
param
.
put
(
"dataStatu"
,
"1"
);
List
<
DmpTableFieldSchemaDto
>
list
=
dmpTableFieldSchemaDao
.
findList
(
param
);
baseBeanResponse
.
setCode
(
StatuConstant
.
SUCCESS_CODE
);
baseBeanResponse
.
setMessage
(
"查询成功"
);
baseBeanResponse
.
setDatas
(
list
);
return
baseBeanResponse
;
}
}
\ No newline at end of file
src/main/resources/mapper/dmp/DmpTableFieldSchemaMapper.xml
View file @
67f2c730
...
...
@@ -4,12 +4,25 @@
<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
column=
"DST_ID"
property=
"dstId"
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>
<resultMap
id=
"BaseDtoResultMap"
type=
"com.jz.dmp.modules.controller.bean.DmpTableFieldSchemaDto"
extends=
"DmpTableFieldSchemaMap"
>
<!-- /*$BaseDtoResultMapContent$*/ -->
</resultMap>
<sql
id=
"Base_Column_List"
>
_schema.ID, _schema.DST_ID, _schema.TYPE_CATEGORY, _schema.FIELD_TYPE, _schema.IS_CAT_DEFAULT
</sql>
<sql
id=
"BaseDto_Column_List"
>
<include
refid=
"Base_Column_List"
/>
<!-- /*$BaseDtoColumnListContent$*/ -->
</sql>
<!--查询单个-->
<select
id=
"queryById"
resultMap=
"DmpTableFieldSchemaMap"
>
select
...
...
@@ -126,4 +139,28 @@
<if
test=
"tableName != null"
>
and a.name = #{tableName}
</if>
</select>
<!-- 条件查询项目表字段类型 -->
<select
id=
"findList"
resultMap=
"BaseDtoResultMap"
>
SELECT
<include
refid=
"BaseDto_Column_List"
/>
FROM dmp_table_field_schema _schema
<where>
<if
test=
"id != null"
>
AND _schema.ID = #{id,jdbcType=INTEGER}
</if>
<if
test=
"dstId != null"
>
AND _schema.DST_ID = #{dstId,jdbcType=INTEGER}
</if>
<if
test=
"typeCategory != null"
>
AND _schema.TYPE_CATEGORY = #{typeCategory,jdbcType=CHAR}
</if>
<if
test=
"fieldType != null"
>
AND _schema.FIELD_TYPE = #{fieldType,jdbcType=CHAR}
</if>
<if
test=
"isCatDefault != null"
>
AND _schema.IS_CAT_DEFAULT = #{isCatDefault,jdbcType=CHAR}
</if>
</where>
</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