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
8a57f4b4
Commit
8a57f4b4
authored
Dec 18, 2019
by
赵建伟
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add rule analysis、insert、struct codes
parent
56b3294d
Show whitespace changes
Inline
Side-by-side
Showing
17 changed files
with
1432 additions
and
28 deletions
+1432
-28
pom.xml
pom.xml
+7
-2
Constants.java
src/main/java/com/gmei/data/dqmp/common/Constants.java
+15
-0
DqRuleController.java
.../java/com/gmei/data/dqmp/controller/DqRuleController.java
+42
-0
TblSysParamInfo.java
src/main/java/com/gmei/data/dqmp/domain/TblSysParamInfo.java
+54
-0
TblSysParamInfoCriteria.java
...va/com/gmei/data/dqmp/domain/TblSysParamInfoCriteria.java
+541
-0
TblSysParamInfoMapper.java
...java/com/gmei/data/dqmp/mapper/TblSysParamInfoMapper.java
+31
-0
DqScheduler.java
src/main/java/com/gmei/data/dqmp/scheduler/DqScheduler.java
+24
-24
DqRuleService.java
src/main/java/com/gmei/data/dqmp/service/DqRuleService.java
+9
-0
TblSysParamInfoService.java
...va/com/gmei/data/dqmp/service/TblSysParamInfoService.java
+9
-0
CheckServiceImpl.java
...ava/com/gmei/data/dqmp/service/impl/CheckServiceImpl.java
+7
-0
DqRuleServiceImpl.java
...va/com/gmei/data/dqmp/service/impl/DqRuleServiceImpl.java
+239
-0
MonitorServiceImpl.java
...a/com/gmei/data/dqmp/service/impl/MonitorServiceImpl.java
+3
-0
TblSysParamInfoServiceImpl.java
...ei/data/dqmp/service/impl/TblSysParamInfoServiceImpl.java
+30
-0
DateUtils.java
src/main/java/com/gmei/data/dqmp/utils/DateUtils.java
+32
-0
DqRuleVo.java
src/main/java/com/gmei/data/dqmp/vo/DqRuleVo.java
+174
-0
generator.xml
src/main/resources/generator.xml
+3
-2
TblSysParamInfoMapper.xml
src/main/resources/mybatis/mapper/TblSysParamInfoMapper.xml
+212
-0
No files found.
pom.xml
View file @
8a57f4b4
...
...
@@ -40,6 +40,10 @@
<artifactId>
spring-boot-starter-test
</artifactId>
<scope>
test
</scope>
</dependency>
<dependency>
<groupId>
org.springframework.boot
</groupId>
<artifactId>
spring-boot-starter-validation
</artifactId>
</dependency>
<!-- 集成mysql驱动 -->
<dependency>
<groupId>
mysql
</groupId>
...
...
@@ -216,7 +220,7 @@
</executions>
</plugin>
<!--集成mybatis自动生成工具 -->
<
!-- <
plugin>
<plugin>
<groupId>
org.mybatis.generator
</groupId>
<artifactId>
mybatis-generator-maven-plugin
</artifactId>
<version>
1.3.2
</version>
...
...
@@ -240,7 +244,7 @@
<version>
1.3.2
</version>
</dependency>
</dependencies>
</plugin>
-->
</plugin>
</plugins>
</build>
</project>
\ No newline at end of file
src/main/java/com/gmei/data/dqmp/common/Constants.java
View file @
8a57f4b4
...
...
@@ -26,4 +26,19 @@ public class Constants {
// 无效
public
static
final
Integer
IS_VALID_OFF
=
0
;
// ***************校验规则映射******************
// 校验规则映射
public
static
final
String
CHECK_RULE_MAPPING
=
"check_rule_mapping"
;
// ***************规则类型映射******************
// 单表规则类型
public
static
final
String
TABLE_SIMPLE
=
"simple"
;
// 双表规则类型
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";
}
src/main/java/com/gmei/data/dqmp/controller/DqRuleController.java
0 → 100644
View file @
8a57f4b4
package
com
.
gmei
.
data
.
dqmp
.
controller
;
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
=
"/dqrule"
)
public
class
DqRuleController
{
@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/domain/TblSysParamInfo.java
0 → 100644
View file @
8a57f4b4
package
com
.
gmei
.
data
.
dqmp
.
domain
;
public
class
TblSysParamInfo
{
private
Integer
id
;
private
String
paramType
;
private
String
paramKey
;
private
String
paramValue
;
private
String
comment
;
public
Integer
getId
()
{
return
id
;
}
public
void
setId
(
Integer
id
)
{
this
.
id
=
id
;
}
public
String
getParamType
()
{
return
paramType
;
}
public
void
setParamType
(
String
paramType
)
{
this
.
paramType
=
paramType
==
null
?
null
:
paramType
.
trim
();
}
public
String
getParamKey
()
{
return
paramKey
;
}
public
void
setParamKey
(
String
paramKey
)
{
this
.
paramKey
=
paramKey
==
null
?
null
:
paramKey
.
trim
();
}
public
String
getParamValue
()
{
return
paramValue
;
}
public
void
setParamValue
(
String
paramValue
)
{
this
.
paramValue
=
paramValue
==
null
?
null
:
paramValue
.
trim
();
}
public
String
getComment
()
{
return
comment
;
}
public
void
setComment
(
String
comment
)
{
this
.
comment
=
comment
==
null
?
null
:
comment
.
trim
();
}
}
\ No newline at end of file
src/main/java/com/gmei/data/dqmp/domain/TblSysParamInfoCriteria.java
0 → 100644
View file @
8a57f4b4
package
com
.
gmei
.
data
.
dqmp
.
domain
;
import
java.util.ArrayList
;
import
java.util.List
;
public
class
TblSysParamInfoCriteria
{
protected
String
orderByClause
;
protected
boolean
distinct
;
protected
List
<
Criteria
>
oredCriteria
;
public
TblSysParamInfoCriteria
()
{
oredCriteria
=
new
ArrayList
<
Criteria
>();
}
public
void
setOrderByClause
(
String
orderByClause
)
{
this
.
orderByClause
=
orderByClause
;
}
public
String
getOrderByClause
()
{
return
orderByClause
;
}
public
void
setDistinct
(
boolean
distinct
)
{
this
.
distinct
=
distinct
;
}
public
boolean
isDistinct
()
{
return
distinct
;
}
public
List
<
Criteria
>
getOredCriteria
()
{
return
oredCriteria
;
}
public
void
or
(
Criteria
criteria
)
{
oredCriteria
.
add
(
criteria
);
}
public
Criteria
or
()
{
Criteria
criteria
=
createCriteriaInternal
();
oredCriteria
.
add
(
criteria
);
return
criteria
;
}
public
Criteria
createCriteria
()
{
Criteria
criteria
=
createCriteriaInternal
();
if
(
oredCriteria
.
size
()
==
0
)
{
oredCriteria
.
add
(
criteria
);
}
return
criteria
;
}
protected
Criteria
createCriteriaInternal
()
{
Criteria
criteria
=
new
Criteria
();
return
criteria
;
}
public
void
clear
()
{
oredCriteria
.
clear
();
orderByClause
=
null
;
distinct
=
false
;
}
protected
abstract
static
class
GeneratedCriteria
{
protected
List
<
Criterion
>
criteria
;
protected
GeneratedCriteria
()
{
super
();
criteria
=
new
ArrayList
<
Criterion
>();
}
public
boolean
isValid
()
{
return
criteria
.
size
()
>
0
;
}
public
List
<
Criterion
>
getAllCriteria
()
{
return
criteria
;
}
public
List
<
Criterion
>
getCriteria
()
{
return
criteria
;
}
protected
void
addCriterion
(
String
condition
)
{
if
(
condition
==
null
)
{
throw
new
RuntimeException
(
"Value for condition cannot be null"
);
}
criteria
.
add
(
new
Criterion
(
condition
));
}
protected
void
addCriterion
(
String
condition
,
Object
value
,
String
property
)
{
if
(
value
==
null
)
{
throw
new
RuntimeException
(
"Value for "
+
property
+
" cannot be null"
);
}
criteria
.
add
(
new
Criterion
(
condition
,
value
));
}
protected
void
addCriterion
(
String
condition
,
Object
value1
,
Object
value2
,
String
property
)
{
if
(
value1
==
null
||
value2
==
null
)
{
throw
new
RuntimeException
(
"Between values for "
+
property
+
" cannot be null"
);
}
criteria
.
add
(
new
Criterion
(
condition
,
value1
,
value2
));
}
public
Criteria
andIdIsNull
()
{
addCriterion
(
"id is null"
);
return
(
Criteria
)
this
;
}
public
Criteria
andIdIsNotNull
()
{
addCriterion
(
"id is not null"
);
return
(
Criteria
)
this
;
}
public
Criteria
andIdEqualTo
(
Integer
value
)
{
addCriterion
(
"id ="
,
value
,
"id"
);
return
(
Criteria
)
this
;
}
public
Criteria
andIdNotEqualTo
(
Integer
value
)
{
addCriterion
(
"id <>"
,
value
,
"id"
);
return
(
Criteria
)
this
;
}
public
Criteria
andIdGreaterThan
(
Integer
value
)
{
addCriterion
(
"id >"
,
value
,
"id"
);
return
(
Criteria
)
this
;
}
public
Criteria
andIdGreaterThanOrEqualTo
(
Integer
value
)
{
addCriterion
(
"id >="
,
value
,
"id"
);
return
(
Criteria
)
this
;
}
public
Criteria
andIdLessThan
(
Integer
value
)
{
addCriterion
(
"id <"
,
value
,
"id"
);
return
(
Criteria
)
this
;
}
public
Criteria
andIdLessThanOrEqualTo
(
Integer
value
)
{
addCriterion
(
"id <="
,
value
,
"id"
);
return
(
Criteria
)
this
;
}
public
Criteria
andIdIn
(
List
<
Integer
>
values
)
{
addCriterion
(
"id in"
,
values
,
"id"
);
return
(
Criteria
)
this
;
}
public
Criteria
andIdNotIn
(
List
<
Integer
>
values
)
{
addCriterion
(
"id not in"
,
values
,
"id"
);
return
(
Criteria
)
this
;
}
public
Criteria
andIdBetween
(
Integer
value1
,
Integer
value2
)
{
addCriterion
(
"id between"
,
value1
,
value2
,
"id"
);
return
(
Criteria
)
this
;
}
public
Criteria
andIdNotBetween
(
Integer
value1
,
Integer
value2
)
{
addCriterion
(
"id not between"
,
value1
,
value2
,
"id"
);
return
(
Criteria
)
this
;
}
public
Criteria
andParamTypeIsNull
()
{
addCriterion
(
"param_type is null"
);
return
(
Criteria
)
this
;
}
public
Criteria
andParamTypeIsNotNull
()
{
addCriterion
(
"param_type is not null"
);
return
(
Criteria
)
this
;
}
public
Criteria
andParamTypeEqualTo
(
String
value
)
{
addCriterion
(
"param_type ="
,
value
,
"paramType"
);
return
(
Criteria
)
this
;
}
public
Criteria
andParamTypeNotEqualTo
(
String
value
)
{
addCriterion
(
"param_type <>"
,
value
,
"paramType"
);
return
(
Criteria
)
this
;
}
public
Criteria
andParamTypeGreaterThan
(
String
value
)
{
addCriterion
(
"param_type >"
,
value
,
"paramType"
);
return
(
Criteria
)
this
;
}
public
Criteria
andParamTypeGreaterThanOrEqualTo
(
String
value
)
{
addCriterion
(
"param_type >="
,
value
,
"paramType"
);
return
(
Criteria
)
this
;
}
public
Criteria
andParamTypeLessThan
(
String
value
)
{
addCriterion
(
"param_type <"
,
value
,
"paramType"
);
return
(
Criteria
)
this
;
}
public
Criteria
andParamTypeLessThanOrEqualTo
(
String
value
)
{
addCriterion
(
"param_type <="
,
value
,
"paramType"
);
return
(
Criteria
)
this
;
}
public
Criteria
andParamTypeLike
(
String
value
)
{
addCriterion
(
"param_type like"
,
value
,
"paramType"
);
return
(
Criteria
)
this
;
}
public
Criteria
andParamTypeNotLike
(
String
value
)
{
addCriterion
(
"param_type not like"
,
value
,
"paramType"
);
return
(
Criteria
)
this
;
}
public
Criteria
andParamTypeIn
(
List
<
String
>
values
)
{
addCriterion
(
"param_type in"
,
values
,
"paramType"
);
return
(
Criteria
)
this
;
}
public
Criteria
andParamTypeNotIn
(
List
<
String
>
values
)
{
addCriterion
(
"param_type not in"
,
values
,
"paramType"
);
return
(
Criteria
)
this
;
}
public
Criteria
andParamTypeBetween
(
String
value1
,
String
value2
)
{
addCriterion
(
"param_type between"
,
value1
,
value2
,
"paramType"
);
return
(
Criteria
)
this
;
}
public
Criteria
andParamTypeNotBetween
(
String
value1
,
String
value2
)
{
addCriterion
(
"param_type not between"
,
value1
,
value2
,
"paramType"
);
return
(
Criteria
)
this
;
}
public
Criteria
andParamKeyIsNull
()
{
addCriterion
(
"param_key is null"
);
return
(
Criteria
)
this
;
}
public
Criteria
andParamKeyIsNotNull
()
{
addCriterion
(
"param_key is not null"
);
return
(
Criteria
)
this
;
}
public
Criteria
andParamKeyEqualTo
(
String
value
)
{
addCriterion
(
"param_key ="
,
value
,
"paramKey"
);
return
(
Criteria
)
this
;
}
public
Criteria
andParamKeyNotEqualTo
(
String
value
)
{
addCriterion
(
"param_key <>"
,
value
,
"paramKey"
);
return
(
Criteria
)
this
;
}
public
Criteria
andParamKeyGreaterThan
(
String
value
)
{
addCriterion
(
"param_key >"
,
value
,
"paramKey"
);
return
(
Criteria
)
this
;
}
public
Criteria
andParamKeyGreaterThanOrEqualTo
(
String
value
)
{
addCriterion
(
"param_key >="
,
value
,
"paramKey"
);
return
(
Criteria
)
this
;
}
public
Criteria
andParamKeyLessThan
(
String
value
)
{
addCriterion
(
"param_key <"
,
value
,
"paramKey"
);
return
(
Criteria
)
this
;
}
public
Criteria
andParamKeyLessThanOrEqualTo
(
String
value
)
{
addCriterion
(
"param_key <="
,
value
,
"paramKey"
);
return
(
Criteria
)
this
;
}
public
Criteria
andParamKeyLike
(
String
value
)
{
addCriterion
(
"param_key like"
,
value
,
"paramKey"
);
return
(
Criteria
)
this
;
}
public
Criteria
andParamKeyNotLike
(
String
value
)
{
addCriterion
(
"param_key not like"
,
value
,
"paramKey"
);
return
(
Criteria
)
this
;
}
public
Criteria
andParamKeyIn
(
List
<
String
>
values
)
{
addCriterion
(
"param_key in"
,
values
,
"paramKey"
);
return
(
Criteria
)
this
;
}
public
Criteria
andParamKeyNotIn
(
List
<
String
>
values
)
{
addCriterion
(
"param_key not in"
,
values
,
"paramKey"
);
return
(
Criteria
)
this
;
}
public
Criteria
andParamKeyBetween
(
String
value1
,
String
value2
)
{
addCriterion
(
"param_key between"
,
value1
,
value2
,
"paramKey"
);
return
(
Criteria
)
this
;
}
public
Criteria
andParamKeyNotBetween
(
String
value1
,
String
value2
)
{
addCriterion
(
"param_key not between"
,
value1
,
value2
,
"paramKey"
);
return
(
Criteria
)
this
;
}
public
Criteria
andParamValueIsNull
()
{
addCriterion
(
"param_value is null"
);
return
(
Criteria
)
this
;
}
public
Criteria
andParamValueIsNotNull
()
{
addCriterion
(
"param_value is not null"
);
return
(
Criteria
)
this
;
}
public
Criteria
andParamValueEqualTo
(
String
value
)
{
addCriterion
(
"param_value ="
,
value
,
"paramValue"
);
return
(
Criteria
)
this
;
}
public
Criteria
andParamValueNotEqualTo
(
String
value
)
{
addCriterion
(
"param_value <>"
,
value
,
"paramValue"
);
return
(
Criteria
)
this
;
}
public
Criteria
andParamValueGreaterThan
(
String
value
)
{
addCriterion
(
"param_value >"
,
value
,
"paramValue"
);
return
(
Criteria
)
this
;
}
public
Criteria
andParamValueGreaterThanOrEqualTo
(
String
value
)
{
addCriterion
(
"param_value >="
,
value
,
"paramValue"
);
return
(
Criteria
)
this
;
}
public
Criteria
andParamValueLessThan
(
String
value
)
{
addCriterion
(
"param_value <"
,
value
,
"paramValue"
);
return
(
Criteria
)
this
;
}
public
Criteria
andParamValueLessThanOrEqualTo
(
String
value
)
{
addCriterion
(
"param_value <="
,
value
,
"paramValue"
);
return
(
Criteria
)
this
;
}
public
Criteria
andParamValueLike
(
String
value
)
{
addCriterion
(
"param_value like"
,
value
,
"paramValue"
);
return
(
Criteria
)
this
;
}
public
Criteria
andParamValueNotLike
(
String
value
)
{
addCriterion
(
"param_value not like"
,
value
,
"paramValue"
);
return
(
Criteria
)
this
;
}
public
Criteria
andParamValueIn
(
List
<
String
>
values
)
{
addCriterion
(
"param_value in"
,
values
,
"paramValue"
);
return
(
Criteria
)
this
;
}
public
Criteria
andParamValueNotIn
(
List
<
String
>
values
)
{
addCriterion
(
"param_value not in"
,
values
,
"paramValue"
);
return
(
Criteria
)
this
;
}
public
Criteria
andParamValueBetween
(
String
value1
,
String
value2
)
{
addCriterion
(
"param_value between"
,
value1
,
value2
,
"paramValue"
);
return
(
Criteria
)
this
;
}
public
Criteria
andParamValueNotBetween
(
String
value1
,
String
value2
)
{
addCriterion
(
"param_value not between"
,
value1
,
value2
,
"paramValue"
);
return
(
Criteria
)
this
;
}
public
Criteria
andCommentIsNull
()
{
addCriterion
(
"comment is null"
);
return
(
Criteria
)
this
;
}
public
Criteria
andCommentIsNotNull
()
{
addCriterion
(
"comment is not null"
);
return
(
Criteria
)
this
;
}
public
Criteria
andCommentEqualTo
(
String
value
)
{
addCriterion
(
"comment ="
,
value
,
"comment"
);
return
(
Criteria
)
this
;
}
public
Criteria
andCommentNotEqualTo
(
String
value
)
{
addCriterion
(
"comment <>"
,
value
,
"comment"
);
return
(
Criteria
)
this
;
}
public
Criteria
andCommentGreaterThan
(
String
value
)
{
addCriterion
(
"comment >"
,
value
,
"comment"
);
return
(
Criteria
)
this
;
}
public
Criteria
andCommentGreaterThanOrEqualTo
(
String
value
)
{
addCriterion
(
"comment >="
,
value
,
"comment"
);
return
(
Criteria
)
this
;
}
public
Criteria
andCommentLessThan
(
String
value
)
{
addCriterion
(
"comment <"
,
value
,
"comment"
);
return
(
Criteria
)
this
;
}
public
Criteria
andCommentLessThanOrEqualTo
(
String
value
)
{
addCriterion
(
"comment <="
,
value
,
"comment"
);
return
(
Criteria
)
this
;
}
public
Criteria
andCommentLike
(
String
value
)
{
addCriterion
(
"comment like"
,
value
,
"comment"
);
return
(
Criteria
)
this
;
}
public
Criteria
andCommentNotLike
(
String
value
)
{
addCriterion
(
"comment not like"
,
value
,
"comment"
);
return
(
Criteria
)
this
;
}
public
Criteria
andCommentIn
(
List
<
String
>
values
)
{
addCriterion
(
"comment in"
,
values
,
"comment"
);
return
(
Criteria
)
this
;
}
public
Criteria
andCommentNotIn
(
List
<
String
>
values
)
{
addCriterion
(
"comment not in"
,
values
,
"comment"
);
return
(
Criteria
)
this
;
}
public
Criteria
andCommentBetween
(
String
value1
,
String
value2
)
{
addCriterion
(
"comment between"
,
value1
,
value2
,
"comment"
);
return
(
Criteria
)
this
;
}
public
Criteria
andCommentNotBetween
(
String
value1
,
String
value2
)
{
addCriterion
(
"comment not between"
,
value1
,
value2
,
"comment"
);
return
(
Criteria
)
this
;
}
}
public
static
class
Criteria
extends
GeneratedCriteria
{
protected
Criteria
()
{
super
();
}
}
public
static
class
Criterion
{
private
String
condition
;
private
Object
value
;
private
Object
secondValue
;
private
boolean
noValue
;
private
boolean
singleValue
;
private
boolean
betweenValue
;
private
boolean
listValue
;
private
String
typeHandler
;
public
String
getCondition
()
{
return
condition
;
}
public
Object
getValue
()
{
return
value
;
}
public
Object
getSecondValue
()
{
return
secondValue
;
}
public
boolean
isNoValue
()
{
return
noValue
;
}
public
boolean
isSingleValue
()
{
return
singleValue
;
}
public
boolean
isBetweenValue
()
{
return
betweenValue
;
}
public
boolean
isListValue
()
{
return
listValue
;
}
public
String
getTypeHandler
()
{
return
typeHandler
;
}
protected
Criterion
(
String
condition
)
{
super
();
this
.
condition
=
condition
;
this
.
typeHandler
=
null
;
this
.
noValue
=
true
;
}
protected
Criterion
(
String
condition
,
Object
value
,
String
typeHandler
)
{
super
();
this
.
condition
=
condition
;
this
.
value
=
value
;
this
.
typeHandler
=
typeHandler
;
if
(
value
instanceof
List
<?>)
{
this
.
listValue
=
true
;
}
else
{
this
.
singleValue
=
true
;
}
}
protected
Criterion
(
String
condition
,
Object
value
)
{
this
(
condition
,
value
,
null
);
}
protected
Criterion
(
String
condition
,
Object
value
,
Object
secondValue
,
String
typeHandler
)
{
super
();
this
.
condition
=
condition
;
this
.
value
=
value
;
this
.
secondValue
=
secondValue
;
this
.
typeHandler
=
typeHandler
;
this
.
betweenValue
=
true
;
}
protected
Criterion
(
String
condition
,
Object
value
,
Object
secondValue
)
{
this
(
condition
,
value
,
secondValue
,
null
);
}
}
}
\ No newline at end of file
src/main/java/com/gmei/data/dqmp/mapper/TblSysParamInfoMapper.java
0 → 100644
View file @
8a57f4b4
package
com
.
gmei
.
data
.
dqmp
.
mapper
;
import
com.gmei.data.dqmp.domain.TblSysParamInfo
;
import
com.gmei.data.dqmp.domain.TblSysParamInfoCriteria
;
import
java.util.List
;
import
org.apache.ibatis.annotations.Param
;
public
interface
TblSysParamInfoMapper
{
int
countByExample
(
TblSysParamInfoCriteria
example
);
int
deleteByExample
(
TblSysParamInfoCriteria
example
);
int
deleteByPrimaryKey
(
Integer
id
);
int
insert
(
TblSysParamInfo
record
);
int
insertSelective
(
TblSysParamInfo
record
);
List
<
TblSysParamInfo
>
selectByExample
(
TblSysParamInfoCriteria
example
);
TblSysParamInfo
selectByPrimaryKey
(
Integer
id
);
int
updateByExampleSelective
(
@Param
(
"record"
)
TblSysParamInfo
record
,
@Param
(
"example"
)
TblSysParamInfoCriteria
example
);
int
updateByExample
(
@Param
(
"record"
)
TblSysParamInfo
record
,
@Param
(
"example"
)
TblSysParamInfoCriteria
example
);
int
updateByPrimaryKeySelective
(
TblSysParamInfo
record
);
int
updateByPrimaryKey
(
TblSysParamInfo
record
);
}
\ No newline at end of file
src/main/java/com/gmei/data/dqmp/scheduler/DqScheduler.java
View file @
8a57f4b4
...
...
@@ -16,28 +16,28 @@ public class DqScheduler {
@Autowired
private
MonitorService
monitorService
;
@Scheduled
(
cron
=
"0 */100 * * * ?"
)
private
void
uniqueCheckProcess
(){
executeService
.
checkAndPersistSimpleResult
(
Constants
.
CHECK_UNIQUE
);
}
@Scheduled
(
cron
=
"10 */100 * * * ?"
)
private
void
unblankCheckProcess
(){
executeService
.
checkAndPersistSimpleResult
(
Constants
.
CHECK_UNBLANK
);
}
@Scheduled
(
cron
=
"0 */100 * * * ?"
)
private
void
referCheckProcess
(){
executeService
.
checkAndPersistMultipleResult
(
Constants
.
CHECK_REFER
);
}
@Scheduled
(
cron
=
"0 */100 * * * ?"
)
private
void
volatilityMonitorProcess
(){
monitorService
.
monitorAndPersistVolatilityResult
(
Constants
.
MONITOR_PV
);
}
@Scheduled
(
cron
=
"0 */1
* * * ?"
)
private
void
specialMonitorProcess
(){
monitorService
.
monitorAndPersistSpecialResult
();
}
//
@Scheduled(cron="0 */100 * * * ?")
//
private void uniqueCheckProcess(){
//
executeService.checkAndPersistSimpleResult(Constants.CHECK_UNIQUE);
//
}
//
//
@Scheduled(cron="10 */100 * * * ?")
//
private void unblankCheckProcess(){
//
executeService.checkAndPersistSimpleResult(Constants.CHECK_UNBLANK);
//
}
//
//
@Scheduled(cron="0 */100 * * * ?")
//
private void referCheckProcess(){
//
executeService.checkAndPersistMultipleResult(Constants.CHECK_REFER);
//
}
//
//
@Scheduled(cron="0 */100 * * * ?")
//
private void volatilityMonitorProcess(){
//
monitorService.monitorAndPersistVolatilityResult(Constants.MONITOR_PV);
//
}
//
// @Scheduled(cron="0 */100
* * * ?")
//
private void specialMonitorProcess(){
//
monitorService.monitorAndPersistSpecialResult();
//
}
}
src/main/java/com/gmei/data/dqmp/service/DqRuleService.java
0 → 100644
View file @
8a57f4b4
package
com
.
gmei
.
data
.
dqmp
.
service
;
import
com.gmei.data.dqmp.vo.DqRuleVo
;
public
interface
DqRuleService
{
Boolean
addDqRule
(
DqRuleVo
dqRuleVo
);
}
src/main/java/com/gmei/data/dqmp/service/TblSysParamInfoService.java
0 → 100644
View file @
8a57f4b4
package
com
.
gmei
.
data
.
dqmp
.
service
;
import
java.util.Map
;
public
interface
TblSysParamInfoService
{
Map
<
String
,
String
>
getSysParamMap
(
String
paramType
);
}
src/main/java/com/gmei/data/dqmp/service/impl/CheckServiceImpl.java
View file @
8a57f4b4
...
...
@@ -26,6 +26,7 @@ import com.gmei.data.dqmp.mapper.TblResultCheckUnblankMapper;
import
com.gmei.data.dqmp.mapper.TblResultCheckUniqueMapper
;
import
com.gmei.data.dqmp.pool.JdbcConnectPool
;
import
com.gmei.data.dqmp.service.CheckService
;
import
com.gmei.data.dqmp.utils.DateUtils
;
@Service
public
class
CheckServiceImpl
implements
CheckService
{
...
...
@@ -116,6 +117,7 @@ public class CheckServiceImpl implements CheckService {
* @return
*/
private
TblResultCheckUnique
getUniqueCheckResult
(
String
sql
)
{
sql
=
sql
.
replaceAll
(
"#partation_date"
,
String
.
format
(
"'%s'"
,
DateUtils
.
getYesterdayDateStr
()));
logger
.
info
(
"Sql content : {}"
,
sql
);
TblResultCheckUnique
tblResultCheckUnique
=
null
;
if
(
StringUtils
.
isBlank
(
sql
))
{
...
...
@@ -151,6 +153,7 @@ public class CheckServiceImpl implements CheckService {
* @return
*/
private
TblResultCheckUnblank
getUnblankCheckResult
(
String
sql
)
{
sql
=
sql
.
replaceAll
(
"#partation_date"
,
String
.
format
(
"'%s'"
,
DateUtils
.
getYesterdayDateStr
()));
logger
.
info
(
"Sql content : {}"
,
sql
);
TblResultCheckUnblank
tblResultCheckUnblank
=
null
;
if
(
StringUtils
.
isBlank
(
sql
))
{
...
...
@@ -186,6 +189,7 @@ public class CheckServiceImpl implements CheckService {
* @return
*/
private
TblResultCheckRefer
getReferCheckResult
(
String
sql
)
{
sql
=
sql
.
replaceAll
(
"#partation_date"
,
String
.
format
(
"'%s'"
,
DateUtils
.
getYesterdayDateStr
()));
logger
.
info
(
"Sql content : {}"
,
sql
);
TblResultCheckRefer
tblResultCheckRefer
=
null
;
if
(
StringUtils
.
isBlank
(
sql
))
{
...
...
@@ -217,4 +221,7 @@ public class CheckServiceImpl implements CheckService {
}
return
tblResultCheckRefer
;
}
public
static
void
main
(
String
[]
args
)
{
}
}
src/main/java/com/gmei/data/dqmp/service/impl/DqRuleServiceImpl.java
0 → 100644
View file @
8a57f4b4
package
com
.
gmei
.
data
.
dqmp
.
service
.
impl
;
import
java.util.HashMap
;
import
java.util.List
;
import
java.util.Map
;
import
org.apache.commons.lang3.StringUtils
;
import
org.slf4j.Logger
;
import
org.slf4j.LoggerFactory
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Service
;
import
org.springframework.transaction.annotation.Transactional
;
import
com.gmei.data.dqmp.common.Constants
;
import
com.gmei.data.dqmp.domain.TblCheckMultipleSql
;
import
com.gmei.data.dqmp.domain.TblCheckSingleSql
;
import
com.gmei.data.dqmp.domain.TblIndicatorOperatorInfo
;
import
com.gmei.data.dqmp.domain.TblIndicatorOperatorInfoCriteria
;
import
com.gmei.data.dqmp.domain.TblMonitorSpecialSql
;
import
com.gmei.data.dqmp.domain.TblMonitorVolatilitySql
;
import
com.gmei.data.dqmp.domain.TblRuleDuplexInfoWithBLOBs
;
import
com.gmei.data.dqmp.domain.TblRuleSimpleInfo
;
import
com.gmei.data.dqmp.domain.TblRuleTemplate
;
import
com.gmei.data.dqmp.domain.TblRuleTemplateCriteria
;
import
com.gmei.data.dqmp.mapper.TblCheckMultipleSqlMapper
;
import
com.gmei.data.dqmp.mapper.TblCheckSingleSqlMapper
;
import
com.gmei.data.dqmp.mapper.TblIndicatorOperatorInfoMapper
;
import
com.gmei.data.dqmp.mapper.TblMonitorSpecialSqlMapper
;
import
com.gmei.data.dqmp.mapper.TblMonitorVolatilitySqlMapper
;
import
com.gmei.data.dqmp.mapper.TblRuleDuplexInfoMapper
;
import
com.gmei.data.dqmp.mapper.TblRuleSimpleInfoMapper
;
import
com.gmei.data.dqmp.mapper.TblRuleTemplateMapper
;
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.DqRuleVo
;
@Service
public
class
DqRuleServiceImpl
implements
DqRuleService
{
@Autowired
private
TblRuleSimpleInfoMapper
tblRuleSimpleInfoMapper
;
@Autowired
private
TblRuleDuplexInfoMapper
tblRuleDuplexInfoMapper
;
@Autowired
private
TblCheckSingleSqlMapper
tblCheckSingleSqlMapper
;
@Autowired
private
TblCheckMultipleSqlMapper
tblCheckMultipleSqlMapper
;
@Autowired
private
TblMonitorVolatilitySqlMapper
tblMonitorVolatilitySqlMapper
;
@Autowired
private
TblMonitorSpecialSqlMapper
tblMonitorSpecialSqlMapper
;
@Autowired
private
TblRuleTemplateMapper
tblRuleTemplateMapper
;
@Autowired
private
TblIndicatorOperatorInfoMapper
tblIndicatorOperatorInfoMapper
;
private
static
final
Logger
logger
=
LoggerFactory
.
getLogger
(
DqRuleServiceImpl
.
class
);
@Override
@Transactional
public
Boolean
addDqRule
(
DqRuleVo
dqRuleVo
)
{
Boolean
rs
=
false
;
String
checkType
=
dqRuleVo
.
getCheckType
();
if
(
Constants
.
CHECK_UNIQUE
.
equals
(
checkType
)
||
Constants
.
CHECK_UNBLANK
.
equals
(
checkType
)
||
Constants
.
CHECK_VOLATILITY
.
equals
(
checkType
)
||
Constants
.
CHECK_SPECIAL
.
equals
(
checkType
))
{
rs
=
simpleRuleInfoInsert
(
dqRuleVo
);
}
else
if
(
Constants
.
CHECK_REFER
.
equals
(
checkType
))
{
rs
=
duplexRuleInfoInsert
(
dqRuleVo
);
}
else
{
logger
.
error
(
"checkType is illegal! {}"
,
checkType
);
return
rs
;
}
return
rs
;
}
/**
* 简单校验规则新增
* @param dqRuleVo
* @return
*/
private
Boolean
simpleRuleInfoInsert
(
DqRuleVo
dqRuleVo
)
{
if
(!
simpleRuleInfoCheck
(
dqRuleVo
))
{
logger
.
error
(
"Param is illegal! {}"
,
dqRuleVo
);
return
false
;
}
TblRuleSimpleInfo
record
=
BeanUtils
.
map
(
dqRuleVo
,
TblRuleSimpleInfo
.
class
);
int
rs
=
tblRuleSimpleInfoMapper
.
insertSelective
(
record
);
if
(
rs
==
1
)
{
String
checkType
=
dqRuleVo
.
getCheckType
();
switch
(
checkType
)
{
case
Constants
.
CHECK_UNIQUE
:
TblCheckSingleSql
tblCheckSingleSql
=
BeanUtils
.
map
(
dqRuleVo
,
TblCheckSingleSql
.
class
);
tblCheckSingleSql
.
setSqlContent
(
genSqlByTemplate
(
dqRuleVo
));
tblCheckSingleSqlMapper
.
insertSelective
(
tblCheckSingleSql
);
break
;
case
Constants
.
CHECK_UNBLANK
:
TblCheckSingleSql
tcss
=
BeanUtils
.
map
(
dqRuleVo
,
TblCheckSingleSql
.
class
);
tcss
.
setSqlContent
(
genSqlByTemplate
(
dqRuleVo
));
tblCheckSingleSqlMapper
.
insertSelective
(
tcss
);
break
;
case
Constants
.
CHECK_VOLATILITY
:
if
(!
volatilityRuleParamsCheck
(
dqRuleVo
))
{
logger
.
error
(
"Param is illegal! {}"
,
dqRuleVo
);
return
false
;
}
TblMonitorVolatilitySql
tblMonitorVolatilitySql
=
BeanUtils
.
map
(
dqRuleVo
,
TblMonitorVolatilitySql
.
class
);
tblMonitorVolatilitySql
.
setSqlContent
(
genSqlByTemplate
(
dqRuleVo
));
tblMonitorVolatilitySqlMapper
.
insertSelective
(
tblMonitorVolatilitySql
);
break
;
case
Constants
.
CHECK_SPECIAL
:
if
(!
specialRuleParamsCheck
(
dqRuleVo
))
{
logger
.
error
(
"Param is illegal! {}"
,
dqRuleVo
);
return
false
;
}
TblMonitorSpecialSql
tblMonitorSpecialSql
=
BeanUtils
.
map
(
dqRuleVo
,
TblMonitorSpecialSql
.
class
);
tblMonitorSpecialSql
.
setSqlContent
(
genSqlByTemplate
(
dqRuleVo
));
tblMonitorSpecialSqlMapper
.
insertSelective
(
tblMonitorSpecialSql
);
break
;
default
:
logger
.
error
(
"checkType value is error! {}"
,
checkType
);
return
false
;
}
}
return
true
;
}
/**
* 双表校验规则录入
* @param dqRuleVo
* @return
*/
private
Boolean
duplexRuleInfoInsert
(
DqRuleVo
dqRuleVo
)
{
if
(!
duplexRuleInfoCheck
(
dqRuleVo
))
{
logger
.
error
(
"Param is illegal! {}"
,
dqRuleVo
);
return
false
;
}
TblRuleDuplexInfoWithBLOBs
record
=
BeanUtils
.
map
(
dqRuleVo
,
TblRuleDuplexInfoWithBLOBs
.
class
);
int
rs
=
tblRuleDuplexInfoMapper
.
insertSelective
(
record
);
if
(
rs
==
1
)
{
String
checkType
=
dqRuleVo
.
getCheckType
();
if
(
Constants
.
CHECK_REFER
.
equals
(
checkType
))
{
TblCheckMultipleSql
tblCheckMultipleSql
=
BeanUtils
.
map
(
dqRuleVo
,
TblCheckMultipleSql
.
class
);
String
sqlContent
=
genSqlByTemplate
(
dqRuleVo
);
tblCheckMultipleSql
.
setSqlContent
(
sqlContent
);
tblCheckMultipleSqlMapper
.
insertSelective
(
tblCheckMultipleSql
);
}
else
{
logger
.
error
(
"checkType value is error! {}"
,
checkType
);
return
false
;
}
}
return
true
;
}
private
boolean
simpleRuleInfoCheck
(
DqRuleVo
dqRuleVo
)
{
if
(
StringUtils
.
isBlank
(
dqRuleVo
.
getDbName
())
||
StringUtils
.
isBlank
(
dqRuleVo
.
getTbName
())
//|| StringUtils.isBlank(dqRuleVo.getFilters())
)
{
return
false
;
}
if
(
Constants
.
CHECK_SPECIAL
.
equals
(
dqRuleVo
.
getCheckType
())){
if
(
StringUtils
.
isBlank
(
dqRuleVo
.
getTimeColName
()))
{
return
false
;
}
}
else
{
if
(
StringUtils
.
isBlank
(
dqRuleVo
.
getColName
()))
{
return
false
;
}
}
return
true
;
}
private
boolean
volatilityRuleParamsCheck
(
DqRuleVo
dqRuleVo
)
{
if
(
StringUtils
.
isBlank
(
dqRuleVo
.
getIndicatorType
()))
{
return
false
;
}
return
true
;
}
private
boolean
specialRuleParamsCheck
(
DqRuleVo
dqRuleVo
)
{
if
(
StringUtils
.
isBlank
(
dqRuleVo
.
getTimeColName
())
||
StringUtils
.
isBlank
(
dqRuleVo
.
getStartTime
())
//|| StringUtils.isBlank(dqRuleVo.getEndTime())
)
{
return
false
;
}
return
true
;
}
private
boolean
duplexRuleInfoCheck
(
DqRuleVo
dqRuleVo
)
{
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
())
//|| StringUtils.isBlank(dqRuleVo.getCheckFilters()) || StringUtils.isBlank(dqRuleVo.getReferfilters())
)
{
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
>();
TblIndicatorOperatorInfoCriteria
tblIndicatorOperatorInfoCriteria
=
new
TblIndicatorOperatorInfoCriteria
();
List
<
TblIndicatorOperatorInfo
>
tblIndicatorOperatorInfos
=
tblIndicatorOperatorInfoMapper
.
selectByExample
(
tblIndicatorOperatorInfoCriteria
);
for
(
TblIndicatorOperatorInfo
tblIndicatorOperatorInfo
:
tblIndicatorOperatorInfos
)
{
indicatorMap
.
put
(
tblIndicatorOperatorInfo
.
getIndicatorName
(),
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
());
if
(
null
!=
dqRuleVo
.
getFilters
())
{
rs
=
rs
.
replaceAll
(
"#filters"
,
dqRuleVo
.
getFilters
());
}
if
(
null
!=
dqRuleVo
.
getCheckFilters
())
{
rs
=
rs
.
replaceAll
(
"#check_filters"
,
dqRuleVo
.
getCheckFilters
());
}
if
(
null
!=
dqRuleVo
.
getReferFilters
())
{
rs
=
rs
.
replaceAll
(
"#refer_filters"
,
dqRuleVo
.
getReferFilters
());
}
return
rs
;
}
}
src/main/java/com/gmei/data/dqmp/service/impl/MonitorServiceImpl.java
View file @
8a57f4b4
...
...
@@ -24,6 +24,7 @@ import com.gmei.data.dqmp.mapper.TblResultMonitorSpecialMapper;
import
com.gmei.data.dqmp.mapper.TblResultMonitorVolatilityMapper
;
import
com.gmei.data.dqmp.pool.JdbcConnectPool
;
import
com.gmei.data.dqmp.service.MonitorService
;
import
com.gmei.data.dqmp.utils.DateUtils
;
@Service
public
class
MonitorServiceImpl
implements
MonitorService
{
...
...
@@ -101,6 +102,7 @@ public class MonitorServiceImpl implements MonitorService {
* @return
*/
private
TblResultMonitorVolatility
getMonitorVolatilityResult
(
String
sql
,
String
indicatorType
)
{
sql
=
sql
.
replaceAll
(
"#partation_date"
,
String
.
format
(
"'%s'"
,
DateUtils
.
getYesterdayDateStr
()));
logger
.
info
(
"Sql content : {},indicatorType: {}"
,
sql
,
indicatorType
);
TblResultMonitorVolatility
tblResultMonitorVolatility
=
null
;
if
(
StringUtils
.
isBlank
(
sql
)
||
StringUtils
.
isBlank
(
indicatorType
))
{
...
...
@@ -136,6 +138,7 @@ public class MonitorServiceImpl implements MonitorService {
* @return
*/
private
TblResultMonitorSpecial
getMonitorSpecialResult
(
String
sql
)
{
sql
=
sql
.
replaceAll
(
"#partation_date"
,
String
.
format
(
"'%s'"
,
DateUtils
.
getYesterdayDateStr
()));
logger
.
info
(
"Sql content : {}"
,
sql
);
TblResultMonitorSpecial
tblResultMonitorSpecial
=
null
;
if
(
StringUtils
.
isBlank
(
sql
))
{
...
...
src/main/java/com/gmei/data/dqmp/service/impl/TblSysParamInfoServiceImpl.java
0 → 100644
View file @
8a57f4b4
package
com
.
gmei
.
data
.
dqmp
.
service
.
impl
;
import
java.util.HashMap
;
import
java.util.List
;
import
java.util.Map
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
com.gmei.data.dqmp.domain.TblSysParamInfo
;
import
com.gmei.data.dqmp.domain.TblSysParamInfoCriteria
;
import
com.gmei.data.dqmp.mapper.TblSysParamInfoMapper
;
import
com.gmei.data.dqmp.service.TblSysParamInfoService
;
public
class
TblSysParamInfoServiceImpl
implements
TblSysParamInfoService
{
@Autowired
private
TblSysParamInfoMapper
tblSysParamInfoMapper
;
@Override
public
Map
<
String
,
String
>
getSysParamMap
(
String
paramType
){
Map
<
String
,
String
>
rsMap
=
new
HashMap
<
String
,
String
>();
TblSysParamInfoCriteria
example
=
new
TblSysParamInfoCriteria
();
example
.
createCriteria
().
andParamTypeEqualTo
(
paramType
);
List
<
TblSysParamInfo
>
rsList
=
tblSysParamInfoMapper
.
selectByExample
(
example
);
for
(
TblSysParamInfo
tblSysParamInfo
:
rsList
)
{
rsMap
.
put
(
tblSysParamInfo
.
getParamKey
(),
tblSysParamInfo
.
getParamValue
());
}
return
rsMap
;
}
}
src/main/java/com/gmei/data/dqmp/utils/DateUtils.java
View file @
8a57f4b4
package
com
.
gmei
.
data
.
dqmp
.
utils
;
import
java.text.SimpleDateFormat
;
import
java.util.Calendar
;
import
java.util.Date
;
public
class
DateUtils
{
private
static
final
String
DATE_FORMATE_YMD
=
"yyyy-MM-dd"
;
private
static
final
String
PARTITION_DATE_FORMAT
=
"yyyyMMdd"
;
private
static
final
String
DATE_FORMATE_YMDHMS
=
"yyyy-MM-dd HH:mm:ss"
;
private
static
final
String
DATE_FORMATE_YMDHMSS
=
"yyyy-MM-dd HH:mm:ss.S"
;
/**
* 获取当前时间字符串
...
...
@@ -23,4 +26,33 @@ public class DateUtils {
public
static
String
getCurrentTimeStr
()
{
return
new
SimpleDateFormat
(
DATE_FORMATE_YMDHMS
).
format
(
new
Date
());
}
/**
* 获取昨天时间字符串
* @return
*/
public
static
String
getYesterdayDateStr
()
{
Calendar
cld
=
Calendar
.
getInstance
();
cld
.
setTime
(
new
Date
());
cld
.
add
(
Calendar
.
DAY_OF_MONTH
,
-
1
);
return
new
SimpleDateFormat
(
PARTITION_DATE_FORMAT
).
format
(
cld
.
getTime
());
}
/**
* 获取今天0时0分0秒0毫秒时间字符串
* @return
*/
public
static
String
getTodayZeroTimeStr
()
{
Calendar
cld
=
Calendar
.
getInstance
();
cld
.
setTime
(
new
Date
());
cld
.
set
(
Calendar
.
HOUR_OF_DAY
,
0
);
cld
.
set
(
Calendar
.
MINUTE
,
0
);
cld
.
set
(
Calendar
.
SECOND
,
0
);
cld
.
set
(
Calendar
.
MILLISECOND
,
0
);
return
new
SimpleDateFormat
(
DATE_FORMATE_YMDHMSS
).
format
(
cld
.
getTime
());
}
public
static
void
main
(
String
[]
args
)
{
System
.
out
.
println
(
getTodayZeroTimeStr
());
}
}
src/main/java/com/gmei/data/dqmp/vo/DqRuleVo.java
0 → 100644
View file @
8a57f4b4
package
com
.
gmei
.
data
.
dqmp
.
vo
;
import
javax.validation.constraints.NotNull
;
import
org.hibernate.validator.constraints.NotBlank
;
public
class
DqRuleVo
extends
BaseVo
{
//common
@NotBlank
(
message
=
"校验类型字段不能为空"
)
private
String
checkType
;
@NotNull
(
message
=
"状态字段不能为NULL"
)
private
Integer
isValid
;
@NotBlank
(
message
=
"校验时间字段不能为空"
)
private
String
checkTime
;
//simple
private
String
dbName
;
private
String
tbName
;
private
String
colName
;
private
String
timeColName
;
private
String
filters
;
private
String
indicatorType
;
private
String
startTime
;
//private String endTime;
//duplex
private
String
checkDbName
;
private
String
checkTbName
;
private
String
checkColName
;
private
String
referDbName
;
private
String
referTbName
;
private
String
referColName
;
private
String
checkFilters
;
private
String
referFilters
;
public
DqRuleVo
()
{
super
();
}
public
DqRuleVo
(
Integer
status
,
String
msg
)
{
super
(
status
,
msg
);
}
public
Integer
getIsValid
()
{
return
isValid
;
}
public
void
setIsValid
(
Integer
isValid
)
{
this
.
isValid
=
isValid
;
}
public
String
getCheckTime
()
{
return
checkTime
;
}
public
void
setCheckTime
(
String
checkTime
)
{
this
.
checkTime
=
checkTime
;
}
public
String
getCheckType
()
{
return
checkType
;
}
public
void
setCheckType
(
String
checkType
)
{
this
.
checkType
=
checkType
;
}
public
String
getDbName
()
{
return
dbName
;
}
public
void
setDbName
(
String
dbName
)
{
this
.
dbName
=
dbName
;
}
public
String
getTbName
()
{
return
tbName
;
}
public
void
setTbName
(
String
tbName
)
{
this
.
tbName
=
tbName
;
}
public
String
getColName
()
{
return
colName
;
}
public
void
setColName
(
String
colName
)
{
this
.
colName
=
colName
;
}
public
String
getTimeColName
()
{
return
timeColName
;
}
public
void
setTimeColName
(
String
timeColName
)
{
this
.
timeColName
=
timeColName
;
}
public
String
getFilters
()
{
return
filters
;
}
public
void
setFilters
(
String
filters
)
{
this
.
filters
=
filters
;
}
public
String
getIndicatorType
()
{
return
indicatorType
;
}
public
void
setIndicatorType
(
String
indicatorType
)
{
this
.
indicatorType
=
indicatorType
;
}
public
String
getStartTime
()
{
return
startTime
;
}
public
void
setStartTime
(
String
startTime
)
{
this
.
startTime
=
startTime
;
}
// public String getEndTime() {
// return endTime;
// }
// public void setEndTime(String endTime) {
// this.endTime = endTime;
// }
public
String
getCheckDbName
()
{
return
checkDbName
;
}
public
void
setCheckDbName
(
String
checkDbName
)
{
this
.
checkDbName
=
checkDbName
;
}
public
String
getCheckTbName
()
{
return
checkTbName
;
}
public
void
setCheckTbName
(
String
checkTbName
)
{
this
.
checkTbName
=
checkTbName
;
}
public
String
getCheckColName
()
{
return
checkColName
;
}
public
void
setCheckColName
(
String
checkColName
)
{
this
.
checkColName
=
checkColName
;
}
public
String
getReferDbName
()
{
return
referDbName
;
}
public
void
setReferDbName
(
String
referDbName
)
{
this
.
referDbName
=
referDbName
;
}
public
String
getReferTbName
()
{
return
referTbName
;
}
public
void
setReferTbName
(
String
referTbName
)
{
this
.
referTbName
=
referTbName
;
}
public
String
getReferColName
()
{
return
referColName
;
}
public
void
setReferColName
(
String
referColName
)
{
this
.
referColName
=
referColName
;
}
public
String
getCheckFilters
()
{
return
checkFilters
;
}
public
void
setCheckFilters
(
String
checkFilters
)
{
this
.
checkFilters
=
checkFilters
;
}
public
String
getReferFilters
()
{
return
referFilters
;
}
public
void
setReferFilters
(
String
referFilters
)
{
this
.
referFilters
=
referFilters
;
}
@Override
public
String
toString
()
{
return
"DqRuleVo [checkType="
+
checkType
+
", isValid="
+
isValid
+
", checkTime="
+
checkTime
+
", dbName="
+
dbName
+
", tbName="
+
tbName
+
", colName="
+
colName
+
", timeColName="
+
timeColName
+
", filters="
+
filters
+
", indicatorType="
+
indicatorType
+
", startTime="
+
startTime
+
", checkDbName="
+
checkDbName
+
", checkTbName="
+
checkTbName
+
", checkColName="
+
checkColName
+
", referDbName="
+
referDbName
+
", referTbName="
+
referTbName
+
", referColName="
+
referColName
+
", checkFilters="
+
checkFilters
+
", referfilters="
+
referFilters
+
"]"
;
}
}
src/main/resources/generator.xml
View file @
8a57f4b4
...
...
@@ -46,7 +46,8 @@
<!-- <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_simple_info"
domainObjectName=
"TblRuleSimpleInfo"
/>
<table
tableName=
"tbl_rule_duplex_info"
domainObjectName=
"TblRuleDuplexInfo"
/>
<!-- <table tableName="tbl_rule_simple_info" domainObjectName="TblRuleSimpleInfo"/> -->
<!-- <table tableName="tbl_rule_duplex_info" domainObjectName="TblRuleDuplexInfo"/> -->
<table
tableName=
"tbl_sys_param_info"
domainObjectName=
"TblSysParamInfo"
/>
</context>
</generatorConfiguration>
src/main/resources/mybatis/mapper/TblSysParamInfoMapper.xml
0 → 100644
View file @
8a57f4b4
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" >
<mapper
namespace=
"com.gmei.data.dqmp.mapper.TblSysParamInfoMapper"
>
<resultMap
id=
"BaseResultMap"
type=
"com.gmei.data.dqmp.domain.TblSysParamInfo"
>
<id
column=
"id"
property=
"id"
jdbcType=
"INTEGER"
/>
<result
column=
"param_type"
property=
"paramType"
jdbcType=
"VARCHAR"
/>
<result
column=
"param_key"
property=
"paramKey"
jdbcType=
"VARCHAR"
/>
<result
column=
"param_value"
property=
"paramValue"
jdbcType=
"VARCHAR"
/>
<result
column=
"comment"
property=
"comment"
jdbcType=
"VARCHAR"
/>
</resultMap>
<sql
id=
"Example_Where_Clause"
>
<where
>
<foreach
collection=
"oredCriteria"
item=
"criteria"
separator=
"or"
>
<if
test=
"criteria.valid"
>
<trim
prefix=
"("
suffix=
")"
prefixOverrides=
"and"
>
<foreach
collection=
"criteria.criteria"
item=
"criterion"
>
<choose
>
<when
test=
"criterion.noValue"
>
and ${criterion.condition}
</when>
<when
test=
"criterion.singleValue"
>
and ${criterion.condition} #{criterion.value}
</when>
<when
test=
"criterion.betweenValue"
>
and ${criterion.condition} #{criterion.value} and #{criterion.secondValue}
</when>
<when
test=
"criterion.listValue"
>
and ${criterion.condition}
<foreach
collection=
"criterion.value"
item=
"listItem"
open=
"("
close=
")"
separator=
","
>
#{listItem}
</foreach>
</when>
</choose>
</foreach>
</trim>
</if>
</foreach>
</where>
</sql>
<sql
id=
"Update_By_Example_Where_Clause"
>
<where
>
<foreach
collection=
"example.oredCriteria"
item=
"criteria"
separator=
"or"
>
<if
test=
"criteria.valid"
>
<trim
prefix=
"("
suffix=
")"
prefixOverrides=
"and"
>
<foreach
collection=
"criteria.criteria"
item=
"criterion"
>
<choose
>
<when
test=
"criterion.noValue"
>
and ${criterion.condition}
</when>
<when
test=
"criterion.singleValue"
>
and ${criterion.condition} #{criterion.value}
</when>
<when
test=
"criterion.betweenValue"
>
and ${criterion.condition} #{criterion.value} and #{criterion.secondValue}
</when>
<when
test=
"criterion.listValue"
>
and ${criterion.condition}
<foreach
collection=
"criterion.value"
item=
"listItem"
open=
"("
close=
")"
separator=
","
>
#{listItem}
</foreach>
</when>
</choose>
</foreach>
</trim>
</if>
</foreach>
</where>
</sql>
<sql
id=
"Base_Column_List"
>
id, param_type, param_key, param_value, comment
</sql>
<select
id=
"selectByExample"
resultMap=
"BaseResultMap"
parameterType=
"com.gmei.data.dqmp.domain.TblSysParamInfoCriteria"
>
select
<if
test=
"distinct"
>
distinct
</if>
<include
refid=
"Base_Column_List"
/>
from tbl_sys_param_info
<if
test=
"_parameter != null"
>
<include
refid=
"Example_Where_Clause"
/>
</if>
<if
test=
"orderByClause != null"
>
order by ${orderByClause}
</if>
</select>
<select
id=
"selectByPrimaryKey"
resultMap=
"BaseResultMap"
parameterType=
"java.lang.Integer"
>
select
<include
refid=
"Base_Column_List"
/>
from tbl_sys_param_info
where id = #{id,jdbcType=INTEGER}
</select>
<delete
id=
"deleteByPrimaryKey"
parameterType=
"java.lang.Integer"
>
delete from tbl_sys_param_info
where id = #{id,jdbcType=INTEGER}
</delete>
<delete
id=
"deleteByExample"
parameterType=
"com.gmei.data.dqmp.domain.TblSysParamInfoCriteria"
>
delete from tbl_sys_param_info
<if
test=
"_parameter != null"
>
<include
refid=
"Example_Where_Clause"
/>
</if>
</delete>
<insert
id=
"insert"
parameterType=
"com.gmei.data.dqmp.domain.TblSysParamInfo"
>
insert into tbl_sys_param_info (id, param_type, param_key,
param_value, comment)
values (#{id,jdbcType=INTEGER}, #{paramType,jdbcType=VARCHAR}, #{paramKey,jdbcType=VARCHAR},
#{paramValue,jdbcType=VARCHAR}, #{comment,jdbcType=VARCHAR})
</insert>
<insert
id=
"insertSelective"
parameterType=
"com.gmei.data.dqmp.domain.TblSysParamInfo"
>
insert into tbl_sys_param_info
<trim
prefix=
"("
suffix=
")"
suffixOverrides=
","
>
<if
test=
"id != null"
>
id,
</if>
<if
test=
"paramType != null"
>
param_type,
</if>
<if
test=
"paramKey != null"
>
param_key,
</if>
<if
test=
"paramValue != null"
>
param_value,
</if>
<if
test=
"comment != null"
>
comment,
</if>
</trim>
<trim
prefix=
"values ("
suffix=
")"
suffixOverrides=
","
>
<if
test=
"id != null"
>
#{id,jdbcType=INTEGER},
</if>
<if
test=
"paramType != null"
>
#{paramType,jdbcType=VARCHAR},
</if>
<if
test=
"paramKey != null"
>
#{paramKey,jdbcType=VARCHAR},
</if>
<if
test=
"paramValue != null"
>
#{paramValue,jdbcType=VARCHAR},
</if>
<if
test=
"comment != null"
>
#{comment,jdbcType=VARCHAR},
</if>
</trim>
</insert>
<select
id=
"countByExample"
parameterType=
"com.gmei.data.dqmp.domain.TblSysParamInfoCriteria"
resultType=
"java.lang.Integer"
>
select count(*) from tbl_sys_param_info
<if
test=
"_parameter != null"
>
<include
refid=
"Example_Where_Clause"
/>
</if>
</select>
<update
id=
"updateByExampleSelective"
parameterType=
"map"
>
update tbl_sys_param_info
<set
>
<if
test=
"record.id != null"
>
id = #{record.id,jdbcType=INTEGER},
</if>
<if
test=
"record.paramType != null"
>
param_type = #{record.paramType,jdbcType=VARCHAR},
</if>
<if
test=
"record.paramKey != null"
>
param_key = #{record.paramKey,jdbcType=VARCHAR},
</if>
<if
test=
"record.paramValue != null"
>
param_value = #{record.paramValue,jdbcType=VARCHAR},
</if>
<if
test=
"record.comment != null"
>
comment = #{record.comment,jdbcType=VARCHAR},
</if>
</set>
<if
test=
"_parameter != null"
>
<include
refid=
"Update_By_Example_Where_Clause"
/>
</if>
</update>
<update
id=
"updateByExample"
parameterType=
"map"
>
update tbl_sys_param_info
set id = #{record.id,jdbcType=INTEGER},
param_type = #{record.paramType,jdbcType=VARCHAR},
param_key = #{record.paramKey,jdbcType=VARCHAR},
param_value = #{record.paramValue,jdbcType=VARCHAR},
comment = #{record.comment,jdbcType=VARCHAR}
<if
test=
"_parameter != null"
>
<include
refid=
"Update_By_Example_Where_Clause"
/>
</if>
</update>
<update
id=
"updateByPrimaryKeySelective"
parameterType=
"com.gmei.data.dqmp.domain.TblSysParamInfo"
>
update tbl_sys_param_info
<set
>
<if
test=
"paramType != null"
>
param_type = #{paramType,jdbcType=VARCHAR},
</if>
<if
test=
"paramKey != null"
>
param_key = #{paramKey,jdbcType=VARCHAR},
</if>
<if
test=
"paramValue != null"
>
param_value = #{paramValue,jdbcType=VARCHAR},
</if>
<if
test=
"comment != null"
>
comment = #{comment,jdbcType=VARCHAR},
</if>
</set>
where id = #{id,jdbcType=INTEGER}
</update>
<update
id=
"updateByPrimaryKey"
parameterType=
"com.gmei.data.dqmp.domain.TblSysParamInfo"
>
update tbl_sys_param_info
set param_type = #{paramType,jdbcType=VARCHAR},
param_key = #{paramKey,jdbcType=VARCHAR},
param_value = #{paramValue,jdbcType=VARCHAR},
comment = #{comment,jdbcType=VARCHAR}
where id = #{id,jdbcType=INTEGER}
</update>
</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