Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
D
DQMP
Project
Project
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
data
DQMP
Commits
63f84a83
Commit
63f84a83
authored
Dec 21, 2019
by
赵建伟
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add del rule、find rule list、front codes
parent
46d2f33b
Hide whitespace changes
Inline
Side-by-side
Showing
38 changed files
with
1276 additions
and
131 deletions
+1276
-131
pom.xml
pom.xml
+5
-0
Constants.java
src/main/java/com/gmei/data/dqmp/common/Constants.java
+5
-4
BaseController.java
...in/java/com/gmei/data/dqmp/controller/BaseController.java
+22
-0
DqRuleController.java
.../java/com/gmei/data/dqmp/controller/DqRuleController.java
+23
-10
DqRuleImportController.java
...com/gmei/data/dqmp/controller/DqRuleImportController.java
+128
-0
IndexController.java
...n/java/com/gmei/data/dqmp/controller/IndexController.java
+42
-0
DqRuleApiController.java
...om/gmei/data/dqmp/controller/api/DqRuleApiController.java
+42
-0
DqRuleImportApiController.java
...i/data/dqmp/controller/api/DqRuleImportApiController.java
+44
-4
TblSqlCheckDuplex.java
...ain/java/com/gmei/data/dqmp/domain/TblSqlCheckDuplex.java
+10
-0
TblSqlCheckDuplexCriteria.java
.../com/gmei/data/dqmp/domain/TblSqlCheckDuplexCriteria.java
+60
-0
TblSqlCheckSingle.java
...ain/java/com/gmei/data/dqmp/domain/TblSqlCheckSingle.java
+10
-0
TblSqlCheckSingleCriteria.java
.../com/gmei/data/dqmp/domain/TblSqlCheckSingleCriteria.java
+60
-0
TblSqlMonitorSpecial.java
.../java/com/gmei/data/dqmp/domain/TblSqlMonitorSpecial.java
+10
-0
TblSqlMonitorSpecialCriteria.java
...m/gmei/data/dqmp/domain/TblSqlMonitorSpecialCriteria.java
+60
-0
TblSqlMonitorVolatility.java
...va/com/gmei/data/dqmp/domain/TblSqlMonitorVolatility.java
+10
-0
TblSqlMonitorVolatilityCriteria.java
...mei/data/dqmp/domain/TblSqlMonitorVolatilityCriteria.java
+60
-0
DqRuleService.java
src/main/java/com/gmei/data/dqmp/service/DqRuleService.java
+19
-0
DqRuleServiceImpl.java
...va/com/gmei/data/dqmp/service/impl/DqRuleServiceImpl.java
+194
-48
BaseVo.java
src/main/java/com/gmei/data/dqmp/vo/BaseVo.java
+8
-8
DqReferRuleVo.java
src/main/java/com/gmei/data/dqmp/vo/DqReferRuleVo.java
+20
-0
DqRuleVo.java
src/main/java/com/gmei/data/dqmp/vo/DqRuleVo.java
+11
-0
DqSpecialRuleVo.java
src/main/java/com/gmei/data/dqmp/vo/DqSpecialRuleVo.java
+19
-0
DqUnblankRuleVo.java
src/main/java/com/gmei/data/dqmp/vo/DqUnblankRuleVo.java
+16
-0
DqUniqueRuleVo.java
src/main/java/com/gmei/data/dqmp/vo/DqUniqueRuleVo.java
+16
-0
DqVolatilityRuleVo.java
src/main/java/com/gmei/data/dqmp/vo/DqVolatilityRuleVo.java
+17
-0
application-dev.yml
src/main/resources/application-dev.yml
+2
-0
application-prod.yml
src/main/resources/application-prod.yml
+2
-0
application-test.yml
src/main/resources/application-test.yml
+2
-0
generator.xml
src/main/resources/generator.xml
+9
-5
TblRuleInfoDuplexMapper.xml
...main/resources/mybatis/mapper/TblRuleInfoDuplexMapper.xml
+16
-16
TblRuleInfoSimpleMapper.xml
...main/resources/mybatis/mapper/TblRuleInfoSimpleMapper.xml
+16
-16
TblSqlCheckDuplexMapper.xml
...main/resources/mybatis/mapper/TblSqlCheckDuplexMapper.xml
+22
-5
TblSqlCheckSingleMapper.xml
...main/resources/mybatis/mapper/TblSqlCheckSingleMapper.xml
+23
-5
TblSqlMonitorSpecialMapper.xml
...n/resources/mybatis/mapper/TblSqlMonitorSpecialMapper.xml
+22
-5
TblSqlMonitorVolatilityMapper.xml
...esources/mybatis/mapper/TblSqlMonitorVolatilityMapper.xml
+23
-5
index.html
src/main/resources/templates/index.html
+212
-0
result.html
src/main/resources/templates/result.html
+16
-0
logo.ico
src/main/resources/templates/static/img/logo.ico
+0
-0
No files found.
pom.xml
View file @
63f84a83
...
...
@@ -66,6 +66,11 @@
<groupId>
org.springframework.boot
</groupId>
<artifactId>
spring-boot-starter-thymeleaf
</artifactId>
</dependency>
<dependency>
<groupId>
net.sourceforge.nekohtml
</groupId>
<artifactId>
nekohtml
</artifactId>
<version>
1.9.22
</version>
</dependency>
<!-- 集成热部署插件 -->
<dependency>
<groupId>
org.springframework.boot
</groupId>
...
...
src/main/java/com/gmei/data/dqmp/common/Constants.java
View file @
63f84a83
...
...
@@ -36,9 +36,10 @@ public class Constants {
// 双表规则类型
public
static
final
String
TABLE_DUPLEX
=
"duplex"
;
// public static final String CHECK_SIMPLE = "check_single";
// public static final String CHECK_MULTIPLE = "check_multiple";
// public static final String MONITOR_VOLATILITY = "monitor_volatility";
// public static final String MONITOR_SPECIAL = "monitor_special";
public
static
final
String
UNIQUE
=
"unique"
;
public
static
final
String
UNBLANK
=
"unblank"
;
public
static
final
String
REFER
=
"refer"
;
public
static
final
String
VOLATILITY
=
"volatility"
;
public
static
final
String
SPECIAL
=
"special"
;
}
src/main/java/com/gmei/data/dqmp/controller/BaseController.java
0 → 100644
View file @
63f84a83
package
com
.
gmei
.
data
.
dqmp
.
controller
;
import
org.springframework.ui.Model
;
public
class
BaseController
{
/**
* 执行结果页面属性返回
* @param model
* @param isSuc
* @param msg
* @return
*/
protected
String
model
(
Model
model
,
boolean
isSuc
,
String
msg
)
{
if
(
isSuc
)
{
model
.
addAttribute
(
"result"
,
"success!"
);
}
else
{
model
.
addAttribute
(
"result"
,
msg
);
}
return
"result"
;
}
}
src/main/java/com/gmei/data/dqmp/controller/DqRuleController.java
View file @
63f84a83
...
...
@@ -2,20 +2,21 @@ package com.gmei.data.dqmp.controller;
import
javax.validation.Valid
;
import
org.apache.commons.lang3.StringUtils
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Controller
;
import
org.springframework.ui.Model
;
import
org.springframework.validation.BindingResult
;
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.ResponseBody
;
import
org.springframework.web.bind.annotation.RestController
;
import
com.gmei.data.dqmp.service.DqRuleService
;
import
com.gmei.data.dqmp.vo.DqRuleVo
;
@
Rest
Controller
@RequestMapping
(
value
=
"/dq
r
ule"
)
public
class
DqRuleController
{
@Controller
@RequestMapping
(
value
=
"/dq
R
ule"
)
public
class
DqRuleController
extends
BaseController
{
@Autowired
private
DqRuleService
dqRuleService
;
...
...
@@ -26,17 +27,29 @@ public class DqRuleController {
* @param bindingResult
* @return
*/
@ResponseBody
@RequestMapping
(
value
=
"/add"
,
method
=
RequestMethod
.
POST
)
public
DqRuleVo
addDqRule
(
@RequestBody
@Valid
DqRuleVo
dqRuleVo
,
BindingResult
bindingResult
)
{
public
String
addDqRule
(
@RequestBody
@Valid
DqRuleVo
dqRuleVo
,
BindingResult
bindingResult
,
Model
model
)
{
if
(
bindingResult
.
hasErrors
())
{
return
new
DqRuleVo
(-
1
,
bindingResult
.
getFieldError
().
getDefaultMessage
());
return
model
(
model
,
false
,
bindingResult
.
getFieldError
().
getDefaultMessage
());
}
Boolean
isAddSuc
=
dqRuleService
.
addDqRule
(
dqRuleVo
);
if
(
isAddSuc
)
{
return
new
DqRuleVo
(
);
return
model
(
model
,
true
,
""
);
}
else
{
return
new
DqRuleVo
(-
1
,
"Rule add error!"
);
return
model
(
model
,
false
,
"Rule add error!"
);
}
}
@RequestMapping
(
value
=
"/del"
,
method
=
RequestMethod
.
GET
)
public
String
delDqRule
(
DqRuleVo
dqRuleVo
,
Model
model
)
{
if
(
dqRuleVo
.
getId
()
==
null
||
StringUtils
.
isBlank
(
dqRuleVo
.
getCheckType
()))
{
return
model
(
model
,
false
,
"Params is error!"
);
}
Boolean
isDelSuc
=
dqRuleService
.
delDqRule
(
dqRuleVo
);
if
(
isDelSuc
)
{
return
model
(
model
,
true
,
""
);
}
else
{
return
model
(
model
,
false
,
"数据质量规则删除失败!"
);
}
}
}
src/main/java/com/gmei/data/dqmp/controller/DqRuleImportController.java
0 → 100644
View file @
63f84a83
package
com
.
gmei
.
data
.
dqmp
.
controller
;
import
javax.servlet.http.HttpServletRequest
;
import
org.slf4j.Logger
;
import
org.slf4j.LoggerFactory
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Controller
;
import
org.springframework.ui.Model
;
import
org.springframework.web.bind.annotation.PostMapping
;
import
org.springframework.web.bind.annotation.RequestMapping
;
import
org.springframework.web.multipart.MultipartFile
;
import
org.springframework.web.multipart.MultipartHttpServletRequest
;
import
com.alibaba.excel.support.ExcelTypeEnum
;
import
com.gmei.data.dqmp.common.Constants
;
import
com.gmei.data.dqmp.service.DqRuleService
;
import
com.gmei.data.dqmp.utils.ImportExcelUtils
;
import
com.gmei.data.dqmp.vo.BaseVo
;
@Controller
@RequestMapping
(
value
=
"/excel"
)
public
class
DqRuleImportController
extends
BaseController
{
@Autowired
private
DqRuleService
dqRuleService
;
private
static
final
Logger
logger
=
LoggerFactory
.
getLogger
(
DqRuleImportController
.
class
);
@PostMapping
(
value
=
"export"
)
public
BaseVo
exportExcel
()
{
return
new
BaseVo
();
}
@PostMapping
(
value
=
"importUnique"
)
public
String
importUniqueExcel
(
HttpServletRequest
httpServletRequest
,
Model
model
)
{
if
(!
checkIsLegal
(
httpServletRequest
,
Constants
.
UNIQUE
))
{
return
model
(
model
,
false
,
"上传的数据质量规则文件格式或内容错误,请核实!"
);
}
try
{
ImportExcelUtils
.
saxReadUniqueListString
(
httpServletRequest
,
dqRuleService
);
}
catch
(
Exception
e
)
{
logger
.
error
(
e
.
getMessage
());
return
model
(
model
,
false
,
e
.
getMessage
());
}
return
model
(
model
,
true
,
""
);
}
@PostMapping
(
value
=
"importUnblank"
)
public
String
importUnblankExcel
(
HttpServletRequest
httpServletRequest
,
Model
model
)
{
if
(!
checkIsLegal
(
httpServletRequest
,
Constants
.
UNBLANK
))
{
return
model
(
model
,
false
,
"上传的数据质量规则文件格式或内容错误,请核实!"
);
}
try
{
ImportExcelUtils
.
saxReadUnblankListString
(
httpServletRequest
,
dqRuleService
);
}
catch
(
Exception
e
)
{
logger
.
error
(
e
.
getMessage
());
return
model
(
model
,
false
,
e
.
getMessage
());
}
return
model
(
model
,
true
,
""
);
}
@PostMapping
(
value
=
"importRefer"
)
public
String
importReferExcel
(
HttpServletRequest
httpServletRequest
,
Model
model
)
{
if
(!
checkIsLegal
(
httpServletRequest
,
Constants
.
REFER
))
{
return
model
(
model
,
false
,
"上传的数据质量规则文件格式或内容错误,请核实!"
);
}
try
{
ImportExcelUtils
.
saxReadReferListString
(
httpServletRequest
,
dqRuleService
);
}
catch
(
Exception
e
)
{
logger
.
error
(
e
.
getMessage
());
return
model
(
model
,
false
,
e
.
getMessage
());
}
return
model
(
model
,
true
,
""
);
}
@PostMapping
(
value
=
"importVolatility"
)
public
String
importVolatilityExcel
(
HttpServletRequest
httpServletRequest
,
Model
model
)
{
if
(!
checkIsLegal
(
httpServletRequest
,
Constants
.
VOLATILITY
))
{
return
model
(
model
,
false
,
"上传的数据质量规则文件格式或内容错误,请核实!"
);
}
try
{
ImportExcelUtils
.
saxReadVolatilityListString
(
httpServletRequest
,
dqRuleService
);
}
catch
(
Exception
e
)
{
logger
.
error
(
e
.
getMessage
());
return
model
(
model
,
false
,
e
.
getMessage
());
}
return
model
(
model
,
true
,
""
);
}
@PostMapping
(
value
=
"importSpecial"
)
public
String
importExcel
(
HttpServletRequest
httpServletRequest
,
Model
model
)
{
if
(!
checkIsLegal
(
httpServletRequest
,
Constants
.
SPECIAL
))
{
return
model
(
model
,
false
,
"上传的数据质量规则文件格式或内容错误,请核实!"
);
}
try
{
ImportExcelUtils
.
saxReadSpecialListString
(
httpServletRequest
,
dqRuleService
);
}
catch
(
Exception
e
)
{
logger
.
error
(
e
.
getMessage
());
return
model
(
model
,
false
,
e
.
getMessage
());
}
return
model
(
model
,
true
,
""
);
}
/**
* 上传文件格式、内容校验
*
* @param httpServletRequest
* @param type
* @return
*/
private
Boolean
checkIsLegal
(
HttpServletRequest
httpServletRequest
,
String
type
)
{
MultipartHttpServletRequest
multipartRequest
=
(
MultipartHttpServletRequest
)
httpServletRequest
;
MultipartFile
requestFile
=
multipartRequest
.
getFile
(
"file"
);
String
originalFilename
=
requestFile
.
getOriginalFilename
();
if
(!
originalFilename
.
endsWith
(
ExcelTypeEnum
.
XLS
.
getValue
())
&&
!
originalFilename
.
endsWith
(
ExcelTypeEnum
.
XLSX
.
getValue
()))
{
logger
.
error
(
"Excel导入错误文件名称:{}"
,
originalFilename
);
return
false
;
}
else
{
if
(!
originalFilename
.
contains
(
type
))
{
logger
.
error
(
"导入的不是非空性校验规则文件:{}"
,
originalFilename
);
return
false
;
}
}
return
true
;
}
}
src/main/java/com/gmei/data/dqmp/controller/IndexController.java
0 → 100644
View file @
63f84a83
package
com
.
gmei
.
data
.
dqmp
.
controller
;
import
java.util.List
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Controller
;
import
org.springframework.ui.Model
;
import
org.springframework.web.bind.annotation.GetMapping
;
import
com.gmei.data.dqmp.service.DqRuleService
;
import
com.gmei.data.dqmp.vo.DqReferRuleVo
;
import
com.gmei.data.dqmp.vo.DqSpecialRuleVo
;
import
com.gmei.data.dqmp.vo.DqUnblankRuleVo
;
import
com.gmei.data.dqmp.vo.DqUniqueRuleVo
;
import
com.gmei.data.dqmp.vo.DqVolatilityRuleVo
;
@Controller
public
class
IndexController
{
@Autowired
private
DqRuleService
dqRuleService
;
/**
* 首页中功能列表
* @param model
* @return
*/
@GetMapping
(
"/"
)
public
String
index
(
Model
model
)
{
List
<
DqUniqueRuleVo
>
uniqueList
=
dqRuleService
.
findUniqueDqRuleList
();
List
<
DqUnblankRuleVo
>
unblankList
=
dqRuleService
.
findUnblankDqRuleList
();
List
<
DqReferRuleVo
>
referList
=
dqRuleService
.
findReferDqRuleList
();
List
<
DqVolatilityRuleVo
>
volatilityList
=
dqRuleService
.
findVolatilityDqRuleList
();
List
<
DqSpecialRuleVo
>
specialList
=
dqRuleService
.
findSpecialDqRuleList
();
model
.
addAttribute
(
"uniqueList"
,
uniqueList
);
model
.
addAttribute
(
"unblankList"
,
unblankList
);
model
.
addAttribute
(
"referList"
,
referList
);
model
.
addAttribute
(
"volatilityList"
,
volatilityList
);
model
.
addAttribute
(
"specialList"
,
specialList
);
return
"index"
;
}
}
src/main/java/com/gmei/data/dqmp/controller/api/DqRuleApiController.java
0 → 100644
View file @
63f84a83
package
com
.
gmei
.
data
.
dqmp
.
controller
.
api
;
import
javax.validation.Valid
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.validation.BindingResult
;
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.ResponseBody
;
import
org.springframework.web.bind.annotation.RestController
;
import
com.gmei.data.dqmp.service.DqRuleService
;
import
com.gmei.data.dqmp.vo.DqRuleVo
;
@RestController
@RequestMapping
(
value
=
"/api/dqrule"
)
public
class
DqRuleApiController
{
@Autowired
private
DqRuleService
dqRuleService
;
/**
* 校验规则新增
* @param dqRuleVo
* @param bindingResult
* @return
*/
@ResponseBody
@RequestMapping
(
value
=
"/add"
,
method
=
RequestMethod
.
POST
)
public
DqRuleVo
addDqRule
(
@RequestBody
@Valid
DqRuleVo
dqRuleVo
,
BindingResult
bindingResult
)
{
if
(
bindingResult
.
hasErrors
())
{
return
new
DqRuleVo
(-
1
,
bindingResult
.
getFieldError
().
getDefaultMessage
());
}
Boolean
isAddSuc
=
dqRuleService
.
addDqRule
(
dqRuleVo
);
if
(
isAddSuc
)
{
return
new
DqRuleVo
();
}
else
{
return
new
DqRuleVo
(-
1
,
"Rule add error!"
);
}
}
}
src/main/java/com/gmei/data/dqmp/controller/
EasyExcel
Controller.java
→
src/main/java/com/gmei/data/dqmp/controller/
api/DqRuleImportApi
Controller.java
View file @
63f84a83
package
com
.
gmei
.
data
.
dqmp
.
controller
;
package
com
.
gmei
.
data
.
dqmp
.
controller
.
api
;
import
javax.servlet.http.HttpServletRequest
;
...
...
@@ -8,18 +8,22 @@ import org.springframework.beans.factory.annotation.Autowired;
import
org.springframework.web.bind.annotation.PostMapping
;
import
org.springframework.web.bind.annotation.RequestMapping
;
import
org.springframework.web.bind.annotation.RestController
;
import
org.springframework.web.multipart.MultipartFile
;
import
org.springframework.web.multipart.MultipartHttpServletRequest
;
import
com.alibaba.excel.support.ExcelTypeEnum
;
import
com.gmei.data.dqmp.common.Constants
;
import
com.gmei.data.dqmp.service.DqRuleService
;
import
com.gmei.data.dqmp.utils.ImportExcelUtils
;
import
com.gmei.data.dqmp.vo.BaseVo
;
@RestController
@RequestMapping
(
value
=
"/excel"
)
public
class
EasyExcel
Controller
{
@RequestMapping
(
value
=
"/
api/
excel"
)
public
class
DqRuleImportApi
Controller
{
@Autowired
private
DqRuleService
dqRuleService
;
private
static
final
Logger
logger
=
LoggerFactory
.
getLogger
(
EasyExcel
Controller
.
class
);
private
static
final
Logger
logger
=
LoggerFactory
.
getLogger
(
DqRuleImportApi
Controller
.
class
);
@PostMapping
(
value
=
"export"
)
public
BaseVo
exportExcel
()
{
...
...
@@ -28,6 +32,9 @@ public class EasyExcelController {
@PostMapping
(
value
=
"importUnique"
)
public
BaseVo
importUniqueExcel
(
HttpServletRequest
httpServletRequest
)
{
if
(!
checkIsLegal
(
httpServletRequest
,
Constants
.
UNIQUE
))
{
return
new
BaseVo
(-
1
,
"上传的数据质量规则文件错误,请核实!"
);
}
try
{
ImportExcelUtils
.
saxReadUniqueListString
(
httpServletRequest
,
dqRuleService
);
}
catch
(
Exception
e
)
{
...
...
@@ -39,6 +46,9 @@ public class EasyExcelController {
@PostMapping
(
value
=
"importUnblank"
)
public
BaseVo
importUnblankExcel
(
HttpServletRequest
httpServletRequest
)
{
if
(!
checkIsLegal
(
httpServletRequest
,
Constants
.
UNBLANK
))
{
return
new
BaseVo
(-
1
,
"上传的数据质量规则文件错误,请核实!"
);
}
try
{
ImportExcelUtils
.
saxReadUnblankListString
(
httpServletRequest
,
dqRuleService
);
}
catch
(
Exception
e
)
{
...
...
@@ -50,6 +60,9 @@ public class EasyExcelController {
@PostMapping
(
value
=
"importRefer"
)
public
BaseVo
importReferExcel
(
HttpServletRequest
httpServletRequest
)
{
if
(!
checkIsLegal
(
httpServletRequest
,
Constants
.
REFER
))
{
return
new
BaseVo
(-
1
,
"上传的数据质量规则文件错误,请核实!"
);
}
try
{
ImportExcelUtils
.
saxReadReferListString
(
httpServletRequest
,
dqRuleService
);
}
catch
(
Exception
e
)
{
...
...
@@ -61,6 +74,9 @@ public class EasyExcelController {
@PostMapping
(
value
=
"importVolatility"
)
public
BaseVo
importVolatilityExcel
(
HttpServletRequest
httpServletRequest
)
{
if
(!
checkIsLegal
(
httpServletRequest
,
Constants
.
VOLATILITY
))
{
return
new
BaseVo
(-
1
,
"上传的数据质量规则文件错误,请核实!"
);
}
try
{
ImportExcelUtils
.
saxReadVolatilityListString
(
httpServletRequest
,
dqRuleService
);
}
catch
(
Exception
e
)
{
...
...
@@ -72,6 +88,9 @@ public class EasyExcelController {
@PostMapping
(
value
=
"importSpecial"
)
public
BaseVo
importExcel
(
HttpServletRequest
httpServletRequest
)
{
if
(!
checkIsLegal
(
httpServletRequest
,
Constants
.
SPECIAL
))
{
return
new
BaseVo
(-
1
,
"上传的数据质量规则文件错误,请核实!"
);
}
try
{
ImportExcelUtils
.
saxReadSpecialListString
(
httpServletRequest
,
dqRuleService
);
}
catch
(
Exception
e
)
{
...
...
@@ -81,4 +100,25 @@ public class EasyExcelController {
return
new
BaseVo
();
}
/**
* 上传文件格式、内容校验
* @param httpServletRequest
* @param type
* @return
*/
private
Boolean
checkIsLegal
(
HttpServletRequest
httpServletRequest
,
String
type
)
{
MultipartHttpServletRequest
multipartRequest
=
(
MultipartHttpServletRequest
)
httpServletRequest
;
MultipartFile
requestFile
=
multipartRequest
.
getFile
(
"file"
);
String
originalFilename
=
requestFile
.
getOriginalFilename
();
if
(!
originalFilename
.
endsWith
(
ExcelTypeEnum
.
XLS
.
getValue
())
&&
!
originalFilename
.
endsWith
(
ExcelTypeEnum
.
XLSX
.
getValue
()))
{
logger
.
error
(
"Excel导入错误文件名称:{}"
,
originalFilename
);
return
false
;
}
else
{
if
(!
originalFilename
.
contains
(
type
))
{
logger
.
error
(
"导入的不是非空性校验规则文件:{}"
,
originalFilename
);
return
false
;
}
}
return
true
;
}
}
src/main/java/com/gmei/data/dqmp/domain/TblSqlCheckDuplex.java
View file @
63f84a83
...
...
@@ -25,6 +25,8 @@ public class TblSqlCheckDuplex {
private
String
comment
;
private
Integer
parentId
;
private
Date
createTime
;
private
String
sqlContent
;
...
...
@@ -117,6 +119,14 @@ public class TblSqlCheckDuplex {
this
.
comment
=
comment
==
null
?
null
:
comment
.
trim
();
}
public
Integer
getParentId
()
{
return
parentId
;
}
public
void
setParentId
(
Integer
parentId
)
{
this
.
parentId
=
parentId
;
}
public
Date
getCreateTime
()
{
return
createTime
;
}
...
...
src/main/java/com/gmei/data/dqmp/domain/TblSqlCheckDuplexCriteria.java
View file @
63f84a83
...
...
@@ -855,6 +855,66 @@ public class TblSqlCheckDuplexCriteria {
return
(
Criteria
)
this
;
}
public
Criteria
andParentIdIsNull
()
{
addCriterion
(
"parent_id is null"
);
return
(
Criteria
)
this
;
}
public
Criteria
andParentIdIsNotNull
()
{
addCriterion
(
"parent_id is not null"
);
return
(
Criteria
)
this
;
}
public
Criteria
andParentIdEqualTo
(
Integer
value
)
{
addCriterion
(
"parent_id ="
,
value
,
"parentId"
);
return
(
Criteria
)
this
;
}
public
Criteria
andParentIdNotEqualTo
(
Integer
value
)
{
addCriterion
(
"parent_id <>"
,
value
,
"parentId"
);
return
(
Criteria
)
this
;
}
public
Criteria
andParentIdGreaterThan
(
Integer
value
)
{
addCriterion
(
"parent_id >"
,
value
,
"parentId"
);
return
(
Criteria
)
this
;
}
public
Criteria
andParentIdGreaterThanOrEqualTo
(
Integer
value
)
{
addCriterion
(
"parent_id >="
,
value
,
"parentId"
);
return
(
Criteria
)
this
;
}
public
Criteria
andParentIdLessThan
(
Integer
value
)
{
addCriterion
(
"parent_id <"
,
value
,
"parentId"
);
return
(
Criteria
)
this
;
}
public
Criteria
andParentIdLessThanOrEqualTo
(
Integer
value
)
{
addCriterion
(
"parent_id <="
,
value
,
"parentId"
);
return
(
Criteria
)
this
;
}
public
Criteria
andParentIdIn
(
List
<
Integer
>
values
)
{
addCriterion
(
"parent_id in"
,
values
,
"parentId"
);
return
(
Criteria
)
this
;
}
public
Criteria
andParentIdNotIn
(
List
<
Integer
>
values
)
{
addCriterion
(
"parent_id not in"
,
values
,
"parentId"
);
return
(
Criteria
)
this
;
}
public
Criteria
andParentIdBetween
(
Integer
value1
,
Integer
value2
)
{
addCriterion
(
"parent_id between"
,
value1
,
value2
,
"parentId"
);
return
(
Criteria
)
this
;
}
public
Criteria
andParentIdNotBetween
(
Integer
value1
,
Integer
value2
)
{
addCriterion
(
"parent_id not between"
,
value1
,
value2
,
"parentId"
);
return
(
Criteria
)
this
;
}
public
Criteria
andCreateTimeIsNull
()
{
addCriterion
(
"create_time is null"
);
return
(
Criteria
)
this
;
...
...
src/main/java/com/gmei/data/dqmp/domain/TblSqlCheckSingle.java
View file @
63f84a83
...
...
@@ -19,6 +19,8 @@ public class TblSqlCheckSingle {
private
String
comment
;
private
Integer
parentId
;
private
Date
createTime
;
private
String
sqlContent
;
...
...
@@ -87,6 +89,14 @@ public class TblSqlCheckSingle {
this
.
comment
=
comment
==
null
?
null
:
comment
.
trim
();
}
public
Integer
getParentId
()
{
return
parentId
;
}
public
void
setParentId
(
Integer
parentId
)
{
this
.
parentId
=
parentId
;
}
public
Date
getCreateTime
()
{
return
createTime
;
}
...
...
src/main/java/com/gmei/data/dqmp/domain/TblSqlCheckSingleCriteria.java
View file @
63f84a83
...
...
@@ -645,6 +645,66 @@ public class TblSqlCheckSingleCriteria {
return
(
Criteria
)
this
;
}
public
Criteria
andParentIdIsNull
()
{
addCriterion
(
"parent_id is null"
);
return
(
Criteria
)
this
;
}
public
Criteria
andParentIdIsNotNull
()
{
addCriterion
(
"parent_id is not null"
);
return
(
Criteria
)
this
;
}
public
Criteria
andParentIdEqualTo
(
Integer
value
)
{
addCriterion
(
"parent_id ="
,
value
,
"parentId"
);
return
(
Criteria
)
this
;
}
public
Criteria
andParentIdNotEqualTo
(
Integer
value
)
{
addCriterion
(
"parent_id <>"
,
value
,
"parentId"
);
return
(
Criteria
)
this
;
}
public
Criteria
andParentIdGreaterThan
(
Integer
value
)
{
addCriterion
(
"parent_id >"
,
value
,
"parentId"
);
return
(
Criteria
)
this
;
}
public
Criteria
andParentIdGreaterThanOrEqualTo
(
Integer
value
)
{
addCriterion
(
"parent_id >="
,
value
,
"parentId"
);
return
(
Criteria
)
this
;
}
public
Criteria
andParentIdLessThan
(
Integer
value
)
{
addCriterion
(
"parent_id <"
,
value
,
"parentId"
);
return
(
Criteria
)
this
;
}
public
Criteria
andParentIdLessThanOrEqualTo
(
Integer
value
)
{
addCriterion
(
"parent_id <="
,
value
,
"parentId"
);
return
(
Criteria
)
this
;
}
public
Criteria
andParentIdIn
(
List
<
Integer
>
values
)
{
addCriterion
(
"parent_id in"
,
values
,
"parentId"
);
return
(
Criteria
)
this
;
}
public
Criteria
andParentIdNotIn
(
List
<
Integer
>
values
)
{
addCriterion
(
"parent_id not in"
,
values
,
"parentId"
);
return
(
Criteria
)
this
;
}
public
Criteria
andParentIdBetween
(
Integer
value1
,
Integer
value2
)
{
addCriterion
(
"parent_id between"
,
value1
,
value2
,
"parentId"
);
return
(
Criteria
)
this
;
}
public
Criteria
andParentIdNotBetween
(
Integer
value1
,
Integer
value2
)
{
addCriterion
(
"parent_id not between"
,
value1
,
value2
,
"parentId"
);
return
(
Criteria
)
this
;
}
public
Criteria
andCreateTimeIsNull
()
{
addCriterion
(
"create_time is null"
);
return
(
Criteria
)
this
;
...
...
src/main/java/com/gmei/data/dqmp/domain/TblSqlMonitorSpecial.java
View file @
63f84a83
...
...
@@ -23,6 +23,8 @@ public class TblSqlMonitorSpecial {
private
String
comment
;
private
Integer
parentId
;
private
Date
createTime
;
private
String
sqlContent
;
...
...
@@ -107,6 +109,14 @@ public class TblSqlMonitorSpecial {
this
.
comment
=
comment
==
null
?
null
:
comment
.
trim
();
}
public
Integer
getParentId
()
{
return
parentId
;
}
public
void
setParentId
(
Integer
parentId
)
{
this
.
parentId
=
parentId
;
}
public
Date
getCreateTime
()
{
return
createTime
;
}
...
...
src/main/java/com/gmei/data/dqmp/domain/TblSqlMonitorSpecialCriteria.java
View file @
63f84a83
...
...
@@ -785,6 +785,66 @@ public class TblSqlMonitorSpecialCriteria {
return
(
Criteria
)
this
;
}
public
Criteria
andParentIdIsNull
()
{
addCriterion
(
"parent_id is null"
);
return
(
Criteria
)
this
;
}
public
Criteria
andParentIdIsNotNull
()
{
addCriterion
(
"parent_id is not null"
);
return
(
Criteria
)
this
;
}
public
Criteria
andParentIdEqualTo
(
Integer
value
)
{
addCriterion
(
"parent_id ="
,
value
,
"parentId"
);
return
(
Criteria
)
this
;
}
public
Criteria
andParentIdNotEqualTo
(
Integer
value
)
{
addCriterion
(
"parent_id <>"
,
value
,
"parentId"
);
return
(
Criteria
)
this
;
}
public
Criteria
andParentIdGreaterThan
(
Integer
value
)
{
addCriterion
(
"parent_id >"
,
value
,
"parentId"
);
return
(
Criteria
)
this
;
}
public
Criteria
andParentIdGreaterThanOrEqualTo
(
Integer
value
)
{
addCriterion
(
"parent_id >="
,
value
,
"parentId"
);
return
(
Criteria
)
this
;
}
public
Criteria
andParentIdLessThan
(
Integer
value
)
{
addCriterion
(
"parent_id <"
,
value
,
"parentId"
);
return
(
Criteria
)
this
;
}
public
Criteria
andParentIdLessThanOrEqualTo
(
Integer
value
)
{
addCriterion
(
"parent_id <="
,
value
,
"parentId"
);
return
(
Criteria
)
this
;
}
public
Criteria
andParentIdIn
(
List
<
Integer
>
values
)
{
addCriterion
(
"parent_id in"
,
values
,
"parentId"
);
return
(
Criteria
)
this
;
}
public
Criteria
andParentIdNotIn
(
List
<
Integer
>
values
)
{
addCriterion
(
"parent_id not in"
,
values
,
"parentId"
);
return
(
Criteria
)
this
;
}
public
Criteria
andParentIdBetween
(
Integer
value1
,
Integer
value2
)
{
addCriterion
(
"parent_id between"
,
value1
,
value2
,
"parentId"
);
return
(
Criteria
)
this
;
}
public
Criteria
andParentIdNotBetween
(
Integer
value1
,
Integer
value2
)
{
addCriterion
(
"parent_id not between"
,
value1
,
value2
,
"parentId"
);
return
(
Criteria
)
this
;
}
public
Criteria
andCreateTimeIsNull
()
{
addCriterion
(
"create_time is null"
);
return
(
Criteria
)
this
;
...
...
src/main/java/com/gmei/data/dqmp/domain/TblSqlMonitorVolatility.java
View file @
63f84a83
...
...
@@ -19,6 +19,8 @@ public class TblSqlMonitorVolatility {
private
String
comment
;
private
Integer
parentId
;
private
Date
createTime
;
private
String
sqlContent
;
...
...
@@ -87,6 +89,14 @@ public class TblSqlMonitorVolatility {
this
.
comment
=
comment
==
null
?
null
:
comment
.
trim
();
}
public
Integer
getParentId
()
{
return
parentId
;
}
public
void
setParentId
(
Integer
parentId
)
{
this
.
parentId
=
parentId
;
}
public
Date
getCreateTime
()
{
return
createTime
;
}
...
...
src/main/java/com/gmei/data/dqmp/domain/TblSqlMonitorVolatilityCriteria.java
View file @
63f84a83
...
...
@@ -645,6 +645,66 @@ public class TblSqlMonitorVolatilityCriteria {
return
(
Criteria
)
this
;
}
public
Criteria
andParentIdIsNull
()
{
addCriterion
(
"parent_id is null"
);
return
(
Criteria
)
this
;
}
public
Criteria
andParentIdIsNotNull
()
{
addCriterion
(
"parent_id is not null"
);
return
(
Criteria
)
this
;
}
public
Criteria
andParentIdEqualTo
(
Integer
value
)
{
addCriterion
(
"parent_id ="
,
value
,
"parentId"
);
return
(
Criteria
)
this
;
}
public
Criteria
andParentIdNotEqualTo
(
Integer
value
)
{
addCriterion
(
"parent_id <>"
,
value
,
"parentId"
);
return
(
Criteria
)
this
;
}
public
Criteria
andParentIdGreaterThan
(
Integer
value
)
{
addCriterion
(
"parent_id >"
,
value
,
"parentId"
);
return
(
Criteria
)
this
;
}
public
Criteria
andParentIdGreaterThanOrEqualTo
(
Integer
value
)
{
addCriterion
(
"parent_id >="
,
value
,
"parentId"
);
return
(
Criteria
)
this
;
}
public
Criteria
andParentIdLessThan
(
Integer
value
)
{
addCriterion
(
"parent_id <"
,
value
,
"parentId"
);
return
(
Criteria
)
this
;
}
public
Criteria
andParentIdLessThanOrEqualTo
(
Integer
value
)
{
addCriterion
(
"parent_id <="
,
value
,
"parentId"
);
return
(
Criteria
)
this
;
}
public
Criteria
andParentIdIn
(
List
<
Integer
>
values
)
{
addCriterion
(
"parent_id in"
,
values
,
"parentId"
);
return
(
Criteria
)
this
;
}
public
Criteria
andParentIdNotIn
(
List
<
Integer
>
values
)
{
addCriterion
(
"parent_id not in"
,
values
,
"parentId"
);
return
(
Criteria
)
this
;
}
public
Criteria
andParentIdBetween
(
Integer
value1
,
Integer
value2
)
{
addCriterion
(
"parent_id between"
,
value1
,
value2
,
"parentId"
);
return
(
Criteria
)
this
;
}
public
Criteria
andParentIdNotBetween
(
Integer
value1
,
Integer
value2
)
{
addCriterion
(
"parent_id not between"
,
value1
,
value2
,
"parentId"
);
return
(
Criteria
)
this
;
}
public
Criteria
andCreateTimeIsNull
()
{
addCriterion
(
"create_time is null"
);
return
(
Criteria
)
this
;
...
...
src/main/java/com/gmei/data/dqmp/service/DqRuleService.java
View file @
63f84a83
package
com
.
gmei
.
data
.
dqmp
.
service
;
import
java.util.List
;
import
com.gmei.data.dqmp.vo.DqReferRuleVo
;
import
com.gmei.data.dqmp.vo.DqRuleVo
;
import
com.gmei.data.dqmp.vo.DqSpecialRuleVo
;
import
com.gmei.data.dqmp.vo.DqUnblankRuleVo
;
import
com.gmei.data.dqmp.vo.DqUniqueRuleVo
;
import
com.gmei.data.dqmp.vo.DqVolatilityRuleVo
;
public
interface
DqRuleService
{
Boolean
addDqRule
(
DqRuleVo
dqRuleVo
);
List
<
DqUniqueRuleVo
>
findUniqueDqRuleList
();
List
<
DqUnblankRuleVo
>
findUnblankDqRuleList
();
List
<
DqReferRuleVo
>
findReferDqRuleList
();
List
<
DqVolatilityRuleVo
>
findVolatilityDqRuleList
();
List
<
DqSpecialRuleVo
>
findSpecialDqRuleList
();
Boolean
delDqRule
(
DqRuleVo
dqRuleVo
);
}
src/main/java/com/gmei/data/dqmp/service/impl/DqRuleServiceImpl.java
View file @
63f84a83
package
com
.
gmei
.
data
.
dqmp
.
service
.
impl
;
import
java.util.ArrayList
;
import
java.util.HashMap
;
import
java.util.List
;
import
java.util.Map
;
...
...
@@ -14,14 +15,20 @@ import org.springframework.transaction.annotation.Transactional;
import
com.gmei.data.dqmp.common.Constants
;
import
com.gmei.data.dqmp.domain.TblIndicatorOperatorInfo
;
import
com.gmei.data.dqmp.domain.TblIndicatorOperatorInfoCriteria
;
import
com.gmei.data.dqmp.domain.TblRuleInfoDuplexCriteria
;
import
com.gmei.data.dqmp.domain.TblRuleInfoDuplexWithBLOBs
;
import
com.gmei.data.dqmp.domain.TblRuleInfoSimple
;
import
com.gmei.data.dqmp.domain.TblRuleInfoSimpleCriteria
;
import
com.gmei.data.dqmp.domain.TblRuleTemplate
;
import
com.gmei.data.dqmp.domain.TblRuleTemplateCriteria
;
import
com.gmei.data.dqmp.domain.TblSqlCheckDuplex
;
import
com.gmei.data.dqmp.domain.TblSqlCheckDuplexCriteria
;
import
com.gmei.data.dqmp.domain.TblSqlCheckSingle
;
import
com.gmei.data.dqmp.domain.TblSqlCheckSingleCriteria
;
import
com.gmei.data.dqmp.domain.TblSqlMonitorSpecial
;
import
com.gmei.data.dqmp.domain.TblSqlMonitorSpecialCriteria
;
import
com.gmei.data.dqmp.domain.TblSqlMonitorVolatility
;
import
com.gmei.data.dqmp.domain.TblSqlMonitorVolatilityCriteria
;
import
com.gmei.data.dqmp.mapper.TblIndicatorOperatorInfoMapper
;
import
com.gmei.data.dqmp.mapper.TblRuleInfoDuplexMapper
;
import
com.gmei.data.dqmp.mapper.TblRuleInfoSimpleMapper
;
...
...
@@ -33,7 +40,12 @@ import com.gmei.data.dqmp.mapper.TblSqlMonitorVolatilityMapper;
import
com.gmei.data.dqmp.service.DqRuleService
;
import
com.gmei.data.dqmp.utils.BeanUtils
;
import
com.gmei.data.dqmp.utils.DateUtils
;
import
com.gmei.data.dqmp.vo.DqReferRuleVo
;
import
com.gmei.data.dqmp.vo.DqRuleVo
;
import
com.gmei.data.dqmp.vo.DqSpecialRuleVo
;
import
com.gmei.data.dqmp.vo.DqUnblankRuleVo
;
import
com.gmei.data.dqmp.vo.DqUniqueRuleVo
;
import
com.gmei.data.dqmp.vo.DqVolatilityRuleVo
;
@Service
public
class
DqRuleServiceImpl
implements
DqRuleService
{
...
...
@@ -75,12 +87,13 @@ public class DqRuleServiceImpl implements DqRuleService {
/**
* 简单校验规则新增
*
* @param dqRuleVo
* @return
*/
private
Boolean
simpleRuleInfoInsert
(
DqRuleVo
dqRuleVo
)
{
if
(!
simpleRuleInfoCheck
(
dqRuleVo
))
{
logger
.
error
(
"Param is illegal! {}"
,
dqRuleVo
);
if
(!
simpleRuleInfoCheck
(
dqRuleVo
))
{
logger
.
error
(
"Param is illegal! {}"
,
dqRuleVo
);
return
false
;
}
TblRuleInfoSimple
record
=
BeanUtils
.
map
(
dqRuleVo
,
TblRuleInfoSimple
.
class
);
...
...
@@ -90,32 +103,37 @@ public class DqRuleServiceImpl implements DqRuleService {
String
checkType
=
dqRuleVo
.
getCheckType
();
switch
(
checkType
)
{
case
Constants
.
CHECK_UNIQUE
:
TblSqlCheckSingle
TblSqlCheckSingle
=
BeanUtils
.
map
(
dqRuleVo
,
TblSqlCheckSingle
.
class
);
TblSqlCheckSingle
.
setSqlContent
(
genSqlByTemplate
(
dqRuleVo
));
tblSqlCheckSingleMapper
.
insertSelective
(
TblSqlCheckSingle
);
TblSqlCheckSingle
tblSqlCheckSingle
=
BeanUtils
.
map
(
dqRuleVo
,
TblSqlCheckSingle
.
class
);
tblSqlCheckSingle
.
setSqlContent
(
genSqlByTemplate
(
dqRuleVo
));
tblSqlCheckSingle
.
setParentId
(
record
.
getId
());
tblSqlCheckSingleMapper
.
insertSelective
(
tblSqlCheckSingle
);
break
;
case
Constants
.
CHECK_UNBLANK
:
TblSqlCheckSingle
tcss
=
BeanUtils
.
map
(
dqRuleVo
,
TblSqlCheckSingle
.
class
);
tcss
.
setSqlContent
(
genSqlByTemplate
(
dqRuleVo
));
tcss
.
setParentId
(
record
.
getId
());
tblSqlCheckSingleMapper
.
insertSelective
(
tcss
);
break
;
case
Constants
.
CHECK_VOLATILITY
:
if
(!
volatilityRuleParamsCheck
(
dqRuleVo
))
{
logger
.
error
(
"Param is illegal! {}"
,
dqRuleVo
);
if
(!
volatilityRuleParamsCheck
(
dqRuleVo
))
{
logger
.
error
(
"Param is illegal! {}"
,
dqRuleVo
);
return
false
;
}
TblSqlMonitorVolatility
TblSqlMonitorVolatility
=
BeanUtils
.
map
(
dqRuleVo
,
TblSqlMonitorVolatility
.
class
);
TblSqlMonitorVolatility
.
setSqlContent
(
genSqlByTemplate
(
dqRuleVo
));
tblSqlMonitorVolatilityMapper
.
insertSelective
(
TblSqlMonitorVolatility
);
TblSqlMonitorVolatility
tblSqlMonitorVolatility
=
BeanUtils
.
map
(
dqRuleVo
,
TblSqlMonitorVolatility
.
class
);
tblSqlMonitorVolatility
.
setSqlContent
(
genSqlByTemplate
(
dqRuleVo
));
tblSqlMonitorVolatility
.
setParentId
(
record
.
getId
());
tblSqlMonitorVolatilityMapper
.
insertSelective
(
tblSqlMonitorVolatility
);
break
;
case
Constants
.
CHECK_SPECIAL
:
if
(!
specialRuleParamsCheck
(
dqRuleVo
))
{
logger
.
error
(
"Param is illegal! {}"
,
dqRuleVo
);
if
(!
specialRuleParamsCheck
(
dqRuleVo
))
{
logger
.
error
(
"Param is illegal! {}"
,
dqRuleVo
);
return
false
;
}
dqRuleVo
.
setStartTime
(
DateUtils
.
getZeroTimeStrsMap
().
get
(
dqRuleVo
.
getStartTime
()));
TblSqlMonitorSpecial
tblSqlMonitorSpecial
=
BeanUtils
.
map
(
dqRuleVo
,
TblSqlMonitorSpecial
.
class
);
tblSqlMonitorSpecial
.
setSqlContent
(
genSqlByTemplate
(
dqRuleVo
));
tblSqlMonitorSpecial
.
setParentId
(
record
.
getId
());
tblSqlMonitorSpecialMapper
.
insertSelective
(
tblSqlMonitorSpecial
);
break
;
default
:
...
...
@@ -125,15 +143,16 @@ public class DqRuleServiceImpl implements DqRuleService {
}
return
true
;
}
/**
* 双表校验规则录入
*
* @param dqRuleVo
* @return
*/
private
Boolean
duplexRuleInfoInsert
(
DqRuleVo
dqRuleVo
)
{
if
(!
duplexRuleInfoCheck
(
dqRuleVo
))
{
logger
.
error
(
"Param is illegal! {}"
,
dqRuleVo
);
if
(!
duplexRuleInfoCheck
(
dqRuleVo
))
{
logger
.
error
(
"Param is illegal! {}"
,
dqRuleVo
);
return
false
;
}
TblRuleInfoDuplexWithBLOBs
record
=
BeanUtils
.
map
(
dqRuleVo
,
TblRuleInfoDuplexWithBLOBs
.
class
);
...
...
@@ -144,6 +163,7 @@ public class DqRuleServiceImpl implements DqRuleService {
TblSqlCheckDuplex
tblSqlCheckDuplex
=
BeanUtils
.
map
(
dqRuleVo
,
TblSqlCheckDuplex
.
class
);
String
sqlContent
=
genSqlByTemplate
(
dqRuleVo
);
tblSqlCheckDuplex
.
setSqlContent
(
sqlContent
);
tblSqlCheckDuplex
.
setParentId
(
record
.
getId
());
tblSqlCheckMultipleMapper
.
insertSelective
(
tblSqlCheckDuplex
);
}
else
{
logger
.
error
(
"checkType value is error! {}"
,
checkType
);
...
...
@@ -154,15 +174,15 @@ public class DqRuleServiceImpl implements DqRuleService {
}
private
boolean
simpleRuleInfoCheck
(
DqRuleVo
dqRuleVo
)
{
if
(
StringUtils
.
isBlank
(
dqRuleVo
.
getDbName
())
||
StringUtils
.
isBlank
(
dqRuleVo
.
getTbName
()))
{
if
(
StringUtils
.
isBlank
(
dqRuleVo
.
getDbName
())
||
StringUtils
.
isBlank
(
dqRuleVo
.
getTbName
()))
{
return
false
;
}
if
(
Constants
.
CHECK_SPECIAL
.
equals
(
dqRuleVo
.
getCheckType
()))
{
if
(
StringUtils
.
isBlank
(
dqRuleVo
.
getTimeColName
()))
{
if
(
Constants
.
CHECK_SPECIAL
.
equals
(
dqRuleVo
.
getCheckType
()))
{
if
(
StringUtils
.
isBlank
(
dqRuleVo
.
getTimeColName
()))
{
return
false
;
}
}
else
{
if
(
StringUtils
.
isBlank
(
dqRuleVo
.
getColName
()))
{
}
else
{
if
(
StringUtils
.
isBlank
(
dqRuleVo
.
getColName
()))
{
return
false
;
}
}
...
...
@@ -170,72 +190,198 @@ public class DqRuleServiceImpl implements DqRuleService {
}
private
boolean
volatilityRuleParamsCheck
(
DqRuleVo
dqRuleVo
)
{
if
(
StringUtils
.
isBlank
(
dqRuleVo
.
getIndicatorType
()))
{
if
(
StringUtils
.
isBlank
(
dqRuleVo
.
getIndicatorType
()))
{
return
false
;
}
return
true
;
}
private
boolean
specialRuleParamsCheck
(
DqRuleVo
dqRuleVo
)
{
if
(
StringUtils
.
isBlank
(
dqRuleVo
.
getTimeColName
())
||
StringUtils
.
isBlank
(
dqRuleVo
.
getStartTime
()))
{
if
(
StringUtils
.
isBlank
(
dqRuleVo
.
getTimeColName
())
||
StringUtils
.
isBlank
(
dqRuleVo
.
getStartTime
()))
{
return
false
;
}
return
true
;
}
private
boolean
duplexRuleInfoCheck
(
DqRuleVo
dqRuleVo
)
{
if
(
StringUtils
.
isBlank
(
dqRuleVo
.
getCheckDbName
())
||
StringUtils
.
isBlank
(
dqRuleVo
.
getCheckTbName
())
if
(
StringUtils
.
isBlank
(
dqRuleVo
.
getCheckDbName
())
||
StringUtils
.
isBlank
(
dqRuleVo
.
getCheckTbName
())
||
StringUtils
.
isBlank
(
dqRuleVo
.
getCheckColName
())
||
StringUtils
.
isBlank
(
dqRuleVo
.
getReferColName
())
||
StringUtils
.
isBlank
(
dqRuleVo
.
getReferDbName
())
||
StringUtils
.
isBlank
(
dqRuleVo
.
getReferTbName
()))
{
return
false
;
}
return
true
;
}
private
String
genSqlByTemplate
(
DqRuleVo
dqRuleVo
)
{
TblRuleTemplateCriteria
example
=
new
TblRuleTemplateCriteria
();
example
.
createCriteria
().
andCheckTypeEqualTo
(
dqRuleVo
.
getCheckType
());
TblRuleTemplate
tblRuleTemplate
=
tblRuleTemplateMapper
.
selectByExampleWithBLOBs
(
example
).
get
(
0
);
String
tpltContent
=
tblRuleTemplate
.
getTpltContent
();
Map
<
String
,
String
>
indicatorMap
=
new
HashMap
<
String
,
String
>();
Map
<
String
,
String
>
indicatorMap
=
new
HashMap
<
String
,
String
>();
TblIndicatorOperatorInfoCriteria
tblIndicatorOperatorInfoCriteria
=
new
TblIndicatorOperatorInfoCriteria
();
List
<
TblIndicatorOperatorInfo
>
tblIndicatorOperatorInfos
=
tblIndicatorOperatorInfoMapper
.
selectByExample
(
tblIndicatorOperatorInfoCriteria
);
for
(
TblIndicatorOperatorInfo
tblIndicatorOperatorInfo
:
tblIndicatorOperatorInfos
)
{
List
<
TblIndicatorOperatorInfo
>
tblIndicatorOperatorInfos
=
tblIndicatorOperatorInfoMapper
.
selectByExample
(
tblIndicatorOperatorInfoCriteria
);
for
(
TblIndicatorOperatorInfo
tblIndicatorOperatorInfo
:
tblIndicatorOperatorInfos
)
{
indicatorMap
.
put
(
tblIndicatorOperatorInfo
.
getIndicatorType
(),
tblIndicatorOperatorInfo
.
getOperatorExpr
());
}
String
indicatorType
=
dqRuleVo
.
getIndicatorType
();
String
rs
=
tpltContent
.
replaceAll
(
"#db_name"
,
dqRuleVo
.
getDbName
())
.
replaceAll
(
"#tb_name"
,
dqRuleVo
.
getTbName
())
.
replaceAll
(
"#indicator_type"
,
indicatorType
)
.
replaceAll
(
"#indicator_expre"
,
indicatorMap
.
get
(
indicatorType
))
.
replaceAll
(
"#col_name"
,
dqRuleVo
.
getColName
())
.
replaceAll
(
"#start_time"
,
"'"
+
dqRuleVo
.
getStartTime
()+
"'"
)
.
replaceAll
(
"#end_time"
,
"'"
+
DateUtils
.
getTodayZeroTimeStr
()+
"'"
)
.
replaceAll
(
"#check_db_name"
,
dqRuleVo
.
getCheckDbName
())
.
replaceAll
(
"#check_tb_name"
,
dqRuleVo
.
getCheckTbName
())
.
replaceAll
(
"#check_col_name"
,
dqRuleVo
.
getCheckColName
())
.
replaceAll
(
"#refer_db_name"
,
dqRuleVo
.
getReferDbName
())
.
replaceAll
(
"#refer_tb_name"
,
dqRuleVo
.
getReferTbName
())
.
replaceAll
(
"#refer_col_name"
,
dqRuleVo
.
getReferColName
())
.
replaceAll
(
"#time_col_name"
,
dqRuleVo
.
getTimeColName
());
String
rs
=
tpltContent
.
replaceAll
(
"#db_name"
,
dqRuleVo
.
getDbName
())
.
replaceAll
(
"#tb_name"
,
dqRuleVo
.
getTbName
()).
replaceAll
(
"#indicator_type"
,
indicatorType
)
.
replaceAll
(
"#indicator_expre"
,
indicatorMap
.
get
(
indicatorType
))
.
replaceAll
(
"#col_name"
,
dqRuleVo
.
getColName
())
.
replaceAll
(
"#start_time"
,
"'"
+
dqRuleVo
.
getStartTime
()
+
"'"
)
.
replaceAll
(
"#end_time"
,
"'"
+
DateUtils
.
getTodayZeroTimeStr
()
+
"'"
)
.
replaceAll
(
"#check_db_name"
,
dqRuleVo
.
getCheckDbName
())
.
replaceAll
(
"#check_tb_name"
,
dqRuleVo
.
getCheckTbName
())
.
replaceAll
(
"#check_col_name"
,
dqRuleVo
.
getCheckColName
())
.
replaceAll
(
"#refer_db_name"
,
dqRuleVo
.
getReferDbName
())
.
replaceAll
(
"#refer_tb_name"
,
dqRuleVo
.
getReferTbName
())
.
replaceAll
(
"#refer_col_name"
,
dqRuleVo
.
getReferColName
())
.
replaceAll
(
"#time_col_name"
,
dqRuleVo
.
getTimeColName
());
String
filters
=
dqRuleVo
.
getFilters
();
if
(
null
!=
filters
)
{
if
(
null
!=
filters
)
{
filters
=
filters
.
replaceAll
(
"\\$"
,
"RDS_CHAR_DOLLAR"
);
rs
=
rs
.
replaceAll
(
"#filters"
,
filters
);
}
String
checkFilters
=
dqRuleVo
.
getCheckFilters
();
if
(
null
!=
checkFilters
)
{
if
(
null
!=
checkFilters
)
{
checkFilters
=
checkFilters
.
replaceAll
(
"\\$"
,
"RDS_CHAR_DOLLAR"
);
rs
=
rs
.
replaceAll
(
"#check_filters"
,
checkFilters
);
}
String
referFilters
=
dqRuleVo
.
getReferFilters
();
if
(
null
!=
referFilters
)
{
if
(
null
!=
referFilters
)
{
referFilters
=
referFilters
.
replaceAll
(
"\\$"
,
"RDS_CHAR_DOLLAR"
);
rs
=
rs
.
replaceAll
(
"#refer_filters"
,
referFilters
);
}
rs
=
rs
.
replaceAll
(
"RDS_CHAR_DOLLAR"
,
"\\$"
);
return
rs
;
}
@Override
public
List
<
DqUniqueRuleVo
>
findUniqueDqRuleList
()
{
List
<
DqUniqueRuleVo
>
rsList
=
new
ArrayList
<
DqUniqueRuleVo
>();
TblRuleInfoSimpleCriteria
example
=
new
TblRuleInfoSimpleCriteria
();
example
.
createCriteria
().
andCheckTypeEqualTo
(
Constants
.
CHECK_UNIQUE
);
List
<
TblRuleInfoSimple
>
selectByExample
=
tblRuleInfoSimpleMapper
.
selectByExampleWithBLOBs
(
example
);
for
(
TblRuleInfoSimple
tblRuleInfoSimple
:
selectByExample
)
{
DqUniqueRuleVo
dqUniqueRuleVo
=
BeanUtils
.
map
(
tblRuleInfoSimple
,
DqUniqueRuleVo
.
class
);
if
(
tblRuleInfoSimple
.
getIsValid
()
==
Constants
.
IS_VALID_ON
)
{
dqUniqueRuleVo
.
setStatus
(
"正常"
);
}
else
{
dqUniqueRuleVo
.
setStatus
(
"禁用"
);
}
rsList
.
add
(
dqUniqueRuleVo
);
}
return
rsList
;
}
@Override
public
List
<
DqUnblankRuleVo
>
findUnblankDqRuleList
()
{
List
<
DqUnblankRuleVo
>
rsList
=
new
ArrayList
<
DqUnblankRuleVo
>();
TblRuleInfoSimpleCriteria
example
=
new
TblRuleInfoSimpleCriteria
();
example
.
createCriteria
().
andCheckTypeEqualTo
(
Constants
.
CHECK_UNBLANK
);
List
<
TblRuleInfoSimple
>
selectByExample
=
tblRuleInfoSimpleMapper
.
selectByExampleWithBLOBs
(
example
);
for
(
TblRuleInfoSimple
tblRuleInfoSimple
:
selectByExample
)
{
DqUnblankRuleVo
dqUnblankRuleVo
=
BeanUtils
.
map
(
tblRuleInfoSimple
,
DqUnblankRuleVo
.
class
);
if
(
tblRuleInfoSimple
.
getIsValid
()
==
Constants
.
IS_VALID_ON
)
{
dqUnblankRuleVo
.
setStatus
(
"正常"
);
}
else
{
dqUnblankRuleVo
.
setStatus
(
"禁用"
);
}
rsList
.
add
(
dqUnblankRuleVo
);
}
return
rsList
;
}
@Override
public
List
<
DqReferRuleVo
>
findReferDqRuleList
()
{
List
<
DqReferRuleVo
>
rsList
=
new
ArrayList
<
DqReferRuleVo
>();
TblRuleInfoDuplexCriteria
example
=
new
TblRuleInfoDuplexCriteria
();
example
.
createCriteria
().
andCheckTypeEqualTo
(
Constants
.
CHECK_REFER
);
List
<
TblRuleInfoDuplexWithBLOBs
>
selectByExampleWithBLOBs
=
tblRuleInfoDuplexMapper
.
selectByExampleWithBLOBs
(
example
);
for
(
TblRuleInfoDuplexWithBLOBs
tblRuleInfoDuplexWithBLOBs
:
selectByExampleWithBLOBs
)
{
DqReferRuleVo
dqReferRuleVo
=
BeanUtils
.
map
(
tblRuleInfoDuplexWithBLOBs
,
DqReferRuleVo
.
class
);
if
(
tblRuleInfoDuplexWithBLOBs
.
getIsValid
()
==
Constants
.
IS_VALID_ON
)
{
dqReferRuleVo
.
setStatus
(
"正常"
);
}
else
{
dqReferRuleVo
.
setStatus
(
"禁用"
);
}
rsList
.
add
(
dqReferRuleVo
);
}
return
rsList
;
}
@Override
public
List
<
DqVolatilityRuleVo
>
findVolatilityDqRuleList
()
{
List
<
DqVolatilityRuleVo
>
rsList
=
new
ArrayList
<
DqVolatilityRuleVo
>();
TblRuleInfoSimpleCriteria
example
=
new
TblRuleInfoSimpleCriteria
();
example
.
createCriteria
().
andCheckTypeEqualTo
(
Constants
.
CHECK_VOLATILITY
);
List
<
TblRuleInfoSimple
>
selectByExample
=
tblRuleInfoSimpleMapper
.
selectByExampleWithBLOBs
(
example
);
for
(
TblRuleInfoSimple
tblRuleInfoSimple
:
selectByExample
)
{
DqVolatilityRuleVo
dqVolatilityRuleVo
=
BeanUtils
.
map
(
tblRuleInfoSimple
,
DqVolatilityRuleVo
.
class
);
if
(
tblRuleInfoSimple
.
getIsValid
()
==
Constants
.
IS_VALID_ON
)
{
dqVolatilityRuleVo
.
setStatus
(
"正常"
);
}
else
{
dqVolatilityRuleVo
.
setStatus
(
"禁用"
);
}
rsList
.
add
(
dqVolatilityRuleVo
);
}
return
rsList
;
}
@Override
public
List
<
DqSpecialRuleVo
>
findSpecialDqRuleList
()
{
List
<
DqSpecialRuleVo
>
rsList
=
new
ArrayList
<
DqSpecialRuleVo
>();
TblRuleInfoSimpleCriteria
example
=
new
TblRuleInfoSimpleCriteria
();
example
.
createCriteria
().
andCheckTypeEqualTo
(
Constants
.
CHECK_SPECIAL
);
List
<
TblRuleInfoSimple
>
selectByExample
=
tblRuleInfoSimpleMapper
.
selectByExampleWithBLOBs
(
example
);
for
(
TblRuleInfoSimple
tblRuleInfoSimple
:
selectByExample
)
{
DqSpecialRuleVo
dqSpecialRuleVo
=
BeanUtils
.
map
(
tblRuleInfoSimple
,
DqSpecialRuleVo
.
class
);
if
(
tblRuleInfoSimple
.
getIsValid
()
==
Constants
.
IS_VALID_ON
)
{
dqSpecialRuleVo
.
setStatus
(
"正常"
);
}
else
{
dqSpecialRuleVo
.
setStatus
(
"禁用"
);
}
rsList
.
add
(
dqSpecialRuleVo
);
}
return
rsList
;
}
@Override
@Transactional
public
Boolean
delDqRule
(
DqRuleVo
dqRuleVo
)
{
Integer
id
=
dqRuleVo
.
getId
();
String
checkType
=
dqRuleVo
.
getCheckType
();
if
(
Constants
.
CHECK_REFER
.
equals
(
checkType
))
{
tblRuleInfoDuplexMapper
.
deleteByPrimaryKey
(
id
);
TblSqlCheckDuplexCriteria
example
=
new
TblSqlCheckDuplexCriteria
();
example
.
createCriteria
().
andCheckTypeEqualTo
(
dqRuleVo
.
getCheckType
()).
andParentIdEqualTo
(
id
);
tblSqlCheckMultipleMapper
.
deleteByExample
(
example
);
}
else
{
tblRuleInfoSimpleMapper
.
deleteByPrimaryKey
(
id
);
switch
(
checkType
)
{
case
Constants
.
CHECK_UNIQUE
:
case
Constants
.
CHECK_UNBLANK
:
TblSqlCheckSingleCriteria
example
=
new
TblSqlCheckSingleCriteria
();
example
.
createCriteria
().
andCheckTypeEqualTo
(
checkType
).
andParentIdEqualTo
(
id
);
tblSqlCheckSingleMapper
.
deleteByExample
(
example
);
break
;
case
Constants
.
CHECK_VOLATILITY
:
TblSqlMonitorVolatilityCriteria
tblSqlMonitorVolatilityCriteria
=
new
TblSqlMonitorVolatilityCriteria
();
tblSqlMonitorVolatilityCriteria
.
createCriteria
().
andParentIdEqualTo
(
id
);
tblSqlMonitorVolatilityMapper
.
deleteByExample
(
tblSqlMonitorVolatilityCriteria
);
break
;
case
Constants
.
CHECK_SPECIAL
:
TblSqlMonitorSpecialCriteria
tblSqlMonitorSpecialCriteria
=
new
TblSqlMonitorSpecialCriteria
();
tblSqlMonitorSpecialCriteria
.
createCriteria
().
andParentIdEqualTo
(
id
);
tblSqlMonitorSpecialMapper
.
deleteByExample
(
tblSqlMonitorSpecialCriteria
);
break
;
default
:
break
;
}
}
return
true
;
}
}
src/main/java/com/gmei/data/dqmp/vo/BaseVo.java
View file @
63f84a83
...
...
@@ -3,7 +3,7 @@ package com.gmei.data.dqmp.vo;
public
class
BaseVo
{
private
int
status
=
0
;
private
String
msg
=
"success!"
;
private
String
user
;
//
private String user;
public
BaseVo
()
{
}
...
...
@@ -29,11 +29,11 @@ public class BaseVo {
this
.
msg
=
msg
;
}
public
String
getUser
()
{
return
user
;
}
public
void
setUser
(
String
user
)
{
this
.
user
=
user
;
}
//
public String getUser() {
//
return user;
//
}
//
//
public void setUser(String user) {
//
this.user = user;
//
}
}
src/main/java/com/gmei/data/dqmp/vo/DqReferRuleVo.java
0 → 100644
View file @
63f84a83
package
com
.
gmei
.
data
.
dqmp
.
vo
;
import
lombok.Data
;
@Data
public
class
DqReferRuleVo
{
private
Integer
id
;
private
String
checkType
;
private
String
status
;
private
String
checkTime
;
private
String
checkDbName
;
private
String
checkTbName
;
private
String
checkColName
;
private
String
checkFilters
;
private
String
referDbName
;
private
String
referTbName
;
private
String
referColName
;
private
String
referFilters
;
private
String
comment
;
}
src/main/java/com/gmei/data/dqmp/vo/DqRuleVo.java
View file @
63f84a83
...
...
@@ -33,6 +33,8 @@ public class DqRuleVo extends BaseVo{
private
String
checkFilters
;
private
String
referFilters
;
private
Integer
id
;
public
DqRuleVo
()
{
super
();
}
...
...
@@ -161,6 +163,15 @@ public class DqRuleVo extends BaseVo{
public
void
setComment
(
String
comment
)
{
this
.
comment
=
comment
;
}
public
Integer
getId
()
{
return
id
;
}
public
void
setId
(
Integer
id
)
{
this
.
id
=
id
;
}
@Override
public
String
toString
()
{
...
...
src/main/java/com/gmei/data/dqmp/vo/DqSpecialRuleVo.java
0 → 100644
View file @
63f84a83
package
com
.
gmei
.
data
.
dqmp
.
vo
;
import
lombok.Data
;
@Data
public
class
DqSpecialRuleVo
{
private
Integer
id
;
private
String
checkType
;
private
String
status
;
private
String
checkTime
;
private
String
dbName
;
private
String
tbName
;
private
String
colName
;
private
String
timeColName
;
private
String
indicatorType
;
private
String
startTime
;
private
String
filters
;
private
String
comment
;
}
src/main/java/com/gmei/data/dqmp/vo/DqUnblankRuleVo.java
0 → 100644
View file @
63f84a83
package
com
.
gmei
.
data
.
dqmp
.
vo
;
import
lombok.Data
;
@Data
public
class
DqUnblankRuleVo
{
private
Integer
id
;
private
String
checkType
;
private
String
status
;
private
String
checkTime
;
private
String
dbName
;
private
String
tbName
;
private
String
colName
;
private
String
filters
;
private
String
comment
;
}
src/main/java/com/gmei/data/dqmp/vo/DqUniqueRuleVo.java
0 → 100644
View file @
63f84a83
package
com
.
gmei
.
data
.
dqmp
.
vo
;
import
lombok.Data
;
@Data
public
class
DqUniqueRuleVo
{
private
Integer
id
;
private
String
checkType
;
private
String
status
;
private
String
checkTime
;
private
String
dbName
;
private
String
tbName
;
private
String
colName
;
private
String
filters
;
private
String
comment
;
}
src/main/java/com/gmei/data/dqmp/vo/DqVolatilityRuleVo.java
0 → 100644
View file @
63f84a83
package
com
.
gmei
.
data
.
dqmp
.
vo
;
import
lombok.Data
;
@Data
public
class
DqVolatilityRuleVo
{
private
Integer
id
;
private
String
checkType
;
private
String
status
;
private
String
checkTime
;
private
String
dbName
;
private
String
tbName
;
private
String
colName
;
private
String
indicatorType
;
private
String
filters
;
private
String
comment
;
}
src/main/resources/application-dev.yml
View file @
63f84a83
...
...
@@ -6,6 +6,8 @@ spring:
#---thymeleaf config ---
thymeleaf
:
cache
:
false
content-type
:
text/html
mode
:
LEGACYHTML5
#---email config---
mail
:
...
...
src/main/resources/application-prod.yml
View file @
63f84a83
...
...
@@ -6,6 +6,8 @@ spring:
#---thymeleaf config ---
thymeleaf
:
cache
:
false
content-type
:
text/html
mode
:
LEGACYHTML5
#---email config---
mail
:
...
...
src/main/resources/application-test.yml
View file @
63f84a83
...
...
@@ -6,6 +6,8 @@ spring:
#---thymeleaf config ---
thymeleaf
:
cache
:
false
content-type
:
text/html
mode
:
LEGACYHTML5
#---email config---
mail
:
...
...
src/main/resources/generator.xml
View file @
63f84a83
...
...
@@ -35,19 +35,23 @@
<!-- 需要生成的数据库表 -->
<!-- <table tableName="tbl_client_version_info" domainObjectName="TblClientVersionInfo"/> -->
<
!-- <table tableName="tbl_sql_check_single" domainObjectName="TblSqlCheckSingle"/> --
>
<
table
tableName=
"tbl_sql_check_single"
domainObjectName=
"TblSqlCheckSingle"
/
>
<table
tableName=
"tbl_sql_check_duplex"
domainObjectName=
"TblSqlCheckDuplex"
/>
<
!-- <
table tableName="tbl_sql_monitor_volatility" domainObjectName="TblSqlMonitorVolatility"/>
<table
tableName=
"tbl_sql_monitor_volatility"
domainObjectName=
"TblSqlMonitorVolatility"
/>
<table
tableName=
"tbl_sql_monitor_special"
domainObjectName=
"TblSqlMonitorSpecial"
/>
<table tableName="tbl_result_check_unique" domainObjectName="TblResultCheckUnique"/>
<
!-- <
table tableName="tbl_result_check_unique" domainObjectName="TblResultCheckUnique"/>
<table tableName="tbl_result_check_unblank" domainObjectName="TblResultCheckUnblank"/>
<table tableName="tbl_result_check_refer" domainObjectName="TblResultCheckRefer"/>
<table tableName="tbl_result_monitor_volatility" domainObjectName="TblResultMonitorVolatility"/>
<table tableName="tbl_result_monitor_special" domainObjectName="TblResultMonitorSpecial"/>
<table tableName="tbl_indicator_operator_info" domainObjectName="TblIndicatorOperatorInfo"/> -->
<!-- <table tableName="tbl_rule_template" domainObjectName="TblRuleTemplate"/> -->
<!-- <table tableName="tbl_rule_info_simple" domainObjectName="TblRuleInfoSimple"/>
<table tableName="tbl_rule_info_duplex" domainObjectName="TblRuleInfoDuplex"/> -->
<table
tableName=
"tbl_rule_info_simple"
domainObjectName=
"TblRuleInfoSimple"
>
<generatedKey
column=
"id"
sqlStatement=
"MySql"
identity=
"true"
/>
</table>
<table
tableName=
"tbl_rule_info_duplex"
domainObjectName=
"TblRuleInfoDuplex"
>
<generatedKey
column=
"id"
sqlStatement=
"MySql"
identity=
"true"
/>
</table>
<!-- <table tableName="tbl_sys_param_info" domainObjectName="TblSysParamInfo"/> -->
</context>
</generatorConfiguration>
src/main/resources/mybatis/mapper/TblRuleInfoDuplexMapper.xml
View file @
63f84a83
...
...
@@ -133,23 +133,26 @@
</if>
</delete>
<insert
id=
"insert"
parameterType=
"com.gmei.data.dqmp.domain.TblRuleInfoDuplexWithBLOBs"
>
insert into tbl_rule_info_duplex (id, check_type, check_db_name,
check_tb_name, check_col_name, refer_db_name,
refer_tb_name, refer_col_name, is_valid,
check_time, comment, create_time,
check_filters, refer_filters)
values (#{id,jdbcType=INTEGER}, #{checkType,jdbcType=VARCHAR}, #{checkDbName,jdbcType=VARCHAR},
#{checkTbName,jdbcType=VARCHAR}, #{checkColName,jdbcType=VARCHAR}, #{referDbName,jdbcType=VARCHAR},
#{referTbName,jdbcType=VARCHAR}, #{referColName,jdbcType=VARCHAR}, #{isValid,jdbcType=INTEGER},
#{checkTime,jdbcType=VARCHAR}, #{comment,jdbcType=VARCHAR}, #{createTime,jdbcType=TIMESTAMP},
#{checkFilters,jdbcType=LONGVARCHAR}, #{referFilters,jdbcType=LONGVARCHAR})
<selectKey
resultType=
"java.lang.Integer"
keyProperty=
"id"
order=
"AFTER"
>
SELECT LAST_INSERT_ID()
</selectKey>
insert into tbl_rule_info_duplex (check_type, check_db_name, check_tb_name,
check_col_name, refer_db_name, refer_tb_name,
refer_col_name, is_valid, check_time,
comment, create_time, check_filters,
refer_filters)
values (#{checkType,jdbcType=VARCHAR}, #{checkDbName,jdbcType=VARCHAR}, #{checkTbName,jdbcType=VARCHAR},
#{checkColName,jdbcType=VARCHAR}, #{referDbName,jdbcType=VARCHAR}, #{referTbName,jdbcType=VARCHAR},
#{referColName,jdbcType=VARCHAR}, #{isValid,jdbcType=INTEGER}, #{checkTime,jdbcType=VARCHAR},
#{comment,jdbcType=VARCHAR}, #{createTime,jdbcType=TIMESTAMP}, #{checkFilters,jdbcType=LONGVARCHAR},
#{referFilters,jdbcType=LONGVARCHAR})
</insert>
<insert
id=
"insertSelective"
parameterType=
"com.gmei.data.dqmp.domain.TblRuleInfoDuplexWithBLOBs"
>
<selectKey
resultType=
"java.lang.Integer"
keyProperty=
"id"
order=
"AFTER"
>
SELECT LAST_INSERT_ID()
</selectKey>
insert into tbl_rule_info_duplex
<trim
prefix=
"("
suffix=
")"
suffixOverrides=
","
>
<if
test=
"id != null"
>
id,
</if>
<if
test=
"checkType != null"
>
check_type,
</if>
...
...
@@ -191,9 +194,6 @@
</if>
</trim>
<trim
prefix=
"values ("
suffix=
")"
suffixOverrides=
","
>
<if
test=
"id != null"
>
#{id,jdbcType=INTEGER},
</if>
<if
test=
"checkType != null"
>
#{checkType,jdbcType=VARCHAR},
</if>
...
...
src/main/resources/mybatis/mapper/TblRuleInfoSimpleMapper.xml
View file @
63f84a83
...
...
@@ -132,23 +132,26 @@
</if>
</delete>
<insert
id=
"insert"
parameterType=
"com.gmei.data.dqmp.domain.TblRuleInfoSimple"
>
insert into tbl_rule_info_simple (id, check_type, db_name,
tb_name, col_name, time_col_name,
indicator_type, start_time, is_valid,
check_time, comment, create_time,
filters)
values (#{id,jdbcType=INTEGER}, #{checkType,jdbcType=VARCHAR}, #{dbName,jdbcType=VARCHAR},
#{tbName,jdbcType=VARCHAR}, #{colName,jdbcType=VARCHAR}, #{timeColName,jdbcType=VARCHAR},
#{indicatorType,jdbcType=VARCHAR}, #{startTime,jdbcType=VARCHAR}, #{isValid,jdbcType=INTEGER},
#{checkTime,jdbcType=VARCHAR}, #{comment,jdbcType=VARCHAR}, #{createTime,jdbcType=TIMESTAMP},
#{filters,jdbcType=LONGVARCHAR})
<selectKey
resultType=
"java.lang.Integer"
keyProperty=
"id"
order=
"AFTER"
>
SELECT LAST_INSERT_ID()
</selectKey>
insert into tbl_rule_info_simple (check_type, db_name, tb_name,
col_name, time_col_name, indicator_type,
start_time, is_valid, check_time,
comment, create_time, filters
)
values (#{checkType,jdbcType=VARCHAR}, #{dbName,jdbcType=VARCHAR}, #{tbName,jdbcType=VARCHAR},
#{colName,jdbcType=VARCHAR}, #{timeColName,jdbcType=VARCHAR}, #{indicatorType,jdbcType=VARCHAR},
#{startTime,jdbcType=VARCHAR}, #{isValid,jdbcType=INTEGER}, #{checkTime,jdbcType=VARCHAR},
#{comment,jdbcType=VARCHAR}, #{createTime,jdbcType=TIMESTAMP}, #{filters,jdbcType=LONGVARCHAR}
)
</insert>
<insert
id=
"insertSelective"
parameterType=
"com.gmei.data.dqmp.domain.TblRuleInfoSimple"
>
<selectKey
resultType=
"java.lang.Integer"
keyProperty=
"id"
order=
"AFTER"
>
SELECT LAST_INSERT_ID()
</selectKey>
insert into tbl_rule_info_simple
<trim
prefix=
"("
suffix=
")"
suffixOverrides=
","
>
<if
test=
"id != null"
>
id,
</if>
<if
test=
"checkType != null"
>
check_type,
</if>
...
...
@@ -187,9 +190,6 @@
</if>
</trim>
<trim
prefix=
"values ("
suffix=
")"
suffixOverrides=
","
>
<if
test=
"id != null"
>
#{id,jdbcType=INTEGER},
</if>
<if
test=
"checkType != null"
>
#{checkType,jdbcType=VARCHAR},
</if>
...
...
src/main/resources/mybatis/mapper/TblSqlCheckDuplexMapper.xml
View file @
63f84a83
...
...
@@ -13,6 +13,7 @@
<result
column=
"is_valid"
property=
"isValid"
jdbcType=
"INTEGER"
/>
<result
column=
"check_time"
property=
"checkTime"
jdbcType=
"VARCHAR"
/>
<result
column=
"comment"
property=
"comment"
jdbcType=
"VARCHAR"
/>
<result
column=
"parent_id"
property=
"parentId"
jdbcType=
"INTEGER"
/>
<result
column=
"create_time"
property=
"createTime"
jdbcType=
"TIMESTAMP"
/>
</resultMap>
<resultMap
id=
"ResultMapWithBLOBs"
type=
"com.gmei.data.dqmp.domain.TblSqlCheckDuplex"
extends=
"BaseResultMap"
>
...
...
@@ -78,7 +79,7 @@
</sql>
<sql
id=
"Base_Column_List"
>
id, check_type, check_db_name, check_tb_name, check_col_name, refer_db_name, refer_tb_name,
refer_col_name, is_valid, check_time, comment, create_time
refer_col_name, is_valid, check_time, comment,
parent_id,
create_time
</sql>
<sql
id=
"Blob_Column_List"
>
sql_content
...
...
@@ -135,13 +136,13 @@
insert into tbl_sql_check_duplex (id, check_type, check_db_name,
check_tb_name, check_col_name, refer_db_name,
refer_tb_name, refer_col_name, is_valid,
check_time, comment,
create_time
,
sql_content)
check_time, comment,
parent_id
,
create_time,
sql_content)
values (#{id,jdbcType=INTEGER}, #{checkType,jdbcType=VARCHAR}, #{checkDbName,jdbcType=VARCHAR},
#{checkTbName,jdbcType=VARCHAR}, #{checkColName,jdbcType=VARCHAR}, #{referDbName,jdbcType=VARCHAR},
#{referTbName,jdbcType=VARCHAR}, #{referColName,jdbcType=VARCHAR}, #{isValid,jdbcType=INTEGER},
#{checkTime,jdbcType=VARCHAR}, #{comment,jdbcType=VARCHAR}, #{
createTime,jdbcType=TIMESTAMP
},
#{sqlContent,jdbcType=LONGVARCHAR})
#{checkTime,jdbcType=VARCHAR}, #{comment,jdbcType=VARCHAR}, #{
parentId,jdbcType=INTEGER
},
#{
createTime,jdbcType=TIMESTAMP}, #{
sqlContent,jdbcType=LONGVARCHAR})
</insert>
<insert
id=
"insertSelective"
parameterType=
"com.gmei.data.dqmp.domain.TblSqlCheckDuplex"
>
insert into tbl_sql_check_duplex
...
...
@@ -179,6 +180,9 @@
<if
test=
"comment != null"
>
comment,
</if>
<if
test=
"parentId != null"
>
parent_id,
</if>
<if
test=
"createTime != null"
>
create_time,
</if>
...
...
@@ -220,6 +224,9 @@
<if
test=
"comment != null"
>
#{comment,jdbcType=VARCHAR},
</if>
<if
test=
"parentId != null"
>
#{parentId,jdbcType=INTEGER},
</if>
<if
test=
"createTime != null"
>
#{createTime,jdbcType=TIMESTAMP},
</if>
...
...
@@ -270,6 +277,9 @@
<if
test=
"record.comment != null"
>
comment = #{record.comment,jdbcType=VARCHAR},
</if>
<if
test=
"record.parentId != null"
>
parent_id = #{record.parentId,jdbcType=INTEGER},
</if>
<if
test=
"record.createTime != null"
>
create_time = #{record.createTime,jdbcType=TIMESTAMP},
</if>
...
...
@@ -294,6 +304,7 @@
is_valid = #{record.isValid,jdbcType=INTEGER},
check_time = #{record.checkTime,jdbcType=VARCHAR},
comment = #{record.comment,jdbcType=VARCHAR},
parent_id = #{record.parentId,jdbcType=INTEGER},
create_time = #{record.createTime,jdbcType=TIMESTAMP},
sql_content = #{record.sqlContent,jdbcType=LONGVARCHAR}
<if
test=
"_parameter != null"
>
...
...
@@ -313,6 +324,7 @@
is_valid = #{record.isValid,jdbcType=INTEGER},
check_time = #{record.checkTime,jdbcType=VARCHAR},
comment = #{record.comment,jdbcType=VARCHAR},
parent_id = #{record.parentId,jdbcType=INTEGER},
create_time = #{record.createTime,jdbcType=TIMESTAMP}
<if
test=
"_parameter != null"
>
<include
refid=
"Update_By_Example_Where_Clause"
/>
...
...
@@ -351,6 +363,9 @@
<if
test=
"comment != null"
>
comment = #{comment,jdbcType=VARCHAR},
</if>
<if
test=
"parentId != null"
>
parent_id = #{parentId,jdbcType=INTEGER},
</if>
<if
test=
"createTime != null"
>
create_time = #{createTime,jdbcType=TIMESTAMP},
</if>
...
...
@@ -372,6 +387,7 @@
is_valid = #{isValid,jdbcType=INTEGER},
check_time = #{checkTime,jdbcType=VARCHAR},
comment = #{comment,jdbcType=VARCHAR},
parent_id = #{parentId,jdbcType=INTEGER},
create_time = #{createTime,jdbcType=TIMESTAMP},
sql_content = #{sqlContent,jdbcType=LONGVARCHAR}
where id = #{id,jdbcType=INTEGER}
...
...
@@ -388,6 +404,7 @@
is_valid = #{isValid,jdbcType=INTEGER},
check_time = #{checkTime,jdbcType=VARCHAR},
comment = #{comment,jdbcType=VARCHAR},
parent_id = #{parentId,jdbcType=INTEGER},
create_time = #{createTime,jdbcType=TIMESTAMP}
where id = #{id,jdbcType=INTEGER}
</update>
...
...
src/main/resources/mybatis/mapper/TblSqlCheckSingleMapper.xml
View file @
63f84a83
...
...
@@ -10,6 +10,7 @@
<result
column=
"is_valid"
property=
"isValid"
jdbcType=
"INTEGER"
/>
<result
column=
"check_time"
property=
"checkTime"
jdbcType=
"VARCHAR"
/>
<result
column=
"comment"
property=
"comment"
jdbcType=
"VARCHAR"
/>
<result
column=
"parent_id"
property=
"parentId"
jdbcType=
"INTEGER"
/>
<result
column=
"create_time"
property=
"createTime"
jdbcType=
"TIMESTAMP"
/>
</resultMap>
<resultMap
id=
"ResultMapWithBLOBs"
type=
"com.gmei.data.dqmp.domain.TblSqlCheckSingle"
extends=
"BaseResultMap"
>
...
...
@@ -74,7 +75,8 @@
</where>
</sql>
<sql
id=
"Base_Column_List"
>
id, check_type, db_name, tb_name, col_name, is_valid, check_time, comment, create_time
id, check_type, db_name, tb_name, col_name, is_valid, check_time, comment, parent_id,
create_time
</sql>
<sql
id=
"Blob_Column_List"
>
sql_content
...
...
@@ -130,12 +132,12 @@
<insert
id=
"insert"
parameterType=
"com.gmei.data.dqmp.domain.TblSqlCheckSingle"
>
insert into tbl_sql_check_single (id, check_type, db_name,
tb_name, col_name, is_valid,
check_time, comment,
create_time
,
sql_content)
check_time, comment,
parent_id
,
create_time,
sql_content)
values (#{id,jdbcType=INTEGER}, #{checkType,jdbcType=VARCHAR}, #{dbName,jdbcType=VARCHAR},
#{tbName,jdbcType=VARCHAR}, #{colName,jdbcType=VARCHAR}, #{isValid,jdbcType=INTEGER},
#{checkTime,jdbcType=VARCHAR}, #{comment,jdbcType=VARCHAR}, #{
createTime,jdbcType=TIMESTAMP
},
#{sqlContent,jdbcType=LONGVARCHAR})
#{checkTime,jdbcType=VARCHAR}, #{comment,jdbcType=VARCHAR}, #{
parentId,jdbcType=INTEGER
},
#{
createTime,jdbcType=TIMESTAMP}, #{
sqlContent,jdbcType=LONGVARCHAR})
</insert>
<insert
id=
"insertSelective"
parameterType=
"com.gmei.data.dqmp.domain.TblSqlCheckSingle"
>
insert into tbl_sql_check_single
...
...
@@ -164,6 +166,9 @@
<if
test=
"comment != null"
>
comment,
</if>
<if
test=
"parentId != null"
>
parent_id,
</if>
<if
test=
"createTime != null"
>
create_time,
</if>
...
...
@@ -196,6 +201,9 @@
<if
test=
"comment != null"
>
#{comment,jdbcType=VARCHAR},
</if>
<if
test=
"parentId != null"
>
#{parentId,jdbcType=INTEGER},
</if>
<if
test=
"createTime != null"
>
#{createTime,jdbcType=TIMESTAMP},
</if>
...
...
@@ -237,6 +245,9 @@
<if
test=
"record.comment != null"
>
comment = #{record.comment,jdbcType=VARCHAR},
</if>
<if
test=
"record.parentId != null"
>
parent_id = #{record.parentId,jdbcType=INTEGER},
</if>
<if
test=
"record.createTime != null"
>
create_time = #{record.createTime,jdbcType=TIMESTAMP},
</if>
...
...
@@ -258,6 +269,7 @@
is_valid = #{record.isValid,jdbcType=INTEGER},
check_time = #{record.checkTime,jdbcType=VARCHAR},
comment = #{record.comment,jdbcType=VARCHAR},
parent_id = #{record.parentId,jdbcType=INTEGER},
create_time = #{record.createTime,jdbcType=TIMESTAMP},
sql_content = #{record.sqlContent,jdbcType=LONGVARCHAR}
<if
test=
"_parameter != null"
>
...
...
@@ -274,6 +286,7 @@
is_valid = #{record.isValid,jdbcType=INTEGER},
check_time = #{record.checkTime,jdbcType=VARCHAR},
comment = #{record.comment,jdbcType=VARCHAR},
parent_id = #{record.parentId,jdbcType=INTEGER},
create_time = #{record.createTime,jdbcType=TIMESTAMP}
<if
test=
"_parameter != null"
>
<include
refid=
"Update_By_Example_Where_Clause"
/>
...
...
@@ -303,6 +316,9 @@
<if
test=
"comment != null"
>
comment = #{comment,jdbcType=VARCHAR},
</if>
<if
test=
"parentId != null"
>
parent_id = #{parentId,jdbcType=INTEGER},
</if>
<if
test=
"createTime != null"
>
create_time = #{createTime,jdbcType=TIMESTAMP},
</if>
...
...
@@ -321,6 +337,7 @@
is_valid = #{isValid,jdbcType=INTEGER},
check_time = #{checkTime,jdbcType=VARCHAR},
comment = #{comment,jdbcType=VARCHAR},
parent_id = #{parentId,jdbcType=INTEGER},
create_time = #{createTime,jdbcType=TIMESTAMP},
sql_content = #{sqlContent,jdbcType=LONGVARCHAR}
where id = #{id,jdbcType=INTEGER}
...
...
@@ -334,6 +351,7 @@
is_valid = #{isValid,jdbcType=INTEGER},
check_time = #{checkTime,jdbcType=VARCHAR},
comment = #{comment,jdbcType=VARCHAR},
parent_id = #{parentId,jdbcType=INTEGER},
create_time = #{createTime,jdbcType=TIMESTAMP}
where id = #{id,jdbcType=INTEGER}
</update>
...
...
src/main/resources/mybatis/mapper/TblSqlMonitorSpecialMapper.xml
View file @
63f84a83
...
...
@@ -12,6 +12,7 @@
<result
column=
"is_valid"
property=
"isValid"
jdbcType=
"INTEGER"
/>
<result
column=
"check_time"
property=
"checkTime"
jdbcType=
"VARCHAR"
/>
<result
column=
"comment"
property=
"comment"
jdbcType=
"VARCHAR"
/>
<result
column=
"parent_id"
property=
"parentId"
jdbcType=
"INTEGER"
/>
<result
column=
"create_time"
property=
"createTime"
jdbcType=
"TIMESTAMP"
/>
</resultMap>
<resultMap
id=
"ResultMapWithBLOBs"
type=
"com.gmei.data.dqmp.domain.TblSqlMonitorSpecial"
extends=
"BaseResultMap"
>
...
...
@@ -77,7 +78,7 @@
</sql>
<sql
id=
"Base_Column_List"
>
id, db_name, tb_name, col_name, time_col_name, indicator_type, start_time, is_valid,
check_time, comment, create_time
check_time, comment,
parent_id,
create_time
</sql>
<sql
id=
"Blob_Column_List"
>
sql_content
...
...
@@ -134,13 +135,13 @@
insert into tbl_sql_monitor_special (id, db_name, tb_name,
col_name, time_col_name, indicator_type,
start_time, is_valid, check_time,
comment,
create_time, sql_content
)
comment,
parent_id, create_time,
sql_content
)
values (#{id,jdbcType=INTEGER}, #{dbName,jdbcType=VARCHAR}, #{tbName,jdbcType=VARCHAR},
#{colName,jdbcType=VARCHAR}, #{timeColName,jdbcType=VARCHAR}, #{indicatorType,jdbcType=VARCHAR},
#{startTime,jdbcType=VARCHAR}, #{isValid,jdbcType=INTEGER}, #{checkTime,jdbcType=VARCHAR},
#{comment,jdbcType=VARCHAR}, #{
createTime,jdbcType=TIMESTAMP}, #{sqlContent,jdbcType=LONGVARCHAR}
)
#{comment,jdbcType=VARCHAR}, #{
parentId,jdbcType=INTEGER}, #{createTime,jdbcType=TIMESTAMP},
#{sqlContent,jdbcType=LONGVARCHAR}
)
</insert>
<insert
id=
"insertSelective"
parameterType=
"com.gmei.data.dqmp.domain.TblSqlMonitorSpecial"
>
insert into tbl_sql_monitor_special
...
...
@@ -175,6 +176,9 @@
<if
test=
"comment != null"
>
comment,
</if>
<if
test=
"parentId != null"
>
parent_id,
</if>
<if
test=
"createTime != null"
>
create_time,
</if>
...
...
@@ -213,6 +217,9 @@
<if
test=
"comment != null"
>
#{comment,jdbcType=VARCHAR},
</if>
<if
test=
"parentId != null"
>
#{parentId,jdbcType=INTEGER},
</if>
<if
test=
"createTime != null"
>
#{createTime,jdbcType=TIMESTAMP},
</if>
...
...
@@ -260,6 +267,9 @@
<if
test=
"record.comment != null"
>
comment = #{record.comment,jdbcType=VARCHAR},
</if>
<if
test=
"record.parentId != null"
>
parent_id = #{record.parentId,jdbcType=INTEGER},
</if>
<if
test=
"record.createTime != null"
>
create_time = #{record.createTime,jdbcType=TIMESTAMP},
</if>
...
...
@@ -283,6 +293,7 @@
is_valid = #{record.isValid,jdbcType=INTEGER},
check_time = #{record.checkTime,jdbcType=VARCHAR},
comment = #{record.comment,jdbcType=VARCHAR},
parent_id = #{record.parentId,jdbcType=INTEGER},
create_time = #{record.createTime,jdbcType=TIMESTAMP},
sql_content = #{record.sqlContent,jdbcType=LONGVARCHAR}
<if
test=
"_parameter != null"
>
...
...
@@ -301,6 +312,7 @@
is_valid = #{record.isValid,jdbcType=INTEGER},
check_time = #{record.checkTime,jdbcType=VARCHAR},
comment = #{record.comment,jdbcType=VARCHAR},
parent_id = #{record.parentId,jdbcType=INTEGER},
create_time = #{record.createTime,jdbcType=TIMESTAMP}
<if
test=
"_parameter != null"
>
<include
refid=
"Update_By_Example_Where_Clause"
/>
...
...
@@ -336,6 +348,9 @@
<if
test=
"comment != null"
>
comment = #{comment,jdbcType=VARCHAR},
</if>
<if
test=
"parentId != null"
>
parent_id = #{parentId,jdbcType=INTEGER},
</if>
<if
test=
"createTime != null"
>
create_time = #{createTime,jdbcType=TIMESTAMP},
</if>
...
...
@@ -356,6 +371,7 @@
is_valid = #{isValid,jdbcType=INTEGER},
check_time = #{checkTime,jdbcType=VARCHAR},
comment = #{comment,jdbcType=VARCHAR},
parent_id = #{parentId,jdbcType=INTEGER},
create_time = #{createTime,jdbcType=TIMESTAMP},
sql_content = #{sqlContent,jdbcType=LONGVARCHAR}
where id = #{id,jdbcType=INTEGER}
...
...
@@ -371,6 +387,7 @@
is_valid = #{isValid,jdbcType=INTEGER},
check_time = #{checkTime,jdbcType=VARCHAR},
comment = #{comment,jdbcType=VARCHAR},
parent_id = #{parentId,jdbcType=INTEGER},
create_time = #{createTime,jdbcType=TIMESTAMP}
where id = #{id,jdbcType=INTEGER}
</update>
...
...
src/main/resources/mybatis/mapper/TblSqlMonitorVolatilityMapper.xml
View file @
63f84a83
...
...
@@ -10,6 +10,7 @@
<result
column=
"is_valid"
property=
"isValid"
jdbcType=
"INTEGER"
/>
<result
column=
"check_time"
property=
"checkTime"
jdbcType=
"VARCHAR"
/>
<result
column=
"comment"
property=
"comment"
jdbcType=
"VARCHAR"
/>
<result
column=
"parent_id"
property=
"parentId"
jdbcType=
"INTEGER"
/>
<result
column=
"create_time"
property=
"createTime"
jdbcType=
"TIMESTAMP"
/>
</resultMap>
<resultMap
id=
"ResultMapWithBLOBs"
type=
"com.gmei.data.dqmp.domain.TblSqlMonitorVolatility"
extends=
"BaseResultMap"
>
...
...
@@ -74,7 +75,8 @@
</where>
</sql>
<sql
id=
"Base_Column_List"
>
id, db_name, tb_name, col_name, indicator_type, is_valid, check_time, comment, create_time
id, db_name, tb_name, col_name, indicator_type, is_valid, check_time, comment, parent_id,
create_time
</sql>
<sql
id=
"Blob_Column_List"
>
sql_content
...
...
@@ -130,12 +132,12 @@
<insert
id=
"insert"
parameterType=
"com.gmei.data.dqmp.domain.TblSqlMonitorVolatility"
>
insert into tbl_sql_monitor_volatility (id, db_name, tb_name,
col_name, indicator_type, is_valid,
check_time, comment,
create_time
,
sql_content)
check_time, comment,
parent_id
,
create_time,
sql_content)
values (#{id,jdbcType=INTEGER}, #{dbName,jdbcType=VARCHAR}, #{tbName,jdbcType=VARCHAR},
#{colName,jdbcType=VARCHAR}, #{indicatorType,jdbcType=VARCHAR}, #{isValid,jdbcType=INTEGER},
#{checkTime,jdbcType=VARCHAR}, #{comment,jdbcType=VARCHAR}, #{
createTime,jdbcType=TIMESTAMP
},
#{sqlContent,jdbcType=LONGVARCHAR})
#{checkTime,jdbcType=VARCHAR}, #{comment,jdbcType=VARCHAR}, #{
parentId,jdbcType=INTEGER
},
#{
createTime,jdbcType=TIMESTAMP}, #{
sqlContent,jdbcType=LONGVARCHAR})
</insert>
<insert
id=
"insertSelective"
parameterType=
"com.gmei.data.dqmp.domain.TblSqlMonitorVolatility"
>
insert into tbl_sql_monitor_volatility
...
...
@@ -164,6 +166,9 @@
<if
test=
"comment != null"
>
comment,
</if>
<if
test=
"parentId != null"
>
parent_id,
</if>
<if
test=
"createTime != null"
>
create_time,
</if>
...
...
@@ -196,6 +201,9 @@
<if
test=
"comment != null"
>
#{comment,jdbcType=VARCHAR},
</if>
<if
test=
"parentId != null"
>
#{parentId,jdbcType=INTEGER},
</if>
<if
test=
"createTime != null"
>
#{createTime,jdbcType=TIMESTAMP},
</if>
...
...
@@ -237,6 +245,9 @@
<if
test=
"record.comment != null"
>
comment = #{record.comment,jdbcType=VARCHAR},
</if>
<if
test=
"record.parentId != null"
>
parent_id = #{record.parentId,jdbcType=INTEGER},
</if>
<if
test=
"record.createTime != null"
>
create_time = #{record.createTime,jdbcType=TIMESTAMP},
</if>
...
...
@@ -258,6 +269,7 @@
is_valid = #{record.isValid,jdbcType=INTEGER},
check_time = #{record.checkTime,jdbcType=VARCHAR},
comment = #{record.comment,jdbcType=VARCHAR},
parent_id = #{record.parentId,jdbcType=INTEGER},
create_time = #{record.createTime,jdbcType=TIMESTAMP},
sql_content = #{record.sqlContent,jdbcType=LONGVARCHAR}
<if
test=
"_parameter != null"
>
...
...
@@ -274,6 +286,7 @@
is_valid = #{record.isValid,jdbcType=INTEGER},
check_time = #{record.checkTime,jdbcType=VARCHAR},
comment = #{record.comment,jdbcType=VARCHAR},
parent_id = #{record.parentId,jdbcType=INTEGER},
create_time = #{record.createTime,jdbcType=TIMESTAMP}
<if
test=
"_parameter != null"
>
<include
refid=
"Update_By_Example_Where_Clause"
/>
...
...
@@ -303,6 +316,9 @@
<if
test=
"comment != null"
>
comment = #{comment,jdbcType=VARCHAR},
</if>
<if
test=
"parentId != null"
>
parent_id = #{parentId,jdbcType=INTEGER},
</if>
<if
test=
"createTime != null"
>
create_time = #{createTime,jdbcType=TIMESTAMP},
</if>
...
...
@@ -321,6 +337,7 @@
is_valid = #{isValid,jdbcType=INTEGER},
check_time = #{checkTime,jdbcType=VARCHAR},
comment = #{comment,jdbcType=VARCHAR},
parent_id = #{parentId,jdbcType=INTEGER},
create_time = #{createTime,jdbcType=TIMESTAMP},
sql_content = #{sqlContent,jdbcType=LONGVARCHAR}
where id = #{id,jdbcType=INTEGER}
...
...
@@ -334,6 +351,7 @@
is_valid = #{isValid,jdbcType=INTEGER},
check_time = #{checkTime,jdbcType=VARCHAR},
comment = #{comment,jdbcType=VARCHAR},
parent_id = #{parentId,jdbcType=INTEGER},
create_time = #{createTime,jdbcType=TIMESTAMP}
where id = #{id,jdbcType=INTEGER}
</update>
...
...
src/main/resources/templates/index.html
0 → 100644
View file @
63f84a83
<!DOCTYPE html>
<html
xmlns:th=
"http://www.thymeleaf.org"
>
<head>
<title>
WT
</title>
</head>
<style
type=
"text/css"
>
.table
{
width
:
100%
;
margin
:
auto
;
}
.tableCenter
{
text-align
:
center
;
}
</style>
<body>
<div
style=
"text-align: center"
>
<h1>
数据质量管理平台
</h1>
<hr></hr>
<h2>
数据质量规则导入
</h2>
<form
action=
"/excel/importUnique"
method=
"post"
enctype=
"multipart/form-data"
>
<input
type=
"file"
name=
"file"
></input>
<button
type=
"submit"
>
唯一性质量规则上传
</button>
</form>
<form
action=
"/excel/importUnblank"
method=
"post"
enctype=
"multipart/form-data"
>
<input
type=
"file"
name=
"file"
></input>
<button
type=
"submit"
>
非空性质量规则上传
</button>
</form>
<form
action=
"/excel/importRefer"
method=
"post"
enctype=
"multipart/form-data"
>
<input
type=
"file"
name=
"file"
></input>
<button
type=
"submit"
>
参照性质量规则上传
</button>
</form>
<form
action=
"/excel/importVolatility"
method=
"post"
enctype=
"multipart/form-data"
>
<input
type=
"file"
name=
"file"
></input>
<button
type=
"submit"
>
波动性质量规则上传
</button>
</form>
<form
action=
"/excel/importSpecial"
method=
"post"
enctype=
"multipart/form-data"
>
<input
type=
"file"
name=
"file"
></input>
<button
type=
"submit"
>
特殊性质量规则上传
</button>
</form>
<hr></hr>
<h2>
数据质量规则列表查询
</h2>
<h3>
唯一性校验规则列表
</h3>
<div
class=
"tableCenter"
>
<table
class=
"table"
style=
"table-layout: fixed;"
>
<tr>
<th>
序号
</th>
<th>
数据库名
</th>
<th>
数据表名
</th>
<th>
数据列名
</th>
<th>
过滤条件
</th>
<th>
当前状态
</th>
<th>
校验时间
</th>
<th>
备注
</th>
<th>
操作
</th>
</tr>
<tr
th:each=
"dqRule,dqRuleStat : ${uniqueList}"
>
<!-- <th th:text="${dqRuleStat.index}"></th> -->
<th
th:text=
"${dqRule.id}"
></th>
<td
th:text=
"${dqRule.dbName}"
></td>
<td
th:text=
"${dqRule.tbName}"
></td>
<th
th:text=
"${dqRule.colName}"
></th>
<th
th:text=
"${dqRule.filters}"
></th>
<th
th:text=
"${dqRule.status}"
></th>
<th
th:text=
"${dqRule.checkTime}"
></th>
<th
th:text=
"${dqRule.comment}"
></th>
<td><a
th:href=
"@{/dqRule/del(id=${dqRule.id},checkType=${dqRule.checkType})}"
>
删除
</a></td>
</tr>
</table>
</div>
<h3>
非空性校验规则列表
</h3>
<div
class=
"tableCenter"
>
<table
class=
"table"
style=
"table-layout: fixed;"
>
<tr>
<th>
序号
</th>
<th>
数据库名
</th>
<th>
数据表名
</th>
<th>
数据列名
</th>
<th>
过滤条件
</th>
<th>
当前状态
</th>
<th>
校验时间
</th>
<th>
备注
</th>
<th>
操作
</th>
</tr>
<tr
th:each=
"dqRule,dqRuleStat : ${unblankList}"
>
<!-- <th th:text="${dqRuleStat.index}"></th> -->
<th
th:text=
"${dqRule.id}"
></th>
<td
th:text=
"${dqRule.dbName}"
></td>
<td
th:text=
"${dqRule.tbName}"
></td>
<th
th:text=
"${dqRule.colName}"
></th>
<th
th:text=
"${dqRule.filters}"
></th>
<th
th:text=
"${dqRule.status}"
></th>
<th
th:text=
"${dqRule.checkTime}"
></th>
<th
th:text=
"${dqRule.comment}"
></th>
<td><a
th:href=
"@{/dqRule/del(id=${dqRule.id},checkType=${dqRule.checkType})}"
>
删除
</a></td>
</tr>
</table>
</div>
<h3>
参照性校验规则列表
</h3>
<div
class=
"tableCenter"
>
<table
class=
"table"
style=
"table-layout: fixed;"
>
<tr>
<th>
序号
</th>
<th>
校验数据库名
</th>
<th>
校验数据表名
</th>
<th>
校验数据列名
</th>
<th>
校验过滤条件
</th>
<th>
参照数据库名
</th>
<th>
参照数据表名
</th>
<th>
参照数据列名
</th>
<th>
参照过滤条件
</th>
<th>
当前状态
</th>
<th>
校验时间
</th>
<th>
备注
</th>
<th>
操作
</th>
</tr>
<tr
th:each=
"dqRule,dqRuleStat : ${referList}"
>
<!-- <th th:text="${dqRuleStat.index}"></th> -->
<th
th:text=
"${dqRule.id}"
></th>
<td
th:text=
"${dqRule.checkDbName}"
></td>
<td
th:text=
"${dqRule.checkTbName}"
></td>
<th
th:text=
"${dqRule.checkColName}"
></th>
<th
th:text=
"${dqRule.checkFilters}"
></th>
<td
th:text=
"${dqRule.referDbName}"
></td>
<td
th:text=
"${dqRule.referTbName}"
></td>
<th
th:text=
"${dqRule.referColName}"
></th>
<th
th:text=
"${dqRule.referFilters}"
></th>
<th
th:text=
"${dqRule.status}"
></th>
<th
th:text=
"${dqRule.checkTime}"
></th>
<th
th:text=
"${dqRule.comment}"
></th>
<td><a
th:href=
"@{/dqRule/del(id=${dqRule.id},checkType=${dqRule.checkType})}"
>
删除
</a></td>
</tr>
</table>
</div>
<h3>
波动性校验规则列表
</h3>
<div
class=
"tableCenter"
>
<table
class=
"table"
style=
"table-layout: fixed;"
>
<tr>
<th>
序号
</th>
<th>
数据库名
</th>
<th>
数据表名
</th>
<th>
数据列名
</th>
<th>
指标类型
</th>
<th>
过滤条件
</th>
<th>
当前状态
</th>
<th>
校验时间
</th>
<th>
备注
</th>
<th>
操作
</th>
</tr>
<tr
th:each=
"dqRule,dqRuleStat : ${volatilityList}"
>
<!-- <th th:text="${dqRuleStat.index}"></th> -->
<th
th:text=
"${dqRule.id}"
></th>
<td
th:text=
"${dqRule.dbName}"
></td>
<td
th:text=
"${dqRule.tbName}"
></td>
<th
th:text=
"${dqRule.colName}"
></th>
<th
th:text=
"${dqRule.indicatorType}"
></th>
<th
th:text=
"${dqRule.filters}"
></th>
<th
th:text=
"${dqRule.status}"
></th>
<th
th:text=
"${dqRule.checkTime}"
></th>
<th
th:text=
"${dqRule.comment}"
></th>
<td><a
th:href=
"@{/dqRule/del(id=${dqRule.id},checkType=${dqRule.checkType})}"
>
删除
</a></td>
</tr>
</table>
</div>
<h3>
特殊性校验规则列表
</h3>
<div
class=
"tableCenter"
>
<table
class=
"table"
style=
"table-layout: fixed;"
>
<tr>
<th>
序号
</th>
<th>
数据库名
</th>
<th>
数据表名
</th>
<th>
数据列名
</th>
<th>
数据时间列名
</th>
<th>
指标类型
</th>
<th>
数据校验起始时间
</th>
<th>
过滤条件
</th>
<th>
当前状态
</th>
<th>
校验时间
</th>
<th>
备注
</th>
<th>
操作
</th>
</tr>
<tr
th:each=
"dqRule,dqRuleStat : ${specialList}"
>
<!-- <th th:text="${dqRuleStat.index}"></th> -->
<th
th:text=
"${dqRule.id}"
></th>
<td
th:text=
"${dqRule.dbName}"
></td>
<td
th:text=
"${dqRule.tbName}"
></td>
<th
th:text=
"${dqRule.colName}"
></th>
<th
th:text=
"${dqRule.timeColName}"
></th>
<th
th:text=
"${dqRule.indicatorType}"
></th>
<th
th:text=
"${dqRule.startTime}"
></th>
<th
th:text=
"${dqRule.filters}"
></th>
<th
th:text=
"${dqRule.status}"
></th>
<th
th:text=
"${dqRule.checkTime}"
></th>
<th
th:text=
"${dqRule.comment}"
></th>
<td><a
th:href=
"@{/dqRule/del(id=${dqRule.id},checkType=${dqRule.checkType})}"
>
删除
</a></td>
</tr>
</table>
</div>
<hr></hr>
</div>
</body>
</html>
src/main/resources/templates/result.html
0 → 100644
View file @
63f84a83
<!DOCTYPE html>
<html
xmlns:th=
"http://www.thymeleaf.org"
>
<head>
<meta
charset=
"UTF-8"
></meta>
<title>
运行结果
</title>
</head>
<body>
<div
style=
"text-align: center"
>
<br></br>
执行结果:
<input
type=
"text"
th:value=
"${result}"
disabled=
"true"
style=
"width: 280px;"
/></input>
<hr></hr>
<div
style=
"text-align: center"
>
<a
href=
"/"
>
返回首页
</a>
</div>
</div>
</body>
</html>
src/main/resources/templates/static/img/logo.ico
0 → 100644
View file @
63f84a83
16.6 KB
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