diff --git a/yudao-framework/yudao-spring-boot-starter-mybatis/src/main/java/cn/iocoder/yudao/framework/mybatis/core/dataobject/BaseEntity.java b/yudao-framework/yudao-spring-boot-starter-mybatis/src/main/java/cn/iocoder/yudao/framework/mybatis/core/dataobject/BaseEntity.java index 08faf191e..847a59100 100644 --- a/yudao-framework/yudao-spring-boot-starter-mybatis/src/main/java/cn/iocoder/yudao/framework/mybatis/core/dataobject/BaseEntity.java +++ b/yudao-framework/yudao-spring-boot-starter-mybatis/src/main/java/cn/iocoder/yudao/framework/mybatis/core/dataobject/BaseEntity.java @@ -47,6 +47,13 @@ public abstract class BaseEntity implements Serializable, TransPojo { */ @TableField(fill = FieldFill.INSERT_UPDATE, jdbcType = JdbcType.VARCHAR) private String updater; + + private Long creatorId; + + private String createBy; + private Long updatorId; + + private String updateBy; /** * 是否删除 */ diff --git a/yudao-module-mdpf/yudao-module-mdpf-biz/src/main/java/cn/iocoder/yudao/module/mdpf/controller/rule/AttAuditRuleController.java b/yudao-module-mdpf/yudao-module-mdpf-biz/src/main/java/cn/iocoder/yudao/module/mdpf/controller/rule/AttAuditRuleController.java new file mode 100644 index 000000000..f96b5890e --- /dev/null +++ b/yudao-module-mdpf/yudao-module-mdpf-biz/src/main/java/cn/iocoder/yudao/module/mdpf/controller/rule/AttAuditRuleController.java @@ -0,0 +1,114 @@ +package cn.iocoder.yudao.module.mdpf.controller.rule; + +import cn.hutool.core.date.DateUtil; +import cn.hutool.poi.excel.ExcelUtil; +import cn.iocoder.yudao.framework.common.pojo.CommonResult; +import cn.iocoder.yudao.framework.common.pojo.PageResult; +import cn.iocoder.yudao.framework.common.util.object.BeanUtils; +import cn.iocoder.yudao.module.mdpf.controller.rule.vo.AttAuditRulePageReqVO; +import cn.iocoder.yudao.module.mdpf.controller.rule.vo.AttAuditRuleRespVO; +import cn.iocoder.yudao.module.mdpf.controller.rule.vo.AttAuditRuleSaveReqVO; +import cn.iocoder.yudao.module.mdpf.core.page.PageParam; +import cn.iocoder.yudao.module.mdpf.dal.dataobject.rule.AttAuditRuleDO; +import cn.iocoder.yudao.module.mdpf.service.rule.IAttAuditRuleService; +import io.swagger.v3.oas.annotations.Operation; +import io.swagger.v3.oas.annotations.tags.Tag; +import org.springframework.security.access.prepost.PreAuthorize; +import org.springframework.validation.annotation.Validated; +import org.springframework.web.bind.annotation.*; +import org.springframework.web.multipart.MultipartFile; +import javax.annotation.Resource; +import javax.servlet.http.HttpServletResponse; +import javax.validation.Valid; +import java.time.LocalDateTime; +import java.util.Arrays; +import java.util.List; + +/** + * 稽查规则Controller + * + * @author qdata + * @date 2025-01-20 + */ +@Tag(name = "稽查规则") +@RestController +@RequestMapping("/att/attAuditRule") +@Validated +public class AttAuditRuleController { + @Resource + private IAttAuditRuleService attAuditRuleService; + + @Operation(summary = "查询稽查规则列表") + @PreAuthorize("@ss.hasPermi('att:rule:auditrule:list')") + @GetMapping("/list") + public CommonResult> list(AttAuditRulePageReqVO attAuditRule) { + PageResult page = attAuditRuleService.getAttAuditRulePage(attAuditRule); + return CommonResult.success(BeanUtils.toBean(page, AttAuditRuleRespVO.class)); + } + +// @Operation(summary = "导出稽查规则列表") +// @PreAuthorize("@ss.hasPermi('att:rule:auditrule:export')") +// @PostMapping("/export") +// public void export(HttpServletResponse response, AttAuditRulePageReqVO exportReqVO) { +// exportReqVO.setPageSize(PageParam.PAGE_SIZE_NONE); +// List list = (List) attAuditRuleService.getAttAuditRulePage(exportReqVO) +// .getList(); +// ExcelUtil util = new ExcelUtil<>(AttAuditRuleRespVO.class); +// util.exportExcel(response, AttAuditRuleConvert.INSTANCE.convertToRespVOList(list), "应用管理数据"); +// } +// +// @Operation(summary = "导入稽查规则列表") +// @PreAuthorize("@ss.hasPermi('att:rule:auditrule:import')") +// @Log(title = "稽查规则", businessType = BusinessType.IMPORT) +// @PostMapping("/importData") +// public AjaxResult importData(MultipartFile file, boolean updateSupport) throws Exception { +// ExcelUtil util = new ExcelUtil<>(AttAuditRuleRespVO.class); +// List importExcelList = util.importExcel(file.getInputStream()); +// String operName = getUsername(); +// String message = attAuditRuleService.importAttAuditRule(importExcelList, updateSupport, operName); +// return success(message); +// } + + @Operation(summary = "获取稽查规则详细信息") + @PreAuthorize("@ss.hasPermi('att:rule:auditrule:query')") + @GetMapping(value = "/{ID}") + public CommonResult getInfo(@PathVariable("ID") Long ID) { + AttAuditRuleDO attAuditRuleDO = attAuditRuleService.getAttAuditRuleById(ID); + return CommonResult.success(BeanUtils.toBean(attAuditRuleDO, AttAuditRuleRespVO.class)); + } + + @Operation(summary = "新增稽查规则") + @PreAuthorize("@ss.hasPermi('att:rule:auditrule:add')") + @PostMapping + public CommonResult add(@Valid @RequestBody AttAuditRuleSaveReqVO attAuditRule) { +// attAuditRule.setCreatorId(getUserId()); +// attAuditRule.setCreateBy(getNickName()); + attAuditRule.setCreateTime(LocalDateTime.now()); + return CommonResult.success(attAuditRuleService.createAttAuditRule(attAuditRule)); + } + + @Operation(summary = "修改稽查规则") + @PreAuthorize("@ss.hasPermi('att:rule:auditrule:edit')") + @PutMapping + public CommonResult edit(@Valid @RequestBody AttAuditRuleSaveReqVO attAuditRule) { +// attAuditRule.setUpdatorId(getUserId()); +// attAuditRule.setUpdateBy(getNickName()); + attAuditRule.setUpdateTime(LocalDateTime.now()); + return CommonResult.success(attAuditRuleService.updateAttAuditRule(attAuditRule)); + } + + @Operation(summary = "删除稽查规则") + @PreAuthorize("@ss.hasPermi('att:rule:auditrule:remove')") + @DeleteMapping("/{ids}") + public CommonResult remove(@PathVariable Long[] ids) { + return CommonResult.success(attAuditRuleService.removeAttAuditRule(Arrays.asList(ids))); + } + + @Operation(summary = "获取稽查规则树形结构") + @GetMapping("/tree") + public CommonResult> tree(@RequestParam Long dataElemId) { + List tree = attAuditRuleService.getAttAuditRuleTree(dataElemId); + return CommonResult.success(tree); + } + +} diff --git a/yudao-module-mdpf/yudao-module-mdpf-biz/src/main/java/cn/iocoder/yudao/module/mdpf/controller/rule/AttCleanRuleController.java b/yudao-module-mdpf/yudao-module-mdpf-biz/src/main/java/cn/iocoder/yudao/module/mdpf/controller/rule/AttCleanRuleController.java new file mode 100644 index 000000000..bbf68d1aa --- /dev/null +++ b/yudao-module-mdpf/yudao-module-mdpf-biz/src/main/java/cn/iocoder/yudao/module/mdpf/controller/rule/AttCleanRuleController.java @@ -0,0 +1,128 @@ +package cn.iocoder.yudao.module.mdpf.controller.rule; + +import cn.hutool.core.date.DateUtil; +import cn.iocoder.yudao.framework.common.pojo.CommonResult; +import cn.iocoder.yudao.framework.common.pojo.PageResult; +import cn.iocoder.yudao.framework.common.util.object.BeanUtils; +import cn.iocoder.yudao.module.mdpf.controller.rule.vo.AttCleanRulePageReqVO; +import cn.iocoder.yudao.module.mdpf.controller.rule.vo.AttCleanRuleRespVO; +import cn.iocoder.yudao.module.mdpf.controller.rule.vo.AttCleanRuleSaveReqVO; +import cn.iocoder.yudao.module.mdpf.dal.dataobject.rule.AttCleanRuleDO; +import cn.iocoder.yudao.module.mdpf.service.rule.IAttCleanRuleService; +import io.swagger.v3.oas.annotations.Operation; +import io.swagger.v3.oas.annotations.tags.Tag; +import org.springframework.security.access.prepost.PreAuthorize; +import org.springframework.validation.annotation.Validated; +import org.springframework.web.bind.annotation.*; +import org.springframework.web.multipart.MultipartFile; + +import javax.annotation.Resource; +import javax.servlet.http.HttpServletResponse; +import javax.validation.Valid; +import java.time.LocalDateTime; +import java.util.Arrays; +import java.util.List; + +/** + * 清洗规则Controller + * + * @author qdata + * @date 2025-01-20 + */ +@Tag(name = "清洗规则") +@RestController +@RequestMapping("/att/attCleanRule") +@Validated +public class AttCleanRuleController { + @Resource + private IAttCleanRuleService attCleanRuleService; + + @Operation(summary = "查询清洗规则列表") + @PreAuthorize("@ss.hasPermi('att:rule:attcleanrule:list')") + @GetMapping("/list") + public CommonResult> list(AttCleanRulePageReqVO attCleanRule) { + PageResult page = attCleanRuleService.getAttCleanRulePage(attCleanRule); + return CommonResult.success(BeanUtils.toBean(page, AttCleanRuleRespVO.class)); + } + + @Operation(summary = "查询清洗规则列表") + @GetMapping("/listAll") + public CommonResult> listAll(AttCleanRulePageReqVO attCleanRule) { + List page = attCleanRuleService.getAttCleanRuleList(attCleanRule); + return CommonResult.success(page); + } + +// @Operation(summary = "导出清洗规则列表") +// @PreAuthorize("@ss.hasPermi('att:rule:attcleanrule:export')") +// @Log(title = "清洗规则", businessType = BusinessType.EXPORT) +// @PostMapping("/export") +// public void export(HttpServletResponse response, AttCleanRulePageReqVO exportReqVO) { +// exportReqVO.setPageSize(PageParam.PAGE_SIZE_NONE); +// List list = (List) attCleanRuleService.getAttCleanRulePage(exportReqVO) +// .getRows(); +// ExcelUtil util = new ExcelUtil<>(AttCleanRuleRespVO.class); +// util.exportExcel(response, AttCleanRuleConvert.INSTANCE.convertToRespVOList(list), "应用管理数据"); +// } +// +// @Operation(summary = "导入清洗规则列表") +// @PreAuthorize("@ss.hasPermi('att:rule:attcleanrule:import')") +// @Log(title = "清洗规则", businessType = BusinessType.IMPORT) +// @PostMapping("/importData") +// public AjaxResult importData(MultipartFile file, boolean updateSupport) throws Exception { +// ExcelUtil util = new ExcelUtil<>(AttCleanRuleRespVO.class); +// List importExcelList = util.importExcel(file.getInputStream()); +// String operName = getUsername(); +// String message = attCleanRuleService.importAttCleanRule(importExcelList, updateSupport, operName); +// return success(message); +// } + + @Operation(summary = "获取清洗规则详细信息") + @PreAuthorize("@ss.hasPermi('att:rule:attcleanrule:query')") + @GetMapping(value = "/{ID}") + public CommonResult getInfo(@PathVariable("ID") Long ID) { + AttCleanRuleDO attCleanRuleDO = attCleanRuleService.getAttCleanRuleById(ID); + return CommonResult.success(BeanUtils.toBean(attCleanRuleDO, AttCleanRuleRespVO.class)); + } + + @Operation(summary = "新增清洗规则") + @PreAuthorize("@ss.hasPermi('att:rule:attcleanrule:add')") + @PostMapping + public CommonResult add(@Valid @RequestBody AttCleanRuleSaveReqVO attCleanRule) { +// attCleanRule.setCreatorId(getUserId()); +// attCleanRule.setCreateBy(getNickName()); + attCleanRule.setCreateTime(LocalDateTime.now()); + return CommonResult.success(attCleanRuleService.createAttCleanRule(attCleanRule)); + } + + @Operation(summary = "修改清洗规则") + @PreAuthorize("@ss.hasPermi('att:rule:attcleanrule:edit')") + @PutMapping + public CommonResult edit(@Valid @RequestBody AttCleanRuleSaveReqVO attCleanRule) { +// attCleanRule.setUpdatorId(getUserId()); +// attCleanRule.setUpdateBy(getNickName()); + attCleanRule.setUpdateTime(LocalDateTime.now()); + return CommonResult.success(attCleanRuleService.updateAttCleanRule(attCleanRule)); + } + + @Operation(summary = "删除清洗规则") + @PreAuthorize("@ss.hasPermi('att:rule:attcleanrule:remove')") + @DeleteMapping("/{ids}") + public CommonResult remove(@PathVariable Long[] ids) { + return CommonResult.success(attCleanRuleService.removeAttCleanRule(Arrays.asList(ids))); + } + + @Operation(summary = "获取清洗规则树形结构") + @GetMapping("/tree") + public CommonResult> tree(@RequestParam Long dataElemId) { + List tree = attCleanRuleService.getAttCleanRuleTree(dataElemId); + return CommonResult.success(tree); + } + + @Operation(summary = "获取清洗规则树形结构") + @GetMapping("/getCleaningRuleTree") + public CommonResult> getCleaningRuleTree(@RequestParam(name = "ids", required = false) Long[] ids) { + List tree = attCleanRuleService.getCleaningRuleTree(ids); + return CommonResult.success(tree); + } + +} diff --git a/yudao-module-mdpf/yudao-module-mdpf-biz/src/main/java/cn/iocoder/yudao/module/mdpf/controller/rule/vo/AttAuditRulePageReqVO.java b/yudao-module-mdpf/yudao-module-mdpf-biz/src/main/java/cn/iocoder/yudao/module/mdpf/controller/rule/vo/AttAuditRulePageReqVO.java new file mode 100644 index 000000000..bdf6f593c --- /dev/null +++ b/yudao-module-mdpf/yudao-module-mdpf-biz/src/main/java/cn/iocoder/yudao/module/mdpf/controller/rule/vo/AttAuditRulePageReqVO.java @@ -0,0 +1,52 @@ +package cn.iocoder.yudao.module.mdpf.controller.rule.vo; + +import cn.iocoder.yudao.module.mdpf.core.page.PageParam; +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; + +/** + * 稽查规则 Request VO 对象 ATT_AUDIT_RULE + * + * @author qdata + * @date 2025-01-20 + */ +@Schema(description = "稽查规则 Request VO") +@Data +public class AttAuditRulePageReqVO extends PageParam { + + private static final long serialVersionUID = 1L; + + @Schema(description = "规则名称", example = "") + private String name; + + @Schema(description = "质量维度", example = "") + private String qualityDim; + + @Schema(description = "规则类型", example = "") + private String type; + @Schema(description = "规则级别", example = "") + private String level; + + @Schema(description = "规则编码", example = "101") + private String code; + + @Schema(description = "使用场景", example = "用于身份证号非空检查") + private String useCase; + + @Schema(description = "示例", example = "字段值不能为空,如:ID=123456") + private String example; + + @Schema(description = "图标地址", example = "/images/icon.png") + private String iconPath; + + @Schema(description = "策略标识", example = "NOT_NULL_ID_CHECK") + private String strategyKey; + + + /** 是否有效 */ + private String validFlag; + + + + +} diff --git a/yudao-module-mdpf/yudao-module-mdpf-biz/src/main/java/cn/iocoder/yudao/module/mdpf/controller/rule/vo/AttAuditRuleRespVO.java b/yudao-module-mdpf/yudao-module-mdpf-biz/src/main/java/cn/iocoder/yudao/module/mdpf/controller/rule/vo/AttAuditRuleRespVO.java new file mode 100644 index 000000000..2d7135094 --- /dev/null +++ b/yudao-module-mdpf/yudao-module-mdpf-biz/src/main/java/cn/iocoder/yudao/module/mdpf/controller/rule/vo/AttAuditRuleRespVO.java @@ -0,0 +1,123 @@ +package cn.iocoder.yudao.module.mdpf.controller.rule.vo; + +import cn.iocoder.yudao.module.mdpf.util.Excel; +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; + +import java.io.Serializable; +import java.util.Date; +import java.util.List; + +/** + * 稽查规则 Response VO 对象 ATT_AUDIT_RULE + * + * @author qdata + * @date 2025-01-20 + */ +@Schema(description = "稽查规则 Response VO") +@Data +public class AttAuditRuleRespVO implements Serializable { + + private static final long serialVersionUID = 1L; + + + @Excel(name = "规则ID") + @Schema(description = "规则ID", example = "") + private Long id; + + @Excel(name = "规则名称") + @Schema(description = "规则名称", example = "") + private String name; + + @Excel(name = "质量维度") + @Schema(description = "质量维度", example = "") + private String qualityDim; + + @Excel(name = "规则类型") + @Schema(description = "规则类型", example = "") + private String type; + + @Excel(name = "规则级别") + @Schema(description = "规则级别", example = "") + private String level; + + @Excel(name = "规则描述") + @Schema(description = "规则描述", example = "") + private String description; + + @Excel(name = "是否有效") + @Schema(description = "是否有效", example = "") + private Boolean validFlag; + + @Excel(name = "删除标志") + @Schema(description = "删除标志", example = "") + private Boolean delFlag; + + @Excel(name = "创建人") + @Schema(description = "创建人", example = "") + private String createBy; + + @Excel(name = "创建人id") + @Schema(description = "创建人id", example = "") + private Long creatorId; + + @Excel(name = "创建时间", width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss") + @Schema(description = "创建时间", example = "") + private Date createTime; + + @Excel(name = "更新人") + @Schema(description = "更新人", example = "") + private String updateBy; + + @Excel(name = "更新人id") + @Schema(description = "更新人id", example = "") + private Long updaterId; + + @Excel(name = "更新时间", width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss") + @Schema(description = "更新时间", example = "") + private Date updateTime; + + @Excel(name = "备注") + @Schema(description = "备注", example = "") + private String remark; + + /** + * 数据元规则关联id + */ + private Long ruleRelId; + + /** + * tree数据类型 1:规则类型 2:规则 + */ + private String dataType; + + /** + * 父级ID + */ + private Long parentId; + + /** + * 规则配置 + */ + private String ruleConfig; + + /** + * 子节点列表 + */ + private List children; + + @Schema(description = "规则编码", example = "101") + private String code; + + @Schema(description = "使用场景", example = "用于身份证号非空检查") + private String useCase; + + @Schema(description = "示例", example = "字段值不能为空,如:ID=123456") + private String example; + + @Schema(description = "图标地址", example = "/images/icon.png") + private String iconPath; + + @Schema(description = "策略标识", example = "NOT_NULL_ID_CHECK") + private String strategyKey; +} diff --git a/yudao-module-mdpf/yudao-module-mdpf-biz/src/main/java/cn/iocoder/yudao/module/mdpf/controller/rule/vo/AttAuditRuleSaveReqVO.java b/yudao-module-mdpf/yudao-module-mdpf-biz/src/main/java/cn/iocoder/yudao/module/mdpf/controller/rule/vo/AttAuditRuleSaveReqVO.java new file mode 100644 index 000000000..48aa42bf0 --- /dev/null +++ b/yudao-module-mdpf/yudao-module-mdpf-biz/src/main/java/cn/iocoder/yudao/module/mdpf/controller/rule/vo/AttAuditRuleSaveReqVO.java @@ -0,0 +1,64 @@ +package cn.iocoder.yudao.module.mdpf.controller.rule.vo; + +import cn.iocoder.yudao.framework.mybatis.core.dataobject.BaseEntity; +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; + +import javax.validation.constraints.Size; + +/** + * 稽查规则 创建/修改 Request VO ATT_AUDIT_RULE + * + * @author qdata + * @date 2025-01-20 + */ +@Schema(description = "稽查规则 Response VO") +@Data +public class AttAuditRuleSaveReqVO extends BaseEntity { + + private static final long serialVersionUID = 1L; + + @Schema(description = "ID") + private Long id; + + @Schema(description = "规则名称", example = "") + @Size(max = 256, message = "规则名称长度不能超过256个字符") + private String name; + + @Schema(description = "质量维度", example = "") + @Size(max = 256, message = "质量维度长度不能超过256个字符") + private String qualityDim; + + @Schema(description = "规则类型", example = "") + @Size(max = 256, message = "规则类型长度不能超过256个字符") + private String type; + + @Schema(description = "规则级别", example = "") + @Size(max = 256, message = "规则级别长度不能超过256个字符") + private String level; + + @Schema(description = "规则描述", example = "") + @Size(max = 256, message = "规则描述长度不能超过256个字符") + private String description; + + @Schema(description = "备注", example = "") + @Size(max = 256, message = "备注长度不能超过256个字符") + private String remark; + + @Schema(description = "规则编码", example = "101") + private String code; + + @Schema(description = "使用场景", example = "用于身份证号非空检查") + private String useCase; + + @Schema(description = "示例", example = "字段值不能为空,如:ID=123456") + private String example; + + + + @Schema(description = "图标地址", example = "/images/icon.png") + private String iconPath; + + @Schema(description = "策略标识", example = "NOT_NULL_ID_CHECK") + private String strategyKey; +} diff --git a/yudao-module-mdpf/yudao-module-mdpf-biz/src/main/java/cn/iocoder/yudao/module/mdpf/controller/rule/vo/AttCleanRulePageReqVO.java b/yudao-module-mdpf/yudao-module-mdpf-biz/src/main/java/cn/iocoder/yudao/module/mdpf/controller/rule/vo/AttCleanRulePageReqVO.java new file mode 100644 index 000000000..a68ae48cd --- /dev/null +++ b/yudao-module-mdpf/yudao-module-mdpf-biz/src/main/java/cn/iocoder/yudao/module/mdpf/controller/rule/vo/AttCleanRulePageReqVO.java @@ -0,0 +1,50 @@ +package cn.iocoder.yudao.module.mdpf.controller.rule.vo; + +import cn.iocoder.yudao.module.mdpf.core.page.PageParam; +import cn.iocoder.yudao.module.mdpf.util.Excel; +import com.baomidou.mybatisplus.annotation.TableField; +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; + +/** + * 清洗规则 Request VO 对象 ATT_CLEAN_RULE + * + * @author qdata + * @date 2025-01-20 + */ +@Schema(description = "清洗规则 Request VO") +@Data +public class AttCleanRulePageReqVO extends PageParam { + + private static final long serialVersionUID = 1L; + + @Schema(description = "规则名称", example = "") + private String name; + + @Schema(description = "规则编码", example = "") + private String code; + + @Schema(description = "规则类型", example = "") + private String type; + @Schema(description = "规则级别", example = "") + private String level; + @Schema(description = "策略标识", example = "") + private String strategyKey; + @Excel(name = "是否有效") + @Schema(description = "是否有效", example = "") + private Boolean validFlag; + + + + /** 类目编码 */ + private String catCode; + + @TableField(exist = false) + private String catID; + + @TableField(exist = false) + private String catName; + + + +} diff --git a/yudao-module-mdpf/yudao-module-mdpf-biz/src/main/java/cn/iocoder/yudao/module/mdpf/controller/rule/vo/AttCleanRuleRespVO.java b/yudao-module-mdpf/yudao-module-mdpf-biz/src/main/java/cn/iocoder/yudao/module/mdpf/controller/rule/vo/AttCleanRuleRespVO.java new file mode 100644 index 000000000..924e06d61 --- /dev/null +++ b/yudao-module-mdpf/yudao-module-mdpf-biz/src/main/java/cn/iocoder/yudao/module/mdpf/controller/rule/vo/AttCleanRuleRespVO.java @@ -0,0 +1,129 @@ +package cn.iocoder.yudao.module.mdpf.controller.rule.vo; + +import cn.iocoder.yudao.module.mdpf.util.Excel; +import com.baomidou.mybatisplus.annotation.TableField; +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; + +import java.io.Serializable; +import java.util.Date; +import java.util.List; + +/** + * 清洗规则 Response VO 对象 ATT_CLEAN_RULE + * + * @author qdata + * @date 2025-01-20 + */ +@Schema(description = "清洗规则 Response VO") +@Data +public class AttCleanRuleRespVO implements Serializable { + + private static final long serialVersionUID = 1L; + + @Excel(name = "规则ID") + @Schema(description = "规则ID", example = "") + private Long id; + + @Excel(name = "规则名称") + @Schema(description = "规则名称", example = "") + private String name; + + @Schema(description = "规则编码", example = "101") + private String code; + + @Schema(description = "使用场景", example = "用于身份证号非空检查") + private String useCase; + + @Schema(description = "示例", example = "字段值不能为空,如:ID=123456") + private String example; + + @Schema(description = "策略标识", example = "NOT_NULL_ID_CHECK") + private String strategyKey; + + + @Excel(name = "规则类型") + @Schema(description = "规则类型", example = "") + private String type; + private String parentName; + private String parentType; + + @Excel(name = "规则级别") + @Schema(description = "规则级别", example = "") + private String level; + + @Excel(name = "规则描述") + @Schema(description = "规则描述", example = "") + private String description; + + @Excel(name = "是否有效") + @Schema(description = "是否有效", example = "") + private Boolean validFlag; + + @Excel(name = "删除标志") + @Schema(description = "删除标志", example = "") + private Boolean delFlag; + + @Excel(name = "创建人") + @Schema(description = "创建人", example = "") + private String createBy; + + @Excel(name = "创建人id") + @Schema(description = "创建人id", example = "") + private Long creatorId; + + @Excel(name = "创建时间", width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss") + @Schema(description = "创建时间", example = "") + private Date createTime; + + @Excel(name = "更新人") + @Schema(description = "更新人", example = "") + private String updateBy; + + @Excel(name = "更新人id") + @Schema(description = "更新人id", example = "") + private Long updaterId; + + @Excel(name = "更新时间", width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss") + @Schema(description = "更新时间", example = "") + private Date updateTime; + + @Excel(name = "备注") + @Schema(description = "备注", example = "") + private String remark; + + /** + * 数据元规则关联id + */ + private Long ruleRelId; + + /** + * tree数据类型 1:规则类型 2:规则 + */ + private String dataType; + + /** + * 父级ID + */ + private Long parentId; + + /** + * 规则配置 + */ + private String ruleConfig; + + /** + * 子节点列表 + */ + private List children; + + + /** 类目编码 */ + private String catCode; + + @TableField(exist = false) + private String catID; + + @TableField(exist = false) + private String catName; +} diff --git a/yudao-module-mdpf/yudao-module-mdpf-biz/src/main/java/cn/iocoder/yudao/module/mdpf/controller/rule/vo/AttCleanRuleSaveReqVO.java b/yudao-module-mdpf/yudao-module-mdpf-biz/src/main/java/cn/iocoder/yudao/module/mdpf/controller/rule/vo/AttCleanRuleSaveReqVO.java new file mode 100644 index 000000000..c1956d26e --- /dev/null +++ b/yudao-module-mdpf/yudao-module-mdpf-biz/src/main/java/cn/iocoder/yudao/module/mdpf/controller/rule/vo/AttCleanRuleSaveReqVO.java @@ -0,0 +1,69 @@ +package cn.iocoder.yudao.module.mdpf.controller.rule.vo; + +import cn.iocoder.yudao.framework.mybatis.core.dataobject.BaseEntity; +import com.baomidou.mybatisplus.annotation.TableField; +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; + +import javax.validation.constraints.Size; + +/** + * 清洗规则 创建/修改 Request VO ATT_CLEAN_RULE + * + * @author qdata + * @date 2025-01-20 + */ +@Schema(description = "清洗规则 Response VO") +@Data +public class AttCleanRuleSaveReqVO extends BaseEntity { + + private static final long serialVersionUID = 1L; + + @Schema(description = "ID") + private Long id; + + @Schema(description = "规则名称", example = "") + @Size(max = 256, message = "规则名称长度不能超过256个字符") + private String name; + + @Schema(description = "规则类型", example = "") + @Size(max = 256, message = "规则类型长度不能超过256个字符") + private String type; + + @Schema(description = "规则级别", example = "") + @Size(max = 256, message = "规则级别长度不能超过256个字符") + private String level; + + @Schema(description = "规则描述", example = "") + @Size(max = 256, message = "规则描述长度不能超过256个字符") + private String description; + + @Schema(description = "备注", example = "") + @Size(max = 256, message = "备注长度不能超过256个字符") + private String remark; + + @Schema(description = "规则编码", example = "101") + private String code; + + @Schema(description = "使用场景", example = "用于身份证号非空检查") + private String useCase; + + @Schema(description = "示例", example = "字段值不能为空,如:ID=123456") + private String example; + + + @Schema(description = "策略标识", example = "NOT_NULL_ID_CHECK") + private String strategyKey; + + @Schema(description = "是否有效", example = "") + private Boolean validFlag; + + /** 类目编码 */ + private String catCode; + + @TableField(exist = false) + private String catID; + + @TableField(exist = false) + private String catName; +} diff --git a/yudao-module-mdpf/yudao-module-mdpf-biz/src/main/java/cn/iocoder/yudao/module/mdpf/dal/dataobject/rule/AttAuditRuleDO.java b/yudao-module-mdpf/yudao-module-mdpf-biz/src/main/java/cn/iocoder/yudao/module/mdpf/dal/dataobject/rule/AttAuditRuleDO.java new file mode 100644 index 000000000..dc8f7b0d1 --- /dev/null +++ b/yudao-module-mdpf/yudao-module-mdpf-biz/src/main/java/cn/iocoder/yudao/module/mdpf/dal/dataobject/rule/AttAuditRuleDO.java @@ -0,0 +1,82 @@ +package cn.iocoder.yudao.module.mdpf.dal.dataobject.rule; + +import cn.iocoder.yudao.framework.mybatis.core.dataobject.BaseEntity; +import com.baomidou.mybatisplus.annotation.TableField; +import com.baomidou.mybatisplus.annotation.TableLogic; +import com.baomidou.mybatisplus.annotation.TableName; +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.*; + +/** + * 稽查规则 DO 对象 ATT_AUDIT_RULE + * + * @author qdata + * @date 2025-01-20 + */ +@Data +@TableName(value = "ATT_AUDIT_RULE") +// 用于 Oracle、PostgreSQL、Kingbase、DB2、H2 数据库的主键自增。如果是 MySQL 等数据库,可不写。 +// @KeySequence("ATT_AUDIT_RULE_seq") +@Builder +@NoArgsConstructor +@AllArgsConstructor +@EqualsAndHashCode(callSuper = true) +public class AttAuditRuleDO extends BaseEntity { + @TableField(exist = false) + private static final long serialVersionUID = 1L; + + /** 规则ID */ + private Long id; + + /** 规则名称 */ + private String name; + + /** 质量维度 */ + private String qualityDim; + + /** 规则类型 */ + private String type; + + /** + * 规则级别 + * 1:字段级,2:表级 + */ + private String level; + + /** 规则描述 */ + private String description; + + /** 是否有效 */ + private Boolean validFlag; + + /** 删除标志 */ + @TableLogic + private Boolean delFlag; + + /** + * 数据元规则关联id + */ + @TableField(exist = false) + private Long ruleRelId; + + /** + * 规则配置 + */ + @TableField(exist = false) + private String ruleConfig; + + @Schema(description = "规则编码", example = "101") + private String code; + + @Schema(description = "使用场景", example = "用于身份证号非空检查") + private String useCase; + + @Schema(description = "示例", example = "字段值不能为空,如:ID=123456") + private String example; + + @Schema(description = "图标地址", example = "/images/icon.png") + private String iconPath; + + @Schema(description = "策略标识", example = "NOT_NULL_ID_CHECK") + private String strategyKey; +} diff --git a/yudao-module-mdpf/yudao-module-mdpf-biz/src/main/java/cn/iocoder/yudao/module/mdpf/dal/dataobject/rule/AttCleanRuleDO.java b/yudao-module-mdpf/yudao-module-mdpf-biz/src/main/java/cn/iocoder/yudao/module/mdpf/dal/dataobject/rule/AttCleanRuleDO.java new file mode 100644 index 000000000..63c00625c --- /dev/null +++ b/yudao-module-mdpf/yudao-module-mdpf-biz/src/main/java/cn/iocoder/yudao/module/mdpf/dal/dataobject/rule/AttCleanRuleDO.java @@ -0,0 +1,85 @@ +package cn.iocoder.yudao.module.mdpf.dal.dataobject.rule; + +import cn.iocoder.yudao.framework.mybatis.core.dataobject.BaseEntity; +import com.baomidou.mybatisplus.annotation.TableField; +import com.baomidou.mybatisplus.annotation.TableLogic; +import com.baomidou.mybatisplus.annotation.TableName; +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.*; + +/** + * 清洗规则 DO 对象 ATT_CLEAN_RULE + * + * @author qdata + * @date 2025-01-20 + */ +@Data +@TableName(value = "ATT_CLEAN_RULE") +// 用于 Oracle、PostgreSQL、Kingbase、DB2、H2 数据库的主键自增。如果是 MySQL 等数据库,可不写。 +// @KeySequence("ATT_CLEAN_RULE_seq") +@Builder +@NoArgsConstructor +@AllArgsConstructor +@EqualsAndHashCode(callSuper = true) +public class AttCleanRuleDO extends BaseEntity { + @TableField(exist = false) + private static final long serialVersionUID = 1L; + + /** 规则ID */ + private Long id; + + /** 规则名称 */ + private String name; + + /** 规则类型 */ + private String type; + + /** + * 规则级别;1:字段级,2:表级 + */ + private String level; + + /** 规则描述 */ + private String description; + + /** 是否有效 */ + private Boolean validFlag; + + /** 删除标志 */ + @TableLogic + private Boolean delFlag; + + /** + * 数据元规则关联id + */ + @TableField(exist = false) + private Long ruleRelId; + + /** + * 规则配置 + */ + @TableField(exist = false) + private String ruleConfig; + + @Schema(description = "规则编码", example = "101") + private String code; + + @Schema(description = "使用场景", example = "用于身份证号非空检查") + private String useCase; + + @Schema(description = "示例", example = "字段值不能为空,如:ID=123456") + private String example; + + @Schema(description = "策略标识", example = "NOT_NULL_ID_CHECK") + private String strategyKey; + + + /** 类目编码 */ + private String catCode; + + @TableField(exist = false) + private String catID; + + @TableField(exist = false) + private String catName; +} diff --git a/yudao-module-mdpf/yudao-module-mdpf-biz/src/main/java/cn/iocoder/yudao/module/mdpf/dal/dataobject/rule/enums/CleanRuleTypeEnum.java b/yudao-module-mdpf/yudao-module-mdpf-biz/src/main/java/cn/iocoder/yudao/module/mdpf/dal/dataobject/rule/enums/CleanRuleTypeEnum.java new file mode 100644 index 000000000..c252b6362 --- /dev/null +++ b/yudao-module-mdpf/yudao-module-mdpf-biz/src/main/java/cn/iocoder/yudao/module/mdpf/dal/dataobject/rule/enums/CleanRuleTypeEnum.java @@ -0,0 +1,30 @@ +package cn.iocoder.yudao.module.mdpf.dal.dataobject.rule.enums; + +import lombok.AllArgsConstructor; +import lombok.Getter; + +/** + * 清洗规则类型枚举 + */ +@Getter +@AllArgsConstructor +public enum CleanRuleTypeEnum { + + STRING_TRANSFORM("1", "字符串转化"), + NUMBER_PROCESS("2", "数值处理"), + TIME_PROCESS("3", "时间处理"), + DUPLICATE_PROCESS("4", "重复值处理"), + NULL_PROCESS("5", "空值处理"); + + private final String type; + private final String name; + + public static String getNameByType(String type) { + for (CleanRuleTypeEnum value : CleanRuleTypeEnum.values()) { + if (value.getType().equals(type)) { + return value.getName(); + } + } + return type; + } +} diff --git a/yudao-module-mdpf/yudao-module-mdpf-biz/src/main/java/cn/iocoder/yudao/module/mdpf/dal/dataobject/rule/enums/RuleTypeEnum.java b/yudao-module-mdpf/yudao-module-mdpf-biz/src/main/java/cn/iocoder/yudao/module/mdpf/dal/dataobject/rule/enums/RuleTypeEnum.java new file mode 100644 index 000000000..8d891f71c --- /dev/null +++ b/yudao-module-mdpf/yudao-module-mdpf-biz/src/main/java/cn/iocoder/yudao/module/mdpf/dal/dataobject/rule/enums/RuleTypeEnum.java @@ -0,0 +1,31 @@ +package cn.iocoder.yudao.module.mdpf.dal.dataobject.rule.enums; + +import lombok.AllArgsConstructor; +import lombok.Getter; + +/** + * 规则类型枚举 + */ +@Getter +@AllArgsConstructor +public enum RuleTypeEnum { + + CHARACTER_CHECK("1", "字符校验"), + NUMBER_CHECK("2", "数值校验"), + NULL_CHECK("3", "空值校验"), + LENGTH_CHECK("4", "长度校验"), + DUPLICATE_CHECK("5", "重复检查"), + FORMAT_CHECK("6", "格式检查"); + + private final String type; + private final String name; + + public static String getNameByType(String type) { + for (RuleTypeEnum value : RuleTypeEnum.values()) { + if (value.getType().equals(type)) { + return value.getName(); + } + } + return type; + } +} diff --git a/yudao-module-mdpf/yudao-module-mdpf-biz/src/main/java/cn/iocoder/yudao/module/mdpf/dal/mapper/rule/AttAuditRuleMapper.java b/yudao-module-mdpf/yudao-module-mdpf-biz/src/main/java/cn/iocoder/yudao/module/mdpf/dal/mapper/rule/AttAuditRuleMapper.java new file mode 100644 index 000000000..f28a752a9 --- /dev/null +++ b/yudao-module-mdpf/yudao-module-mdpf-biz/src/main/java/cn/iocoder/yudao/module/mdpf/dal/mapper/rule/AttAuditRuleMapper.java @@ -0,0 +1,51 @@ +package cn.iocoder.yudao.module.mdpf.dal.mapper.rule; + +import cn.iocoder.yudao.framework.common.pojo.PageResult; +import cn.iocoder.yudao.framework.mybatis.core.mapper.BaseMapperX; +import cn.iocoder.yudao.framework.mybatis.core.query.LambdaQueryWrapperX; +import cn.iocoder.yudao.module.mdpf.controller.rule.vo.AttAuditRulePageReqVO; +import cn.iocoder.yudao.module.mdpf.dal.dataobject.rule.AttAuditRuleDO; +import com.baomidou.dynamic.datasource.annotation.DS; +import org.apache.ibatis.annotations.Mapper; +import org.apache.ibatis.annotations.Param; + +import java.util.Arrays; +import java.util.HashSet; +import java.util.List; +import java.util.Set; + +/** + * 稽查规则Mapper接口 + * + * @author qdata + * @date 2025-01-20 + */ +@Mapper +@DS("slave") +public interface AttAuditRuleMapper extends BaseMapperX { + + default PageResult selectPage(AttAuditRulePageReqVO reqVO) { + // 定义排序的字段(防止 SQL 注入,与数据库字段名称一致) + Set allowedColumns = new HashSet<>(Arrays.asList("id", "create_time", "update_time")); + LambdaQueryWrapperX queryparam = new LambdaQueryWrapperX<>(); + queryparam.likeIfPresent(AttAuditRuleDO::getName, reqVO.getName()) + .eqIfPresent(AttAuditRuleDO::getQualityDim, reqVO.getQualityDim()) + .eqIfPresent(AttAuditRuleDO::getType, reqVO.getType()) + .eqIfPresent(AttAuditRuleDO::getLevel, reqVO.getLevel()) + .eqIfPresent(AttAuditRuleDO::getValidFlag, reqVO.getValidFlag()) + .eqIfPresent(AttAuditRuleDO::getCode, reqVO.getCode()) + .likeIfPresent(AttAuditRuleDO::getUseCase, reqVO.getUseCase()) + .likeIfPresent(AttAuditRuleDO::getExample, reqVO.getExample()) + // 如果 reqVO.getName() 不为空,则添加 name 的精确匹配条件(name = '') + // .likeIfPresent(AttAuditRuleDO::getName, reqVO.getName()) + // 按照 createTime 字段降序排序 +// .orderBy(reqVO.getOrderByColumn(), reqVO.getIsAsc(), allowedColumns)); + .orderByDesc(AttAuditRuleDO::getCreateTime); + + // 构造动态查询条件 + return selectPage(reqVO); + + } + + List selectAttAuditRuleList(@Param("dataElemId") Long dataElemId); +} diff --git a/yudao-module-mdpf/yudao-module-mdpf-biz/src/main/java/cn/iocoder/yudao/module/mdpf/dal/mapper/rule/AttCleanRuleMapper.java b/yudao-module-mdpf/yudao-module-mdpf-biz/src/main/java/cn/iocoder/yudao/module/mdpf/dal/mapper/rule/AttCleanRuleMapper.java new file mode 100644 index 000000000..db2f885af --- /dev/null +++ b/yudao-module-mdpf/yudao-module-mdpf-biz/src/main/java/cn/iocoder/yudao/module/mdpf/dal/mapper/rule/AttCleanRuleMapper.java @@ -0,0 +1,51 @@ +package cn.iocoder.yudao.module.mdpf.dal.mapper.rule; + +import cn.iocoder.yudao.framework.common.pojo.PageResult; +import cn.iocoder.yudao.framework.mybatis.core.mapper.BaseMapperX; +import cn.iocoder.yudao.module.mdpf.controller.rule.vo.AttCleanRulePageReqVO; +import cn.iocoder.yudao.module.mdpf.dal.dataobject.rule.AttCleanRuleDO; +import com.baomidou.dynamic.datasource.annotation.DS; +import com.github.yulichang.wrapper.MPJLambdaWrapper; +import org.apache.commons.lang3.StringUtils; +import org.apache.ibatis.annotations.Mapper; +import org.apache.ibatis.annotations.Param; + +import java.util.Arrays; +import java.util.HashSet; +import java.util.List; +import java.util.Set; + +/** + * 清洗规则Mapper接口 + * + * @author qdata + * @date 2025-01-20 + */ +@Mapper +@DS("slave") +public interface AttCleanRuleMapper extends BaseMapperX { + +// default PageResult selectPage(AttCleanRulePageReqVO reqVO) { +// // 定义排序的字段(防止 SQL 注入,与数据库字段名称一致) +// Set allowedColumns = new HashSet<>(Arrays.asList("id", "create_time", "update_time")); +// +// MPJLambdaWrapper lambdaWrapper = new MPJLambdaWrapper(); +// lambdaWrapper.selectAll(AttCleanRuleDO.class) +// .select("t2.NAME AS catName") +// .leftJoin("ATT_CLEAN_CAT t2 on t.CAT_CODE = t2.CODE AND t2.DEL_FLAG = '0'") +// .likeRight(StringUtils.isNotBlank(reqVO.getCatCode()), AttCleanRuleDO::getCatCode, reqVO.getCatCode()) +// .like(StringUtils.isNotBlank(reqVO.getName()), AttCleanRuleDO::getName, reqVO.getName()) +// .eq(StringUtils.isNotBlank(reqVO.getType()), AttCleanRuleDO::getType, reqVO.getType()) +// .eq(StringUtils.isNotBlank(reqVO.getCode()), AttCleanRuleDO::getCode, reqVO.getCode()) +// .eq(StringUtils.isNotBlank(reqVO.getLevel()), AttCleanRuleDO::getLevel, reqVO.getLevel()) +// .orderByStr(StringUtils.isNotBlank(reqVO.getOrderByColumn()), StringUtils.equals("asc", reqVO.getIsAsc()), StringUtils.isNotBlank(reqVO.getOrderByColumn()) ? Arrays.asList(reqVO.getOrderByColumn().split(",")) : null); +// +// return selectJoinPage(reqVO, AttCleanRuleDO.class, lambdaWrapper); +// } + + PageResult selectPage(AttCleanRulePageReqVO reqVO); + + List selectAttCleanRuleList(@Param("dataElemId") Long dataElemId); + + List getCleaningRuleTreeIds(Long[] dataElemId); +} diff --git a/yudao-module-mdpf/yudao-module-mdpf-biz/src/main/java/cn/iocoder/yudao/module/mdpf/service/rule/IAttAuditRuleService.java b/yudao-module-mdpf/yudao-module-mdpf-biz/src/main/java/cn/iocoder/yudao/module/mdpf/service/rule/IAttAuditRuleService.java new file mode 100644 index 000000000..745efcf9a --- /dev/null +++ b/yudao-module-mdpf/yudao-module-mdpf-biz/src/main/java/cn/iocoder/yudao/module/mdpf/service/rule/IAttAuditRuleService.java @@ -0,0 +1,89 @@ +package cn.iocoder.yudao.module.mdpf.service.rule; + +import cn.iocoder.yudao.framework.common.pojo.PageResult; +import cn.iocoder.yudao.module.mdpf.controller.rule.vo.AttAuditRulePageReqVO; +import cn.iocoder.yudao.module.mdpf.controller.rule.vo.AttAuditRuleRespVO; +import cn.iocoder.yudao.module.mdpf.controller.rule.vo.AttAuditRuleSaveReqVO; +import cn.iocoder.yudao.module.mdpf.dal.dataobject.rule.AttAuditRuleDO; +import com.baomidou.mybatisplus.extension.service.IService; +import java.util.Collection; +import java.util.List; +import java.util.Map; + +/** + * 稽查规则Service接口 + * + * @author qdata + * @date 2025-01-20 + */ +public interface IAttAuditRuleService extends IService { + + /** + * 获得稽查规则分页列表 + * + * @param pageReqVO 分页请求 + * @return 稽查规则分页列表 + */ + PageResult getAttAuditRulePage(AttAuditRulePageReqVO pageReqVO); + + /** + * 创建稽查规则 + * + * @param createReqVO 稽查规则信息 + * @return 稽查规则编号 + */ + Long createAttAuditRule(AttAuditRuleSaveReqVO createReqVO); + + /** + * 更新稽查规则 + * + * @param updateReqVO 稽查规则信息 + */ + int updateAttAuditRule(AttAuditRuleSaveReqVO updateReqVO); + + /** + * 删除稽查规则 + * + * @param idList 稽查规则编号 + */ + int removeAttAuditRule(Collection idList); + + /** + * 获得稽查规则详情 + * + * @param id 稽查规则编号 + * @return 稽查规则 + */ + AttAuditRuleDO getAttAuditRuleById(Long id); + + /** + * 获得全部稽查规则列表 + * + * @return 稽查规则列表 + */ + List getAttAuditRuleList(); + + /** + * 获得全部稽查规则 Map + * + * @return 稽查规则 Map + */ + Map getAttAuditRuleMap(); + + /** + * 导入稽查规则数据 + * + * @param importExcelList 稽查规则数据列表 + * @param isUpdateSupport 是否更新支持,如果已存在,则进行更新数据 + * @param operName 操作用户 + * @return 结果 + */ + String importAttAuditRule(List importExcelList, boolean isUpdateSupport, String operName); + + /** + * 获取稽查规则树形结构 + * + * @return 树形结构列表 + */ + List getAttAuditRuleTree(Long dataElemId); +} diff --git a/yudao-module-mdpf/yudao-module-mdpf-biz/src/main/java/cn/iocoder/yudao/module/mdpf/service/rule/IAttCleanRuleService.java b/yudao-module-mdpf/yudao-module-mdpf-biz/src/main/java/cn/iocoder/yudao/module/mdpf/service/rule/IAttCleanRuleService.java new file mode 100644 index 000000000..1111cfda2 --- /dev/null +++ b/yudao-module-mdpf/yudao-module-mdpf-biz/src/main/java/cn/iocoder/yudao/module/mdpf/service/rule/IAttCleanRuleService.java @@ -0,0 +1,95 @@ +package cn.iocoder.yudao.module.mdpf.service.rule; + +import cn.iocoder.yudao.framework.common.pojo.PageResult; +import cn.iocoder.yudao.module.mdpf.controller.rule.vo.AttCleanRulePageReqVO; +import cn.iocoder.yudao.module.mdpf.controller.rule.vo.AttCleanRuleRespVO; +import cn.iocoder.yudao.module.mdpf.controller.rule.vo.AttCleanRuleSaveReqVO; +import cn.iocoder.yudao.module.mdpf.dal.dataobject.rule.AttCleanRuleDO; +import com.baomidou.mybatisplus.extension.service.IService; + +import java.util.Collection; +import java.util.List; +import java.util.Map; + +/** + * 清洗规则Service接口 + * + * @author qdata + * @date 2025-01-20 + */ +public interface IAttCleanRuleService extends IService { + + /** + * 获得清洗规则分页列表 + * + * @param pageReqVO 分页请求 + * @return 清洗规则分页列表 + */ + PageResult getAttCleanRulePage(AttCleanRulePageReqVO pageReqVO); + + /** + * 创建清洗规则 + * + * @param createReqVO 清洗规则信息 + * @return 清洗规则编号 + */ + Long createAttCleanRule(AttCleanRuleSaveReqVO createReqVO); + + /** + * 更新清洗规则 + * + * @param updateReqVO 清洗规则信息 + */ + int updateAttCleanRule(AttCleanRuleSaveReqVO updateReqVO); + + /** + * 删除清洗规则 + * + * @param idList 清洗规则编号 + */ + int removeAttCleanRule(Collection idList); + + /** + * 获得清洗规则详情 + * + * @param id 清洗规则编号 + * @return 清洗规则 + */ + AttCleanRuleDO getAttCleanRuleById(Long id); + + /** + * 获得全部清洗规则列表 + * + * @return 清洗规则列表 + */ + List getAttCleanRuleList(); + List getAttCleanRuleList(AttCleanRulePageReqVO attCleanRule); + + /** + * 获得全部清洗规则 Map + * + * @return 清洗规则 Map + */ + Map getAttCleanRuleMap(); + + /** + * 导入清洗规则数据 + * + * @param importExcelList 清洗规则数据列表 + * @param isUpdateSupport 是否更新支持,如果已存在,则进行更新数据 + * @param operName 操作用户 + * @return 结果 + */ + String importAttCleanRule(List importExcelList, boolean isUpdateSupport, String operName); + + /** + * 获取清洗规则树形结构 + * + * @return 树形结构列表 + */ + List getAttCleanRuleTree(Long dataElemId); + + List getCleaningRuleTree(Long[] dataElemId); + + Long getCount(AttCleanRulePageReqVO vo); +} diff --git a/yudao-module-mdpf/yudao-module-mdpf-biz/src/main/java/cn/iocoder/yudao/module/mdpf/service/rule/impl/AttAuditRuleServiceImpl.java b/yudao-module-mdpf/yudao-module-mdpf-biz/src/main/java/cn/iocoder/yudao/module/mdpf/service/rule/impl/AttAuditRuleServiceImpl.java new file mode 100644 index 000000000..2d87a909e --- /dev/null +++ b/yudao-module-mdpf/yudao-module-mdpf-biz/src/main/java/cn/iocoder/yudao/module/mdpf/service/rule/impl/AttAuditRuleServiceImpl.java @@ -0,0 +1,202 @@ +package cn.iocoder.yudao.module.mdpf.service.rule.impl; + +import cn.iocoder.yudao.framework.common.pojo.PageResult; +import cn.iocoder.yudao.framework.common.util.object.BeanUtils; +import cn.iocoder.yudao.module.mdpf.controller.rule.vo.AttAuditRulePageReqVO; +import cn.iocoder.yudao.module.mdpf.controller.rule.vo.AttAuditRuleRespVO; +import cn.iocoder.yudao.module.mdpf.controller.rule.vo.AttAuditRuleSaveReqVO; +import cn.iocoder.yudao.module.mdpf.dal.dataobject.rule.AttAuditRuleDO; +import cn.iocoder.yudao.module.mdpf.dal.dataobject.rule.enums.RuleTypeEnum; +import cn.iocoder.yudao.module.mdpf.dal.mapper.rule.AttAuditRuleMapper; +import cn.iocoder.yudao.module.mdpf.service.rule.IAttAuditRuleService; +import cn.iocoder.yudao.module.mdpf.util.StringUtils; +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import lombok.extern.slf4j.Slf4j; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; + +import javax.annotation.Resource; +import java.util.ArrayList; +import java.util.Collection; +import java.util.List; +import java.util.Map; +import java.util.stream.Collectors; + +/** + * 稽查规则Service业务层处理 + * + * @author qdata + * @date 2025-01-20 + */ +@Slf4j +@Service +@Transactional(rollbackFor = Exception.class) +public class AttAuditRuleServiceImpl extends ServiceImpl + implements IAttAuditRuleService { + @Resource + private AttAuditRuleMapper attAuditRuleMapper; + + @Override + public PageResult getAttAuditRulePage(AttAuditRulePageReqVO pageReqVO) { + return attAuditRuleMapper.selectPage(pageReqVO); + } + + @Override + public Long createAttAuditRule(AttAuditRuleSaveReqVO createReqVO) { + AttAuditRuleDO dictType = BeanUtils.toBean(createReqVO, AttAuditRuleDO.class); + attAuditRuleMapper.insert(dictType); + return dictType.getId(); + } + + @Override + public int updateAttAuditRule(AttAuditRuleSaveReqVO updateReqVO) { + // 相关校验 + + // 更新稽查规则 + AttAuditRuleDO updateObj = BeanUtils.toBean(updateReqVO, AttAuditRuleDO.class); + return attAuditRuleMapper.updateById(updateObj); + } + + @Override + public int removeAttAuditRule(Collection idList) { + // 批量删除稽查规则 + return attAuditRuleMapper.deleteBatchIds(idList); + } + + @Override + public AttAuditRuleDO getAttAuditRuleById(Long id) { + return attAuditRuleMapper.selectById(id); + } + + @Override + public List getAttAuditRuleList() { + return attAuditRuleMapper.selectList(); + } + + @Override + public Map getAttAuditRuleMap() { + List attAuditRuleList = attAuditRuleMapper.selectList(); + return attAuditRuleList.stream() + .collect(Collectors.toMap( + AttAuditRuleDO::getId, + attAuditRuleDO -> attAuditRuleDO, + // 保留已存在的值 + (existing, replacement) -> existing)); + } + + @Override + public List getAttAuditRuleTree(Long dataElemId) { + // 1. 获取所有稽查规则列表 + List list = attAuditRuleMapper.selectAttAuditRuleList(dataElemId); + // 2. 转换为VO对象 + List voList = BeanUtils.toBean(list, AttAuditRuleRespVO.class); + // 3. 构建树形结构 + return buildTreeByType(voList); + } + + /** + * 构建树形结构 - 以type字段作为父节点 + * + * @param list 规则列表 + * @return 树形结构列表 + */ + private List buildTreeByType(List list) { + List resultList = new ArrayList<>(); + // 创建type映射,用于存储相同type的节点 + Map> typeMap = list.stream() + .collect(Collectors.groupingBy(AttAuditRuleRespVO::getType)); + + // 遍历每个type分组 + for (Map.Entry> entry : typeMap.entrySet()) { + String type = entry.getKey(); + List typeNodes = entry.getValue(); + for (AttAuditRuleRespVO typeNode : typeNodes) { + typeNode.setDataType("2"); + } + // 创建父节点 + AttAuditRuleRespVO parentNode = new AttAuditRuleRespVO(); + parentNode.setId(0L); // 设置一个特殊的ID + parentNode.setType(type); + parentNode.setDataType("1"); + // 使用枚举获取类型名称 + String typeName = RuleTypeEnum.getNameByType(type); + parentNode.setName(typeName); // 设置父节点名称 + parentNode.setChildren(new ArrayList<>(typeNodes)); + + resultList.add(parentNode); + } + + return resultList; + } + + /** + * 导入稽查规则数据 + * + * @param importExcelList 稽查规则数据列表 + * @param isUpdateSupport 是否更新支持,如果已存在,则进行更新数据 + * @param operName 操作用户 + * @return 结果 + */ + @Override + public String importAttAuditRule(List importExcelList, boolean isUpdateSupport, + String operName) { + if (StringUtils.isNull(importExcelList) || importExcelList.size() == 0) { + throw new RuntimeException("导入数据不能为空!"); + } + + int successNum = 0; + int failureNum = 0; + List successMessages = new ArrayList<>(); + List failureMessages = new ArrayList<>(); + + for (AttAuditRuleRespVO respVO : importExcelList) { + try { + AttAuditRuleDO attAuditRuleDO = BeanUtils.toBean(respVO, AttAuditRuleDO.class); + Long attAuditRuleId = respVO.getId(); + if (isUpdateSupport) { + if (attAuditRuleId != null) { + AttAuditRuleDO existingAttAuditRule = attAuditRuleMapper.selectById(attAuditRuleId); + if (existingAttAuditRule != null) { + attAuditRuleMapper.updateById(attAuditRuleDO); + successNum++; + successMessages.add("数据更新成功,ID为 " + attAuditRuleId + " 的稽查规则记录。"); + } else { + failureNum++; + failureMessages.add("数据更新失败,ID为 " + attAuditRuleId + " 的稽查规则记录不存在。"); + } + } else { + failureNum++; + failureMessages.add("数据更新失败,某条记录的ID不存在。"); + } + } else { + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.eq("id", attAuditRuleId); + AttAuditRuleDO existingAttAuditRule = attAuditRuleMapper.selectOne(queryWrapper); + if (existingAttAuditRule == null) { + attAuditRuleMapper.insert(attAuditRuleDO); + successNum++; + successMessages.add("数据插入成功,ID为 " + attAuditRuleId + " 的稽查规则记录。"); + } else { + failureNum++; + failureMessages.add("数据插入失败,ID为 " + attAuditRuleId + " 的稽查规则记录已存在。"); + } + } + } catch (Exception e) { + failureNum++; + String errorMsg = "数据导入失败,错误信息:" + e.getMessage(); + failureMessages.add(errorMsg); + log.error(errorMsg, e); + } + } + StringBuilder resultMsg = new StringBuilder(); + if (failureNum > 0) { + resultMsg.append("很抱歉,导入失败!共 ").append(failureNum).append(" 条数据格式不正确,错误如下:"); + resultMsg.append("
").append(String.join("
", failureMessages)); + throw new RuntimeException(resultMsg.toString()); + } else { + resultMsg.append("恭喜您,数据已全部导入成功!共 ").append(successNum).append(" 条。"); + } + return resultMsg.toString(); + } +} diff --git a/yudao-module-mdpf/yudao-module-mdpf-biz/src/main/java/cn/iocoder/yudao/module/mdpf/service/rule/impl/AttCleanRuleServiceImpl.java b/yudao-module-mdpf/yudao-module-mdpf-biz/src/main/java/cn/iocoder/yudao/module/mdpf/service/rule/impl/AttCleanRuleServiceImpl.java new file mode 100644 index 000000000..f243b2d6e --- /dev/null +++ b/yudao-module-mdpf/yudao-module-mdpf-biz/src/main/java/cn/iocoder/yudao/module/mdpf/service/rule/impl/AttCleanRuleServiceImpl.java @@ -0,0 +1,254 @@ +package cn.iocoder.yudao.module.mdpf.service.rule.impl; + +import cn.iocoder.yudao.framework.common.pojo.PageResult; +import cn.iocoder.yudao.framework.common.util.object.BeanUtils; +import cn.iocoder.yudao.module.mdpf.controller.rule.vo.AttCleanRulePageReqVO; +import cn.iocoder.yudao.module.mdpf.controller.rule.vo.AttCleanRuleRespVO; +import cn.iocoder.yudao.module.mdpf.controller.rule.vo.AttCleanRuleSaveReqVO; +import cn.iocoder.yudao.module.mdpf.core.text.Convert; +import cn.iocoder.yudao.module.mdpf.dal.dataobject.rule.AttCleanRuleDO; +import cn.iocoder.yudao.module.mdpf.dal.dataobject.rule.enums.CleanRuleTypeEnum; +import cn.iocoder.yudao.module.mdpf.dal.mapper.rule.AttCleanRuleMapper; +import cn.iocoder.yudao.module.mdpf.service.rule.IAttCleanRuleService; +import cn.iocoder.yudao.module.mdpf.util.StringUtils; +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.baomidou.mybatisplus.core.toolkit.Wrappers; +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import com.github.yulichang.wrapper.MPJLambdaWrapper; +import lombok.extern.slf4j.Slf4j; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; + +import javax.annotation.Resource; +import java.util.ArrayList; +import java.util.Collection; +import java.util.List; +import java.util.Map; +import java.util.stream.Collectors; + +/** + * 清洗规则Service业务层处理 + * + * @author qdata + * @date 2025-01-20 + */ +@Slf4j +@Service +@Transactional(rollbackFor = Exception.class) +public class AttCleanRuleServiceImpl extends ServiceImpl + implements IAttCleanRuleService { + @Resource + private AttCleanRuleMapper attCleanRuleMapper; + + + @Override + public PageResult getAttCleanRulePage(AttCleanRulePageReqVO pageReqVO) { + return attCleanRuleMapper.selectPage(pageReqVO); + } + + @Override + public Long createAttCleanRule(AttCleanRuleSaveReqVO createReqVO) { + List code = attCleanRuleMapper.selectList("code", createReqVO.getCode()); + if (code.size() > 0) { + throw new RuntimeException("规则编码重复请重新输入"); + } + AttCleanRuleDO dictType = BeanUtils.toBean(createReqVO, AttCleanRuleDO.class); + attCleanRuleMapper.insert(dictType); + return dictType.getId(); + } + + @Override + public int updateAttCleanRule(AttCleanRuleSaveReqVO updateReqVO) { + // 相关校验 + List code = attCleanRuleMapper.selectList("code", updateReqVO.getCode()); + if (code.size() > 0) { + throw new RuntimeException("规则编码重复请重新输入"); + } + // 更新清洗规则 + AttCleanRuleDO updateObj = BeanUtils.toBean(updateReqVO, AttCleanRuleDO.class); + return attCleanRuleMapper.updateById(updateObj); + } + + @Override + public int removeAttCleanRule(Collection idList) { + // 批量删除清洗规则 + return attCleanRuleMapper.deleteBatchIds(idList); + } + + @Override + public AttCleanRuleDO getAttCleanRuleById(Long id) { + return attCleanRuleMapper.selectById(id); + } + + @Override + public List getAttCleanRuleList() { + return attCleanRuleMapper.selectList(); + } + + @Override + public List getAttCleanRuleList(AttCleanRulePageReqVO attCleanRule) { + + MPJLambdaWrapper lambdaWrapper = new MPJLambdaWrapper(); + lambdaWrapper.selectAll(AttCleanRuleDO.class) + .select("t2.NAME AS catName") + .leftJoin("ATT_CLEAN_CAT t2 on t.CAT_CODE = t2.CODE AND t2.DEL_FLAG = '0'") + .likeRight(org.apache.commons.lang3.StringUtils.isNotBlank(attCleanRule.getCatCode()), AttCleanRuleDO::getCatCode, attCleanRule.getCatCode()); +// LambdaQueryWrapperX x = new LambdaQueryWrapperX<>(); +// x.eqIfPresent(AttCleanRuleDO::getType , attCleanRule.getType()); +// x.eqIfPresent(AttCleanRuleDO::getValidFlag , attCleanRule.getValidFlag()); + List attCleanRuleDOS = attCleanRuleMapper.selectList(lambdaWrapper); + List bean = BeanUtils.toBean(attCleanRuleDOS, AttCleanRuleRespVO.class); + for (AttCleanRuleRespVO respVO : bean) { + + respVO.setParentType(Convert.toStr(respVO.getCatID())); + respVO.setParentName(respVO.getCatName()); + } + return bean; + } + + @Override + public Map getAttCleanRuleMap() { + List attCleanRuleList = attCleanRuleMapper.selectList(); + return attCleanRuleList.stream() + .collect(Collectors.toMap( + AttCleanRuleDO::getId, + attCleanRuleDO -> attCleanRuleDO, + // 保留已存在的值 + (existing, replacement) -> existing)); + } + + /** + * 导入清洗规则数据 + * + * @param importExcelList 清洗规则数据列表 + * @param isUpdateSupport 是否更新支持,如果已存在,则进行更新数据 + * @param operName 操作用户 + * @return 结果 + */ + @Override + public String importAttCleanRule(List importExcelList, boolean isUpdateSupport, + String operName) { + if (StringUtils.isNull(importExcelList) || importExcelList.size() == 0) { + throw new RuntimeException("导入数据不能为空!"); + } + + int successNum = 0; + int failureNum = 0; + List successMessages = new ArrayList<>(); + List failureMessages = new ArrayList<>(); + + for (AttCleanRuleRespVO respVO : importExcelList) { + try { + AttCleanRuleDO attCleanRuleDO = BeanUtils.toBean(respVO, AttCleanRuleDO.class); + Long attCleanRuleId = respVO.getId(); + if (isUpdateSupport) { + if (attCleanRuleId != null) { + AttCleanRuleDO existingAttCleanRule = attCleanRuleMapper.selectById(attCleanRuleId); + if (existingAttCleanRule != null) { + attCleanRuleMapper.updateById(attCleanRuleDO); + successNum++; + successMessages.add("数据更新成功,ID为 " + attCleanRuleId + " 的清洗规则记录。"); + } else { + failureNum++; + failureMessages.add("数据更新失败,ID为 " + attCleanRuleId + " 的清洗规则记录不存在。"); + } + } else { + failureNum++; + failureMessages.add("数据更新失败,某条记录的ID不存在。"); + } + } else { + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.eq("id", attCleanRuleId); + AttCleanRuleDO existingAttCleanRule = attCleanRuleMapper.selectOne(queryWrapper); + if (existingAttCleanRule == null) { + attCleanRuleMapper.insert(attCleanRuleDO); + successNum++; + successMessages.add("数据插入成功,ID为 " + attCleanRuleId + " 的清洗规则记录。"); + } else { + failureNum++; + failureMessages.add("数据插入失败,ID为 " + attCleanRuleId + " 的清洗规则记录已存在。"); + } + } + } catch (Exception e) { + failureNum++; + String errorMsg = "数据导入失败,错误信息:" + e.getMessage(); + failureMessages.add(errorMsg); + log.error(errorMsg, e); + } + } + StringBuilder resultMsg = new StringBuilder(); + if (failureNum > 0) { + resultMsg.append("很抱歉,导入失败!共 ").append(failureNum).append(" 条数据格式不正确,错误如下:"); + resultMsg.append("
").append(String.join("
", failureMessages)); + throw new RuntimeException(resultMsg.toString()); + } else { + resultMsg.append("恭喜您,数据已全部导入成功!共 ").append(successNum).append(" 条。"); + } + return resultMsg.toString(); + } + + @Override + public List getAttCleanRuleTree(Long dataElemId) { + // 1. 获取所有清洗规则列表 + List list = attCleanRuleMapper.selectAttCleanRuleList(dataElemId); + // 2. 转换为VO对象 + List voList = BeanUtils.toBean(list, AttCleanRuleRespVO.class); + // 3. 构建树形结构 + return buildTreeByType(voList); + } + + @Override + public List getCleaningRuleTree(Long[] dataElemId) { + List list =null; + if (dataElemId == null || dataElemId.length == 0) { + // 数组为空或未初始化 + list = attCleanRuleMapper.selectList(); + }else { + list = attCleanRuleMapper.getCleaningRuleTreeIds(dataElemId); + } + // 2. 转换为VO对象 + List voList = BeanUtils.toBean(list, AttCleanRuleRespVO.class); + // 3. 构建树形结构 + return buildTreeByType(voList); + } + + @Override + public Long getCount(AttCleanRulePageReqVO vo) { + return attCleanRuleMapper.selectCount(Wrappers.lambdaQuery(AttCleanRuleDO.class) + .likeRight(AttCleanRuleDO::getType, vo.getType())); + } + + /** + * 构建树形结构 - 以type字段作为父节点 + * + * @param list 规则列表 + * @return 树形结构列表 + */ + private List buildTreeByType(List list) { + List resultList = new ArrayList<>(); + // 创建type映射,用于存储相同type的节点 + Map> typeMap = list.stream() + .collect(Collectors.groupingBy(AttCleanRuleRespVO::getType)); + + // 遍历每个type分组 + for (Map.Entry> entry : typeMap.entrySet()) { + String type = entry.getKey(); + List typeNodes = entry.getValue(); + for (AttCleanRuleRespVO typeNode : typeNodes) { + typeNode.setDataType("2"); + } + // 创建父节点 + AttCleanRuleRespVO parentNode = new AttCleanRuleRespVO(); + parentNode.setId(0L); // 设置一个特殊的ID + parentNode.setType(type); + parentNode.setDataType("1"); + String typeName = CleanRuleTypeEnum.getNameByType(type); + parentNode.setName(typeName); // 设置父节点名称 + parentNode.setChildren(new ArrayList<>(typeNodes)); + + resultList.add(parentNode); + } + + return resultList; + } +} diff --git a/yudao-module-mdpf/yudao-module-mdpf-biz/src/main/resources/mapper/rule/AttAuditRuleMapper.xml b/yudao-module-mdpf/yudao-module-mdpf-biz/src/main/resources/mapper/rule/AttAuditRuleMapper.xml new file mode 100644 index 000000000..3a13db70e --- /dev/null +++ b/yudao-module-mdpf/yudao-module-mdpf-biz/src/main/resources/mapper/rule/AttAuditRuleMapper.xml @@ -0,0 +1,140 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + select ID, NAME, QUALITY_DIM, TYPE, LEVEL, DESCRIPTION, CODE, USE_CASE, EXAMPLE, ICON_PATH, STRATEGY_KEY,VALID_FLAG, DEL_FLAG, CREATE_BY, CREATOR_ID, CREATE_TIME, UPDATE_BY, UPDATER_ID, UPDATE_TIME, REMARK from ATT_AUDIT_RULE + + + + + + + + insert into ATT_AUDIT_RULE + + ID, + NAME, + QUALITY_DIM, + TYPE, + LEVEL, + DESCRIPTION, + VALID_FLAG, + DEL_FLAG, + CREATE_BY, + CREATOR_ID, + CREATE_TIME, + UPDATE_BY, + UPDATER_ID, + UPDATE_TIME, + REMARK, + CODE, + USE_CASE, + EXAMPLE, + ICON_PATH, + STRATEGY_KEY, + + + #{id}, + #{name}, + #{qualityDim}, + #{type}, + #{level}, + #{description}, + #{validFlag}, + #{delFlag}, + #{createBy}, + #{creatorId}, + #{createTime}, + #{updateBy}, + #{updaterId}, + #{updateTime}, + #{remark}, + #{code}, + #{useCase}, + #{example}, + #{iconPath}, + #{strategyKey}, + + + + + update ATT_AUDIT_RULE + + NAME = #{name}, + QUALITY_DIM = #{qualityDim}, + TYPE = #{type}, + LEVEL = #{level}, + DESCRIPTION = #{description}, + VALID_FLAG = #{validFlag}, + DEL_FLAG = #{delFlag}, + CREATE_BY = #{createBy}, + CREATOR_ID = #{creatorId}, + CREATE_TIME = #{createTime}, + UPDATE_BY = #{updateBy}, + UPDATER_ID = #{updaterId}, + UPDATE_TIME = #{updateTime}, + REMARK = #{remark}, + CODE = #{code}, + USE_CASE = #{useCase}, + EXAMPLE = #{example}, + ICON_PATH = #{iconPath}, + STRATEGY_KEY = #{strategyKey}, + + where ID = #{id} + + + + delete from ATT_AUDIT_RULE where ID = #{id} + + + + delete from ATT_AUDIT_RULE where ID in + + #{id} + + + diff --git a/yudao-module-mdpf/yudao-module-mdpf-biz/src/main/resources/mapper/rule/AttCleanRuleMapper.xml b/yudao-module-mdpf/yudao-module-mdpf-biz/src/main/resources/mapper/rule/AttCleanRuleMapper.xml new file mode 100644 index 000000000..a53d75d95 --- /dev/null +++ b/yudao-module-mdpf/yudao-module-mdpf-biz/src/main/resources/mapper/rule/AttCleanRuleMapper.xml @@ -0,0 +1,159 @@ + + + + + + + + + + + + + + + + + + + + + + + select ID, NAME, TYPE, LEVEL, DESCRIPTION, VALID_FLAG, DEL_FLAG, CREATE_BY, CREATOR_ID, CREATE_TIME, UPDATE_BY, UPDATER_ID, UPDATE_TIME, REMARK from ATT_CLEAN_RULE + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + insert into ATT_CLEAN_RULE + + ID, + NAME, + TYPE, + LEVEL, + DESCRIPTION, + VALID_FLAG, + DEL_FLAG, + CREATE_BY, + CREATOR_ID, + CREATE_TIME, + UPDATE_BY, + UPDATER_ID, + UPDATE_TIME, + REMARK, + + + #{id}, + #{name}, + #{type}, + #{level}, + #{description}, + #{validFlag}, + #{delFlag}, + #{createBy}, + #{creatorId}, + #{createTime}, + #{updateBy}, + #{updaterId}, + #{updateTime}, + #{remark}, + + + + + update ATT_CLEAN_RULE + + NAME = #{name}, + TYPE = #{type}, + LEVEL = #{level}, + DESCRIPTION = #{description}, + VALID_FLAG = #{validFlag}, + DEL_FLAG = #{delFlag}, + CREATE_BY = #{createBy}, + CREATOR_ID = #{creatorId}, + CREATE_TIME = #{createTime}, + UPDATE_BY = #{updateBy}, + UPDATER_ID = #{updaterId}, + UPDATE_TIME = #{updateTime}, + REMARK = #{remark}, + + where ID = #{id} + + + + delete from ATT_CLEAN_RULE where ID = #{id} + + + + delete from ATT_CLEAN_RULE where ID in + + #{id} + + +