Merge remote-tracking branch 'origin/breach-zhy'
commit
8973798784
@ -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<List<HwGlobalCfg>> queryByPage(HwGlobalCfg hwGlobalCfg) {
|
||||
List<HwGlobalCfg> list = hwGlobalCfgService.queryAll(hwGlobalCfg);
|
||||
return ResponseEntity.ok(list);
|
||||
}
|
||||
|
||||
/**
|
||||
* 通过主键查询单条数据
|
||||
*
|
||||
* @param id 主键
|
||||
* @return 单条数据
|
||||
*/
|
||||
@GetMapping("{id}")
|
||||
public ResponseEntity<HwGlobalCfg> queryById(@PathVariable("id") Long id) {
|
||||
return ResponseEntity.ok(this.hwGlobalCfgService.queryById(id));
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增数据
|
||||
*
|
||||
* @param hwGlobalCfg 实体
|
||||
* @return 新增结果
|
||||
*/
|
||||
@PostMapping
|
||||
public ResponseEntity<Integer> add(@RequestBody HwGlobalCfg hwGlobalCfg) {
|
||||
return ResponseEntity.ok(this.hwGlobalCfgService.insert(hwGlobalCfg));
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 编辑数据
|
||||
*
|
||||
* @param hwGlobalCfg 实体
|
||||
* @return 编辑结果
|
||||
*/
|
||||
@PutMapping
|
||||
public ResponseEntity<HwGlobalCfg> edit(@RequestBody HwGlobalCfg hwGlobalCfg) {
|
||||
return ResponseEntity.ok(this.hwGlobalCfgService.update(hwGlobalCfg));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除数据
|
||||
*
|
||||
* @param id 主键
|
||||
* @return 删除是否成功
|
||||
*/
|
||||
@DeleteMapping
|
||||
public ResponseEntity<Boolean> deleteById(Long globalCfgId) {
|
||||
return ResponseEntity.ok(this.hwGlobalCfgService.deleteById(globalCfgId));
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -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<HwTemplateAchieve> list = hwTemplateAchieveService.queryAll(hwTemplateAchieve);
|
||||
return getDataTable(list);
|
||||
}
|
||||
|
||||
/**
|
||||
* 通过主键查询单条数据
|
||||
*
|
||||
* @param id 主键
|
||||
* @return 单条数据
|
||||
*/
|
||||
@GetMapping("{id}")
|
||||
public ResponseEntity<HwTemplateAchieve> queryById(@PathVariable("id") Long id) {
|
||||
return ResponseEntity.ok(this.hwTemplateAchieveService.queryById(id));
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增数据
|
||||
* @return 新增结果
|
||||
*/
|
||||
@PostMapping
|
||||
public AjaxResult add(@RequestBody Map<String,Object> 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<SysFile> 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<SysFile> list = hwTemplateAchieveService.queryImage(sysFile);
|
||||
return AjaxResult.success(getDataTable(list));
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -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<HwTemplate> list = hwTemplateService.queryAll(hwTemplate);
|
||||
return getDataTable(list);
|
||||
}
|
||||
|
||||
/**
|
||||
* 通过主键查询单条数据
|
||||
*
|
||||
* @param id 主键
|
||||
* @return 单条数据
|
||||
*/
|
||||
@GetMapping("{id}")
|
||||
public ResponseEntity<HwTemplate> queryById(@PathVariable("id") Long id) {
|
||||
return ResponseEntity.ok(this.hwTemplateService.queryById(id));
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增数据
|
||||
*
|
||||
* @param
|
||||
* @return 新增结果
|
||||
*/
|
||||
@PostMapping
|
||||
public AjaxResult add(@RequestBody Map<String,Object> 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();
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -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;
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -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;
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -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;
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -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;
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
@ -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<HwGlobalCfg> 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<HwGlobalCfg> queryAll(HwGlobalCfg hwGlobalCfg);
|
||||
|
||||
|
||||
}
|
@ -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<HwTemplateAchieve> 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<HwTemplateAchieve> queryAll(HwTemplateAchieve hwTemplateAchieve);
|
||||
|
||||
int saveImage(SysFile sysFile);
|
||||
|
||||
List<SysFile> queryImage(SysFile sysFile);
|
||||
|
||||
}
|
@ -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<HwTemplate> 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<HwTemplate> queryAll(HwTemplate hwTemplate);
|
||||
}
|
@ -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<HwGlobalCfg> 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<HwGlobalCfg> queryAll(HwGlobalCfg hwGlobalCfg) {
|
||||
return hwGlobalCfgDao.queryAll(hwGlobalCfg);
|
||||
}
|
||||
|
||||
/**
|
||||
* 通过主键删除数据
|
||||
*
|
||||
* @param globalCfgId 主键
|
||||
* @return 是否成功
|
||||
*/
|
||||
@Override
|
||||
public boolean deleteById(Long globalCfgId) {
|
||||
return this.hwGlobalCfgDao.deleteById(globalCfgId) > 0;
|
||||
}
|
||||
}
|
@ -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<HwTemplateAchieve> 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<SysFile> queryImage(SysFile sysFile) {
|
||||
return hwTemplateAchieveDao.queryImage(sysFile);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int saveImage(SysFile sysFile) {
|
||||
return hwTemplateAchieveDao.saveImage(sysFile);
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<HwTemplateAchieve> 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;
|
||||
}
|
||||
}
|
@ -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<HwTemplate> 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<HwTemplate> queryAll(HwTemplate hwTemplate) {
|
||||
return hwTemplateDao.queryAll(hwTemplate);
|
||||
}
|
||||
|
||||
/**
|
||||
* 通过主键删除数据
|
||||
*
|
||||
* @param templateId 主键
|
||||
* @return 是否成功
|
||||
*/
|
||||
@Override
|
||||
public boolean deleteById(Long templateId) {
|
||||
return this.hwTemplateDao.deleteById(templateId) > 0;
|
||||
}
|
||||
|
||||
|
||||
}
|
@ -0,0 +1,158 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="com.ruoyi.basic.mapper.HwGlobalCfgDao">
|
||||
|
||||
<resultMap type="com.ruoyi.basic.domain.HwGlobalCfg" id="HwGlobalCfgMap">
|
||||
<result property="globalCfgId" column="global_cfg_id" jdbcType="INTEGER"/>
|
||||
<result property="globalCfgName" column="global_cfg_name" jdbcType="VARCHAR"/>
|
||||
<result property="globalCfgType" column="global_cfg_type" jdbcType="VARCHAR"/>
|
||||
<result property="globalCfgDate" column="global_cfg_date" jdbcType="VARCHAR"/>
|
||||
<result property="isDetail" column="is_detail" jdbcType="VARCHAR"/>
|
||||
<result property="details" column="details" jdbcType="VARCHAR"/>
|
||||
</resultMap>
|
||||
|
||||
<!--查询单个-->
|
||||
<select id="queryById" resultMap="HwGlobalCfgMap">
|
||||
select
|
||||
global_cfg_id, global_cfg_name, global_cfg_type, global_cfg_date, is_detail, details
|
||||
from hw_global_cfg
|
||||
where global_cfg_id = #{globalCfgId}
|
||||
</select>
|
||||
|
||||
<!--查询指定行数据-->
|
||||
<select id="queryAllByLimit" resultMap="HwGlobalCfgMap">
|
||||
select
|
||||
global_cfg_id, global_cfg_name, global_cfg_type, global_cfg_date, is_detail, details
|
||||
from hw_global_cfg
|
||||
<where>
|
||||
<if test="globalCfgId != null">
|
||||
and global_cfg_id = #{globalCfgId}
|
||||
</if>
|
||||
<if test="globalCfgName != null and globalCfgName != ''">
|
||||
and global_cfg_name = #{globalCfgName}
|
||||
</if>
|
||||
<if test="globalCfgType != null and globalCfgType != ''">
|
||||
and global_cfg_type = #{globalCfgType}
|
||||
</if>
|
||||
<if test="globalCfgDate != null and globalCfgDate != ''">
|
||||
and global_cfg_date = #{globalCfgDate}
|
||||
</if>
|
||||
<if test="isDetail != null and isDetail != ''">
|
||||
and is_detail = #{isDetail}
|
||||
</if>
|
||||
<if test="details != null">
|
||||
and details = #{details}
|
||||
</if>
|
||||
</where>
|
||||
limit #{pageable.offset}, #{pageable.pageSize}
|
||||
</select>
|
||||
|
||||
<!--统计总行数-->
|
||||
<select id="count" resultType="java.lang.Long">
|
||||
select count(1)
|
||||
from hw_global_cfg
|
||||
<where>
|
||||
<if test="globalCfgId != null">
|
||||
and global_cfg_id = #{globalCfgId}
|
||||
</if>
|
||||
<if test="globalCfgName != null and globalCfgName != ''">
|
||||
and global_cfg_name = #{globalCfgName}
|
||||
</if>
|
||||
<if test="globalCfgType != null and globalCfgType != ''">
|
||||
and global_cfg_type = #{globalCfgType}
|
||||
</if>
|
||||
<if test="globalCfgDate != null and globalCfgDate != ''">
|
||||
and global_cfg_date = #{globalCfgDate}
|
||||
</if>
|
||||
<if test="isDetail != null and isDetail != ''">
|
||||
and is_detail = #{isDetail}
|
||||
</if>
|
||||
<if test="details != null and details.size()>0">
|
||||
and details = #{details}
|
||||
</if>
|
||||
</where>
|
||||
</select>
|
||||
<select id="queryAll" resultType="com.ruoyi.basic.domain.HwGlobalCfg"
|
||||
parameterType="com.ruoyi.basic.domain.HwGlobalCfg">
|
||||
select *
|
||||
from hw_global_cfg
|
||||
<where>
|
||||
<if test="globalCfgId != null">
|
||||
and global_cfg_id = #{globalCfgId}
|
||||
</if>
|
||||
<if test="globalCfgName != null and globalCfgName != ''">
|
||||
and global_cfg_name = #{globalCfgName}
|
||||
</if>
|
||||
<if test="globalCfgType != null and globalCfgType != ''">
|
||||
and global_cfg_type = #{globalCfgType}
|
||||
</if>
|
||||
<if test="globalCfgDate != null and globalCfgDate != ''">
|
||||
and global_cfg_date = #{globalCfgDate}
|
||||
</if>
|
||||
<if test="isDetail != null and isDetail != ''">
|
||||
and is_detail = #{isDetail}
|
||||
</if>
|
||||
<if test="details != null">
|
||||
and details = #{details}
|
||||
</if>
|
||||
</where>
|
||||
</select>
|
||||
|
||||
<!--新增所有列-->
|
||||
<insert id="insert" keyProperty="globalCfgId" useGeneratedKeys="true">
|
||||
insert into hw_global_cfg(global_cfg_name, global_cfg_type, global_cfg_date, is_detail, details)
|
||||
values (#{globalCfgName}, #{globalCfgType}, #{globalCfgDate}, #{isDetail}, #{details})
|
||||
</insert>
|
||||
|
||||
<insert id="insertBatch" keyProperty="globalCfgId" useGeneratedKeys="true">
|
||||
insert into hw_global_cfg(global_cfg_name, global_cfg_type, global_cfg_date, is_detail, details)
|
||||
values
|
||||
<foreach collection="entities" item="entity" separator=",">
|
||||
(#{entity.globalCfgName}, #{entity.globalCfgType}, #{entity.globalCfgDate}, #{entity.isDetail}, #{entity.details})
|
||||
</foreach>
|
||||
</insert>
|
||||
|
||||
<insert id="insertOrUpdateBatch" keyProperty="globalCfgId" useGeneratedKeys="true">
|
||||
insert into hw_global_cfg(global_cfg_name, global_cfg_type, global_cfg_date, is_detail, details)
|
||||
values
|
||||
<foreach collection="entities" item="entity" separator=",">
|
||||
(#{entity.globalCfgName}, #{entity.globalCfgType}, #{entity.globalCfgDate}, #{entity.isDetail}, #{entity.details})
|
||||
</foreach>
|
||||
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)
|
||||
</insert>
|
||||
|
||||
<!--通过主键修改数据-->
|
||||
<update id="update">
|
||||
update hw_global_cfg
|
||||
<set>
|
||||
<if test="globalCfgName != null and globalCfgName != ''">
|
||||
global_cfg_name = #{globalCfgName},
|
||||
</if>
|
||||
<if test="globalCfgType != null and globalCfgType != ''">
|
||||
global_cfg_type = #{globalCfgType},
|
||||
</if>
|
||||
<if test="globalCfgDate != null and globalCfgDate != ''">
|
||||
global_cfg_date = #{globalCfgDate},
|
||||
</if>
|
||||
<if test="isDetail != null and isDetail != ''">
|
||||
is_detail = #{isDetail},
|
||||
</if>
|
||||
<if test="details != null">
|
||||
details = #{details},
|
||||
</if>
|
||||
</set>
|
||||
where global_cfg_id = #{globalCfgId}
|
||||
</update>
|
||||
|
||||
<!--通过主键删除-->
|
||||
<delete id="deleteById">
|
||||
delete from hw_global_cfg where global_cfg_id = #{globalCfgId}
|
||||
</delete>
|
||||
|
||||
</mapper>
|
||||
|
@ -0,0 +1,200 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="com.ruoyi.basic.mapper.HwTemplateAchieveDao">
|
||||
|
||||
<resultMap type="com.ruoyi.basic.domain.HwTemplateAchieve" id="HwTemplateAchieveMap">
|
||||
<result property="achieveId" column="achieve_id" jdbcType="INTEGER"/>
|
||||
<result property="templateId" column="template_id" jdbcType="INTEGER"/>
|
||||
<result property="achieveName" column="achieve_name" jdbcType="VARCHAR"/>
|
||||
<result property="achieveContent" column="achieve_content" jdbcType="VARCHAR"/>
|
||||
<result property="createBy" column="create_by" jdbcType="VARCHAR"/>
|
||||
<result property="createTime" column="create_time" jdbcType="TIMESTAMP"/>
|
||||
<result property="updateBy" column="update_by" jdbcType="VARCHAR"/>
|
||||
<result property="updateTime" column="update_time" jdbcType="TIMESTAMP"/>
|
||||
<result property="remark" column="remark" jdbcType="VARCHAR"/>
|
||||
</resultMap>
|
||||
|
||||
<!--查询单个-->
|
||||
<select id="queryById" resultMap="HwTemplateAchieveMap">
|
||||
select
|
||||
achieve_id, template_id, achieve_name, achieve_content, create_by, create_time, update_by, update_time, remark
|
||||
from hw_template_achieve
|
||||
where achieve_id = #{achieveId}
|
||||
</select>
|
||||
|
||||
<!--查询指定行数据-->
|
||||
<select id="queryAllByLimit" resultMap="HwTemplateAchieveMap">
|
||||
select
|
||||
achieve_id, template_id, achieve_name, achieve_content, create_by, create_time, update_by, update_time, remark
|
||||
from hw_template_achieve
|
||||
<where>
|
||||
<if test="achieveId != null">
|
||||
and achieve_id = #{achieveId}
|
||||
</if>
|
||||
<if test="templateId != null">
|
||||
and template_id = #{templateId}
|
||||
</if>
|
||||
<if test="achieveName != null and achieveName != ''">
|
||||
and achieve_name = #{achieveName}
|
||||
</if>
|
||||
<if test="achieveContent != null and achieveContent != ''">
|
||||
and achieve_content = #{achieveContent}
|
||||
</if>
|
||||
<if test="createBy != null and createBy != ''">
|
||||
and create_by = #{createBy}
|
||||
</if>
|
||||
<if test="createTime != null">
|
||||
and create_time = #{createTime}
|
||||
</if>
|
||||
<if test="updateBy != null and updateBy != ''">
|
||||
and update_by = #{updateBy}
|
||||
</if>
|
||||
<if test="updateTime != null">
|
||||
and update_time = #{updateTime}
|
||||
</if>
|
||||
<if test="remark != null and remark != ''">
|
||||
and remark = #{remark}
|
||||
</if>
|
||||
</where>
|
||||
limit #{pageable.offset}, #{pageable.pageSize}
|
||||
</select>
|
||||
|
||||
<!--统计总行数-->
|
||||
<select id="count" resultType="java.lang.Long">
|
||||
select count(1)
|
||||
from hw_template_achieve
|
||||
<where>
|
||||
<if test="achieveId != null">
|
||||
and achieve_id = #{achieveId}
|
||||
</if>
|
||||
<if test="templateId != null">
|
||||
and template_id = #{templateId}
|
||||
</if>
|
||||
<if test="achieveName != null and achieveName != ''">
|
||||
and achieve_name = #{achieveName}
|
||||
</if>
|
||||
<if test="achieveContent != null and achieveContent != ''">
|
||||
and achieve_content = #{achieveContent}
|
||||
</if>
|
||||
<if test="createBy != null and createBy != ''">
|
||||
and create_by = #{createBy}
|
||||
</if>
|
||||
<if test="createTime != null">
|
||||
and create_time = #{createTime}
|
||||
</if>
|
||||
<if test="updateBy != null and updateBy != ''">
|
||||
and update_by = #{updateBy}
|
||||
</if>
|
||||
<if test="updateTime != null">
|
||||
and update_time = #{updateTime}
|
||||
</if>
|
||||
<if test="remark != null and remark != ''">
|
||||
and remark = #{remark}
|
||||
</if>
|
||||
</where>
|
||||
</select>
|
||||
<select id="queryAll" resultType="com.ruoyi.basic.domain.HwTemplateAchieve"
|
||||
parameterType="com.ruoyi.basic.domain.HwTemplateAchieve">
|
||||
select a.achieve_id,a.achieve_name,b.achieve_content achieve_content
|
||||
from hw_template_achieve a left join hw_template_achieve_content b on a.achieve_id = b.achieve_id
|
||||
<where>
|
||||
<if test="achieveId != null">
|
||||
and a.achieve_id = #{achieveId}
|
||||
</if>
|
||||
<if test="achieveName != null and achieveName != ''">
|
||||
and achieve_name like concat('%',#{achieveName},'%')
|
||||
</if>
|
||||
<if test="achieveContent != null and achieveContent != ''">
|
||||
and achieve_content = #{achieveContent}
|
||||
</if>
|
||||
<if test="createBy != null and createBy != ''">
|
||||
and create_by = #{createBy}
|
||||
</if>
|
||||
<if test="createTime != null">
|
||||
and create_time = #{createTime}
|
||||
</if>
|
||||
<if test="updateBy != null and updateBy != ''">
|
||||
and update_by = #{updateBy}
|
||||
</if>
|
||||
<if test="updateTime != null">
|
||||
and update_time = #{updateTime}
|
||||
</if>
|
||||
<if test="remark != null and remark != ''">
|
||||
and remark = #{remark}
|
||||
</if>
|
||||
</where>
|
||||
</select>
|
||||
<select id="queryImage" resultType="com.ruoyi.system.api.domain.SysFile"
|
||||
parameterType="com.ruoyi.system.api.domain.SysFile">
|
||||
select * from sys_file
|
||||
<where>
|
||||
<if test="name != null and name != ''">
|
||||
and name like concat('%',#{name},'%')
|
||||
</if>
|
||||
<if test="url != null and url != ''">
|
||||
and url = #{url}
|
||||
</if>
|
||||
</where>
|
||||
</select>
|
||||
|
||||
<!--新增所有列-->
|
||||
<insert id="insert" keyProperty="achieveId" useGeneratedKeys="true">
|
||||
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>
|
||||
|
||||
<insert id="insertBatch" keyProperty="achieveId" useGeneratedKeys="true">
|
||||
insert into hw_template_achieve(template_id, achieve_name, achieve_content, create_by, create_time, update_by, update_time, remark)
|
||||
values
|
||||
<foreach collection="entities" item="entity" separator=",">
|
||||
(#{entity.templateId}, #{entity.achieveName}, #{entity.achieveContent}, #{entity.createBy}, #{entity.createTime}, #{entity.updateBy}, #{entity.updateTime}, #{entity.remark})
|
||||
</foreach>
|
||||
</insert>
|
||||
|
||||
<insert id="insertOrUpdateBatch" keyProperty="achieveId" useGeneratedKeys="true">
|
||||
insert into hw_template_achieve(template_id, achieve_name, achieve_content, create_by, create_time, update_by, update_time, remark)
|
||||
values
|
||||
<foreach collection="entities" item="entity" separator=",">
|
||||
(#{entity.templateId}, #{entity.achieveName}, #{entity.achieveContent}, #{entity.createBy}, #{entity.createTime}, #{entity.updateBy}, #{entity.updateTime}, #{entity.remark})
|
||||
</foreach>
|
||||
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>
|
||||
<insert id="insertContent" parameterType="com.ruoyi.basic.domain.HwTemplateAchieveContent">
|
||||
insert into hw_template_achieve_content(achieve_id, achieve_content)
|
||||
values
|
||||
(#{entity.achieveId}, #{entity.achieveContent})
|
||||
</insert>
|
||||
<insert id="saveImage">
|
||||
insert into sys_file(name,url)
|
||||
values (#{name},#{url})
|
||||
</insert>
|
||||
|
||||
<!--通过主键修改数据-->
|
||||
<update id="update">
|
||||
update hw_template_achieve_content
|
||||
<set>
|
||||
<if test="entity.achieveContent != null and entity.achieveContent != ''">
|
||||
achieve_content = #{entity.achieveContent},
|
||||
</if>
|
||||
</set>
|
||||
where achieve_id = #{entity.achieveId}
|
||||
</update>
|
||||
|
||||
<!--通过主键删除-->
|
||||
<delete id="deleteById">
|
||||
delete from hw_template_achieve where achieve_id = #{achieveId}
|
||||
</delete>
|
||||
<delete id="deleteContentById">
|
||||
delete from hw_template_achieve_content where achieve_id = #{achieveId}
|
||||
</delete>
|
||||
|
||||
</mapper>
|
||||
|
@ -0,0 +1,156 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="com.ruoyi.basic.mapper.HwTemplateDao">
|
||||
|
||||
<resultMap type="com.ruoyi.basic.domain.HwTemplate" id="HwTemplateMap">
|
||||
<result property="templateId" column="template_id" jdbcType="INTEGER"/>
|
||||
<result property="templateName" column="template_name" jdbcType="VARCHAR"/>
|
||||
<result property="templateContent" column="template_content" jdbcType="VARCHAR"/>
|
||||
<result property="createBy" column="create_by" jdbcType="VARCHAR"/>
|
||||
<result property="createTime" column="create_time" jdbcType="TIMESTAMP"/>
|
||||
<result property="updateBy" column="update_by" jdbcType="VARCHAR"/>
|
||||
<result property="updateTime" column="update_time" jdbcType="TIMESTAMP"/>
|
||||
<result property="remark" column="remark" jdbcType="VARCHAR"/>
|
||||
</resultMap>
|
||||
|
||||
<!--查询单个-->
|
||||
<select id="queryById" resultMap="HwTemplateMap">
|
||||
select
|
||||
template_id, template_name, template_content, create_by, create_time, update_by, update_time, remark
|
||||
from hw_template
|
||||
where template_id = #{templateId}
|
||||
</select>
|
||||
|
||||
<!--查询指定行数据-->
|
||||
<select id="queryAllByLimit" resultMap="HwTemplateMap">
|
||||
select
|
||||
template_id, template_name, template_content, create_by, create_time, update_by, update_time, remark
|
||||
from hw_template
|
||||
<where>
|
||||
<if test="templateId != null">
|
||||
and template_id = #{templateId}
|
||||
</if>
|
||||
<if test="templateName != null and templateName != ''">
|
||||
and template_name = #{templateName}
|
||||
</if>
|
||||
<if test="templateContent != null and templateContent != ''">
|
||||
and template_content = #{templateContent}
|
||||
</if>
|
||||
<if test="createBy != null and createBy != ''">
|
||||
and create_by = #{createBy}
|
||||
</if>
|
||||
<if test="createTime != null">
|
||||
and create_time = #{createTime}
|
||||
</if>
|
||||
<if test="updateBy != null and updateBy != ''">
|
||||
and update_by = #{updateBy}
|
||||
</if>
|
||||
<if test="updateTime != null">
|
||||
and update_time = #{updateTime}
|
||||
</if>
|
||||
<if test="remark != null and remark != ''">
|
||||
and remark = #{remark}
|
||||
</if>
|
||||
</where>
|
||||
limit #{pageable.offset}, #{pageable.pageSize}
|
||||
</select>
|
||||
|
||||
<!--统计总行数-->
|
||||
<select id="queryAll" resultType="com.ruoyi.basic.domain.HwTemplate" parameterType="com.ruoyi.basic.domain.HwTemplate">
|
||||
select *
|
||||
from hw_template
|
||||
<where>
|
||||
<if test="templateId != null">
|
||||
and template_id = #{templateId}
|
||||
</if>
|
||||
<if test="templateName != null and templateName != ''">
|
||||
and template_name = #{templateName}
|
||||
</if>
|
||||
<if test="templateContent != null and templateContent != ''">
|
||||
and template_content = #{templateContent}
|
||||
</if>
|
||||
<if test="createBy != null and createBy != ''">
|
||||
and create_by = #{createBy}
|
||||
</if>
|
||||
<if test="createTime != null">
|
||||
and create_time = #{createTime}
|
||||
</if>
|
||||
<if test="updateBy != null and updateBy != ''">
|
||||
and update_by = #{updateBy}
|
||||
</if>
|
||||
<if test="updateTime != null">
|
||||
and update_time = #{updateTime}
|
||||
</if>
|
||||
<if test="remark != null and remark != ''">
|
||||
and remark = #{remark}
|
||||
</if>
|
||||
</where>
|
||||
</select>
|
||||
|
||||
|
||||
<!--新增所有列-->
|
||||
<insert id="insert" keyProperty="templateId" useGeneratedKeys="true">
|
||||
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>
|
||||
|
||||
<insert id="insertBatch" keyProperty="templateId" useGeneratedKeys="true">
|
||||
insert into hw_template(template_name, template_content, create_by, create_time, update_by, update_time, remark)
|
||||
values
|
||||
<foreach collection="entities" item="entity" separator=",">
|
||||
(#{entity.templateName}, #{entity.templateContent}, #{entity.createBy}, #{entity.createTime}, #{entity.updateBy}, #{entity.updateTime}, #{entity.remark})
|
||||
</foreach>
|
||||
</insert>
|
||||
|
||||
<insert id="insertOrUpdateBatch" keyProperty="templateId" useGeneratedKeys="true">
|
||||
insert into hw_template(template_name, template_content, create_by, create_time, update_by, update_time, remark)
|
||||
values
|
||||
<foreach collection="entities" item="entity" separator=",">
|
||||
(#{entity.templateName}, #{entity.templateContent}, #{entity.createBy}, #{entity.createTime}, #{entity.updateBy}, #{entity.updateTime}, #{entity.remark})
|
||||
</foreach>
|
||||
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)
|
||||
</insert>
|
||||
|
||||
<!--通过主键修改数据-->
|
||||
<update id="update">
|
||||
update hw_template
|
||||
<set>
|
||||
<if test="templateName != null and templateName != ''">
|
||||
template_name = #{templateName},
|
||||
</if>
|
||||
<if test="templateContent != null and templateContent != ''">
|
||||
template_content = #{templateContent},
|
||||
</if>
|
||||
<if test="createBy != null and createBy != ''">
|
||||
create_by = #{createBy},
|
||||
</if>
|
||||
<if test="createTime != null">
|
||||
create_time = #{createTime},
|
||||
</if>
|
||||
<if test="updateBy != null and updateBy != ''">
|
||||
update_by = #{updateBy},
|
||||
</if>
|
||||
<if test="updateTime != null">
|
||||
update_time = #{updateTime},
|
||||
</if>
|
||||
<if test="remark != null and remark != ''">
|
||||
remark = #{remark},
|
||||
</if>
|
||||
</set>
|
||||
where template_id = #{templateId}
|
||||
</update>
|
||||
|
||||
<!--通过主键删除-->
|
||||
<delete id="deleteById">
|
||||
delete from hw_template where template_id = #{templateId}
|
||||
</delete>
|
||||
|
||||
</mapper>
|
||||
|
Loading…
Reference in New Issue