Merge remote-tracking branch 'origin/breach-zhy'

master
xs 1 month ago
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;
/**
* (1true 2false)
*/
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,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<HwGlobalCfg> queryAllByLimit(HwGlobalCfg hwGlobalCfg, @Param("pageable") Pageable pageable);
/**
*
*
* @param hwGlobalCfg
* @return
*/
long count(HwGlobalCfg hwGlobalCfg);
/**
*
*
* @param hwGlobalCfg
* @return
*/
int insert(HwGlobalCfg hwGlobalCfg);
/**
* MyBatisforeach
*
* @param entities List<HwGlobalCfg>
* @return
*/
int insertBatch(@Param("entities") List<HwGlobalCfg> entities);
/**
* MyBatisforeach
*
* @param entities List<HwGlobalCfg>
* @return
* @throws org.springframework.jdbc.BadSqlGrammarException ListSQL
*/
int insertOrUpdateBatch(@Param("entities") List<HwGlobalCfg> entities);
/**
*
*
* @param hwGlobalCfg
* @return
*/
int update(HwGlobalCfg hwGlobalCfg);
/**
*
*
* @param globalCfgId
* @return
*/
int deleteById(Long globalCfgId);
List<HwGlobalCfg> queryAll(HwGlobalCfg hwGlobalCfg);
}

@ -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<HwTemplateAchieve> queryAllByLimit(HwTemplateAchieve hwTemplateAchieve, @Param("pageable") Pageable pageable);
/**
*
*
* @param hwTemplateAchieve
* @return
*/
long count(HwTemplateAchieve hwTemplateAchieve);
/**
*
*
* @param hwTemplateAchieve
* @return
*/
int insert(HwTemplateAchieve hwTemplateAchieve);
/**
* MyBatisforeach
*
* @param entities List<HwTemplateAchieve>
* @return
*/
int insertBatch(@Param("entities") List<HwTemplateAchieve> entities);
/**
* MyBatisforeach
*
* @param entities List<HwTemplateAchieve>
* @return
* @throws org.springframework.jdbc.BadSqlGrammarException ListSQL
*/
int insertOrUpdateBatch(@Param("entities") List<HwTemplateAchieve> entities);
/**
*
*
* @param hwTemplateAchieve
* @return
*/
int update(@Param("entity") HwTemplateAchieve hwTemplateAchieve);
/**
*
*
* @param achieveId
* @return
*/
int deleteById(Long achieveId);
List<HwTemplateAchieve> queryAll(HwTemplateAchieve hwTemplateAchieve);
int insertContent(@Param("entity") HwTemplateAchieveContent content);
int deleteContentById(Long achieveId);
int saveImage(SysFile sysFile);
List<SysFile> queryImage(SysFile sysFile);
}

@ -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<HwTemplate> queryAllByLimit(HwTemplate hwTemplate, @Param("pageable") Pageable pageable);
/**
*
*
* @param hwTemplate
* @return
*/
long count(HwTemplate hwTemplate);
/**
*
*
* @param hwTemplate
* @return
*/
int insert(HwTemplate hwTemplate);
/**
* MyBatisforeach
*
* @param entities List<HwTemplate>
* @return
*/
int insertBatch(@Param("entities") List<HwTemplate> entities);
/**
* MyBatisforeach
*
* @param entities List<HwTemplate>
* @return
* @throws org.springframework.jdbc.BadSqlGrammarException ListSQL
*/
int insertOrUpdateBatch(@Param("entities") List<HwTemplate> entities);
/**
*
*
* @param hwTemplate
* @return
*/
int update(HwTemplate hwTemplate);
/**
*
*
* @param templateId
* @return
*/
int deleteById(Long templateId);
List<HwTemplate> queryAll(HwTemplate hwTemplate);
}

@ -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…
Cancel
Save