From f0f3524fb09576eaaa63116a079795a10adb737b Mon Sep 17 00:00:00 2001 From: "maxw@mesnac.com" Date: Wed, 18 Dec 2024 13:57:52 +0800 Subject: [PATCH] =?UTF-8?q?=E6=A8=A1=E6=9D=BF=E6=8E=A5=E5=8F=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../controller/HwGlobalCfgController.java | 84 ++++++++ .../HwTemplateAchieveController.java | 125 +++++++++++ .../controller/HwTemplateController.java | 114 ++++++++++ .../com/ruoyi/basic/domain/HwGlobalCfg.java | 88 ++++++++ .../com/ruoyi/basic/domain/HwTemplate.java | 113 ++++++++++ .../ruoyi/basic/domain/HwTemplateAchieve.java | 129 +++++++++++ .../domain/HwTemplateAchieveContent.java | 34 +++ .../ruoyi/basic/mapper/HwGlobalCfgDao.java | 87 ++++++++ .../basic/mapper/HwTemplateAchieveDao.java | 95 +++++++++ .../com/ruoyi/basic/mapper/HwTemplateDao.java | 86 ++++++++ .../basic/service/HwGlobalCfgService.java | 61 ++++++ .../service/HwTemplateAchieveService.java | 66 ++++++ .../basic/service/HwTemplateService.java | 59 ++++++ .../service/impl/HwGlobalCfgServiceImpl.java | 90 ++++++++ .../impl/HwTemplateAchieveServiceImpl.java | 112 ++++++++++ .../service/impl/HwTemplateServiceImpl.java | 94 ++++++++ .../resources/mapper/basic/HwGlobalCfgDao.xml | 158 ++++++++++++++ .../mapper/basic/HwTemplateAchieveDao.xml | 200 ++++++++++++++++++ .../resources/mapper/basic/HwTemplateDao.xml | 156 ++++++++++++++ 19 files changed, 1951 insertions(+) create mode 100644 ruoyi-modules/hw-basic/src/main/java/com/ruoyi/basic/controller/HwGlobalCfgController.java create mode 100644 ruoyi-modules/hw-basic/src/main/java/com/ruoyi/basic/controller/HwTemplateAchieveController.java create mode 100644 ruoyi-modules/hw-basic/src/main/java/com/ruoyi/basic/controller/HwTemplateController.java create mode 100644 ruoyi-modules/hw-basic/src/main/java/com/ruoyi/basic/domain/HwGlobalCfg.java create mode 100644 ruoyi-modules/hw-basic/src/main/java/com/ruoyi/basic/domain/HwTemplate.java create mode 100644 ruoyi-modules/hw-basic/src/main/java/com/ruoyi/basic/domain/HwTemplateAchieve.java create mode 100644 ruoyi-modules/hw-basic/src/main/java/com/ruoyi/basic/domain/HwTemplateAchieveContent.java create mode 100644 ruoyi-modules/hw-basic/src/main/java/com/ruoyi/basic/mapper/HwGlobalCfgDao.java create mode 100644 ruoyi-modules/hw-basic/src/main/java/com/ruoyi/basic/mapper/HwTemplateAchieveDao.java create mode 100644 ruoyi-modules/hw-basic/src/main/java/com/ruoyi/basic/mapper/HwTemplateDao.java create mode 100644 ruoyi-modules/hw-basic/src/main/java/com/ruoyi/basic/service/HwGlobalCfgService.java create mode 100644 ruoyi-modules/hw-basic/src/main/java/com/ruoyi/basic/service/HwTemplateAchieveService.java create mode 100644 ruoyi-modules/hw-basic/src/main/java/com/ruoyi/basic/service/HwTemplateService.java create mode 100644 ruoyi-modules/hw-basic/src/main/java/com/ruoyi/basic/service/impl/HwGlobalCfgServiceImpl.java create mode 100644 ruoyi-modules/hw-basic/src/main/java/com/ruoyi/basic/service/impl/HwTemplateAchieveServiceImpl.java create mode 100644 ruoyi-modules/hw-basic/src/main/java/com/ruoyi/basic/service/impl/HwTemplateServiceImpl.java create mode 100644 ruoyi-modules/hw-basic/src/main/resources/mapper/basic/HwGlobalCfgDao.xml create mode 100644 ruoyi-modules/hw-basic/src/main/resources/mapper/basic/HwTemplateAchieveDao.xml create mode 100644 ruoyi-modules/hw-basic/src/main/resources/mapper/basic/HwTemplateDao.xml diff --git a/ruoyi-modules/hw-basic/src/main/java/com/ruoyi/basic/controller/HwGlobalCfgController.java b/ruoyi-modules/hw-basic/src/main/java/com/ruoyi/basic/controller/HwGlobalCfgController.java new file mode 100644 index 0000000..fddb2e5 --- /dev/null +++ b/ruoyi-modules/hw-basic/src/main/java/com/ruoyi/basic/controller/HwGlobalCfgController.java @@ -0,0 +1,84 @@ +package com.ruoyi.basic.controller; +import com.ruoyi.basic.domain.HwGlobalCfg; +import com.ruoyi.basic.service.HwGlobalCfgService; +import com.ruoyi.common.core.web.controller.BaseController; +import org.springframework.http.ResponseEntity; +import org.springframework.web.bind.annotation.*; + +import javax.annotation.Resource; +import java.util.List; + +/** + * 全局配置表(HwGlobalCfg)表控制层 + * + * @author makejava + * @since 2024-09-26 14:42:39 + */ +@RestController +@RequestMapping("hwGlobalCfg") +public class HwGlobalCfgController extends BaseController { + /** + * 服务对象 + */ + @Resource + private HwGlobalCfgService hwGlobalCfgService; + + /** + * 分页查询 + * + * @param hwGlobalCfg 筛选条件 + * @return 查询结果 + */ + @GetMapping + public ResponseEntity> queryByPage(HwGlobalCfg hwGlobalCfg) { + List list = hwGlobalCfgService.queryAll(hwGlobalCfg); + return ResponseEntity.ok(list); + } + + /** + * 通过主键查询单条数据 + * + * @param id 主键 + * @return 单条数据 + */ + @GetMapping("{id}") + public ResponseEntity queryById(@PathVariable("id") Long id) { + return ResponseEntity.ok(this.hwGlobalCfgService.queryById(id)); + } + + /** + * 新增数据 + * + * @param hwGlobalCfg 实体 + * @return 新增结果 + */ + @PostMapping + public ResponseEntity add(@RequestBody HwGlobalCfg hwGlobalCfg) { + return ResponseEntity.ok(this.hwGlobalCfgService.insert(hwGlobalCfg)); + } + + + /** + * 编辑数据 + * + * @param hwGlobalCfg 实体 + * @return 编辑结果 + */ + @PutMapping + public ResponseEntity edit(@RequestBody HwGlobalCfg hwGlobalCfg) { + return ResponseEntity.ok(this.hwGlobalCfgService.update(hwGlobalCfg)); + } + + /** + * 删除数据 + * + * @param id 主键 + * @return 删除是否成功 + */ + @DeleteMapping + public ResponseEntity deleteById(Long globalCfgId) { + return ResponseEntity.ok(this.hwGlobalCfgService.deleteById(globalCfgId)); + } + +} + diff --git a/ruoyi-modules/hw-basic/src/main/java/com/ruoyi/basic/controller/HwTemplateAchieveController.java b/ruoyi-modules/hw-basic/src/main/java/com/ruoyi/basic/controller/HwTemplateAchieveController.java new file mode 100644 index 0000000..f3e806c --- /dev/null +++ b/ruoyi-modules/hw-basic/src/main/java/com/ruoyi/basic/controller/HwTemplateAchieveController.java @@ -0,0 +1,125 @@ +package com.ruoyi.basic.controller; + +import com.fasterxml.jackson.core.JsonProcessingException; +import com.fasterxml.jackson.databind.ObjectMapper; +import com.ruoyi.basic.domain.HwTemplate; +import com.ruoyi.basic.domain.HwTemplateAchieve; +import com.ruoyi.basic.service.HwTemplateAchieveService; +import com.ruoyi.common.core.domain.R; +import com.ruoyi.common.core.utils.file.FileUtils; +import com.ruoyi.common.core.web.controller.BaseController; +import com.ruoyi.common.core.web.domain.AjaxResult; +import com.ruoyi.common.core.web.page.TableDataInfo; +import com.ruoyi.system.api.RemoteFileService; +import com.ruoyi.system.api.domain.SysFile; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.data.domain.Page; +import org.springframework.data.domain.PageRequest; +import org.springframework.http.ResponseEntity; +import org.springframework.web.bind.annotation.*; +import org.springframework.web.multipart.MultipartFile; + +import javax.annotation.Resource; +import java.io.IOException; +import java.util.Base64; +import java.util.List; +import java.util.Map; + +/** + * 模板实现表(HwTemplateAchieve)表控制层 + * + * @author makejava + * @since 2024-09-18 10:09:52 + */ +@RestController +@RequestMapping("hwTemplateAchieve") +public class HwTemplateAchieveController extends BaseController { + /** + * 服务对象 + */ + @Resource + private HwTemplateAchieveService hwTemplateAchieveService; + + @Autowired + private RemoteFileService remoteFileService; + + /** + * 分页查询 + * + * @param hwTemplateAchieve 筛选条件 + * @param + * @return 查询结果 + */ + @GetMapping + public TableDataInfo queryByPage(HwTemplateAchieve hwTemplateAchieve) { + startPage(); + List list = hwTemplateAchieveService.queryAll(hwTemplateAchieve); + return getDataTable(list); + } + + /** + * 通过主键查询单条数据 + * + * @param id 主键 + * @return 单条数据 + */ + @GetMapping("{id}") + public ResponseEntity queryById(@PathVariable("id") Long id) { + return ResponseEntity.ok(this.hwTemplateAchieveService.queryById(id)); + } + + /** + * 新增数据 + * @return 新增结果 + */ + @PostMapping + public AjaxResult add(@RequestBody Map templateAchieve) { + HwTemplateAchieve hwTemplateAchieve = new HwTemplateAchieve(); + hwTemplateAchieve.setAchieveContent(templateAchieve.get("achieveContent").toString()); + hwTemplateAchieve.setTemplateId((Long)templateAchieve.get("templateId")); + hwTemplateAchieve.setAchieveName(templateAchieve.get("achieveName").toString()); + int insert = this.hwTemplateAchieveService.insert(hwTemplateAchieve); + if (insert == 0){ + return AjaxResult.error("添加失败"); + } + return AjaxResult.success("添加成功"); + } + + /** + * 编辑数据 + * + * @param hwTemplateAchieve 实体 + * @return 编辑结果 + */ + @PutMapping + public AjaxResult edit(@RequestBody HwTemplateAchieve hwTemplateAchieve) { + return AjaxResult.success(this.hwTemplateAchieveService.update(hwTemplateAchieve)); + } + + /** + * 删除数据 + * + * @param achieveId 主键 + * @return 删除是否成功 + */ + @DeleteMapping + public AjaxResult deleteById(Long achieveId) { + return AjaxResult.success(this.hwTemplateAchieveService.deleteById(achieveId)); + } + + @PostMapping("/saveImage") + public AjaxResult saveImage(@RequestParam("file") MultipartFile file){ + R sysFileR = remoteFileService.upload(file); + SysFile sysFile = sysFileR.getData(); + int count = hwTemplateAchieveService.saveImage(sysFile); + return AjaxResult.success(sysFile); + } + @PostMapping("/queryImage") + public AjaxResult queryImage(@RequestBody SysFile sysFile){ + startPage(); + List list = hwTemplateAchieveService.queryImage(sysFile); + return AjaxResult.success(getDataTable(list)); + } + +} + diff --git a/ruoyi-modules/hw-basic/src/main/java/com/ruoyi/basic/controller/HwTemplateController.java b/ruoyi-modules/hw-basic/src/main/java/com/ruoyi/basic/controller/HwTemplateController.java new file mode 100644 index 0000000..1847055 --- /dev/null +++ b/ruoyi-modules/hw-basic/src/main/java/com/ruoyi/basic/controller/HwTemplateController.java @@ -0,0 +1,114 @@ +package com.ruoyi.basic.controller; + + +import com.fasterxml.jackson.core.JsonProcessingException; +import com.fasterxml.jackson.databind.ObjectMapper; +import com.ruoyi.basic.domain.HwTemplate; +import com.ruoyi.basic.service.HwTemplateService; +import com.ruoyi.common.core.web.controller.BaseController; +import com.ruoyi.common.core.web.domain.AjaxResult; +import com.ruoyi.common.core.web.page.TableDataInfo; +import com.ruoyi.common.security.utils.SecurityUtils; +import org.springframework.data.domain.Page; +import org.springframework.data.domain.PageRequest; +import org.springframework.http.ResponseEntity; +import org.springframework.web.bind.annotation.*; + +import javax.annotation.Resource; +import java.util.Date; +import java.util.List; +import java.util.Map; + +/** + * 模板表(HwTemplate)表控制层 + * + * @author makejava + * @since 2024-09-18 10:09:19 + */ +@RestController +@RequestMapping("hwTemplate") +public class HwTemplateController extends BaseController { + /** + * 服务对象 + */ + @Resource + private HwTemplateService hwTemplateService; + + /** + * 分页查询 + * + * @param hwTemplate 筛选条件 + * @return 查询结果 + */ + @GetMapping + public TableDataInfo queryByPage(HwTemplate hwTemplate) { + startPage(); + List list = hwTemplateService.queryAll(hwTemplate); + return getDataTable(list); + } + + /** + * 通过主键查询单条数据 + * + * @param id 主键 + * @return 单条数据 + */ + @GetMapping("{id}") + public ResponseEntity queryById(@PathVariable("id") Long id) { + return ResponseEntity.ok(this.hwTemplateService.queryById(id)); + } + + /** + * 新增数据 + * + * @param + * @return 新增结果 + */ + @PostMapping + public AjaxResult add(@RequestBody Map template){ + HwTemplate hwTemplate = new HwTemplate(); + String templateName = template.get("templateName").toString(); + template.remove("templateName"); + hwTemplate.setTemplateName(templateName); + hwTemplate.setTemplateContent(template.get("templateContent").toString()); + HwTemplate insert = hwTemplateService.insert(hwTemplate); + if (insert == null){ + return AjaxResult.error("操作失败"); + } + return AjaxResult.success(); + } + + /** + * 编辑数据 + * + * @param hwTemplate 实体 + * @return 编辑结果 + */ + @PutMapping + public AjaxResult edit(@RequestBody HwTemplate hwTemplate) { + hwTemplate.setUpdateBy(SecurityUtils.getUsername()); + hwTemplate.setUpdateTime(new Date()); + int update = hwTemplateService.update(hwTemplate); + if (update == 0) { + return AjaxResult.error("操作失败"); + } + return AjaxResult.success(); + } + + /** + * 删除数据 + * + * @param templateId 主键 + * @return 删除是否成功 + */ + @DeleteMapping + public AjaxResult deleteById(Long templateId) { + boolean delete = hwTemplateService.deleteById(templateId); + if (delete == false) { + return AjaxResult.error("操作失败"); + } + return AjaxResult.success(); + } + +} + diff --git a/ruoyi-modules/hw-basic/src/main/java/com/ruoyi/basic/domain/HwGlobalCfg.java b/ruoyi-modules/hw-basic/src/main/java/com/ruoyi/basic/domain/HwGlobalCfg.java new file mode 100644 index 0000000..979cde2 --- /dev/null +++ b/ruoyi-modules/hw-basic/src/main/java/com/ruoyi/basic/domain/HwGlobalCfg.java @@ -0,0 +1,88 @@ +package com.ruoyi.basic.domain; + +import java.io.Serializable; + +/** + * 全局配置表(HwGlobalCfg)实体类 + * + * @author makejava + * @since 2024-09-26 14:42:42 + */ +public class HwGlobalCfg implements Serializable { + private static final long serialVersionUID = 673640661217554284L; + /** + * 全局配置ID + */ + private Long globalCfgId; + /** + * 配置名称 + */ + private String globalCfgName; + /** + * 配置类型 + */ + private String globalCfgType; + /** + * 配置值 + */ + private String globalCfgDate; + /** + * 是否包含内容(1、true 2、false) + */ + private String isDetail; + /** + * 内容 + */ + private String details; + + + public Long getGlobalCfgId() { + return globalCfgId; + } + + public void setGlobalCfgId(Long globalCfgId) { + this.globalCfgId = globalCfgId; + } + + public String getGlobalCfgName() { + return globalCfgName; + } + + public void setGlobalCfgName(String globalCfgName) { + this.globalCfgName = globalCfgName; + } + + public String getGlobalCfgType() { + return globalCfgType; + } + + public void setGlobalCfgType(String globalCfgType) { + this.globalCfgType = globalCfgType; + } + + public String getGlobalCfgDate() { + return globalCfgDate; + } + + public void setGlobalCfgDate(String globalCfgDate) { + this.globalCfgDate = globalCfgDate; + } + + public String getIsDetail() { + return isDetail; + } + + public void setIsDetail(String isDetail) { + this.isDetail = isDetail; + } + + public String getDetails() { + return details; + } + + public void setDetails(String details) { + this.details = details; + } + +} + diff --git a/ruoyi-modules/hw-basic/src/main/java/com/ruoyi/basic/domain/HwTemplate.java b/ruoyi-modules/hw-basic/src/main/java/com/ruoyi/basic/domain/HwTemplate.java new file mode 100644 index 0000000..8475ef4 --- /dev/null +++ b/ruoyi-modules/hw-basic/src/main/java/com/ruoyi/basic/domain/HwTemplate.java @@ -0,0 +1,113 @@ +package com.ruoyi.basic.domain; + +import java.io.Serializable; +import java.util.Date; + +/** + * 模板表(HwTemplate)实体类 + * + * @author makejava + * @since 2024-09-18 10:09:21 + */ +public class HwTemplate implements Serializable { + private static final long serialVersionUID = -58454096786541114L; + /** + * 模板id + */ + private Long templateId; + /** + * 模板名称 + */ + private String templateName; + /** + * 模板内容 + */ + private String templateContent; + /** + * 创建者 + */ + private String createBy; + /** + * 创建时间 + */ + private Date createTime; + /** + * 更新者 + */ + private String updateBy; + /** + * 更新时间 + */ + private Date updateTime; + /** + * 备注 + */ + private String remark; + + + public Long getTemplateId() { + return templateId; + } + + public void setTemplateId(Long templateId) { + this.templateId = templateId; + } + + public String getTemplateName() { + return templateName; + } + + public void setTemplateName(String templateName) { + this.templateName = templateName; + } + + public String getTemplateContent() { + return templateContent; + } + + public void setTemplateContent(String templateContent) { + this.templateContent = templateContent; + } + + public String getCreateBy() { + return createBy; + } + + public void setCreateBy(String createBy) { + this.createBy = createBy; + } + + public Date getCreateTime() { + return createTime; + } + + public void setCreateTime(Date createTime) { + this.createTime = createTime; + } + + public String getUpdateBy() { + return updateBy; + } + + public void setUpdateBy(String updateBy) { + this.updateBy = updateBy; + } + + public Date getUpdateTime() { + return updateTime; + } + + public void setUpdateTime(Date updateTime) { + this.updateTime = updateTime; + } + + public String getRemark() { + return remark; + } + + public void setRemark(String remark) { + this.remark = remark; + } + +} + diff --git a/ruoyi-modules/hw-basic/src/main/java/com/ruoyi/basic/domain/HwTemplateAchieve.java b/ruoyi-modules/hw-basic/src/main/java/com/ruoyi/basic/domain/HwTemplateAchieve.java new file mode 100644 index 0000000..c30c79a --- /dev/null +++ b/ruoyi-modules/hw-basic/src/main/java/com/ruoyi/basic/domain/HwTemplateAchieve.java @@ -0,0 +1,129 @@ +package com.ruoyi.basic.domain; + +import lombok.Data; + +import java.io.Serializable; +import java.util.Date; + +/** + * 模板实现表(HwTemplateAchieve)实体类 + * + * @author makejava + * @since 2024-09-18 10:09:52 + */ +@Data +public class HwTemplateAchieve implements Serializable { + private static final long serialVersionUID = 683594578695679743L; + /** + * 模板实现id + */ + private Long achieveId; + /** + * 模板id + */ + private Long templateId; + /** + * 模板名称 + */ + private String achieveName; + /** + * 模板内容 + */ + private String achieveContent; + private byte[] image; + /** + * 创建者 + */ + private String createBy; + /** + * 创建时间 + */ + private Date createTime; + /** + * 更新者 + */ + private String updateBy; + /** + * 更新时间 + */ + private Date updateTime; + /** + * 备注 + */ + private String remark; + + + public Long getAchieveId() { + return achieveId; + } + + public void setAchieveId(Long achieveId) { + this.achieveId = achieveId; + } + + public Long getTemplateId() { + return templateId; + } + + public void setTemplateId(Long templateId) { + this.templateId = templateId; + } + + public String getAchieveName() { + return achieveName; + } + + public void setAchieveName(String achieveName) { + this.achieveName = achieveName; + } + + public String getAchieveContent() { + return achieveContent; + } + + public void setAchieveContent(String achieveContent) { + this.achieveContent = achieveContent; + } + + public String getCreateBy() { + return createBy; + } + + public void setCreateBy(String createBy) { + this.createBy = createBy; + } + + public Date getCreateTime() { + return createTime; + } + + public void setCreateTime(Date createTime) { + this.createTime = createTime; + } + + public String getUpdateBy() { + return updateBy; + } + + public void setUpdateBy(String updateBy) { + this.updateBy = updateBy; + } + + public Date getUpdateTime() { + return updateTime; + } + + public void setUpdateTime(Date updateTime) { + this.updateTime = updateTime; + } + + public String getRemark() { + return remark; + } + + public void setRemark(String remark) { + this.remark = remark; + } + +} + diff --git a/ruoyi-modules/hw-basic/src/main/java/com/ruoyi/basic/domain/HwTemplateAchieveContent.java b/ruoyi-modules/hw-basic/src/main/java/com/ruoyi/basic/domain/HwTemplateAchieveContent.java new file mode 100644 index 0000000..56b4587 --- /dev/null +++ b/ruoyi-modules/hw-basic/src/main/java/com/ruoyi/basic/domain/HwTemplateAchieveContent.java @@ -0,0 +1,34 @@ +package com.ruoyi.basic.domain; + +import lombok.Data; + +import java.io.Serializable; +import java.util.Date; + +/** + * 模板实现表(HwTemplateAchieve)实体类 + * + * @author makejava + * @since 2024-09-18 10:09:52 + */ +@Data +public class HwTemplateAchieveContent implements Serializable { + private static final long serialVersionUID = 683594578695679743L; + /** + * 模板实现id + */ + private Long id; + /** + * 模板id + */ + private Long achieveId; + /** + * 模板名称 + */ + + private String achieveContent; + + + +} + diff --git a/ruoyi-modules/hw-basic/src/main/java/com/ruoyi/basic/mapper/HwGlobalCfgDao.java b/ruoyi-modules/hw-basic/src/main/java/com/ruoyi/basic/mapper/HwGlobalCfgDao.java new file mode 100644 index 0000000..9103f49 --- /dev/null +++ b/ruoyi-modules/hw-basic/src/main/java/com/ruoyi/basic/mapper/HwGlobalCfgDao.java @@ -0,0 +1,87 @@ +package com.ruoyi.basic.mapper; + +import com.ruoyi.basic.domain.HwGlobalCfg; +import org.apache.ibatis.annotations.Param; +import org.springframework.data.domain.Pageable; + +import java.util.List; + +/** + * 全局配置表(HwGlobalCfg)表数据库访问层 + * + * @author makejava + * @since 2024-09-26 14:42:39 + */ +public interface HwGlobalCfgDao { + + /** + * 通过ID查询单条数据 + * + * @param globalCfgId 主键 + * @return 实例对象 + */ + HwGlobalCfg queryById(Long globalCfgId); + + /** + * 查询指定行数据 + * + * @param hwGlobalCfg 查询条件 + * @param pageable 分页对象 + * @return 对象列表 + */ + List queryAllByLimit(HwGlobalCfg hwGlobalCfg, @Param("pageable") Pageable pageable); + + /** + * 统计总行数 + * + * @param hwGlobalCfg 查询条件 + * @return 总行数 + */ + long count(HwGlobalCfg hwGlobalCfg); + + /** + * 新增数据 + * + * @param hwGlobalCfg 实例对象 + * @return 影响行数 + */ + int insert(HwGlobalCfg hwGlobalCfg); + + /** + * 批量新增数据(MyBatis原生foreach方法) + * + * @param entities List 实例对象列表 + * @return 影响行数 + */ + int insertBatch(@Param("entities") List entities); + + /** + * 批量新增或按主键更新数据(MyBatis原生foreach方法) + * + * @param entities List 实例对象列表 + * @return 影响行数 + * @throws org.springframework.jdbc.BadSqlGrammarException 入参是空List的时候会抛SQL语句错误的异常,请自行校验入参 + */ + int insertOrUpdateBatch(@Param("entities") List entities); + + /** + * 修改数据 + * + * @param hwGlobalCfg 实例对象 + * @return 影响行数 + */ + int update(HwGlobalCfg hwGlobalCfg); + + /** + * 通过主键删除数据 + * + * @param globalCfgId 主键 + * @return 影响行数 + */ + int deleteById(Long globalCfgId); + + List queryAll(HwGlobalCfg hwGlobalCfg); + + +} + diff --git a/ruoyi-modules/hw-basic/src/main/java/com/ruoyi/basic/mapper/HwTemplateAchieveDao.java b/ruoyi-modules/hw-basic/src/main/java/com/ruoyi/basic/mapper/HwTemplateAchieveDao.java new file mode 100644 index 0000000..314cc76 --- /dev/null +++ b/ruoyi-modules/hw-basic/src/main/java/com/ruoyi/basic/mapper/HwTemplateAchieveDao.java @@ -0,0 +1,95 @@ +package com.ruoyi.basic.mapper; + +import com.ruoyi.basic.domain.HwTemplateAchieve; +import com.ruoyi.basic.domain.HwTemplateAchieveContent; +import com.ruoyi.system.api.domain.SysFile; +import org.apache.ibatis.annotations.Param; +import org.springframework.data.domain.Pageable; + +import java.util.List; + +/** + * 模板实现表(HwTemplateAchieve)表数据库访问层 + * + * @author makejava + * @since 2024-09-18 10:09:52 + */ +public interface HwTemplateAchieveDao { + + /** + * 通过ID查询单条数据 + * + * @param achieveId 主键 + * @return 实例对象 + */ + HwTemplateAchieve queryById(Long achieveId); + + /** + * 查询指定行数据 + * + * @param hwTemplateAchieve 查询条件 + * @param pageable 分页对象 + * @return 对象列表 + */ + List queryAllByLimit(HwTemplateAchieve hwTemplateAchieve, @Param("pageable") Pageable pageable); + + /** + * 统计总行数 + * + * @param hwTemplateAchieve 查询条件 + * @return 总行数 + */ + long count(HwTemplateAchieve hwTemplateAchieve); + + /** + * 新增数据 + * + * @param hwTemplateAchieve 实例对象 + * @return 影响行数 + */ + int insert(HwTemplateAchieve hwTemplateAchieve); + + /** + * 批量新增数据(MyBatis原生foreach方法) + * + * @param entities List 实例对象列表 + * @return 影响行数 + */ + int insertBatch(@Param("entities") List entities); + + /** + * 批量新增或按主键更新数据(MyBatis原生foreach方法) + * + * @param entities List 实例对象列表 + * @return 影响行数 + * @throws org.springframework.jdbc.BadSqlGrammarException 入参是空List的时候会抛SQL语句错误的异常,请自行校验入参 + */ + int insertOrUpdateBatch(@Param("entities") List entities); + + /** + * 修改数据 + * + * @param hwTemplateAchieve 实例对象 + * @return 影响行数 + */ + int update(@Param("entity") HwTemplateAchieve hwTemplateAchieve); + + /** + * 通过主键删除数据 + * + * @param achieveId 主键 + * @return 影响行数 + */ + int deleteById(Long achieveId); + + List queryAll(HwTemplateAchieve hwTemplateAchieve); + + int insertContent(@Param("entity") HwTemplateAchieveContent content); + + int deleteContentById(Long achieveId); + + int saveImage(SysFile sysFile); + + List queryImage(SysFile sysFile); +} + diff --git a/ruoyi-modules/hw-basic/src/main/java/com/ruoyi/basic/mapper/HwTemplateDao.java b/ruoyi-modules/hw-basic/src/main/java/com/ruoyi/basic/mapper/HwTemplateDao.java new file mode 100644 index 0000000..4e032e7 --- /dev/null +++ b/ruoyi-modules/hw-basic/src/main/java/com/ruoyi/basic/mapper/HwTemplateDao.java @@ -0,0 +1,86 @@ +package com.ruoyi.basic.mapper; + +import com.ruoyi.basic.domain.HwTemplate; +import org.apache.ibatis.annotations.Param; +import org.springframework.data.domain.Pageable; + +import java.util.List; + +/** + * 模板表(HwTemplate)表数据库访问层 + * + * @author makejava + * @since 2024-09-18 10:09:19 + */ +public interface HwTemplateDao { + + /** + * 通过ID查询单条数据 + * + * @param templateId 主键 + * @return 实例对象 + */ + HwTemplate queryById(Long templateId); + + /** + * 查询指定行数据 + * + * @param hwTemplate 查询条件 + * @param pageable 分页对象 + * @return 对象列表 + */ + List queryAllByLimit(HwTemplate hwTemplate, @Param("pageable") Pageable pageable); + + /** + * 统计总行数 + * + * @param hwTemplate 查询条件 + * @return 总行数 + */ + long count(HwTemplate hwTemplate); + + /** + * 新增数据 + * + * @param hwTemplate 实例对象 + * @return 影响行数 + */ + int insert(HwTemplate hwTemplate); + + /** + * 批量新增数据(MyBatis原生foreach方法) + * + * @param entities List 实例对象列表 + * @return 影响行数 + */ + int insertBatch(@Param("entities") List entities); + + /** + * 批量新增或按主键更新数据(MyBatis原生foreach方法) + * + * @param entities List 实例对象列表 + * @return 影响行数 + * @throws org.springframework.jdbc.BadSqlGrammarException 入参是空List的时候会抛SQL语句错误的异常,请自行校验入参 + */ + int insertOrUpdateBatch(@Param("entities") List entities); + + /** + * 修改数据 + * + * @param hwTemplate 实例对象 + * @return 影响行数 + */ + int update(HwTemplate hwTemplate); + + /** + * 通过主键删除数据 + * + * @param templateId 主键 + * @return 影响行数 + */ + int deleteById(Long templateId); + + List queryAll(HwTemplate hwTemplate); + +} + diff --git a/ruoyi-modules/hw-basic/src/main/java/com/ruoyi/basic/service/HwGlobalCfgService.java b/ruoyi-modules/hw-basic/src/main/java/com/ruoyi/basic/service/HwGlobalCfgService.java new file mode 100644 index 0000000..ff92c89 --- /dev/null +++ b/ruoyi-modules/hw-basic/src/main/java/com/ruoyi/basic/service/HwGlobalCfgService.java @@ -0,0 +1,61 @@ +package com.ruoyi.basic.service; + +import com.ruoyi.basic.domain.HwGlobalCfg; +import org.springframework.data.domain.Page; +import org.springframework.data.domain.PageRequest; + +import java.util.List; + +/** + * 全局配置表(HwGlobalCfg)表服务接口 + * + * @author makejava + * @since 2024-09-26 14:42:44 + */ +public interface HwGlobalCfgService { + + /** + * 通过ID查询单条数据 + * + * @param globalCfgId 主键 + * @return 实例对象 + */ + HwGlobalCfg queryById(Long globalCfgId); + + /** + * 分页查询 + * + * @param hwGlobalCfg 筛选条件 + * @param pageRequest 分页对象 + * @return 查询结果 + */ + Page queryByPage(HwGlobalCfg hwGlobalCfg, PageRequest pageRequest); + + /** + * 新增数据 + * + * @param hwGlobalCfg 实例对象 + * @return 实例对象 + */ + int insert(HwGlobalCfg hwGlobalCfg); + + /** + * 修改数据 + * + * @param hwGlobalCfg 实例对象 + * @return 实例对象 + */ + HwGlobalCfg update(HwGlobalCfg hwGlobalCfg); + + /** + * 通过主键删除数据 + * + * @param globalCfgId 主键 + * @return 是否成功 + */ + boolean deleteById(Long globalCfgId); + + List queryAll(HwGlobalCfg hwGlobalCfg); + + +} diff --git a/ruoyi-modules/hw-basic/src/main/java/com/ruoyi/basic/service/HwTemplateAchieveService.java b/ruoyi-modules/hw-basic/src/main/java/com/ruoyi/basic/service/HwTemplateAchieveService.java new file mode 100644 index 0000000..78298dd --- /dev/null +++ b/ruoyi-modules/hw-basic/src/main/java/com/ruoyi/basic/service/HwTemplateAchieveService.java @@ -0,0 +1,66 @@ +package com.ruoyi.basic.service; + + +import com.ruoyi.basic.domain.HwTemplateAchieve; +import com.ruoyi.system.api.domain.SysFile; +import org.springframework.data.domain.Page; +import org.springframework.data.domain.PageRequest; + +import java.util.List; + +/** + * 模板实现表(HwTemplateAchieve)表服务接口 + * + * @author makejava + * @since 2024-09-18 10:09:52 + */ +public interface HwTemplateAchieveService { + + /** + * 通过ID查询单条数据 + * + * @param achieveId 主键 + * @return 实例对象 + */ + HwTemplateAchieve queryById(Long achieveId); + + /** + * 分页查询 + * + * @param hwTemplateAchieve 筛选条件 + * @param pageRequest 分页对象 + * @return 查询结果 + */ + Page queryByPage(HwTemplateAchieve hwTemplateAchieve, PageRequest pageRequest); + + /** + * 新增数据 + * + * @param hwTemplateAchieve 实例对象 + * @return 实例对象 + */ + int insert(HwTemplateAchieve hwTemplateAchieve); + + /** + * 修改数据 + * + * @param hwTemplateAchieve 实例对象 + * @return 实例对象 + */ + int update(HwTemplateAchieve hwTemplateAchieve); + + /** + * 通过主键删除数据 + * + * @param achieveId 主键 + * @return 是否成功 + */ + boolean deleteById(Long achieveId); + + List queryAll(HwTemplateAchieve hwTemplateAchieve); + + int saveImage(SysFile sysFile); + + List queryImage(SysFile sysFile); + +} diff --git a/ruoyi-modules/hw-basic/src/main/java/com/ruoyi/basic/service/HwTemplateService.java b/ruoyi-modules/hw-basic/src/main/java/com/ruoyi/basic/service/HwTemplateService.java new file mode 100644 index 0000000..f293b55 --- /dev/null +++ b/ruoyi-modules/hw-basic/src/main/java/com/ruoyi/basic/service/HwTemplateService.java @@ -0,0 +1,59 @@ +package com.ruoyi.basic.service; + +import com.ruoyi.basic.domain.HwTemplate; +import org.springframework.data.domain.Page; +import org.springframework.data.domain.PageRequest; + +import java.util.List; + +/** + * 模板表(HwTemplate)表服务接口 + * + * @author makejava + * @since 2024-09-18 10:09:26 + */ +public interface HwTemplateService { + + /** + * 通过ID查询单条数据 + * + * @param templateId 主键 + * @return 实例对象 + */ + HwTemplate queryById(Long templateId); + + /** + * 分页查询 + * + * @param hwTemplate 筛选条件 + * @param pageRequest 分页对象 + * @return 查询结果 + */ + Page queryByPage(HwTemplate hwTemplate, PageRequest pageRequest); + + /** + * 新增数据 + * + * @param hwTemplate 实例对象 + * @return 实例对象 + */ + HwTemplate insert(HwTemplate hwTemplate); + + /** + * 修改数据 + * + * @param hwTemplate 实例对象 + * @return 实例对象 + */ + int update(HwTemplate hwTemplate); + + /** + * 通过主键删除数据 + * + * @param templateId 主键 + * @return 是否成功 + */ + boolean deleteById(Long templateId); + + List queryAll(HwTemplate hwTemplate); +} diff --git a/ruoyi-modules/hw-basic/src/main/java/com/ruoyi/basic/service/impl/HwGlobalCfgServiceImpl.java b/ruoyi-modules/hw-basic/src/main/java/com/ruoyi/basic/service/impl/HwGlobalCfgServiceImpl.java new file mode 100644 index 0000000..4d14f7f --- /dev/null +++ b/ruoyi-modules/hw-basic/src/main/java/com/ruoyi/basic/service/impl/HwGlobalCfgServiceImpl.java @@ -0,0 +1,90 @@ +package com.ruoyi.basic.service.impl; + +import com.ruoyi.basic.domain.HwGlobalCfg; +import com.ruoyi.basic.mapper.HwGlobalCfgDao; +import com.ruoyi.basic.service.HwGlobalCfgService; +import org.springframework.stereotype.Service; +import org.springframework.data.domain.Page; +import org.springframework.data.domain.PageImpl; +import org.springframework.data.domain.PageRequest; + +import javax.annotation.Resource; +import java.util.List; + +/** + * 全局配置表(HwGlobalCfg)表服务实现类 + * + * @author makejava + * @since 2024-09-26 14:42:44 + */ +@Service("hwGlobalCfgService") +public class HwGlobalCfgServiceImpl implements HwGlobalCfgService { + @Resource + private HwGlobalCfgDao hwGlobalCfgDao; + + /** + * 通过ID查询单条数据 + * + * @param globalCfgId 主键 + * @return 实例对象 + */ + @Override + public HwGlobalCfg queryById(Long globalCfgId) { + return this.hwGlobalCfgDao.queryById(globalCfgId); + } + + /** + * 分页查询 + * + * @param hwGlobalCfg 筛选条件 + * @param pageRequest 分页对象 + * @return 查询结果 + */ + @Override + public Page queryByPage(HwGlobalCfg hwGlobalCfg, PageRequest pageRequest) { + long total = this.hwGlobalCfgDao.count(hwGlobalCfg); + return new PageImpl<>(this.hwGlobalCfgDao.queryAllByLimit(hwGlobalCfg, pageRequest), pageRequest, total); + } + + /** + * 新增数据 + * + * @param hwGlobalCfg 实例对象 + * @return 实例对象 + */ + @Override + public int insert(HwGlobalCfg hwGlobalCfg) { + int insert = this.hwGlobalCfgDao.insert(hwGlobalCfg); + return insert; + } + + /** + * 修改数据 + * + * @param hwGlobalCfg 实例对象 + * @return 实例对象 + */ + @Override + public HwGlobalCfg update(HwGlobalCfg hwGlobalCfg) { + this.hwGlobalCfgDao.update(hwGlobalCfg); + return this.queryById(hwGlobalCfg.getGlobalCfgId()); + } + + + + @Override + public List queryAll(HwGlobalCfg hwGlobalCfg) { + return hwGlobalCfgDao.queryAll(hwGlobalCfg); + } + + /** + * 通过主键删除数据 + * + * @param globalCfgId 主键 + * @return 是否成功 + */ + @Override + public boolean deleteById(Long globalCfgId) { + return this.hwGlobalCfgDao.deleteById(globalCfgId) > 0; + } +} diff --git a/ruoyi-modules/hw-basic/src/main/java/com/ruoyi/basic/service/impl/HwTemplateAchieveServiceImpl.java b/ruoyi-modules/hw-basic/src/main/java/com/ruoyi/basic/service/impl/HwTemplateAchieveServiceImpl.java new file mode 100644 index 0000000..3bcbeba --- /dev/null +++ b/ruoyi-modules/hw-basic/src/main/java/com/ruoyi/basic/service/impl/HwTemplateAchieveServiceImpl.java @@ -0,0 +1,112 @@ +package com.ruoyi.basic.service.impl; + +import com.ruoyi.basic.domain.HwTemplateAchieve; +import com.ruoyi.basic.domain.HwTemplateAchieveContent; +import com.ruoyi.basic.mapper.HwTemplateAchieveDao; +import com.ruoyi.basic.service.HwTemplateAchieveService; +import com.ruoyi.common.security.utils.SecurityUtils; +import com.ruoyi.system.api.domain.SysFile; +import org.springframework.stereotype.Service; +import org.springframework.data.domain.Page; +import org.springframework.data.domain.PageImpl; +import org.springframework.data.domain.PageRequest; + +import javax.annotation.Resource; +import java.util.Date; +import java.util.List; + +/** + * 模板实现表(HwTemplateAchieve)表服务实现类 + * + * @author makejava + * @since 2024-09-18 10:09:52 + */ +@Service("hwTemplateAchieveService") +public class HwTemplateAchieveServiceImpl implements HwTemplateAchieveService { + @Resource + private HwTemplateAchieveDao hwTemplateAchieveDao; + + /** + * 通过ID查询单条数据 + * + * @param achieveId 主键 + * @return 实例对象 + */ + @Override + public HwTemplateAchieve queryById(Long achieveId) { + return this.hwTemplateAchieveDao.queryById(achieveId); + } + + /** + * 分页查询 + * + * @param hwTemplateAchieve 筛选条件 + * @param pageRequest 分页对象 + * @return 查询结果 + */ + @Override + public Page queryByPage(HwTemplateAchieve hwTemplateAchieve, PageRequest pageRequest) { + long total = this.hwTemplateAchieveDao.count(hwTemplateAchieve); + return new PageImpl<>(this.hwTemplateAchieveDao.queryAllByLimit(hwTemplateAchieve, pageRequest), pageRequest, total); + } + + /** + * 新增数据 + * + * @param hwTemplateAchieve 实例对象 + * @return 实例对象 + */ + @Override + public int insert(HwTemplateAchieve hwTemplateAchieve) { + hwTemplateAchieve.setCreateBy(SecurityUtils.getUsername()); + hwTemplateAchieve.setCreateTime(new Date()); + HwTemplateAchieveContent content = new HwTemplateAchieveContent(); + content.setAchieveContent(hwTemplateAchieve.getAchieveContent()); + hwTemplateAchieve.setAchieveContent(null); + int insert = hwTemplateAchieveDao.insert(hwTemplateAchieve); + content.setAchieveId(hwTemplateAchieve.getAchieveId()); + int count = hwTemplateAchieveDao.insertContent(content); + return count+insert; + } + + /** + * 修改数据 + * + * @param hwTemplateAchieve 实例对象 + * @return 实例对象 + */ + @Override + public int update(HwTemplateAchieve hwTemplateAchieve) { + return hwTemplateAchieveDao.update(hwTemplateAchieve); + + } + + @Override + public List queryImage(SysFile sysFile) { + return hwTemplateAchieveDao.queryImage(sysFile); + } + + @Override + public int saveImage(SysFile sysFile) { + return hwTemplateAchieveDao.saveImage(sysFile); + + } + + @Override + public List queryAll(HwTemplateAchieve hwTemplateAchieve) { + return hwTemplateAchieveDao.queryAll(hwTemplateAchieve); + } + + /** + * 通过主键删除数据 + * + * @param achieveId 主键 + * @return 是否成功 + */ + @Override + public boolean deleteById(Long achieveId) { + int count = hwTemplateAchieveDao.deleteContentById(achieveId); + int delete = hwTemplateAchieveDao.deleteById(achieveId); + return count+delete > 0; + } +} diff --git a/ruoyi-modules/hw-basic/src/main/java/com/ruoyi/basic/service/impl/HwTemplateServiceImpl.java b/ruoyi-modules/hw-basic/src/main/java/com/ruoyi/basic/service/impl/HwTemplateServiceImpl.java new file mode 100644 index 0000000..e90c3c1 --- /dev/null +++ b/ruoyi-modules/hw-basic/src/main/java/com/ruoyi/basic/service/impl/HwTemplateServiceImpl.java @@ -0,0 +1,94 @@ +package com.ruoyi.basic.service.impl; + +import com.ruoyi.basic.domain.HwTemplate; +import com.ruoyi.basic.mapper.HwTemplateDao; +import com.ruoyi.basic.service.HwTemplateService; +import com.ruoyi.common.security.utils.SecurityUtils; +import org.springframework.stereotype.Service; +import org.springframework.data.domain.Page; +import org.springframework.data.domain.PageImpl; +import org.springframework.data.domain.PageRequest; + +import javax.annotation.Resource; +import java.util.Date; +import java.util.List; + +/** + * 模板表(HwTemplate)表服务实现类 + * + * @author makejava + * @since 2024-09-18 10:09:26 + */ +@Service("hwTemplateService") +public class HwTemplateServiceImpl implements HwTemplateService { + @Resource + private HwTemplateDao hwTemplateDao; + + /** + * 通过ID查询单条数据 + * + * @param templateId 主键 + * @return 实例对象 + */ + @Override + public HwTemplate queryById(Long templateId) { + return this.hwTemplateDao.queryById(templateId); + } + + /** + * 分页查询 + * + * @param hwTemplate 筛选条件 + * @param pageRequest 分页对象 + * @return 查询结果 + */ + @Override + public Page queryByPage(HwTemplate hwTemplate, PageRequest pageRequest) { + long total = this.hwTemplateDao.count(hwTemplate); + return new PageImpl<>(this.hwTemplateDao.queryAllByLimit(hwTemplate, pageRequest), pageRequest, total); + } + + /** + * 新增数据 + * + * @param hwTemplate 实例对象 + * @return 实例对象 + */ + @Override + public HwTemplate insert(HwTemplate hwTemplate) { + hwTemplate.setCreateBy(SecurityUtils.getUsername()); + hwTemplate.setCreateTime(new Date()); + this.hwTemplateDao.insert(hwTemplate); + return hwTemplate; + } + + /** + * 修改数据 + * + * @param hwTemplate 实例对象 + * @return 实例对象 + */ + @Override + public int update(HwTemplate hwTemplate) { + int update = this.hwTemplateDao.update(hwTemplate); + return update; + } + + @Override + public List queryAll(HwTemplate hwTemplate) { + return hwTemplateDao.queryAll(hwTemplate); + } + + /** + * 通过主键删除数据 + * + * @param templateId 主键 + * @return 是否成功 + */ + @Override + public boolean deleteById(Long templateId) { + return this.hwTemplateDao.deleteById(templateId) > 0; + } + + +} diff --git a/ruoyi-modules/hw-basic/src/main/resources/mapper/basic/HwGlobalCfgDao.xml b/ruoyi-modules/hw-basic/src/main/resources/mapper/basic/HwGlobalCfgDao.xml new file mode 100644 index 0000000..6269433 --- /dev/null +++ b/ruoyi-modules/hw-basic/src/main/resources/mapper/basic/HwGlobalCfgDao.xml @@ -0,0 +1,158 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + insert into hw_global_cfg(global_cfg_name, global_cfg_type, global_cfg_date, is_detail, details) + values (#{globalCfgName}, #{globalCfgType}, #{globalCfgDate}, #{isDetail}, #{details}) + + + + insert into hw_global_cfg(global_cfg_name, global_cfg_type, global_cfg_date, is_detail, details) + values + + (#{entity.globalCfgName}, #{entity.globalCfgType}, #{entity.globalCfgDate}, #{entity.isDetail}, #{entity.details}) + + + + + insert into hw_global_cfg(global_cfg_name, global_cfg_type, global_cfg_date, is_detail, details) + values + + (#{entity.globalCfgName}, #{entity.globalCfgType}, #{entity.globalCfgDate}, #{entity.isDetail}, #{entity.details}) + + on duplicate key update + global_cfg_name = values(global_cfg_name), + global_cfg_type = values(global_cfg_type), + global_cfg_date = values(global_cfg_date), + is_detail = values(is_detail), + details = values(details) + + + + + update hw_global_cfg + + + global_cfg_name = #{globalCfgName}, + + + global_cfg_type = #{globalCfgType}, + + + global_cfg_date = #{globalCfgDate}, + + + is_detail = #{isDetail}, + + + details = #{details}, + + + where global_cfg_id = #{globalCfgId} + + + + + delete from hw_global_cfg where global_cfg_id = #{globalCfgId} + + + + diff --git a/ruoyi-modules/hw-basic/src/main/resources/mapper/basic/HwTemplateAchieveDao.xml b/ruoyi-modules/hw-basic/src/main/resources/mapper/basic/HwTemplateAchieveDao.xml new file mode 100644 index 0000000..36c1734 --- /dev/null +++ b/ruoyi-modules/hw-basic/src/main/resources/mapper/basic/HwTemplateAchieveDao.xml @@ -0,0 +1,200 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + insert into hw_template_achieve(template_id, achieve_name, create_by, create_time, update_by, update_time, remark) + values (#{templateId}, #{achieveName}, #{createBy}, #{createTime}, #{updateBy}, #{updateTime}, #{remark}) + + + + insert into hw_template_achieve(template_id, achieve_name, achieve_content, create_by, create_time, update_by, update_time, remark) + values + + (#{entity.templateId}, #{entity.achieveName}, #{entity.achieveContent}, #{entity.createBy}, #{entity.createTime}, #{entity.updateBy}, #{entity.updateTime}, #{entity.remark}) + + + + + insert into hw_template_achieve(template_id, achieve_name, achieve_content, create_by, create_time, update_by, update_time, remark) + values + + (#{entity.templateId}, #{entity.achieveName}, #{entity.achieveContent}, #{entity.createBy}, #{entity.createTime}, #{entity.updateBy}, #{entity.updateTime}, #{entity.remark}) + + on duplicate key update + template_id = values(template_id), + achieve_name = values(achieve_name), + achieve_content = values(achieve_content), + create_by = values(create_by), + create_time = values(create_time), + update_by = values(update_by), + update_time = values(update_time), + remark = values(remark) + + + insert into hw_template_achieve_content(achieve_id, achieve_content) + values + (#{entity.achieveId}, #{entity.achieveContent}) + + + insert into sys_file(name,url) + values (#{name},#{url}) + + + + + update hw_template_achieve_content + + + achieve_content = #{entity.achieveContent}, + + + where achieve_id = #{entity.achieveId} + + + + + delete from hw_template_achieve where achieve_id = #{achieveId} + + + delete from hw_template_achieve_content where achieve_id = #{achieveId} + + + + diff --git a/ruoyi-modules/hw-basic/src/main/resources/mapper/basic/HwTemplateDao.xml b/ruoyi-modules/hw-basic/src/main/resources/mapper/basic/HwTemplateDao.xml new file mode 100644 index 0000000..5c3248b --- /dev/null +++ b/ruoyi-modules/hw-basic/src/main/resources/mapper/basic/HwTemplateDao.xml @@ -0,0 +1,156 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + insert into hw_template(template_name, template_content, create_by, create_time, update_by, update_time, remark) + values (#{templateName}, #{templateContent}, #{createBy}, #{createTime}, #{updateBy}, #{updateTime}, #{remark}) + + + + insert into hw_template(template_name, template_content, create_by, create_time, update_by, update_time, remark) + values + + (#{entity.templateName}, #{entity.templateContent}, #{entity.createBy}, #{entity.createTime}, #{entity.updateBy}, #{entity.updateTime}, #{entity.remark}) + + + + + insert into hw_template(template_name, template_content, create_by, create_time, update_by, update_time, remark) + values + + (#{entity.templateName}, #{entity.templateContent}, #{entity.createBy}, #{entity.createTime}, #{entity.updateBy}, #{entity.updateTime}, #{entity.remark}) + + on duplicate key update + template_name = values(template_name), + template_content = values(template_content), + create_by = values(create_by), + create_time = values(create_time), + update_by = values(update_by), + update_time = values(update_time), + remark = values(remark) + + + + + update hw_template + + + template_name = #{templateName}, + + + template_content = #{templateContent}, + + + create_by = #{createBy}, + + + create_time = #{createTime}, + + + update_by = #{updateBy}, + + + update_time = #{updateTime}, + + + remark = #{remark}, + + + where template_id = #{templateId} + + + + + delete from hw_template where template_id = #{templateId} + + + +