Commit 63f84a83 authored by 赵建伟's avatar 赵建伟

add del rule、find rule list、front codes

parent 46d2f33b
...@@ -66,6 +66,11 @@ ...@@ -66,6 +66,11 @@
<groupId>org.springframework.boot</groupId> <groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-thymeleaf</artifactId> <artifactId>spring-boot-starter-thymeleaf</artifactId>
</dependency> </dependency>
<dependency>
<groupId>net.sourceforge.nekohtml</groupId>
<artifactId>nekohtml</artifactId>
<version>1.9.22</version>
</dependency>
<!-- 集成热部署插件 --> <!-- 集成热部署插件 -->
<dependency> <dependency>
<groupId>org.springframework.boot</groupId> <groupId>org.springframework.boot</groupId>
......
...@@ -36,9 +36,10 @@ public class Constants { ...@@ -36,9 +36,10 @@ public class Constants {
// 双表规则类型 // 双表规则类型
public static final String TABLE_DUPLEX = "duplex"; public static final String TABLE_DUPLEX = "duplex";
// public static final String CHECK_SIMPLE = "check_single"; public static final String UNIQUE = "unique";
// public static final String CHECK_MULTIPLE = "check_multiple"; public static final String UNBLANK = "unblank";
// public static final String MONITOR_VOLATILITY = "monitor_volatility"; public static final String REFER = "refer";
// public static final String MONITOR_SPECIAL = "monitor_special"; public static final String VOLATILITY = "volatility";
public static final String SPECIAL = "special";
} }
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";
}
}
...@@ -2,20 +2,21 @@ package com.gmei.data.dqmp.controller; ...@@ -2,20 +2,21 @@ package com.gmei.data.dqmp.controller;
import javax.validation.Valid; import javax.validation.Valid;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired; 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.validation.BindingResult;
import org.springframework.web.bind.annotation.RequestBody; import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod; 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.service.DqRuleService;
import com.gmei.data.dqmp.vo.DqRuleVo; import com.gmei.data.dqmp.vo.DqRuleVo;
@RestController @Controller
@RequestMapping(value = "/dqrule") @RequestMapping(value = "/dqRule")
public class DqRuleController { public class DqRuleController extends BaseController{
@Autowired @Autowired
private DqRuleService dqRuleService; private DqRuleService dqRuleService;
...@@ -26,17 +27,29 @@ public class DqRuleController { ...@@ -26,17 +27,29 @@ public class DqRuleController {
* @param bindingResult * @param bindingResult
* @return * @return
*/ */
@ResponseBody
@RequestMapping(value = "/add", method = RequestMethod.POST) @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()) { if (bindingResult.hasErrors()) {
return new DqRuleVo(-1,bindingResult.getFieldError().getDefaultMessage()); return model(model,false,bindingResult.getFieldError().getDefaultMessage());
} }
Boolean isAddSuc = dqRuleService.addDqRule(dqRuleVo); Boolean isAddSuc = dqRuleService.addDqRule(dqRuleVo);
if(isAddSuc) { if(isAddSuc) {
return new DqRuleVo(); return model(model,true,"");
}else { }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,"数据质量规则删除失败!");
} }
} }
} }
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;
}
}
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";
}
}
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!");
}
}
}
package com.gmei.data.dqmp.controller; package com.gmei.data.dqmp.controller.api;
import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletRequest;
...@@ -8,18 +8,22 @@ import org.springframework.beans.factory.annotation.Autowired; ...@@ -8,18 +8,22 @@ import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping; import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController; 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.service.DqRuleService;
import com.gmei.data.dqmp.utils.ImportExcelUtils; import com.gmei.data.dqmp.utils.ImportExcelUtils;
import com.gmei.data.dqmp.vo.BaseVo; import com.gmei.data.dqmp.vo.BaseVo;
@RestController @RestController
@RequestMapping(value = "/excel") @RequestMapping(value = "/api/excel")
public class EasyExcelController { public class DqRuleImportApiController {
@Autowired @Autowired
private DqRuleService dqRuleService; private DqRuleService dqRuleService;
private static final Logger logger = LoggerFactory.getLogger(EasyExcelController.class); private static final Logger logger = LoggerFactory.getLogger(DqRuleImportApiController.class);
@PostMapping(value = "export") @PostMapping(value = "export")
public BaseVo exportExcel() { public BaseVo exportExcel() {
...@@ -28,6 +32,9 @@ public class EasyExcelController { ...@@ -28,6 +32,9 @@ public class EasyExcelController {
@PostMapping(value = "importUnique") @PostMapping(value = "importUnique")
public BaseVo importUniqueExcel(HttpServletRequest httpServletRequest) { public BaseVo importUniqueExcel(HttpServletRequest httpServletRequest) {
if(!checkIsLegal(httpServletRequest,Constants.UNIQUE)) {
return new BaseVo(-1,"上传的数据质量规则文件错误,请核实!");
}
try { try {
ImportExcelUtils.saxReadUniqueListString(httpServletRequest,dqRuleService); ImportExcelUtils.saxReadUniqueListString(httpServletRequest,dqRuleService);
}catch (Exception e) { }catch (Exception e) {
...@@ -39,6 +46,9 @@ public class EasyExcelController { ...@@ -39,6 +46,9 @@ public class EasyExcelController {
@PostMapping(value = "importUnblank") @PostMapping(value = "importUnblank")
public BaseVo importUnblankExcel(HttpServletRequest httpServletRequest) { public BaseVo importUnblankExcel(HttpServletRequest httpServletRequest) {
if(!checkIsLegal(httpServletRequest,Constants.UNBLANK)) {
return new BaseVo(-1,"上传的数据质量规则文件错误,请核实!");
}
try { try {
ImportExcelUtils.saxReadUnblankListString(httpServletRequest,dqRuleService); ImportExcelUtils.saxReadUnblankListString(httpServletRequest,dqRuleService);
}catch (Exception e) { }catch (Exception e) {
...@@ -50,6 +60,9 @@ public class EasyExcelController { ...@@ -50,6 +60,9 @@ public class EasyExcelController {
@PostMapping(value = "importRefer") @PostMapping(value = "importRefer")
public BaseVo importReferExcel(HttpServletRequest httpServletRequest) { public BaseVo importReferExcel(HttpServletRequest httpServletRequest) {
if(!checkIsLegal(httpServletRequest,Constants.REFER)) {
return new BaseVo(-1,"上传的数据质量规则文件错误,请核实!");
}
try { try {
ImportExcelUtils.saxReadReferListString(httpServletRequest,dqRuleService); ImportExcelUtils.saxReadReferListString(httpServletRequest,dqRuleService);
}catch (Exception e) { }catch (Exception e) {
...@@ -61,6 +74,9 @@ public class EasyExcelController { ...@@ -61,6 +74,9 @@ public class EasyExcelController {
@PostMapping(value = "importVolatility") @PostMapping(value = "importVolatility")
public BaseVo importVolatilityExcel(HttpServletRequest httpServletRequest) { public BaseVo importVolatilityExcel(HttpServletRequest httpServletRequest) {
if(!checkIsLegal(httpServletRequest,Constants.VOLATILITY)) {
return new BaseVo(-1,"上传的数据质量规则文件错误,请核实!");
}
try { try {
ImportExcelUtils.saxReadVolatilityListString(httpServletRequest,dqRuleService); ImportExcelUtils.saxReadVolatilityListString(httpServletRequest,dqRuleService);
}catch (Exception e) { }catch (Exception e) {
...@@ -72,6 +88,9 @@ public class EasyExcelController { ...@@ -72,6 +88,9 @@ public class EasyExcelController {
@PostMapping(value = "importSpecial") @PostMapping(value = "importSpecial")
public BaseVo importExcel(HttpServletRequest httpServletRequest) { public BaseVo importExcel(HttpServletRequest httpServletRequest) {
if(!checkIsLegal(httpServletRequest,Constants.SPECIAL)) {
return new BaseVo(-1,"上传的数据质量规则文件错误,请核实!");
}
try { try {
ImportExcelUtils.saxReadSpecialListString(httpServletRequest,dqRuleService); ImportExcelUtils.saxReadSpecialListString(httpServletRequest,dqRuleService);
}catch (Exception e) { }catch (Exception e) {
...@@ -81,4 +100,25 @@ public class EasyExcelController { ...@@ -81,4 +100,25 @@ public class EasyExcelController {
return new BaseVo(); 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;
}
} }
...@@ -25,6 +25,8 @@ public class TblSqlCheckDuplex { ...@@ -25,6 +25,8 @@ public class TblSqlCheckDuplex {
private String comment; private String comment;
private Integer parentId;
private Date createTime; private Date createTime;
private String sqlContent; private String sqlContent;
...@@ -117,6 +119,14 @@ public class TblSqlCheckDuplex { ...@@ -117,6 +119,14 @@ public class TblSqlCheckDuplex {
this.comment = comment == null ? null : comment.trim(); this.comment = comment == null ? null : comment.trim();
} }
public Integer getParentId() {
return parentId;
}
public void setParentId(Integer parentId) {
this.parentId = parentId;
}
public Date getCreateTime() { public Date getCreateTime() {
return createTime; return createTime;
} }
......
...@@ -855,6 +855,66 @@ public class TblSqlCheckDuplexCriteria { ...@@ -855,6 +855,66 @@ public class TblSqlCheckDuplexCriteria {
return (Criteria) this; 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() { public Criteria andCreateTimeIsNull() {
addCriterion("create_time is null"); addCriterion("create_time is null");
return (Criteria) this; return (Criteria) this;
......
...@@ -19,6 +19,8 @@ public class TblSqlCheckSingle { ...@@ -19,6 +19,8 @@ public class TblSqlCheckSingle {
private String comment; private String comment;
private Integer parentId;
private Date createTime; private Date createTime;
private String sqlContent; private String sqlContent;
...@@ -87,6 +89,14 @@ public class TblSqlCheckSingle { ...@@ -87,6 +89,14 @@ public class TblSqlCheckSingle {
this.comment = comment == null ? null : comment.trim(); this.comment = comment == null ? null : comment.trim();
} }
public Integer getParentId() {
return parentId;
}
public void setParentId(Integer parentId) {
this.parentId = parentId;
}
public Date getCreateTime() { public Date getCreateTime() {
return createTime; return createTime;
} }
......
...@@ -645,6 +645,66 @@ public class TblSqlCheckSingleCriteria { ...@@ -645,6 +645,66 @@ public class TblSqlCheckSingleCriteria {
return (Criteria) this; 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() { public Criteria andCreateTimeIsNull() {
addCriterion("create_time is null"); addCriterion("create_time is null");
return (Criteria) this; return (Criteria) this;
......
...@@ -23,6 +23,8 @@ public class TblSqlMonitorSpecial { ...@@ -23,6 +23,8 @@ public class TblSqlMonitorSpecial {
private String comment; private String comment;
private Integer parentId;
private Date createTime; private Date createTime;
private String sqlContent; private String sqlContent;
...@@ -107,6 +109,14 @@ public class TblSqlMonitorSpecial { ...@@ -107,6 +109,14 @@ public class TblSqlMonitorSpecial {
this.comment = comment == null ? null : comment.trim(); this.comment = comment == null ? null : comment.trim();
} }
public Integer getParentId() {
return parentId;
}
public void setParentId(Integer parentId) {
this.parentId = parentId;
}
public Date getCreateTime() { public Date getCreateTime() {
return createTime; return createTime;
} }
......
...@@ -785,6 +785,66 @@ public class TblSqlMonitorSpecialCriteria { ...@@ -785,6 +785,66 @@ public class TblSqlMonitorSpecialCriteria {
return (Criteria) this; 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() { public Criteria andCreateTimeIsNull() {
addCriterion("create_time is null"); addCriterion("create_time is null");
return (Criteria) this; return (Criteria) this;
......
...@@ -19,6 +19,8 @@ public class TblSqlMonitorVolatility { ...@@ -19,6 +19,8 @@ public class TblSqlMonitorVolatility {
private String comment; private String comment;
private Integer parentId;
private Date createTime; private Date createTime;
private String sqlContent; private String sqlContent;
...@@ -87,6 +89,14 @@ public class TblSqlMonitorVolatility { ...@@ -87,6 +89,14 @@ public class TblSqlMonitorVolatility {
this.comment = comment == null ? null : comment.trim(); this.comment = comment == null ? null : comment.trim();
} }
public Integer getParentId() {
return parentId;
}
public void setParentId(Integer parentId) {
this.parentId = parentId;
}
public Date getCreateTime() { public Date getCreateTime() {
return createTime; return createTime;
} }
......
...@@ -645,6 +645,66 @@ public class TblSqlMonitorVolatilityCriteria { ...@@ -645,6 +645,66 @@ public class TblSqlMonitorVolatilityCriteria {
return (Criteria) this; 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() { public Criteria andCreateTimeIsNull() {
addCriterion("create_time is null"); addCriterion("create_time is null");
return (Criteria) this; return (Criteria) this;
......
package com.gmei.data.dqmp.service; 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.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 { public interface DqRuleService {
Boolean addDqRule(DqRuleVo dqRuleVo); Boolean addDqRule(DqRuleVo dqRuleVo);
List<DqUniqueRuleVo> findUniqueDqRuleList();
List<DqUnblankRuleVo> findUnblankDqRuleList();
List<DqReferRuleVo> findReferDqRuleList();
List<DqVolatilityRuleVo> findVolatilityDqRuleList();
List<DqSpecialRuleVo> findSpecialDqRuleList();
Boolean delDqRule(DqRuleVo dqRuleVo);
} }
package com.gmei.data.dqmp.service.impl; package com.gmei.data.dqmp.service.impl;
import java.util.ArrayList;
import java.util.HashMap; import java.util.HashMap;
import java.util.List; import java.util.List;
import java.util.Map; import java.util.Map;
...@@ -14,14 +15,20 @@ import org.springframework.transaction.annotation.Transactional; ...@@ -14,14 +15,20 @@ import org.springframework.transaction.annotation.Transactional;
import com.gmei.data.dqmp.common.Constants; import com.gmei.data.dqmp.common.Constants;
import com.gmei.data.dqmp.domain.TblIndicatorOperatorInfo; import com.gmei.data.dqmp.domain.TblIndicatorOperatorInfo;
import com.gmei.data.dqmp.domain.TblIndicatorOperatorInfoCriteria; 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.TblRuleInfoDuplexWithBLOBs;
import com.gmei.data.dqmp.domain.TblRuleInfoSimple; 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.TblRuleTemplate;
import com.gmei.data.dqmp.domain.TblRuleTemplateCriteria; import com.gmei.data.dqmp.domain.TblRuleTemplateCriteria;
import com.gmei.data.dqmp.domain.TblSqlCheckDuplex; 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.TblSqlCheckSingle;
import com.gmei.data.dqmp.domain.TblSqlCheckSingleCriteria;
import com.gmei.data.dqmp.domain.TblSqlMonitorSpecial; 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.TblSqlMonitorVolatility;
import com.gmei.data.dqmp.domain.TblSqlMonitorVolatilityCriteria;
import com.gmei.data.dqmp.mapper.TblIndicatorOperatorInfoMapper; import com.gmei.data.dqmp.mapper.TblIndicatorOperatorInfoMapper;
import com.gmei.data.dqmp.mapper.TblRuleInfoDuplexMapper; import com.gmei.data.dqmp.mapper.TblRuleInfoDuplexMapper;
import com.gmei.data.dqmp.mapper.TblRuleInfoSimpleMapper; import com.gmei.data.dqmp.mapper.TblRuleInfoSimpleMapper;
...@@ -33,7 +40,12 @@ import com.gmei.data.dqmp.mapper.TblSqlMonitorVolatilityMapper; ...@@ -33,7 +40,12 @@ import com.gmei.data.dqmp.mapper.TblSqlMonitorVolatilityMapper;
import com.gmei.data.dqmp.service.DqRuleService; import com.gmei.data.dqmp.service.DqRuleService;
import com.gmei.data.dqmp.utils.BeanUtils; import com.gmei.data.dqmp.utils.BeanUtils;
import com.gmei.data.dqmp.utils.DateUtils; 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.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 @Service
public class DqRuleServiceImpl implements DqRuleService { public class DqRuleServiceImpl implements DqRuleService {
...@@ -75,12 +87,13 @@ public class DqRuleServiceImpl implements DqRuleService { ...@@ -75,12 +87,13 @@ public class DqRuleServiceImpl implements DqRuleService {
/** /**
* 简单校验规则新增 * 简单校验规则新增
*
* @param dqRuleVo * @param dqRuleVo
* @return * @return
*/ */
private Boolean simpleRuleInfoInsert(DqRuleVo dqRuleVo) { private Boolean simpleRuleInfoInsert(DqRuleVo dqRuleVo) {
if(!simpleRuleInfoCheck(dqRuleVo)) { if (!simpleRuleInfoCheck(dqRuleVo)) {
logger.error("Param is illegal! {}",dqRuleVo); logger.error("Param is illegal! {}", dqRuleVo);
return false; return false;
} }
TblRuleInfoSimple record = BeanUtils.map(dqRuleVo, TblRuleInfoSimple.class); TblRuleInfoSimple record = BeanUtils.map(dqRuleVo, TblRuleInfoSimple.class);
...@@ -90,32 +103,37 @@ public class DqRuleServiceImpl implements DqRuleService { ...@@ -90,32 +103,37 @@ public class DqRuleServiceImpl implements DqRuleService {
String checkType = dqRuleVo.getCheckType(); String checkType = dqRuleVo.getCheckType();
switch (checkType) { switch (checkType) {
case Constants.CHECK_UNIQUE: case Constants.CHECK_UNIQUE:
TblSqlCheckSingle TblSqlCheckSingle = BeanUtils.map(dqRuleVo, TblSqlCheckSingle.class); TblSqlCheckSingle tblSqlCheckSingle = BeanUtils.map(dqRuleVo, TblSqlCheckSingle.class);
TblSqlCheckSingle.setSqlContent(genSqlByTemplate(dqRuleVo)); tblSqlCheckSingle.setSqlContent(genSqlByTemplate(dqRuleVo));
tblSqlCheckSingleMapper.insertSelective(TblSqlCheckSingle); tblSqlCheckSingle.setParentId(record.getId());
tblSqlCheckSingleMapper.insertSelective(tblSqlCheckSingle);
break; break;
case Constants.CHECK_UNBLANK: case Constants.CHECK_UNBLANK:
TblSqlCheckSingle tcss = BeanUtils.map(dqRuleVo, TblSqlCheckSingle.class); TblSqlCheckSingle tcss = BeanUtils.map(dqRuleVo, TblSqlCheckSingle.class);
tcss.setSqlContent(genSqlByTemplate(dqRuleVo)); tcss.setSqlContent(genSqlByTemplate(dqRuleVo));
tcss.setParentId(record.getId());
tblSqlCheckSingleMapper.insertSelective(tcss); tblSqlCheckSingleMapper.insertSelective(tcss);
break; break;
case Constants.CHECK_VOLATILITY: case Constants.CHECK_VOLATILITY:
if(!volatilityRuleParamsCheck(dqRuleVo)) { if (!volatilityRuleParamsCheck(dqRuleVo)) {
logger.error("Param is illegal! {}",dqRuleVo); logger.error("Param is illegal! {}", dqRuleVo);
return false; return false;
} }
TblSqlMonitorVolatility TblSqlMonitorVolatility = BeanUtils.map(dqRuleVo,TblSqlMonitorVolatility.class); TblSqlMonitorVolatility tblSqlMonitorVolatility = BeanUtils.map(dqRuleVo,
TblSqlMonitorVolatility.setSqlContent(genSqlByTemplate(dqRuleVo)); TblSqlMonitorVolatility.class);
tblSqlMonitorVolatilityMapper.insertSelective(TblSqlMonitorVolatility); tblSqlMonitorVolatility.setSqlContent(genSqlByTemplate(dqRuleVo));
tblSqlMonitorVolatility.setParentId(record.getId());
tblSqlMonitorVolatilityMapper.insertSelective(tblSqlMonitorVolatility);
break; break;
case Constants.CHECK_SPECIAL: case Constants.CHECK_SPECIAL:
if(!specialRuleParamsCheck(dqRuleVo)) { if (!specialRuleParamsCheck(dqRuleVo)) {
logger.error("Param is illegal! {}",dqRuleVo); logger.error("Param is illegal! {}", dqRuleVo);
return false; return false;
} }
dqRuleVo.setStartTime(DateUtils.getZeroTimeStrsMap().get(dqRuleVo.getStartTime())); dqRuleVo.setStartTime(DateUtils.getZeroTimeStrsMap().get(dqRuleVo.getStartTime()));
TblSqlMonitorSpecial tblSqlMonitorSpecial = BeanUtils.map(dqRuleVo, TblSqlMonitorSpecial.class); TblSqlMonitorSpecial tblSqlMonitorSpecial = BeanUtils.map(dqRuleVo, TblSqlMonitorSpecial.class);
tblSqlMonitorSpecial.setSqlContent(genSqlByTemplate(dqRuleVo)); tblSqlMonitorSpecial.setSqlContent(genSqlByTemplate(dqRuleVo));
tblSqlMonitorSpecial.setParentId(record.getId());
tblSqlMonitorSpecialMapper.insertSelective(tblSqlMonitorSpecial); tblSqlMonitorSpecialMapper.insertSelective(tblSqlMonitorSpecial);
break; break;
default: default:
...@@ -125,15 +143,16 @@ public class DqRuleServiceImpl implements DqRuleService { ...@@ -125,15 +143,16 @@ public class DqRuleServiceImpl implements DqRuleService {
} }
return true; return true;
} }
/** /**
* 双表校验规则录入 * 双表校验规则录入
*
* @param dqRuleVo * @param dqRuleVo
* @return * @return
*/ */
private Boolean duplexRuleInfoInsert(DqRuleVo dqRuleVo) { private Boolean duplexRuleInfoInsert(DqRuleVo dqRuleVo) {
if(!duplexRuleInfoCheck(dqRuleVo)) { if (!duplexRuleInfoCheck(dqRuleVo)) {
logger.error("Param is illegal! {}",dqRuleVo); logger.error("Param is illegal! {}", dqRuleVo);
return false; return false;
} }
TblRuleInfoDuplexWithBLOBs record = BeanUtils.map(dqRuleVo, TblRuleInfoDuplexWithBLOBs.class); TblRuleInfoDuplexWithBLOBs record = BeanUtils.map(dqRuleVo, TblRuleInfoDuplexWithBLOBs.class);
...@@ -144,6 +163,7 @@ public class DqRuleServiceImpl implements DqRuleService { ...@@ -144,6 +163,7 @@ public class DqRuleServiceImpl implements DqRuleService {
TblSqlCheckDuplex tblSqlCheckDuplex = BeanUtils.map(dqRuleVo, TblSqlCheckDuplex.class); TblSqlCheckDuplex tblSqlCheckDuplex = BeanUtils.map(dqRuleVo, TblSqlCheckDuplex.class);
String sqlContent = genSqlByTemplate(dqRuleVo); String sqlContent = genSqlByTemplate(dqRuleVo);
tblSqlCheckDuplex.setSqlContent(sqlContent); tblSqlCheckDuplex.setSqlContent(sqlContent);
tblSqlCheckDuplex.setParentId(record.getId());
tblSqlCheckMultipleMapper.insertSelective(tblSqlCheckDuplex); tblSqlCheckMultipleMapper.insertSelective(tblSqlCheckDuplex);
} else { } else {
logger.error("checkType value is error! {}", checkType); logger.error("checkType value is error! {}", checkType);
...@@ -154,15 +174,15 @@ public class DqRuleServiceImpl implements DqRuleService { ...@@ -154,15 +174,15 @@ public class DqRuleServiceImpl implements DqRuleService {
} }
private boolean simpleRuleInfoCheck(DqRuleVo dqRuleVo) { 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; return false;
} }
if(Constants.CHECK_SPECIAL.equals(dqRuleVo.getCheckType())){ if (Constants.CHECK_SPECIAL.equals(dqRuleVo.getCheckType())) {
if(StringUtils.isBlank(dqRuleVo.getTimeColName())) { if (StringUtils.isBlank(dqRuleVo.getTimeColName())) {
return false; return false;
} }
}else { } else {
if(StringUtils.isBlank(dqRuleVo.getColName())) { if (StringUtils.isBlank(dqRuleVo.getColName())) {
return false; return false;
} }
} }
...@@ -170,72 +190,198 @@ public class DqRuleServiceImpl implements DqRuleService { ...@@ -170,72 +190,198 @@ public class DqRuleServiceImpl implements DqRuleService {
} }
private boolean volatilityRuleParamsCheck(DqRuleVo dqRuleVo) { private boolean volatilityRuleParamsCheck(DqRuleVo dqRuleVo) {
if(StringUtils.isBlank(dqRuleVo.getIndicatorType())) { if (StringUtils.isBlank(dqRuleVo.getIndicatorType())) {
return false; return false;
} }
return true; return true;
} }
private boolean specialRuleParamsCheck(DqRuleVo dqRuleVo) { 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 false;
} }
return true; return true;
} }
private boolean duplexRuleInfoCheck(DqRuleVo dqRuleVo) { 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.getCheckColName()) || StringUtils.isBlank(dqRuleVo.getReferColName())
|| StringUtils.isBlank(dqRuleVo.getReferDbName()) || StringUtils.isBlank(dqRuleVo.getReferTbName())) { || StringUtils.isBlank(dqRuleVo.getReferDbName()) || StringUtils.isBlank(dqRuleVo.getReferTbName())) {
return false; return false;
} }
return true; return true;
} }
private String genSqlByTemplate(DqRuleVo dqRuleVo) { private String genSqlByTemplate(DqRuleVo dqRuleVo) {
TblRuleTemplateCriteria example = new TblRuleTemplateCriteria(); TblRuleTemplateCriteria example = new TblRuleTemplateCriteria();
example.createCriteria().andCheckTypeEqualTo(dqRuleVo.getCheckType()); example.createCriteria().andCheckTypeEqualTo(dqRuleVo.getCheckType());
TblRuleTemplate tblRuleTemplate = tblRuleTemplateMapper.selectByExampleWithBLOBs(example).get(0); TblRuleTemplate tblRuleTemplate = tblRuleTemplateMapper.selectByExampleWithBLOBs(example).get(0);
String tpltContent = tblRuleTemplate.getTpltContent(); String tpltContent = tblRuleTemplate.getTpltContent();
Map<String,String> indicatorMap = new HashMap<String, String>(); Map<String, String> indicatorMap = new HashMap<String, String>();
TblIndicatorOperatorInfoCriteria tblIndicatorOperatorInfoCriteria = new TblIndicatorOperatorInfoCriteria(); TblIndicatorOperatorInfoCriteria tblIndicatorOperatorInfoCriteria = new TblIndicatorOperatorInfoCriteria();
List<TblIndicatorOperatorInfo> tblIndicatorOperatorInfos = tblIndicatorOperatorInfoMapper.selectByExample(tblIndicatorOperatorInfoCriteria); List<TblIndicatorOperatorInfo> tblIndicatorOperatorInfos = tblIndicatorOperatorInfoMapper
for(TblIndicatorOperatorInfo tblIndicatorOperatorInfo : tblIndicatorOperatorInfos) { .selectByExample(tblIndicatorOperatorInfoCriteria);
for (TblIndicatorOperatorInfo tblIndicatorOperatorInfo : tblIndicatorOperatorInfos) {
indicatorMap.put(tblIndicatorOperatorInfo.getIndicatorType(), tblIndicatorOperatorInfo.getOperatorExpr()); indicatorMap.put(tblIndicatorOperatorInfo.getIndicatorType(), tblIndicatorOperatorInfo.getOperatorExpr());
} }
String indicatorType = dqRuleVo.getIndicatorType(); String indicatorType = dqRuleVo.getIndicatorType();
String rs = tpltContent String rs = tpltContent.replaceAll("#db_name", dqRuleVo.getDbName())
.replaceAll("#db_name", dqRuleVo.getDbName()) .replaceAll("#tb_name", dqRuleVo.getTbName()).replaceAll("#indicator_type", indicatorType)
.replaceAll("#tb_name", dqRuleVo.getTbName()) .replaceAll("#indicator_expre", indicatorMap.get(indicatorType))
.replaceAll("#indicator_type", indicatorType) .replaceAll("#col_name", dqRuleVo.getColName())
.replaceAll("#indicator_expre", indicatorMap.get(indicatorType)) .replaceAll("#start_time", "'" + dqRuleVo.getStartTime() + "'")
.replaceAll("#col_name", dqRuleVo.getColName()) .replaceAll("#end_time", "'" + DateUtils.getTodayZeroTimeStr() + "'")
.replaceAll("#start_time", "'"+dqRuleVo.getStartTime()+"'") .replaceAll("#check_db_name", dqRuleVo.getCheckDbName())
.replaceAll("#end_time", "'"+DateUtils.getTodayZeroTimeStr()+"'") .replaceAll("#check_tb_name", dqRuleVo.getCheckTbName())
.replaceAll("#check_db_name", dqRuleVo.getCheckDbName()) .replaceAll("#check_col_name", dqRuleVo.getCheckColName())
.replaceAll("#check_tb_name", dqRuleVo.getCheckTbName()) .replaceAll("#refer_db_name", dqRuleVo.getReferDbName())
.replaceAll("#check_col_name", dqRuleVo.getCheckColName()) .replaceAll("#refer_tb_name", dqRuleVo.getReferTbName())
.replaceAll("#refer_db_name", dqRuleVo.getReferDbName()) .replaceAll("#refer_col_name", dqRuleVo.getReferColName())
.replaceAll("#refer_tb_name", dqRuleVo.getReferTbName()) .replaceAll("#time_col_name", dqRuleVo.getTimeColName());
.replaceAll("#refer_col_name", dqRuleVo.getReferColName())
.replaceAll("#time_col_name", dqRuleVo.getTimeColName());
String filters = dqRuleVo.getFilters(); String filters = dqRuleVo.getFilters();
if(null != filters) { if (null != filters) {
filters = filters.replaceAll("\\$", "RDS_CHAR_DOLLAR"); filters = filters.replaceAll("\\$", "RDS_CHAR_DOLLAR");
rs = rs.replaceAll("#filters", filters); rs = rs.replaceAll("#filters", filters);
} }
String checkFilters = dqRuleVo.getCheckFilters(); String checkFilters = dqRuleVo.getCheckFilters();
if(null != checkFilters) { if (null != checkFilters) {
checkFilters = checkFilters.replaceAll("\\$", "RDS_CHAR_DOLLAR"); checkFilters = checkFilters.replaceAll("\\$", "RDS_CHAR_DOLLAR");
rs = rs.replaceAll("#check_filters", checkFilters); rs = rs.replaceAll("#check_filters", checkFilters);
} }
String referFilters = dqRuleVo.getReferFilters(); String referFilters = dqRuleVo.getReferFilters();
if(null != referFilters) { if (null != referFilters) {
referFilters = referFilters.replaceAll("\\$", "RDS_CHAR_DOLLAR"); referFilters = referFilters.replaceAll("\\$", "RDS_CHAR_DOLLAR");
rs = rs.replaceAll("#refer_filters", referFilters); rs = rs.replaceAll("#refer_filters", referFilters);
} }
rs = rs.replaceAll("RDS_CHAR_DOLLAR", "\\$"); rs = rs.replaceAll("RDS_CHAR_DOLLAR", "\\$");
return rs; 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;
}
} }
...@@ -3,7 +3,7 @@ package com.gmei.data.dqmp.vo; ...@@ -3,7 +3,7 @@ package com.gmei.data.dqmp.vo;
public class BaseVo { public class BaseVo {
private int status = 0; private int status = 0;
private String msg = "success!"; private String msg = "success!";
private String user; //private String user;
public BaseVo() { public BaseVo() {
} }
...@@ -29,11 +29,11 @@ public class BaseVo { ...@@ -29,11 +29,11 @@ public class BaseVo {
this.msg = msg; this.msg = msg;
} }
public String getUser() { // public String getUser() {
return user; // return user;
} // }
//
public void setUser(String user) { // public void setUser(String user) {
this.user = user; // this.user = user;
} // }
} }
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;
}
...@@ -33,6 +33,8 @@ public class DqRuleVo extends BaseVo{ ...@@ -33,6 +33,8 @@ public class DqRuleVo extends BaseVo{
private String checkFilters; private String checkFilters;
private String referFilters; private String referFilters;
private Integer id;
public DqRuleVo() { public DqRuleVo() {
super(); super();
} }
...@@ -161,6 +163,15 @@ public class DqRuleVo extends BaseVo{ ...@@ -161,6 +163,15 @@ public class DqRuleVo extends BaseVo{
public void setComment(String comment) { public void setComment(String comment) {
this.comment = comment; this.comment = comment;
} }
public Integer getId() {
return id;
}
public void setId(Integer id) {
this.id = id;
}
@Override @Override
public String toString() { public String toString() {
......
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;
}
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;
}
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;
}
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;
}
...@@ -6,6 +6,8 @@ spring: ...@@ -6,6 +6,8 @@ spring:
#---thymeleaf config --- #---thymeleaf config ---
thymeleaf: thymeleaf:
cache: false cache: false
content-type: text/html
mode: LEGACYHTML5
#---email config--- #---email config---
mail: mail:
......
...@@ -6,6 +6,8 @@ spring: ...@@ -6,6 +6,8 @@ spring:
#---thymeleaf config --- #---thymeleaf config ---
thymeleaf: thymeleaf:
cache: false cache: false
content-type: text/html
mode: LEGACYHTML5
#---email config--- #---email config---
mail: mail:
......
...@@ -6,6 +6,8 @@ spring: ...@@ -6,6 +6,8 @@ spring:
#---thymeleaf config --- #---thymeleaf config ---
thymeleaf: thymeleaf:
cache: false cache: false
content-type: text/html
mode: LEGACYHTML5
#---email config--- #---email config---
mail: mail:
......
...@@ -35,19 +35,23 @@ ...@@ -35,19 +35,23 @@
<!-- 需要生成的数据库表 --> <!-- 需要生成的数据库表 -->
<!-- <table tableName="tbl_client_version_info" domainObjectName="TblClientVersionInfo"/> --> <!-- <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_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_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_unblank" domainObjectName="TblResultCheckUnblank"/>
<table tableName="tbl_result_check_refer" domainObjectName="TblResultCheckRefer"/> <table tableName="tbl_result_check_refer" domainObjectName="TblResultCheckRefer"/>
<table tableName="tbl_result_monitor_volatility" domainObjectName="TblResultMonitorVolatility"/> <table tableName="tbl_result_monitor_volatility" domainObjectName="TblResultMonitorVolatility"/>
<table tableName="tbl_result_monitor_special" domainObjectName="TblResultMonitorSpecial"/> <table tableName="tbl_result_monitor_special" domainObjectName="TblResultMonitorSpecial"/>
<table tableName="tbl_indicator_operator_info" domainObjectName="TblIndicatorOperatorInfo"/> --> <table tableName="tbl_indicator_operator_info" domainObjectName="TblIndicatorOperatorInfo"/> -->
<!-- <table tableName="tbl_rule_template" domainObjectName="TblRuleTemplate"/> --> <!-- <table tableName="tbl_rule_template" domainObjectName="TblRuleTemplate"/> -->
<!-- <table tableName="tbl_rule_info_simple" domainObjectName="TblRuleInfoSimple"/> <table tableName="tbl_rule_info_simple" domainObjectName="TblRuleInfoSimple">
<table tableName="tbl_rule_info_duplex" domainObjectName="TblRuleInfoDuplex"/> --> <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"/> --> <!-- <table tableName="tbl_sys_param_info" domainObjectName="TblSysParamInfo"/> -->
</context> </context>
</generatorConfiguration> </generatorConfiguration>
...@@ -133,23 +133,26 @@ ...@@ -133,23 +133,26 @@
</if> </if>
</delete> </delete>
<insert id="insert" parameterType="com.gmei.data.dqmp.domain.TblRuleInfoDuplexWithBLOBs" > <insert id="insert" parameterType="com.gmei.data.dqmp.domain.TblRuleInfoDuplexWithBLOBs" >
insert into tbl_rule_info_duplex (id, check_type, check_db_name, <selectKey resultType="java.lang.Integer" keyProperty="id" order="AFTER" >
check_tb_name, check_col_name, refer_db_name, SELECT LAST_INSERT_ID()
refer_tb_name, refer_col_name, is_valid, </selectKey>
check_time, comment, create_time, insert into tbl_rule_info_duplex (check_type, check_db_name, check_tb_name,
check_filters, refer_filters) check_col_name, refer_db_name, refer_tb_name,
values (#{id,jdbcType=INTEGER}, #{checkType,jdbcType=VARCHAR}, #{checkDbName,jdbcType=VARCHAR}, refer_col_name, is_valid, check_time,
#{checkTbName,jdbcType=VARCHAR}, #{checkColName,jdbcType=VARCHAR}, #{referDbName,jdbcType=VARCHAR}, comment, create_time, check_filters,
#{referTbName,jdbcType=VARCHAR}, #{referColName,jdbcType=VARCHAR}, #{isValid,jdbcType=INTEGER}, refer_filters)
#{checkTime,jdbcType=VARCHAR}, #{comment,jdbcType=VARCHAR}, #{createTime,jdbcType=TIMESTAMP}, values (#{checkType,jdbcType=VARCHAR}, #{checkDbName,jdbcType=VARCHAR}, #{checkTbName,jdbcType=VARCHAR},
#{checkFilters,jdbcType=LONGVARCHAR}, #{referFilters,jdbcType=LONGVARCHAR}) #{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>
<insert id="insertSelective" parameterType="com.gmei.data.dqmp.domain.TblRuleInfoDuplexWithBLOBs" > <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 insert into tbl_rule_info_duplex
<trim prefix="(" suffix=")" suffixOverrides="," > <trim prefix="(" suffix=")" suffixOverrides="," >
<if test="id != null" >
id,
</if>
<if test="checkType != null" > <if test="checkType != null" >
check_type, check_type,
</if> </if>
...@@ -191,9 +194,6 @@ ...@@ -191,9 +194,6 @@
</if> </if>
</trim> </trim>
<trim prefix="values (" suffix=")" suffixOverrides="," > <trim prefix="values (" suffix=")" suffixOverrides="," >
<if test="id != null" >
#{id,jdbcType=INTEGER},
</if>
<if test="checkType != null" > <if test="checkType != null" >
#{checkType,jdbcType=VARCHAR}, #{checkType,jdbcType=VARCHAR},
</if> </if>
......
...@@ -132,23 +132,26 @@ ...@@ -132,23 +132,26 @@
</if> </if>
</delete> </delete>
<insert id="insert" parameterType="com.gmei.data.dqmp.domain.TblRuleInfoSimple" > <insert id="insert" parameterType="com.gmei.data.dqmp.domain.TblRuleInfoSimple" >
insert into tbl_rule_info_simple (id, check_type, db_name, <selectKey resultType="java.lang.Integer" keyProperty="id" order="AFTER" >
tb_name, col_name, time_col_name, SELECT LAST_INSERT_ID()
indicator_type, start_time, is_valid, </selectKey>
check_time, comment, create_time, insert into tbl_rule_info_simple (check_type, db_name, tb_name,
filters) col_name, time_col_name, indicator_type,
values (#{id,jdbcType=INTEGER}, #{checkType,jdbcType=VARCHAR}, #{dbName,jdbcType=VARCHAR}, start_time, is_valid, check_time,
#{tbName,jdbcType=VARCHAR}, #{colName,jdbcType=VARCHAR}, #{timeColName,jdbcType=VARCHAR}, comment, create_time, filters
#{indicatorType,jdbcType=VARCHAR}, #{startTime,jdbcType=VARCHAR}, #{isValid,jdbcType=INTEGER}, )
#{checkTime,jdbcType=VARCHAR}, #{comment,jdbcType=VARCHAR}, #{createTime,jdbcType=TIMESTAMP}, values (#{checkType,jdbcType=VARCHAR}, #{dbName,jdbcType=VARCHAR}, #{tbName,jdbcType=VARCHAR},
#{filters,jdbcType=LONGVARCHAR}) #{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>
<insert id="insertSelective" parameterType="com.gmei.data.dqmp.domain.TblRuleInfoSimple" > <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 insert into tbl_rule_info_simple
<trim prefix="(" suffix=")" suffixOverrides="," > <trim prefix="(" suffix=")" suffixOverrides="," >
<if test="id != null" >
id,
</if>
<if test="checkType != null" > <if test="checkType != null" >
check_type, check_type,
</if> </if>
...@@ -187,9 +190,6 @@ ...@@ -187,9 +190,6 @@
</if> </if>
</trim> </trim>
<trim prefix="values (" suffix=")" suffixOverrides="," > <trim prefix="values (" suffix=")" suffixOverrides="," >
<if test="id != null" >
#{id,jdbcType=INTEGER},
</if>
<if test="checkType != null" > <if test="checkType != null" >
#{checkType,jdbcType=VARCHAR}, #{checkType,jdbcType=VARCHAR},
</if> </if>
......
...@@ -13,6 +13,7 @@ ...@@ -13,6 +13,7 @@
<result column="is_valid" property="isValid" jdbcType="INTEGER" /> <result column="is_valid" property="isValid" jdbcType="INTEGER" />
<result column="check_time" property="checkTime" jdbcType="VARCHAR" /> <result column="check_time" property="checkTime" jdbcType="VARCHAR" />
<result column="comment" property="comment" 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" /> <result column="create_time" property="createTime" jdbcType="TIMESTAMP" />
</resultMap> </resultMap>
<resultMap id="ResultMapWithBLOBs" type="com.gmei.data.dqmp.domain.TblSqlCheckDuplex" extends="BaseResultMap" > <resultMap id="ResultMapWithBLOBs" type="com.gmei.data.dqmp.domain.TblSqlCheckDuplex" extends="BaseResultMap" >
...@@ -78,7 +79,7 @@ ...@@ -78,7 +79,7 @@
</sql> </sql>
<sql id="Base_Column_List" > <sql id="Base_Column_List" >
id, check_type, check_db_name, check_tb_name, check_col_name, refer_db_name, refer_tb_name, 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>
<sql id="Blob_Column_List" > <sql id="Blob_Column_List" >
sql_content sql_content
...@@ -135,13 +136,13 @@ ...@@ -135,13 +136,13 @@
insert into tbl_sql_check_duplex (id, check_type, check_db_name, insert into tbl_sql_check_duplex (id, check_type, check_db_name,
check_tb_name, check_col_name, refer_db_name, check_tb_name, check_col_name, refer_db_name,
refer_tb_name, refer_col_name, is_valid, refer_tb_name, refer_col_name, is_valid,
check_time, comment, create_time, check_time, comment, parent_id,
sql_content) create_time, sql_content)
values (#{id,jdbcType=INTEGER}, #{checkType,jdbcType=VARCHAR}, #{checkDbName,jdbcType=VARCHAR}, values (#{id,jdbcType=INTEGER}, #{checkType,jdbcType=VARCHAR}, #{checkDbName,jdbcType=VARCHAR},
#{checkTbName,jdbcType=VARCHAR}, #{checkColName,jdbcType=VARCHAR}, #{referDbName,jdbcType=VARCHAR}, #{checkTbName,jdbcType=VARCHAR}, #{checkColName,jdbcType=VARCHAR}, #{referDbName,jdbcType=VARCHAR},
#{referTbName,jdbcType=VARCHAR}, #{referColName,jdbcType=VARCHAR}, #{isValid,jdbcType=INTEGER}, #{referTbName,jdbcType=VARCHAR}, #{referColName,jdbcType=VARCHAR}, #{isValid,jdbcType=INTEGER},
#{checkTime,jdbcType=VARCHAR}, #{comment,jdbcType=VARCHAR}, #{createTime,jdbcType=TIMESTAMP}, #{checkTime,jdbcType=VARCHAR}, #{comment,jdbcType=VARCHAR}, #{parentId,jdbcType=INTEGER},
#{sqlContent,jdbcType=LONGVARCHAR}) #{createTime,jdbcType=TIMESTAMP}, #{sqlContent,jdbcType=LONGVARCHAR})
</insert> </insert>
<insert id="insertSelective" parameterType="com.gmei.data.dqmp.domain.TblSqlCheckDuplex" > <insert id="insertSelective" parameterType="com.gmei.data.dqmp.domain.TblSqlCheckDuplex" >
insert into tbl_sql_check_duplex insert into tbl_sql_check_duplex
...@@ -179,6 +180,9 @@ ...@@ -179,6 +180,9 @@
<if test="comment != null" > <if test="comment != null" >
comment, comment,
</if> </if>
<if test="parentId != null" >
parent_id,
</if>
<if test="createTime != null" > <if test="createTime != null" >
create_time, create_time,
</if> </if>
...@@ -220,6 +224,9 @@ ...@@ -220,6 +224,9 @@
<if test="comment != null" > <if test="comment != null" >
#{comment,jdbcType=VARCHAR}, #{comment,jdbcType=VARCHAR},
</if> </if>
<if test="parentId != null" >
#{parentId,jdbcType=INTEGER},
</if>
<if test="createTime != null" > <if test="createTime != null" >
#{createTime,jdbcType=TIMESTAMP}, #{createTime,jdbcType=TIMESTAMP},
</if> </if>
...@@ -270,6 +277,9 @@ ...@@ -270,6 +277,9 @@
<if test="record.comment != null" > <if test="record.comment != null" >
comment = #{record.comment,jdbcType=VARCHAR}, comment = #{record.comment,jdbcType=VARCHAR},
</if> </if>
<if test="record.parentId != null" >
parent_id = #{record.parentId,jdbcType=INTEGER},
</if>
<if test="record.createTime != null" > <if test="record.createTime != null" >
create_time = #{record.createTime,jdbcType=TIMESTAMP}, create_time = #{record.createTime,jdbcType=TIMESTAMP},
</if> </if>
...@@ -294,6 +304,7 @@ ...@@ -294,6 +304,7 @@
is_valid = #{record.isValid,jdbcType=INTEGER}, is_valid = #{record.isValid,jdbcType=INTEGER},
check_time = #{record.checkTime,jdbcType=VARCHAR}, check_time = #{record.checkTime,jdbcType=VARCHAR},
comment = #{record.comment,jdbcType=VARCHAR}, comment = #{record.comment,jdbcType=VARCHAR},
parent_id = #{record.parentId,jdbcType=INTEGER},
create_time = #{record.createTime,jdbcType=TIMESTAMP}, create_time = #{record.createTime,jdbcType=TIMESTAMP},
sql_content = #{record.sqlContent,jdbcType=LONGVARCHAR} sql_content = #{record.sqlContent,jdbcType=LONGVARCHAR}
<if test="_parameter != null" > <if test="_parameter != null" >
...@@ -313,6 +324,7 @@ ...@@ -313,6 +324,7 @@
is_valid = #{record.isValid,jdbcType=INTEGER}, is_valid = #{record.isValid,jdbcType=INTEGER},
check_time = #{record.checkTime,jdbcType=VARCHAR}, check_time = #{record.checkTime,jdbcType=VARCHAR},
comment = #{record.comment,jdbcType=VARCHAR}, comment = #{record.comment,jdbcType=VARCHAR},
parent_id = #{record.parentId,jdbcType=INTEGER},
create_time = #{record.createTime,jdbcType=TIMESTAMP} create_time = #{record.createTime,jdbcType=TIMESTAMP}
<if test="_parameter != null" > <if test="_parameter != null" >
<include refid="Update_By_Example_Where_Clause" /> <include refid="Update_By_Example_Where_Clause" />
...@@ -351,6 +363,9 @@ ...@@ -351,6 +363,9 @@
<if test="comment != null" > <if test="comment != null" >
comment = #{comment,jdbcType=VARCHAR}, comment = #{comment,jdbcType=VARCHAR},
</if> </if>
<if test="parentId != null" >
parent_id = #{parentId,jdbcType=INTEGER},
</if>
<if test="createTime != null" > <if test="createTime != null" >
create_time = #{createTime,jdbcType=TIMESTAMP}, create_time = #{createTime,jdbcType=TIMESTAMP},
</if> </if>
...@@ -372,6 +387,7 @@ ...@@ -372,6 +387,7 @@
is_valid = #{isValid,jdbcType=INTEGER}, is_valid = #{isValid,jdbcType=INTEGER},
check_time = #{checkTime,jdbcType=VARCHAR}, check_time = #{checkTime,jdbcType=VARCHAR},
comment = #{comment,jdbcType=VARCHAR}, comment = #{comment,jdbcType=VARCHAR},
parent_id = #{parentId,jdbcType=INTEGER},
create_time = #{createTime,jdbcType=TIMESTAMP}, create_time = #{createTime,jdbcType=TIMESTAMP},
sql_content = #{sqlContent,jdbcType=LONGVARCHAR} sql_content = #{sqlContent,jdbcType=LONGVARCHAR}
where id = #{id,jdbcType=INTEGER} where id = #{id,jdbcType=INTEGER}
...@@ -388,6 +404,7 @@ ...@@ -388,6 +404,7 @@
is_valid = #{isValid,jdbcType=INTEGER}, is_valid = #{isValid,jdbcType=INTEGER},
check_time = #{checkTime,jdbcType=VARCHAR}, check_time = #{checkTime,jdbcType=VARCHAR},
comment = #{comment,jdbcType=VARCHAR}, comment = #{comment,jdbcType=VARCHAR},
parent_id = #{parentId,jdbcType=INTEGER},
create_time = #{createTime,jdbcType=TIMESTAMP} create_time = #{createTime,jdbcType=TIMESTAMP}
where id = #{id,jdbcType=INTEGER} where id = #{id,jdbcType=INTEGER}
</update> </update>
......
...@@ -10,6 +10,7 @@ ...@@ -10,6 +10,7 @@
<result column="is_valid" property="isValid" jdbcType="INTEGER" /> <result column="is_valid" property="isValid" jdbcType="INTEGER" />
<result column="check_time" property="checkTime" jdbcType="VARCHAR" /> <result column="check_time" property="checkTime" jdbcType="VARCHAR" />
<result column="comment" property="comment" 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" /> <result column="create_time" property="createTime" jdbcType="TIMESTAMP" />
</resultMap> </resultMap>
<resultMap id="ResultMapWithBLOBs" type="com.gmei.data.dqmp.domain.TblSqlCheckSingle" extends="BaseResultMap" > <resultMap id="ResultMapWithBLOBs" type="com.gmei.data.dqmp.domain.TblSqlCheckSingle" extends="BaseResultMap" >
...@@ -74,7 +75,8 @@ ...@@ -74,7 +75,8 @@
</where> </where>
</sql> </sql>
<sql id="Base_Column_List" > <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>
<sql id="Blob_Column_List" > <sql id="Blob_Column_List" >
sql_content sql_content
...@@ -130,12 +132,12 @@ ...@@ -130,12 +132,12 @@
<insert id="insert" parameterType="com.gmei.data.dqmp.domain.TblSqlCheckSingle" > <insert id="insert" parameterType="com.gmei.data.dqmp.domain.TblSqlCheckSingle" >
insert into tbl_sql_check_single (id, check_type, db_name, insert into tbl_sql_check_single (id, check_type, db_name,
tb_name, col_name, is_valid, tb_name, col_name, is_valid,
check_time, comment, create_time, check_time, comment, parent_id,
sql_content) create_time, sql_content)
values (#{id,jdbcType=INTEGER}, #{checkType,jdbcType=VARCHAR}, #{dbName,jdbcType=VARCHAR}, values (#{id,jdbcType=INTEGER}, #{checkType,jdbcType=VARCHAR}, #{dbName,jdbcType=VARCHAR},
#{tbName,jdbcType=VARCHAR}, #{colName,jdbcType=VARCHAR}, #{isValid,jdbcType=INTEGER}, #{tbName,jdbcType=VARCHAR}, #{colName,jdbcType=VARCHAR}, #{isValid,jdbcType=INTEGER},
#{checkTime,jdbcType=VARCHAR}, #{comment,jdbcType=VARCHAR}, #{createTime,jdbcType=TIMESTAMP}, #{checkTime,jdbcType=VARCHAR}, #{comment,jdbcType=VARCHAR}, #{parentId,jdbcType=INTEGER},
#{sqlContent,jdbcType=LONGVARCHAR}) #{createTime,jdbcType=TIMESTAMP}, #{sqlContent,jdbcType=LONGVARCHAR})
</insert> </insert>
<insert id="insertSelective" parameterType="com.gmei.data.dqmp.domain.TblSqlCheckSingle" > <insert id="insertSelective" parameterType="com.gmei.data.dqmp.domain.TblSqlCheckSingle" >
insert into tbl_sql_check_single insert into tbl_sql_check_single
...@@ -164,6 +166,9 @@ ...@@ -164,6 +166,9 @@
<if test="comment != null" > <if test="comment != null" >
comment, comment,
</if> </if>
<if test="parentId != null" >
parent_id,
</if>
<if test="createTime != null" > <if test="createTime != null" >
create_time, create_time,
</if> </if>
...@@ -196,6 +201,9 @@ ...@@ -196,6 +201,9 @@
<if test="comment != null" > <if test="comment != null" >
#{comment,jdbcType=VARCHAR}, #{comment,jdbcType=VARCHAR},
</if> </if>
<if test="parentId != null" >
#{parentId,jdbcType=INTEGER},
</if>
<if test="createTime != null" > <if test="createTime != null" >
#{createTime,jdbcType=TIMESTAMP}, #{createTime,jdbcType=TIMESTAMP},
</if> </if>
...@@ -237,6 +245,9 @@ ...@@ -237,6 +245,9 @@
<if test="record.comment != null" > <if test="record.comment != null" >
comment = #{record.comment,jdbcType=VARCHAR}, comment = #{record.comment,jdbcType=VARCHAR},
</if> </if>
<if test="record.parentId != null" >
parent_id = #{record.parentId,jdbcType=INTEGER},
</if>
<if test="record.createTime != null" > <if test="record.createTime != null" >
create_time = #{record.createTime,jdbcType=TIMESTAMP}, create_time = #{record.createTime,jdbcType=TIMESTAMP},
</if> </if>
...@@ -258,6 +269,7 @@ ...@@ -258,6 +269,7 @@
is_valid = #{record.isValid,jdbcType=INTEGER}, is_valid = #{record.isValid,jdbcType=INTEGER},
check_time = #{record.checkTime,jdbcType=VARCHAR}, check_time = #{record.checkTime,jdbcType=VARCHAR},
comment = #{record.comment,jdbcType=VARCHAR}, comment = #{record.comment,jdbcType=VARCHAR},
parent_id = #{record.parentId,jdbcType=INTEGER},
create_time = #{record.createTime,jdbcType=TIMESTAMP}, create_time = #{record.createTime,jdbcType=TIMESTAMP},
sql_content = #{record.sqlContent,jdbcType=LONGVARCHAR} sql_content = #{record.sqlContent,jdbcType=LONGVARCHAR}
<if test="_parameter != null" > <if test="_parameter != null" >
...@@ -274,6 +286,7 @@ ...@@ -274,6 +286,7 @@
is_valid = #{record.isValid,jdbcType=INTEGER}, is_valid = #{record.isValid,jdbcType=INTEGER},
check_time = #{record.checkTime,jdbcType=VARCHAR}, check_time = #{record.checkTime,jdbcType=VARCHAR},
comment = #{record.comment,jdbcType=VARCHAR}, comment = #{record.comment,jdbcType=VARCHAR},
parent_id = #{record.parentId,jdbcType=INTEGER},
create_time = #{record.createTime,jdbcType=TIMESTAMP} create_time = #{record.createTime,jdbcType=TIMESTAMP}
<if test="_parameter != null" > <if test="_parameter != null" >
<include refid="Update_By_Example_Where_Clause" /> <include refid="Update_By_Example_Where_Clause" />
...@@ -303,6 +316,9 @@ ...@@ -303,6 +316,9 @@
<if test="comment != null" > <if test="comment != null" >
comment = #{comment,jdbcType=VARCHAR}, comment = #{comment,jdbcType=VARCHAR},
</if> </if>
<if test="parentId != null" >
parent_id = #{parentId,jdbcType=INTEGER},
</if>
<if test="createTime != null" > <if test="createTime != null" >
create_time = #{createTime,jdbcType=TIMESTAMP}, create_time = #{createTime,jdbcType=TIMESTAMP},
</if> </if>
...@@ -321,6 +337,7 @@ ...@@ -321,6 +337,7 @@
is_valid = #{isValid,jdbcType=INTEGER}, is_valid = #{isValid,jdbcType=INTEGER},
check_time = #{checkTime,jdbcType=VARCHAR}, check_time = #{checkTime,jdbcType=VARCHAR},
comment = #{comment,jdbcType=VARCHAR}, comment = #{comment,jdbcType=VARCHAR},
parent_id = #{parentId,jdbcType=INTEGER},
create_time = #{createTime,jdbcType=TIMESTAMP}, create_time = #{createTime,jdbcType=TIMESTAMP},
sql_content = #{sqlContent,jdbcType=LONGVARCHAR} sql_content = #{sqlContent,jdbcType=LONGVARCHAR}
where id = #{id,jdbcType=INTEGER} where id = #{id,jdbcType=INTEGER}
...@@ -334,6 +351,7 @@ ...@@ -334,6 +351,7 @@
is_valid = #{isValid,jdbcType=INTEGER}, is_valid = #{isValid,jdbcType=INTEGER},
check_time = #{checkTime,jdbcType=VARCHAR}, check_time = #{checkTime,jdbcType=VARCHAR},
comment = #{comment,jdbcType=VARCHAR}, comment = #{comment,jdbcType=VARCHAR},
parent_id = #{parentId,jdbcType=INTEGER},
create_time = #{createTime,jdbcType=TIMESTAMP} create_time = #{createTime,jdbcType=TIMESTAMP}
where id = #{id,jdbcType=INTEGER} where id = #{id,jdbcType=INTEGER}
</update> </update>
......
...@@ -12,6 +12,7 @@ ...@@ -12,6 +12,7 @@
<result column="is_valid" property="isValid" jdbcType="INTEGER" /> <result column="is_valid" property="isValid" jdbcType="INTEGER" />
<result column="check_time" property="checkTime" jdbcType="VARCHAR" /> <result column="check_time" property="checkTime" jdbcType="VARCHAR" />
<result column="comment" property="comment" 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" /> <result column="create_time" property="createTime" jdbcType="TIMESTAMP" />
</resultMap> </resultMap>
<resultMap id="ResultMapWithBLOBs" type="com.gmei.data.dqmp.domain.TblSqlMonitorSpecial" extends="BaseResultMap" > <resultMap id="ResultMapWithBLOBs" type="com.gmei.data.dqmp.domain.TblSqlMonitorSpecial" extends="BaseResultMap" >
...@@ -77,7 +78,7 @@ ...@@ -77,7 +78,7 @@
</sql> </sql>
<sql id="Base_Column_List" > <sql id="Base_Column_List" >
id, db_name, tb_name, col_name, time_col_name, indicator_type, start_time, is_valid, 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>
<sql id="Blob_Column_List" > <sql id="Blob_Column_List" >
sql_content sql_content
...@@ -134,13 +135,13 @@ ...@@ -134,13 +135,13 @@
insert into tbl_sql_monitor_special (id, db_name, tb_name, insert into tbl_sql_monitor_special (id, db_name, tb_name,
col_name, time_col_name, indicator_type, col_name, time_col_name, indicator_type,
start_time, is_valid, check_time, 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}, values (#{id,jdbcType=INTEGER}, #{dbName,jdbcType=VARCHAR}, #{tbName,jdbcType=VARCHAR},
#{colName,jdbcType=VARCHAR}, #{timeColName,jdbcType=VARCHAR}, #{indicatorType,jdbcType=VARCHAR}, #{colName,jdbcType=VARCHAR}, #{timeColName,jdbcType=VARCHAR}, #{indicatorType,jdbcType=VARCHAR},
#{startTime,jdbcType=VARCHAR}, #{isValid,jdbcType=INTEGER}, #{checkTime,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>
<insert id="insertSelective" parameterType="com.gmei.data.dqmp.domain.TblSqlMonitorSpecial" > <insert id="insertSelective" parameterType="com.gmei.data.dqmp.domain.TblSqlMonitorSpecial" >
insert into tbl_sql_monitor_special insert into tbl_sql_monitor_special
...@@ -175,6 +176,9 @@ ...@@ -175,6 +176,9 @@
<if test="comment != null" > <if test="comment != null" >
comment, comment,
</if> </if>
<if test="parentId != null" >
parent_id,
</if>
<if test="createTime != null" > <if test="createTime != null" >
create_time, create_time,
</if> </if>
...@@ -213,6 +217,9 @@ ...@@ -213,6 +217,9 @@
<if test="comment != null" > <if test="comment != null" >
#{comment,jdbcType=VARCHAR}, #{comment,jdbcType=VARCHAR},
</if> </if>
<if test="parentId != null" >
#{parentId,jdbcType=INTEGER},
</if>
<if test="createTime != null" > <if test="createTime != null" >
#{createTime,jdbcType=TIMESTAMP}, #{createTime,jdbcType=TIMESTAMP},
</if> </if>
...@@ -260,6 +267,9 @@ ...@@ -260,6 +267,9 @@
<if test="record.comment != null" > <if test="record.comment != null" >
comment = #{record.comment,jdbcType=VARCHAR}, comment = #{record.comment,jdbcType=VARCHAR},
</if> </if>
<if test="record.parentId != null" >
parent_id = #{record.parentId,jdbcType=INTEGER},
</if>
<if test="record.createTime != null" > <if test="record.createTime != null" >
create_time = #{record.createTime,jdbcType=TIMESTAMP}, create_time = #{record.createTime,jdbcType=TIMESTAMP},
</if> </if>
...@@ -283,6 +293,7 @@ ...@@ -283,6 +293,7 @@
is_valid = #{record.isValid,jdbcType=INTEGER}, is_valid = #{record.isValid,jdbcType=INTEGER},
check_time = #{record.checkTime,jdbcType=VARCHAR}, check_time = #{record.checkTime,jdbcType=VARCHAR},
comment = #{record.comment,jdbcType=VARCHAR}, comment = #{record.comment,jdbcType=VARCHAR},
parent_id = #{record.parentId,jdbcType=INTEGER},
create_time = #{record.createTime,jdbcType=TIMESTAMP}, create_time = #{record.createTime,jdbcType=TIMESTAMP},
sql_content = #{record.sqlContent,jdbcType=LONGVARCHAR} sql_content = #{record.sqlContent,jdbcType=LONGVARCHAR}
<if test="_parameter != null" > <if test="_parameter != null" >
...@@ -301,6 +312,7 @@ ...@@ -301,6 +312,7 @@
is_valid = #{record.isValid,jdbcType=INTEGER}, is_valid = #{record.isValid,jdbcType=INTEGER},
check_time = #{record.checkTime,jdbcType=VARCHAR}, check_time = #{record.checkTime,jdbcType=VARCHAR},
comment = #{record.comment,jdbcType=VARCHAR}, comment = #{record.comment,jdbcType=VARCHAR},
parent_id = #{record.parentId,jdbcType=INTEGER},
create_time = #{record.createTime,jdbcType=TIMESTAMP} create_time = #{record.createTime,jdbcType=TIMESTAMP}
<if test="_parameter != null" > <if test="_parameter != null" >
<include refid="Update_By_Example_Where_Clause" /> <include refid="Update_By_Example_Where_Clause" />
...@@ -336,6 +348,9 @@ ...@@ -336,6 +348,9 @@
<if test="comment != null" > <if test="comment != null" >
comment = #{comment,jdbcType=VARCHAR}, comment = #{comment,jdbcType=VARCHAR},
</if> </if>
<if test="parentId != null" >
parent_id = #{parentId,jdbcType=INTEGER},
</if>
<if test="createTime != null" > <if test="createTime != null" >
create_time = #{createTime,jdbcType=TIMESTAMP}, create_time = #{createTime,jdbcType=TIMESTAMP},
</if> </if>
...@@ -356,6 +371,7 @@ ...@@ -356,6 +371,7 @@
is_valid = #{isValid,jdbcType=INTEGER}, is_valid = #{isValid,jdbcType=INTEGER},
check_time = #{checkTime,jdbcType=VARCHAR}, check_time = #{checkTime,jdbcType=VARCHAR},
comment = #{comment,jdbcType=VARCHAR}, comment = #{comment,jdbcType=VARCHAR},
parent_id = #{parentId,jdbcType=INTEGER},
create_time = #{createTime,jdbcType=TIMESTAMP}, create_time = #{createTime,jdbcType=TIMESTAMP},
sql_content = #{sqlContent,jdbcType=LONGVARCHAR} sql_content = #{sqlContent,jdbcType=LONGVARCHAR}
where id = #{id,jdbcType=INTEGER} where id = #{id,jdbcType=INTEGER}
...@@ -371,6 +387,7 @@ ...@@ -371,6 +387,7 @@
is_valid = #{isValid,jdbcType=INTEGER}, is_valid = #{isValid,jdbcType=INTEGER},
check_time = #{checkTime,jdbcType=VARCHAR}, check_time = #{checkTime,jdbcType=VARCHAR},
comment = #{comment,jdbcType=VARCHAR}, comment = #{comment,jdbcType=VARCHAR},
parent_id = #{parentId,jdbcType=INTEGER},
create_time = #{createTime,jdbcType=TIMESTAMP} create_time = #{createTime,jdbcType=TIMESTAMP}
where id = #{id,jdbcType=INTEGER} where id = #{id,jdbcType=INTEGER}
</update> </update>
......
...@@ -10,6 +10,7 @@ ...@@ -10,6 +10,7 @@
<result column="is_valid" property="isValid" jdbcType="INTEGER" /> <result column="is_valid" property="isValid" jdbcType="INTEGER" />
<result column="check_time" property="checkTime" jdbcType="VARCHAR" /> <result column="check_time" property="checkTime" jdbcType="VARCHAR" />
<result column="comment" property="comment" 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" /> <result column="create_time" property="createTime" jdbcType="TIMESTAMP" />
</resultMap> </resultMap>
<resultMap id="ResultMapWithBLOBs" type="com.gmei.data.dqmp.domain.TblSqlMonitorVolatility" extends="BaseResultMap" > <resultMap id="ResultMapWithBLOBs" type="com.gmei.data.dqmp.domain.TblSqlMonitorVolatility" extends="BaseResultMap" >
...@@ -74,7 +75,8 @@ ...@@ -74,7 +75,8 @@
</where> </where>
</sql> </sql>
<sql id="Base_Column_List" > <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>
<sql id="Blob_Column_List" > <sql id="Blob_Column_List" >
sql_content sql_content
...@@ -130,12 +132,12 @@ ...@@ -130,12 +132,12 @@
<insert id="insert" parameterType="com.gmei.data.dqmp.domain.TblSqlMonitorVolatility" > <insert id="insert" parameterType="com.gmei.data.dqmp.domain.TblSqlMonitorVolatility" >
insert into tbl_sql_monitor_volatility (id, db_name, tb_name, insert into tbl_sql_monitor_volatility (id, db_name, tb_name,
col_name, indicator_type, is_valid, col_name, indicator_type, is_valid,
check_time, comment, create_time, check_time, comment, parent_id,
sql_content) create_time, sql_content)
values (#{id,jdbcType=INTEGER}, #{dbName,jdbcType=VARCHAR}, #{tbName,jdbcType=VARCHAR}, values (#{id,jdbcType=INTEGER}, #{dbName,jdbcType=VARCHAR}, #{tbName,jdbcType=VARCHAR},
#{colName,jdbcType=VARCHAR}, #{indicatorType,jdbcType=VARCHAR}, #{isValid,jdbcType=INTEGER}, #{colName,jdbcType=VARCHAR}, #{indicatorType,jdbcType=VARCHAR}, #{isValid,jdbcType=INTEGER},
#{checkTime,jdbcType=VARCHAR}, #{comment,jdbcType=VARCHAR}, #{createTime,jdbcType=TIMESTAMP}, #{checkTime,jdbcType=VARCHAR}, #{comment,jdbcType=VARCHAR}, #{parentId,jdbcType=INTEGER},
#{sqlContent,jdbcType=LONGVARCHAR}) #{createTime,jdbcType=TIMESTAMP}, #{sqlContent,jdbcType=LONGVARCHAR})
</insert> </insert>
<insert id="insertSelective" parameterType="com.gmei.data.dqmp.domain.TblSqlMonitorVolatility" > <insert id="insertSelective" parameterType="com.gmei.data.dqmp.domain.TblSqlMonitorVolatility" >
insert into tbl_sql_monitor_volatility insert into tbl_sql_monitor_volatility
...@@ -164,6 +166,9 @@ ...@@ -164,6 +166,9 @@
<if test="comment != null" > <if test="comment != null" >
comment, comment,
</if> </if>
<if test="parentId != null" >
parent_id,
</if>
<if test="createTime != null" > <if test="createTime != null" >
create_time, create_time,
</if> </if>
...@@ -196,6 +201,9 @@ ...@@ -196,6 +201,9 @@
<if test="comment != null" > <if test="comment != null" >
#{comment,jdbcType=VARCHAR}, #{comment,jdbcType=VARCHAR},
</if> </if>
<if test="parentId != null" >
#{parentId,jdbcType=INTEGER},
</if>
<if test="createTime != null" > <if test="createTime != null" >
#{createTime,jdbcType=TIMESTAMP}, #{createTime,jdbcType=TIMESTAMP},
</if> </if>
...@@ -237,6 +245,9 @@ ...@@ -237,6 +245,9 @@
<if test="record.comment != null" > <if test="record.comment != null" >
comment = #{record.comment,jdbcType=VARCHAR}, comment = #{record.comment,jdbcType=VARCHAR},
</if> </if>
<if test="record.parentId != null" >
parent_id = #{record.parentId,jdbcType=INTEGER},
</if>
<if test="record.createTime != null" > <if test="record.createTime != null" >
create_time = #{record.createTime,jdbcType=TIMESTAMP}, create_time = #{record.createTime,jdbcType=TIMESTAMP},
</if> </if>
...@@ -258,6 +269,7 @@ ...@@ -258,6 +269,7 @@
is_valid = #{record.isValid,jdbcType=INTEGER}, is_valid = #{record.isValid,jdbcType=INTEGER},
check_time = #{record.checkTime,jdbcType=VARCHAR}, check_time = #{record.checkTime,jdbcType=VARCHAR},
comment = #{record.comment,jdbcType=VARCHAR}, comment = #{record.comment,jdbcType=VARCHAR},
parent_id = #{record.parentId,jdbcType=INTEGER},
create_time = #{record.createTime,jdbcType=TIMESTAMP}, create_time = #{record.createTime,jdbcType=TIMESTAMP},
sql_content = #{record.sqlContent,jdbcType=LONGVARCHAR} sql_content = #{record.sqlContent,jdbcType=LONGVARCHAR}
<if test="_parameter != null" > <if test="_parameter != null" >
...@@ -274,6 +286,7 @@ ...@@ -274,6 +286,7 @@
is_valid = #{record.isValid,jdbcType=INTEGER}, is_valid = #{record.isValid,jdbcType=INTEGER},
check_time = #{record.checkTime,jdbcType=VARCHAR}, check_time = #{record.checkTime,jdbcType=VARCHAR},
comment = #{record.comment,jdbcType=VARCHAR}, comment = #{record.comment,jdbcType=VARCHAR},
parent_id = #{record.parentId,jdbcType=INTEGER},
create_time = #{record.createTime,jdbcType=TIMESTAMP} create_time = #{record.createTime,jdbcType=TIMESTAMP}
<if test="_parameter != null" > <if test="_parameter != null" >
<include refid="Update_By_Example_Where_Clause" /> <include refid="Update_By_Example_Where_Clause" />
...@@ -303,6 +316,9 @@ ...@@ -303,6 +316,9 @@
<if test="comment != null" > <if test="comment != null" >
comment = #{comment,jdbcType=VARCHAR}, comment = #{comment,jdbcType=VARCHAR},
</if> </if>
<if test="parentId != null" >
parent_id = #{parentId,jdbcType=INTEGER},
</if>
<if test="createTime != null" > <if test="createTime != null" >
create_time = #{createTime,jdbcType=TIMESTAMP}, create_time = #{createTime,jdbcType=TIMESTAMP},
</if> </if>
...@@ -321,6 +337,7 @@ ...@@ -321,6 +337,7 @@
is_valid = #{isValid,jdbcType=INTEGER}, is_valid = #{isValid,jdbcType=INTEGER},
check_time = #{checkTime,jdbcType=VARCHAR}, check_time = #{checkTime,jdbcType=VARCHAR},
comment = #{comment,jdbcType=VARCHAR}, comment = #{comment,jdbcType=VARCHAR},
parent_id = #{parentId,jdbcType=INTEGER},
create_time = #{createTime,jdbcType=TIMESTAMP}, create_time = #{createTime,jdbcType=TIMESTAMP},
sql_content = #{sqlContent,jdbcType=LONGVARCHAR} sql_content = #{sqlContent,jdbcType=LONGVARCHAR}
where id = #{id,jdbcType=INTEGER} where id = #{id,jdbcType=INTEGER}
...@@ -334,6 +351,7 @@ ...@@ -334,6 +351,7 @@
is_valid = #{isValid,jdbcType=INTEGER}, is_valid = #{isValid,jdbcType=INTEGER},
check_time = #{checkTime,jdbcType=VARCHAR}, check_time = #{checkTime,jdbcType=VARCHAR},
comment = #{comment,jdbcType=VARCHAR}, comment = #{comment,jdbcType=VARCHAR},
parent_id = #{parentId,jdbcType=INTEGER},
create_time = #{createTime,jdbcType=TIMESTAMP} create_time = #{createTime,jdbcType=TIMESTAMP}
where id = #{id,jdbcType=INTEGER} where id = #{id,jdbcType=INTEGER}
</update> </update>
......
<!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>
<!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>
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment