Merge remote-tracking branch 'origin/master'
commit
f6db1a14d6
@ -0,0 +1,31 @@
|
||||
package com.ruoyi.common.core.web.page;
|
||||
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* @ClassName : TableDataNameVo
|
||||
* @Description :
|
||||
* @Author :
|
||||
* @Date: 2024-06-17 10:41
|
||||
*/
|
||||
public class TableDataNameVo {
|
||||
private TableDataInfo tableDataInfo;
|
||||
|
||||
private Map<String, Object> mapName;
|
||||
|
||||
public TableDataInfo getTableDataInfo() {
|
||||
return tableDataInfo;
|
||||
}
|
||||
|
||||
public void setTableDataInfo(TableDataInfo tableDataInfo) {
|
||||
this.tableDataInfo = tableDataInfo;
|
||||
}
|
||||
|
||||
public Map<String, Object> getMapName() {
|
||||
return mapName;
|
||||
}
|
||||
|
||||
public void setMapName(Map<String, Object> mapName) {
|
||||
this.mapName = mapName;
|
||||
}
|
||||
}
|
@ -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>
|
||||
|
@ -0,0 +1,112 @@
|
||||
package com.ruoyi.business.controller;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.io.IOException;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
|
||||
import com.ruoyi.business.domain.*;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.PutMapping;
|
||||
import org.springframework.web.bind.annotation.DeleteMapping;
|
||||
import org.springframework.web.bind.annotation.PathVariable;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
import com.ruoyi.common.log.annotation.Log;
|
||||
import com.ruoyi.common.log.enums.BusinessType;
|
||||
import com.ruoyi.common.security.annotation.RequiresPermissions;
|
||||
|
||||
import com.ruoyi.business.service.IHwAlarmInfoService;
|
||||
import com.ruoyi.common.core.web.controller.BaseController;
|
||||
import com.ruoyi.common.core.web.domain.AjaxResult;
|
||||
import com.ruoyi.common.core.utils.poi.ExcelUtil;
|
||||
import com.ruoyi.common.core.web.page.TableDataInfo;
|
||||
|
||||
/**
|
||||
* 报警信息Controller
|
||||
*
|
||||
* @author zangch
|
||||
* @date 2024-09-05
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/alarmInformation")
|
||||
public class HwAlarmInfomationController extends BaseController
|
||||
{
|
||||
@Autowired
|
||||
private IHwAlarmInfoService hwAlarmInfoService;
|
||||
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* 查询报警信息列表
|
||||
*/
|
||||
@RequiresPermissions("business:alarmInformation:list")
|
||||
@GetMapping("/list")
|
||||
public TableDataInfo list(HwAlarmInfo hwAlarmInfo)
|
||||
{
|
||||
startPage();
|
||||
List<HwAlarmInfo> list = hwAlarmInfoService.selectHwAlarmInfoList(hwAlarmInfo);
|
||||
return getDataTable(list);
|
||||
}
|
||||
|
||||
/**
|
||||
* 导出报警信息列表
|
||||
*/
|
||||
@RequiresPermissions("business:alarmInformation:export")
|
||||
@Log(title = "报警信息", businessType = BusinessType.EXPORT)
|
||||
@PostMapping("/export")
|
||||
public void export(HttpServletResponse response, HwAlarmInfo hwAlarmInfo)
|
||||
{
|
||||
List<HwAlarmInfo> list = hwAlarmInfoService.selectHwAlarmInfoList(hwAlarmInfo);
|
||||
ExcelUtil<HwAlarmInfo> util = new ExcelUtil<HwAlarmInfo>(HwAlarmInfo.class);
|
||||
util.exportExcel(response, list, "报警信息数据");
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取报警信息详细信息
|
||||
*/
|
||||
@RequiresPermissions("business:alarmInformation:query")
|
||||
@GetMapping(value = "/{alarmInfoId}")
|
||||
public AjaxResult getInfo(@PathVariable("alarmInfoId") Long alarmInfoId)
|
||||
{
|
||||
return success(hwAlarmInfoService.selectHwAlarmInfoByAlarmInfoId(alarmInfoId));
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增报警信息
|
||||
*/
|
||||
@RequiresPermissions("business:alarmInformation:add")
|
||||
@Log(title = "报警信息", businessType = BusinessType.INSERT)
|
||||
@PostMapping
|
||||
public AjaxResult add(@RequestBody HwAlarmInfo hwAlarmInfo)
|
||||
{
|
||||
return toAjax(hwAlarmInfoService.insertHwAlarmInfo(hwAlarmInfo));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改报警信息
|
||||
*/
|
||||
@RequiresPermissions("business:alarmInformation:edit")
|
||||
@Log(title = "报警信息", businessType = BusinessType.UPDATE)
|
||||
@PutMapping
|
||||
public AjaxResult edit(@RequestBody HwAlarmInfo hwAlarmInfo)
|
||||
{
|
||||
return toAjax(hwAlarmInfoService.updateHwAlarmInformation(hwAlarmInfo));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除报警信息
|
||||
*/
|
||||
@RequiresPermissions("business:alarmInformation:remove")
|
||||
@Log(title = "报警信息", businessType = BusinessType.DELETE)
|
||||
@DeleteMapping("/{alarmInfoIds}")
|
||||
public AjaxResult remove(@PathVariable Long[] alarmInfoIds)
|
||||
{
|
||||
return toAjax(hwAlarmInfoService.deleteHwAlarmInfoByAlarmInfoIds(alarmInfoIds));
|
||||
}
|
||||
|
||||
}
|
@ -0,0 +1,112 @@
|
||||
package com.ruoyi.business.controller;
|
||||
|
||||
import com.ruoyi.business.domain.HwMonitorUnitAttribute;
|
||||
import com.ruoyi.business.service.HwMonitorUnitAttributeService;
|
||||
import com.ruoyi.common.core.web.domain.AjaxResult;
|
||||
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.Collections;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 监控单元属性表(HwMonitorUnitAttribute)表控制层
|
||||
*
|
||||
* @author makejava
|
||||
* @since 2024-09-04 13:20:30
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("hwMonitorUnitAttribute")
|
||||
public class HwMonitorUnitAttributeController {
|
||||
/**
|
||||
* 服务对象
|
||||
*/
|
||||
@Resource
|
||||
private HwMonitorUnitAttributeService hwMonitorUnitAttributeService;
|
||||
|
||||
/**
|
||||
* 分页查询
|
||||
*
|
||||
* @param hwMonitorUnitAttribute 筛选条件
|
||||
* @param pageRequest 分页对象
|
||||
* @return 查询结果
|
||||
*/
|
||||
@GetMapping
|
||||
public ResponseEntity<Page<HwMonitorUnitAttribute>> queryByPage(HwMonitorUnitAttribute hwMonitorUnitAttribute, PageRequest pageRequest) {
|
||||
return ResponseEntity.ok(this.hwMonitorUnitAttributeService.queryByPage(hwMonitorUnitAttribute, pageRequest));
|
||||
}
|
||||
|
||||
/**
|
||||
* 通过主键查询单条数据
|
||||
*
|
||||
* @param id 主键
|
||||
* @return 单条数据
|
||||
*/
|
||||
@GetMapping("{id}")
|
||||
public ResponseEntity<HwMonitorUnitAttribute> queryById(@PathVariable("id") Long id) {
|
||||
return ResponseEntity.ok(this.hwMonitorUnitAttributeService.queryById(id));
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增数据
|
||||
*
|
||||
* @param hwMonitorUnitAttribute 实体
|
||||
* @return 新增结果
|
||||
*/
|
||||
@PostMapping
|
||||
public ResponseEntity<HwMonitorUnitAttribute> add(HwMonitorUnitAttribute hwMonitorUnitAttribute) {
|
||||
return ResponseEntity.ok(this.hwMonitorUnitAttributeService.insert(hwMonitorUnitAttribute));
|
||||
}
|
||||
|
||||
/**
|
||||
* 编辑数据
|
||||
*
|
||||
* @param hwMonitorUnitAttribute 实体
|
||||
* @return 编辑结果
|
||||
*/
|
||||
@PutMapping
|
||||
public ResponseEntity<HwMonitorUnitAttribute> edit(HwMonitorUnitAttribute hwMonitorUnitAttribute) {
|
||||
return ResponseEntity.ok(this.hwMonitorUnitAttributeService.update(hwMonitorUnitAttribute));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除数据
|
||||
*
|
||||
* @param id 主键
|
||||
* @return 删除是否成功
|
||||
*/
|
||||
@DeleteMapping
|
||||
public ResponseEntity<Boolean> deleteById(Long id) {
|
||||
return ResponseEntity.ok(this.hwMonitorUnitAttributeService.deleteById(id));
|
||||
}
|
||||
|
||||
@PostMapping("/addUnitAttribute")
|
||||
public AjaxResult addUnitAttribute(@RequestBody HwMonitorUnitAttribute hwMonitorUnitAttribute){
|
||||
int rows = hwMonitorUnitAttributeService.addUnitAttribute(hwMonitorUnitAttribute);
|
||||
return AjaxResult.success(rows);
|
||||
}
|
||||
|
||||
@GetMapping("/selectAttributeByUnitId")
|
||||
public AjaxResult selectAttributeByUnitId(Long monitorUnitId){
|
||||
List<HwMonitorUnitAttribute> attributes = hwMonitorUnitAttributeService.selectAttributeByUnitId(monitorUnitId);
|
||||
if (attributes.size()==0){
|
||||
return AjaxResult.success(Collections.emptyList());
|
||||
}
|
||||
return AjaxResult.success(attributes);
|
||||
}
|
||||
|
||||
@PostMapping("/updateAttributeByUniitId")
|
||||
public AjaxResult updateAttributeByUniitId(@RequestBody HwMonitorUnitAttribute hwMonitorUnitAttribute){
|
||||
return AjaxResult.success(hwMonitorUnitAttributeService.updateAttributeByUniitId(hwMonitorUnitAttribute));
|
||||
}
|
||||
|
||||
@DeleteMapping("/deleteAttributeByUniitId/{attributeId}")
|
||||
public AjaxResult deleteAttributeByUniitId(@PathVariable Long attributeId){
|
||||
return AjaxResult.success(hwMonitorUnitAttributeService.deleteAttributeByUniitId(attributeId));
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -0,0 +1,42 @@
|
||||
package com.ruoyi.business.controller;
|
||||
|
||||
import com.ruoyi.business.domain.HwOfflineRule;
|
||||
import com.ruoyi.business.service.HwOfflineRuleService;
|
||||
import com.ruoyi.common.core.web.controller.BaseController;
|
||||
import com.ruoyi.common.core.web.page.TableDataInfo;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@RestController
|
||||
@RequestMapping("/offlineRule")
|
||||
public class HwOfflineRuleController extends BaseController {
|
||||
|
||||
@Autowired
|
||||
private HwOfflineRuleService hwOfflineRuleService;
|
||||
|
||||
@GetMapping("list")
|
||||
public TableDataInfo list(HwOfflineRule hwOfflineRule){
|
||||
startPage();
|
||||
List<HwOfflineRule> hwOfflineRules = hwOfflineRuleService.selectRuleList(hwOfflineRule);
|
||||
return getDataTable(hwOfflineRules);
|
||||
}
|
||||
@GetMapping("/{offlineRuleId}")
|
||||
public HwOfflineRule selectOfflineRuleById(@PathVariable("offlineRuleId") Long offlineRuleId){
|
||||
HwOfflineRule hwOfflineRule = hwOfflineRuleService.selectOfflineRuleById(offlineRuleId);
|
||||
return hwOfflineRule;
|
||||
}
|
||||
|
||||
@DeleteMapping("/{offlineRuleId}")
|
||||
public int deleteOfflineRuleById(@PathVariable("offlineRuleId") Long offlineRuleId){
|
||||
return hwOfflineRuleService.deleteOfflineRuleById(offlineRuleId);
|
||||
|
||||
}
|
||||
|
||||
@PostMapping
|
||||
public int addOfflineRule(@RequestBody HwOfflineRule hwOfflineRule){
|
||||
return hwOfflineRuleService.addOfflineRule(hwOfflineRule);
|
||||
|
||||
}
|
||||
}
|
@ -0,0 +1,131 @@
|
||||
package com.ruoyi.business.domain;
|
||||
|
||||
/**
|
||||
* @ClassName : BeaconDevice
|
||||
* @Description :
|
||||
* @Author :
|
||||
* @Date: 2024-06-06 15:31
|
||||
*/
|
||||
public class BeaconDevice {
|
||||
private Long deviceId;
|
||||
|
||||
private String deviceName;
|
||||
|
||||
private Double latitude;
|
||||
|
||||
private Double longitude;
|
||||
|
||||
private String remark;
|
||||
|
||||
private String deviceLocation;
|
||||
|
||||
private Long deviceModeId;
|
||||
|
||||
private String deviceStatus;
|
||||
|
||||
private String ifAlarm;
|
||||
|
||||
private String monitorUnitName;
|
||||
private Boolean alarmElectronFence;
|
||||
public Boolean getAlarmElectronFence() {
|
||||
return alarmElectronFence;
|
||||
}
|
||||
|
||||
public void setAlarmElectronFence(Boolean alarmElectronFence) {
|
||||
this.alarmElectronFence = alarmElectronFence;
|
||||
}
|
||||
|
||||
public String getIfAlarm() {
|
||||
return ifAlarm;
|
||||
}
|
||||
|
||||
public void setIfAlarm(String ifAlarm) {
|
||||
this.ifAlarm = ifAlarm;
|
||||
}
|
||||
|
||||
public String getDeviceStatus() {
|
||||
return deviceStatus;
|
||||
}
|
||||
|
||||
public void setDeviceStatus(String deviceStatus) {
|
||||
this.deviceStatus = deviceStatus;
|
||||
}
|
||||
|
||||
public Long getDeviceModeId() {
|
||||
return deviceModeId;
|
||||
}
|
||||
|
||||
public void setDeviceModeId(Long deviceModeId) {
|
||||
this.deviceModeId = deviceModeId;
|
||||
}
|
||||
|
||||
public String getDeviceLocation() {
|
||||
return deviceLocation;
|
||||
}
|
||||
|
||||
public void setDeviceLocation(String deviceLocation) {
|
||||
this.deviceLocation = deviceLocation;
|
||||
}
|
||||
|
||||
public String getRemark() {
|
||||
return remark;
|
||||
}
|
||||
|
||||
public void setRemark(String remark) {
|
||||
this.remark = remark;
|
||||
}
|
||||
|
||||
public Long getDeviceId() {
|
||||
return deviceId;
|
||||
}
|
||||
|
||||
public void setDeviceId(Long deviceId) {
|
||||
this.deviceId = deviceId;
|
||||
}
|
||||
|
||||
public String getDeviceName() {
|
||||
return deviceName;
|
||||
}
|
||||
|
||||
public void setDeviceName(String deviceName) {
|
||||
this.deviceName = deviceName;
|
||||
}
|
||||
|
||||
public Double getLatitude() {
|
||||
return latitude;
|
||||
}
|
||||
|
||||
public void setLatitude(Double latitude) {
|
||||
this.latitude = latitude;
|
||||
}
|
||||
|
||||
public Double getLongitude() {
|
||||
return longitude;
|
||||
}
|
||||
|
||||
public void setLongitude(Double longitude) {
|
||||
this.longitude = longitude;
|
||||
}
|
||||
|
||||
public String getMonitorUnitName() {
|
||||
return monitorUnitName;
|
||||
}
|
||||
|
||||
public void setMonitorUnitName(String monitorUnitName) {
|
||||
this.monitorUnitName = monitorUnitName;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "BeaconDevice{" +
|
||||
"deviceId=" + deviceId +
|
||||
", deviceName='" + deviceName + '\'' +
|
||||
", latitude=" + latitude +
|
||||
", longitude=" + longitude +
|
||||
", remark='" + remark + '\'' +
|
||||
", deviceLocation='" + deviceLocation + '\'' +
|
||||
", deviceModeId=" + deviceModeId +
|
||||
", deviceStatus='" + deviceStatus + '\'' +
|
||||
'}';
|
||||
}
|
||||
}
|
@ -0,0 +1,114 @@
|
||||
package com.ruoyi.business.domain;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.Date;
|
||||
|
||||
/**
|
||||
* 监控单元属性表(HwMonitorUnitAttribute)实体类
|
||||
*
|
||||
* @author makejava
|
||||
* @since 2024-09-04 13:20:33
|
||||
*/
|
||||
public class HwMonitorUnitAttribute implements Serializable {
|
||||
private static final long serialVersionUID = -41167481835416588L;
|
||||
/**
|
||||
* 监控单元属性ID
|
||||
*/
|
||||
private Long attributeId;
|
||||
/**
|
||||
* 监控单元ID
|
||||
*/
|
||||
private Long monitorUnitId;
|
||||
/**
|
||||
* 监控单元属性名称
|
||||
*/
|
||||
private String attributeName;
|
||||
/**
|
||||
* 监控单元属性值
|
||||
*/
|
||||
private String attributeValue;
|
||||
/**
|
||||
* 创建人
|
||||
*/
|
||||
private String createBy;
|
||||
/**
|
||||
* 创建时间
|
||||
*/
|
||||
private Date createTime;
|
||||
/**
|
||||
* 更新人
|
||||
*/
|
||||
private String updateBy;
|
||||
/**
|
||||
* 更新时间
|
||||
*/
|
||||
private Date updateTime;
|
||||
|
||||
|
||||
public Long getAttributeId() {
|
||||
return attributeId;
|
||||
}
|
||||
|
||||
public void setAttributeId(Long attributeId) {
|
||||
this.attributeId = attributeId;
|
||||
}
|
||||
|
||||
public Long getMonitorUnitId() {
|
||||
return monitorUnitId;
|
||||
}
|
||||
|
||||
public void setMonitorUnitId(Long monitorUnitId) {
|
||||
this.monitorUnitId = monitorUnitId;
|
||||
}
|
||||
|
||||
public String getAttributeName() {
|
||||
return attributeName;
|
||||
}
|
||||
|
||||
public void setAttributeName(String attributeName) {
|
||||
this.attributeName = attributeName;
|
||||
}
|
||||
|
||||
public String getAttributeValue() {
|
||||
return attributeValue;
|
||||
}
|
||||
|
||||
public void setAttributeValue(String attributeValue) {
|
||||
this.attributeValue = attributeValue;
|
||||
}
|
||||
|
||||
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;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
@ -0,0 +1,125 @@
|
||||
package com.ruoyi.business.domain.VO;
|
||||
|
||||
import com.ruoyi.common.core.annotation.Excel;
|
||||
import lombok.Data;
|
||||
|
||||
import javax.validation.constraints.Email;
|
||||
|
||||
/**
|
||||
* @ClassName : AlarmInfoExportVo
|
||||
* @Description :
|
||||
* @Author :
|
||||
* @Date: 2024-06-14 09:52
|
||||
*/
|
||||
@Data
|
||||
public class AlarmInfoExportVo {
|
||||
@Excel(name = "报警id")
|
||||
private Long alarmInfoId;
|
||||
|
||||
@Excel(name = "报警位置")
|
||||
private String monitorUnitName;
|
||||
|
||||
// @Excel(name = "报警级别名称")
|
||||
// private String alarmLevelName;
|
||||
|
||||
@Excel(name = "报警类型名称")
|
||||
private String alarmTypeName;
|
||||
|
||||
@Excel(name = "报警时间")
|
||||
private String alarmTime;
|
||||
|
||||
@Excel(name = "ID")
|
||||
private String monitorUnitId;
|
||||
|
||||
@Excel(name = "状态")
|
||||
private String monitorUnitStatus;
|
||||
|
||||
@Excel(name = "类型")
|
||||
private String monitorUnitTypeName;
|
||||
|
||||
@Excel(name = "报警区域")
|
||||
private String areaName;
|
||||
|
||||
// public Long getAlarmInfoId() {
|
||||
// return alarmInfoId;
|
||||
// }
|
||||
//
|
||||
// public void setAlarmInfoId(Long alarmInfoId) {
|
||||
// this.alarmInfoId = alarmInfoId;
|
||||
// }
|
||||
//
|
||||
// public String getAreaName() {
|
||||
// return areaName;
|
||||
// }
|
||||
//
|
||||
// public void setAreaName(String areaName) {
|
||||
// this.areaName = areaName;
|
||||
// }
|
||||
//
|
||||
// public String getMonitorUnitName() {
|
||||
// return monitorUnitName;
|
||||
// }
|
||||
//
|
||||
// public void setMonitorUnitName(String monitorUnitName) {
|
||||
// this.monitorUnitName = monitorUnitName;
|
||||
// }
|
||||
//
|
||||
// public String getAlarmLevelName() {
|
||||
// return alarmLevelName;
|
||||
// }
|
||||
//
|
||||
// public void setAlarmLevelName(String alarmLevelName) {
|
||||
// this.alarmLevelName = alarmLevelName;
|
||||
// }
|
||||
//
|
||||
// public String getAlarmTypeName() {
|
||||
// return alarmTypeName;
|
||||
// }
|
||||
//
|
||||
// public void setAlarmTypeName(String alarmTypeName) {
|
||||
// this.alarmTypeName = alarmTypeName;
|
||||
// }
|
||||
//
|
||||
// public String getAlarmTime() {
|
||||
// return alarmTime;
|
||||
// }
|
||||
//
|
||||
// public void setAlarmTime(String alarmTime) {
|
||||
// this.alarmTime = alarmTime;
|
||||
// }
|
||||
|
||||
// public String getMonitor_unit_id() {
|
||||
// return monitor_unit_id;
|
||||
// }
|
||||
//
|
||||
// public void setMonitor_unit_id(String monitor_unit_id) {
|
||||
// this.monitor_unit_id = monitor_unit_id;
|
||||
// }
|
||||
//
|
||||
// public String getMonitor_unit_status() {
|
||||
// return monitor_unit_status;
|
||||
// }
|
||||
//
|
||||
// public void setMonitor_unit_status(String monitor_unit_status) {
|
||||
// this.monitor_unit_status = monitor_unit_status;
|
||||
// }
|
||||
//
|
||||
// public String getMonitor_unit_type_name() {
|
||||
// return monitor_unit_type_name;
|
||||
// }
|
||||
//
|
||||
// public void setMonitor_unit_type_name(String monitor_unit_type_name) {
|
||||
// this.monitor_unit_type_name = monitor_unit_type_name;
|
||||
// }
|
||||
|
||||
// @Override
|
||||
// public String toString() {
|
||||
// return "AlarmInfoExportVo{" +
|
||||
// "alarmInfoId=" + alarmInfoId +
|
||||
// ", monitorUnitName='" + monitorUnitName + '\'' +
|
||||
// ", alarmLevelName='" + alarmLevelName + '\'' +
|
||||
// ", alarmTypeName='" + alarmTypeName + '\'' +
|
||||
// ", alarmTime='" + alarmTime + '\'' +
|
||||
// '}';
|
||||
// }
|
||||
}
|
@ -0,0 +1,85 @@
|
||||
package com.ruoyi.business.domain.VO;
|
||||
|
||||
import com.ruoyi.common.core.annotation.Excel;
|
||||
import org.springframework.web.bind.annotation.ExceptionHandler;
|
||||
|
||||
/**
|
||||
* @ClassName : DeviceExport
|
||||
* @Description :
|
||||
* @Author :
|
||||
* @Date: 2024-06-12 13:26
|
||||
*/
|
||||
public class DeviceExport {
|
||||
@Excel(name = "设备ID")
|
||||
private Long deviceId;
|
||||
@Excel(name = "温度")
|
||||
private String value1;
|
||||
@Excel(name = "电压")
|
||||
private String voltage;
|
||||
@Excel(name = "经度")
|
||||
private String longitude;
|
||||
@Excel(name = "纬度")
|
||||
private String latitude;
|
||||
@Excel(name = "记录时间")
|
||||
private String ts;
|
||||
|
||||
public Long getDeviceId() {
|
||||
return deviceId;
|
||||
}
|
||||
|
||||
public void setDeviceId(Long deviceId) {
|
||||
this.deviceId = deviceId;
|
||||
}
|
||||
|
||||
public String getValue1() {
|
||||
return value1;
|
||||
}
|
||||
|
||||
public void setValue1(String value1) {
|
||||
this.value1 = value1;
|
||||
}
|
||||
|
||||
public String getVoltage() {
|
||||
return voltage;
|
||||
}
|
||||
|
||||
public void setVoltage(String voltage) {
|
||||
this.voltage = voltage;
|
||||
}
|
||||
|
||||
public String getLongitude() {
|
||||
return longitude;
|
||||
}
|
||||
|
||||
public void setLongitude(String longitude) {
|
||||
this.longitude = longitude;
|
||||
}
|
||||
|
||||
public String getLatitude() {
|
||||
return latitude;
|
||||
}
|
||||
|
||||
public void setLatitude(String latitude) {
|
||||
this.latitude = latitude;
|
||||
}
|
||||
|
||||
public String getTs() {
|
||||
return ts;
|
||||
}
|
||||
|
||||
public void setTs(String ts) {
|
||||
this.ts = ts;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "DeviceExport{" +
|
||||
"deviceId=" + deviceId +
|
||||
", value1='" + value1 + '\'' +
|
||||
", voltage='" + voltage + '\'' +
|
||||
", longitude='" + longitude + '\'' +
|
||||
", latitude='" + latitude + '\'' +
|
||||
", ts='" + ts + '\'' +
|
||||
'}';
|
||||
}
|
||||
}
|
@ -0,0 +1,115 @@
|
||||
package com.ruoyi.business.domain.VO;
|
||||
|
||||
import com.ruoyi.business.domain.HwDevice;
|
||||
import com.ruoyi.business.domain.HwMonitorUnit;
|
||||
import com.ruoyi.common.core.web.domain.BaseEntity;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @ClassName : TreeAreaVo
|
||||
* @Description :
|
||||
* @Author :
|
||||
* @Date: 2024-06-13 10:20
|
||||
*/
|
||||
public class TreeAreaVo {
|
||||
|
||||
private Long areaId;
|
||||
|
||||
private String areaName;
|
||||
|
||||
// private String ancestors;
|
||||
//
|
||||
// private Long parentId;
|
||||
//
|
||||
// private String areaStatus;
|
||||
//
|
||||
// private Long orderNum;
|
||||
|
||||
private List<TreeAreaVo> listArea;
|
||||
|
||||
private List<HwDevice> deviceList;
|
||||
|
||||
private List<HwMonitorUnit> monitorUnitList;
|
||||
|
||||
public List<HwMonitorUnit> getMonitorUnitList() {
|
||||
return monitorUnitList;
|
||||
}
|
||||
|
||||
public void setMonitorUnitList(List<HwMonitorUnit> monitorUnitList) {
|
||||
this.monitorUnitList = monitorUnitList;
|
||||
}
|
||||
|
||||
public List<HwDevice> getDeviceList() {
|
||||
return deviceList;
|
||||
}
|
||||
|
||||
public void setDeviceList(List<HwDevice> deviceList) {
|
||||
this.deviceList = deviceList;
|
||||
}
|
||||
|
||||
public Long getAreaId() {
|
||||
return areaId;
|
||||
}
|
||||
|
||||
public void setAreaId(Long areaId) {
|
||||
this.areaId = areaId;
|
||||
}
|
||||
|
||||
public String getAreaName() {
|
||||
return areaName;
|
||||
}
|
||||
|
||||
public void setAreaName(String areaName) {
|
||||
this.areaName = areaName;
|
||||
}
|
||||
//
|
||||
// public String getAncestors() {
|
||||
// return ancestors;
|
||||
// }
|
||||
//
|
||||
// public void setAncestors(String ancestors) {
|
||||
// this.ancestors = ancestors;
|
||||
// }
|
||||
//
|
||||
// public Long getParentId() {
|
||||
// return parentId;
|
||||
// }
|
||||
//
|
||||
// public void setParentId(Long parentId) {
|
||||
// this.parentId = parentId;
|
||||
// }
|
||||
//
|
||||
// public String getAreaStatus() {
|
||||
// return areaStatus;
|
||||
// }
|
||||
//
|
||||
// public void setAreaStatus(String areaStatus) {
|
||||
// this.areaStatus = areaStatus;
|
||||
// }
|
||||
//
|
||||
// public Long getOrderNum() {
|
||||
// return orderNum;
|
||||
// }
|
||||
//
|
||||
// public void setOrderNum(Long orderNum) {
|
||||
// this.orderNum = orderNum;
|
||||
// }
|
||||
|
||||
public List<TreeAreaVo> getListArea() {
|
||||
return listArea;
|
||||
}
|
||||
|
||||
public void setListArea(List<TreeAreaVo> listArea) {
|
||||
this.listArea = listArea;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "TreeAreaVo{" +
|
||||
"areaId=" + areaId +
|
||||
", areaName='" + areaName + '\'' +
|
||||
", listArea=" + listArea +
|
||||
'}';
|
||||
}
|
||||
}
|
@ -0,0 +1,73 @@
|
||||
package com.ruoyi.business.domain.VO;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @ClassName : TreeDeviceVo
|
||||
* @Description :
|
||||
* @Author :
|
||||
* @Date: 2024-06-11 17:47
|
||||
*/
|
||||
public class TreeDeviceVo {
|
||||
|
||||
private Long voId;
|
||||
|
||||
private String voName;
|
||||
|
||||
private Long parentId;
|
||||
|
||||
private List<TreeDeviceVo> voList;
|
||||
|
||||
private String prop;
|
||||
|
||||
public String getProp() {
|
||||
return prop;
|
||||
}
|
||||
|
||||
public void setProp(String prop) {
|
||||
this.prop = prop;
|
||||
}
|
||||
|
||||
public Long getVoId() {
|
||||
return voId;
|
||||
}
|
||||
|
||||
public void setVoId(Long voId) {
|
||||
this.voId = voId;
|
||||
}
|
||||
|
||||
public String getVoName() {
|
||||
return voName;
|
||||
}
|
||||
|
||||
public void setVoName(String voName) {
|
||||
this.voName = voName;
|
||||
}
|
||||
|
||||
public Long getParentId() {
|
||||
return parentId;
|
||||
}
|
||||
|
||||
public void setParentId(Long parentId) {
|
||||
this.parentId = parentId;
|
||||
}
|
||||
|
||||
public List<TreeDeviceVo> getVoList() {
|
||||
return voList;
|
||||
}
|
||||
|
||||
public void setVoList(List<TreeDeviceVo> voList) {
|
||||
this.voList = voList;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "TreeDeviceVo{" +
|
||||
"voId=" + voId +
|
||||
", voName='" + voName + '\'' +
|
||||
", parentId=" + parentId +
|
||||
", voList=" + voList +
|
||||
", prop=" + prop +
|
||||
'}';
|
||||
}
|
||||
}
|
@ -0,0 +1,17 @@
|
||||
package com.ruoyi.business.mapper;
|
||||
|
||||
import com.ruoyi.business.domain.HwOfflineRule;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public interface HwOfflineRuleMapper {
|
||||
|
||||
List<HwOfflineRule> selectHwOfflineRuleJoinList(HwOfflineRule hwOfflineRule);
|
||||
|
||||
|
||||
HwOfflineRule selectOfflineRuleById(Long offlineRuleId);
|
||||
|
||||
int deleteOfflineRuleById(Long offlineRuleId);
|
||||
|
||||
int addOfflineRule(HwOfflineRule hwOfflineRule);
|
||||
}
|
@ -0,0 +1,68 @@
|
||||
package com.ruoyi.business.service;
|
||||
|
||||
|
||||
import com.ruoyi.business.domain.HwMonitorUnitAttribute;
|
||||
import org.springframework.data.domain.Page;
|
||||
import org.springframework.data.domain.PageRequest;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 监控单元属性表(HwMonitorUnitAttribute)表服务接口
|
||||
*
|
||||
* @author makejava
|
||||
* @since 2024-09-04 13:20:34
|
||||
*/
|
||||
public interface HwMonitorUnitAttributeService {
|
||||
|
||||
/**
|
||||
* 通过ID查询单条数据
|
||||
*
|
||||
* @param attributeId 主键
|
||||
* @return 实例对象
|
||||
*/
|
||||
HwMonitorUnitAttribute queryById(Long attributeId);
|
||||
|
||||
/**
|
||||
* 分页查询
|
||||
*
|
||||
* @param hwMonitorUnitAttribute 筛选条件
|
||||
* @param pageRequest 分页对象
|
||||
* @return 查询结果
|
||||
*/
|
||||
Page<HwMonitorUnitAttribute> queryByPage(HwMonitorUnitAttribute hwMonitorUnitAttribute, PageRequest pageRequest);
|
||||
|
||||
/**
|
||||
* 新增数据
|
||||
*
|
||||
* @param hwMonitorUnitAttribute 实例对象
|
||||
* @return 实例对象
|
||||
*/
|
||||
HwMonitorUnitAttribute insert(HwMonitorUnitAttribute hwMonitorUnitAttribute);
|
||||
|
||||
/**
|
||||
* 修改数据
|
||||
*
|
||||
* @param hwMonitorUnitAttribute 实例对象
|
||||
* @return 实例对象
|
||||
*/
|
||||
HwMonitorUnitAttribute update(HwMonitorUnitAttribute hwMonitorUnitAttribute);
|
||||
|
||||
/**
|
||||
* 通过主键删除数据
|
||||
*
|
||||
* @param attributeId 主键
|
||||
* @return 是否成功
|
||||
*/
|
||||
boolean deleteById(Long attributeId);
|
||||
|
||||
int addUnitAttribute(HwMonitorUnitAttribute hwMonitorUnitAttribute);
|
||||
|
||||
List<HwMonitorUnitAttribute> selectAttributeByUnitId(Long monitorUnitId);
|
||||
|
||||
int updateAttributeByUniitId(HwMonitorUnitAttribute hwMonitorUnitAttribute);
|
||||
|
||||
int deleteAttributeByUniitId(Long attributeId);
|
||||
|
||||
List<HwMonitorUnitAttribute> selectAttributes(Long unitId);
|
||||
}
|
@ -0,0 +1,15 @@
|
||||
package com.ruoyi.business.service;
|
||||
|
||||
import com.ruoyi.business.domain.HwOfflineRule;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public interface HwOfflineRuleService {
|
||||
List<HwOfflineRule> selectRuleList(HwOfflineRule hwOfflineRule);
|
||||
|
||||
HwOfflineRule selectOfflineRuleById(Long offlineRuleId);
|
||||
|
||||
int deleteOfflineRuleById(Long offlineRuleId);
|
||||
|
||||
int addOfflineRule(HwOfflineRule hwOfflineRule);
|
||||
}
|
@ -0,0 +1,116 @@
|
||||
package com.ruoyi.business.service.impl;
|
||||
|
||||
|
||||
import com.ruoyi.business.domain.HwMonitorUnitAttribute;
|
||||
import com.ruoyi.business.mapper.HwMonitorUnitAttributeDao;
|
||||
import com.ruoyi.business.service.HwMonitorUnitAttributeService;
|
||||
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;
|
||||
|
||||
/**
|
||||
* 监控单元属性表(HwMonitorUnitAttribute)表服务实现类
|
||||
*
|
||||
* @author makejava
|
||||
* @since 2024-09-04 13:20:34
|
||||
*/
|
||||
@Service("hwMonitorUnitAttributeService")
|
||||
public class HwMonitorUnitAttributeServiceImpl implements HwMonitorUnitAttributeService {
|
||||
@Resource
|
||||
private HwMonitorUnitAttributeDao hwMonitorUnitAttributeDao;
|
||||
|
||||
/**
|
||||
* 通过ID查询单条数据
|
||||
*
|
||||
* @param attributeId 主键
|
||||
* @return 实例对象
|
||||
*/
|
||||
@Override
|
||||
public HwMonitorUnitAttribute queryById(Long attributeId) {
|
||||
return this.hwMonitorUnitAttributeDao.queryById(attributeId);
|
||||
}
|
||||
|
||||
/**
|
||||
* 分页查询
|
||||
*
|
||||
* @param hwMonitorUnitAttribute 筛选条件
|
||||
* @param pageRequest 分页对象
|
||||
* @return 查询结果
|
||||
*/
|
||||
@Override
|
||||
public Page<HwMonitorUnitAttribute> queryByPage(HwMonitorUnitAttribute hwMonitorUnitAttribute, PageRequest pageRequest) {
|
||||
long total = this.hwMonitorUnitAttributeDao.count(hwMonitorUnitAttribute);
|
||||
return new PageImpl<>(this.hwMonitorUnitAttributeDao.queryAllByLimit(hwMonitorUnitAttribute, pageRequest), pageRequest, total);
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增数据
|
||||
*
|
||||
* @param hwMonitorUnitAttribute 实例对象
|
||||
* @return 实例对象
|
||||
*/
|
||||
@Override
|
||||
public HwMonitorUnitAttribute insert(HwMonitorUnitAttribute hwMonitorUnitAttribute) {
|
||||
this.hwMonitorUnitAttributeDao.insert(hwMonitorUnitAttribute);
|
||||
return hwMonitorUnitAttribute;
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改数据
|
||||
*
|
||||
* @param hwMonitorUnitAttribute 实例对象
|
||||
* @return 实例对象
|
||||
*/
|
||||
@Override
|
||||
public HwMonitorUnitAttribute update(HwMonitorUnitAttribute hwMonitorUnitAttribute) {
|
||||
this.hwMonitorUnitAttributeDao.update(hwMonitorUnitAttribute);
|
||||
return this.queryById(hwMonitorUnitAttribute.getAttributeId());
|
||||
}
|
||||
|
||||
/**
|
||||
* 通过主键删除数据
|
||||
*
|
||||
* @param attributeId 主键
|
||||
* @return 是否成功
|
||||
*/
|
||||
@Override
|
||||
public boolean deleteById(Long attributeId) {
|
||||
return this.hwMonitorUnitAttributeDao.deleteById(attributeId) > 0;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int addUnitAttribute(HwMonitorUnitAttribute hwMonitorUnitAttribute) {
|
||||
hwMonitorUnitAttribute.setCreateBy(SecurityUtils.getUsername());
|
||||
hwMonitorUnitAttribute.setCreateTime(new Date());
|
||||
return hwMonitorUnitAttributeDao.insert(hwMonitorUnitAttribute);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<HwMonitorUnitAttribute> selectAttributeByUnitId(Long monitorUnitId) {
|
||||
return hwMonitorUnitAttributeDao.selectAttributeByUnitId(monitorUnitId);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int updateAttributeByUniitId(HwMonitorUnitAttribute hwMonitorUnitAttribute) {
|
||||
return hwMonitorUnitAttributeDao.updateAttributeByUniitId(hwMonitorUnitAttribute);
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<HwMonitorUnitAttribute> selectAttributes(Long aLong) {
|
||||
return hwMonitorUnitAttributeDao.selectAttributes(aLong);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int deleteAttributeByUniitId(Long unitId) {
|
||||
return hwMonitorUnitAttributeDao.deleteAttributeByUniitId(unitId);
|
||||
}
|
||||
|
||||
|
||||
}
|
@ -0,0 +1,34 @@
|
||||
package com.ruoyi.business.service.impl;
|
||||
|
||||
import com.ruoyi.business.domain.HwOfflineRule;
|
||||
import com.ruoyi.business.mapper.HwOfflineRuleMapper;
|
||||
import com.ruoyi.business.service.HwOfflineRuleService;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.util.List;
|
||||
@Service
|
||||
public class HwOfflineRuleServiceImpl implements HwOfflineRuleService {
|
||||
@Autowired
|
||||
private HwOfflineRuleMapper hwOfflineRuleMapper;
|
||||
@Override
|
||||
public List<HwOfflineRule> selectRuleList(HwOfflineRule hwOfflineRule) {
|
||||
List<HwOfflineRule> hwOfflineRules = hwOfflineRuleMapper.selectHwOfflineRuleJoinList(hwOfflineRule);
|
||||
return hwOfflineRules;
|
||||
}
|
||||
|
||||
@Override
|
||||
public HwOfflineRule selectOfflineRuleById(Long offlineRuleId) {
|
||||
return hwOfflineRuleMapper.selectOfflineRuleById(offlineRuleId);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int deleteOfflineRuleById(Long offlineRuleId) {
|
||||
return hwOfflineRuleMapper.deleteOfflineRuleById(offlineRuleId);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int addOfflineRule(HwOfflineRule hwOfflineRule) {
|
||||
return hwOfflineRuleMapper.addOfflineRule(hwOfflineRule);
|
||||
}
|
||||
}
|
File diff suppressed because it is too large
Load Diff
@ -0,0 +1,89 @@
|
||||
package com.ruoyi.business.utils;
|
||||
|
||||
import com.ruoyi.business.mapper.HwAlarmInfoMapper;
|
||||
import com.ruoyi.common.core.utils.DateUtils;
|
||||
import org.apache.poi.ss.usermodel.Row;
|
||||
import org.apache.poi.ss.usermodel.Sheet;
|
||||
import org.apache.poi.ss.usermodel.Workbook;
|
||||
import org.apache.poi.xssf.usermodel.XSSFWorkbook;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import java.io.FileNotFoundException;
|
||||
import java.io.FileOutputStream;
|
||||
import java.io.IOException;
|
||||
import java.time.LocalDate;
|
||||
import java.time.LocalDateTime;
|
||||
import java.util.*;
|
||||
|
||||
public class UnitExcelUtils {
|
||||
@Autowired
|
||||
private HwAlarmInfoMapper hwAlarmInfoMapper;
|
||||
|
||||
public void exportAlarmInfos(HttpServletResponse response, HashMap<String, List<LinkedHashMap>> map) throws IOException {
|
||||
Workbook bk = new XSSFWorkbook();
|
||||
for (String aLong : map.keySet()) {
|
||||
List<LinkedHashMap> list3 = map.get(aLong);
|
||||
Sheet unitId = bk.createSheet(aLong);
|
||||
int row = 0;
|
||||
for (row = 0;row < list3.size();row++){
|
||||
if (row == 0){
|
||||
LinkedHashMap map1 = list3.get(row);
|
||||
ArrayList list1 = new ArrayList<>(map1.keySet());
|
||||
int size = map1.keySet().size();
|
||||
int cellIndex = 0;
|
||||
Row row1 = unitId.createRow(row);
|
||||
Row row2 = unitId.createRow(1);
|
||||
for (cellIndex = 0;cellIndex < size;cellIndex++){
|
||||
String key = list1.get(cellIndex).toString();
|
||||
row1.createCell(cellIndex).setCellValue(key);
|
||||
Object value = map1.get(key);
|
||||
if (value instanceof String){
|
||||
row2.createCell(cellIndex).setCellValue((String) map1.get(key));
|
||||
}else if (value instanceof Long){
|
||||
row2.createCell(cellIndex).setCellValue((Long) map1.get(key));
|
||||
}else if(value instanceof Date){
|
||||
row2.createCell(cellIndex).setCellValue((Date) map1.get(key));
|
||||
}else {
|
||||
row2.createCell(cellIndex).setCellValue("");
|
||||
}
|
||||
}
|
||||
|
||||
}else {
|
||||
LinkedHashMap map1 = list3.get(row);
|
||||
ArrayList list1 = new ArrayList<>(map1.keySet());
|
||||
int size = map1.keySet().size();
|
||||
int cellIndex = 0;
|
||||
Row row1 = unitId.createRow(row+1);
|
||||
for (cellIndex = 0;cellIndex < size;cellIndex++){
|
||||
String key = list1.get(cellIndex).toString();
|
||||
Object value = map1.get(key);
|
||||
if (value instanceof String){
|
||||
row1.createCell(cellIndex).setCellValue((String) map1.get(key));
|
||||
}else if (value instanceof Long){
|
||||
row1.createCell(cellIndex).setCellValue((Long) map1.get(key));
|
||||
}
|
||||
else if(value instanceof Date){
|
||||
row1.createCell(cellIndex).setCellValue((Date) map1.get(key));
|
||||
}
|
||||
else {
|
||||
row1.createCell(cellIndex).setCellValue("");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
try {
|
||||
// FileOutputStream stream = new FileOutputStream("告警信息");
|
||||
bk.write(response.getOutputStream());
|
||||
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
bk.close();
|
||||
}
|
||||
}
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue