From 0cccc11761e3747e2fe3d0bf8b9ae12ee48b46c9 Mon Sep 17 00:00:00 2001 From: yinq Date: Wed, 22 May 2024 17:22:59 +0800 Subject: [PATCH] =?UTF-8?q?change=20-=20add=E8=92=B8=E6=B1=BD=E5=AE=9E?= =?UTF-8?q?=E6=97=B6=E6=95=B0=E6=8D=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../EmsRecordSteamInstantController.java | 100 ++++++++ .../record/domain/EmsRecordSteamInstant.java | 219 ++++++++++++++++++ .../mapper/EmsRecordSteamInstantMapper.java | 61 +++++ .../IEmsRecordSteamInstantService.java | 61 +++++ .../EmsRecordSteamInstantServiceImpl.java | 87 +++++++ .../record/EmsRecordSteamInstantMapper.xml | 129 +++++++++++ 6 files changed, 657 insertions(+) create mode 100644 os-ems/src/main/java/com/os/ems/record/controller/EmsRecordSteamInstantController.java create mode 100644 os-ems/src/main/java/com/os/ems/record/domain/EmsRecordSteamInstant.java create mode 100644 os-ems/src/main/java/com/os/ems/record/mapper/EmsRecordSteamInstantMapper.java create mode 100644 os-ems/src/main/java/com/os/ems/record/service/IEmsRecordSteamInstantService.java create mode 100644 os-ems/src/main/java/com/os/ems/record/service/impl/EmsRecordSteamInstantServiceImpl.java create mode 100644 os-ems/src/main/resources/mapper/ems/record/EmsRecordSteamInstantMapper.xml diff --git a/os-ems/src/main/java/com/os/ems/record/controller/EmsRecordSteamInstantController.java b/os-ems/src/main/java/com/os/ems/record/controller/EmsRecordSteamInstantController.java new file mode 100644 index 0000000..61dcdfa --- /dev/null +++ b/os-ems/src/main/java/com/os/ems/record/controller/EmsRecordSteamInstantController.java @@ -0,0 +1,100 @@ +package com.os.ems.record.controller; + +import java.util.List; +import javax.servlet.http.HttpServletResponse; + +import org.springframework.security.access.prepost.PreAuthorize; +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.os.common.annotation.Log; +import com.os.common.core.controller.BaseController; +import com.os.common.core.domain.AjaxResult; +import com.os.common.enums.BusinessType; +import com.os.ems.record.domain.EmsRecordSteamInstant; +import com.os.ems.record.service.IEmsRecordSteamInstantService; +import com.os.common.utils.poi.ExcelUtil; +import com.os.common.core.page.TableDataInfo; + +/** + * 蒸汽实时数据Controller + * + * @author Yinq + * @date 2024-05-22 + */ +@RestController +@RequestMapping("/ems/record/recordSteamInstant") +public class EmsRecordSteamInstantController extends BaseController { + @Autowired + private IEmsRecordSteamInstantService emsRecordSteamInstantService; + + /** + * 查询蒸汽实时数据列表 + */ + @PreAuthorize("@ss.hasPermi('ems/record:recordSteamInstant:list')") + @GetMapping("/list") + public TableDataInfo list(EmsRecordSteamInstant emsRecordSteamInstant) { + startPage(); + List list = emsRecordSteamInstantService.selectEmsRecordSteamInstantList(emsRecordSteamInstant); + return getDataTable(list); + } + + /** + * 导出蒸汽实时数据列表 + */ + @PreAuthorize("@ss.hasPermi('ems/record:recordSteamInstant:export')") + @Log(title = "蒸汽实时数据", businessType = BusinessType.EXPORT) + @PostMapping("/export") + public void export(HttpServletResponse response, EmsRecordSteamInstant emsRecordSteamInstant) { + List list = emsRecordSteamInstantService.selectEmsRecordSteamInstantList(emsRecordSteamInstant); + ExcelUtil util = new ExcelUtil(EmsRecordSteamInstant.class); + util.exportExcel(response, list, "蒸汽实时数据数据"); + } + + /** + * 获取蒸汽实时数据详细信息 + */ + @PreAuthorize("@ss.hasPermi('ems/record:recordSteamInstant:query')") + @GetMapping(value = "/{objId}") + public AjaxResult getInfo(@PathVariable("objId") Long objId) { + return success(emsRecordSteamInstantService.selectEmsRecordSteamInstantByObjId(objId)); + } + + /** + * 新增蒸汽实时数据 + */ + @PreAuthorize("@ss.hasPermi('ems/record:recordSteamInstant:add')") + @Log(title = "蒸汽实时数据", businessType = BusinessType.INSERT) + @PostMapping + public AjaxResult add(@RequestBody EmsRecordSteamInstant emsRecordSteamInstant) { + emsRecordSteamInstant.setCreateBy(getUsername()); + return toAjax(emsRecordSteamInstantService.insertEmsRecordSteamInstant(emsRecordSteamInstant)); + } + + /** + * 修改蒸汽实时数据 + */ + @PreAuthorize("@ss.hasPermi('ems/record:recordSteamInstant:edit')") + @Log(title = "蒸汽实时数据", businessType = BusinessType.UPDATE) + @PutMapping + public AjaxResult edit(@RequestBody EmsRecordSteamInstant emsRecordSteamInstant) { + emsRecordSteamInstant.setUpdateBy(getUsername()); + return toAjax(emsRecordSteamInstantService.updateEmsRecordSteamInstant(emsRecordSteamInstant)); + } + + /** + * 删除蒸汽实时数据 + */ + @PreAuthorize("@ss.hasPermi('ems/record:recordSteamInstant:remove')") + @Log(title = "蒸汽实时数据", businessType = BusinessType.DELETE) + @DeleteMapping("/{objIds}") + public AjaxResult remove(@PathVariable Long[] objIds) { + return toAjax(emsRecordSteamInstantService.deleteEmsRecordSteamInstantByObjIds(objIds)); + } +} diff --git a/os-ems/src/main/java/com/os/ems/record/domain/EmsRecordSteamInstant.java b/os-ems/src/main/java/com/os/ems/record/domain/EmsRecordSteamInstant.java new file mode 100644 index 0000000..89d9742 --- /dev/null +++ b/os-ems/src/main/java/com/os/ems/record/domain/EmsRecordSteamInstant.java @@ -0,0 +1,219 @@ +package com.os.ems.record.domain; + +import java.math.BigDecimal; +import java.util.Date; + +import com.fasterxml.jackson.annotation.JsonFormat; +import org.apache.commons.lang3.builder.ToStringBuilder; +import org.apache.commons.lang3.builder.ToStringStyle; +import com.os.common.annotation.Excel; +import com.os.common.core.domain.BaseEntity; + +/** + * 蒸汽实时数据对象 ems_record_steam_instant + * + * @author Yinq + * @date 2024-05-22 + */ +public class EmsRecordSteamInstant extends BaseEntity { + private static final long serialVersionUID = 1L; + + /** + * 自增标识 + */ + private Long objId; + + /** + * 计量设备编号 + */ + @Excel(name = "计量设备编号") + private String monitorCode; + + /** 计量设备编号 */ + @Excel(name = "计量设备名称") + private String monitorName; + + /** + * 采集时间 + */ + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") + @Excel(name = "采集时间", width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss") + private Date collectTime; + + /** + * 瞬时流量 + */ + @Excel(name = "瞬时流量") + private BigDecimal fluxFlow; + + /** + * 累计流量 + */ + @Excel(name = "累计流量") + private BigDecimal steamFlow; + + /** + * 瞬时热量 + */ + @Excel(name = "瞬时热量") + private BigDecimal heatInstantValue; + + /** + * 累计热量 + */ + @Excel(name = "累计热量") + private BigDecimal heatTotalValue; + + /** + * 温度 + */ + @Excel(name = "温度") + private BigDecimal temperature; + + /** + * 压力 + */ + @Excel(name = "压力") + private BigDecimal press; + + /** + * 密度 + */ + @Excel(name = "密度") + private BigDecimal density; + + /** + * 压力差值 + */ + @Excel(name = "压力差值") + private BigDecimal differencePress; + + /** + * 记录时间 + */ + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") + @Excel(name = "记录时间", width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss") + private Date recordTime; + + public String getMonitorName() { + return monitorName; + } + + public void setMonitorName(String monitorName) { + this.monitorName = monitorName; + } + + public void setObjId(Long objId) { + this.objId = objId; + } + + public Long getObjId() { + return objId; + } + + public void setMonitorCode(String monitorCode) { + this.monitorCode = monitorCode; + } + + public String getMonitorCode() { + return monitorCode; + } + + public void setCollectTime(Date collectTime) { + this.collectTime = collectTime; + } + + public Date getCollectTime() { + return collectTime; + } + + public void setFluxFlow(BigDecimal fluxFlow) { + this.fluxFlow = fluxFlow; + } + + public BigDecimal getFluxFlow() { + return fluxFlow; + } + + public void setSteamFlow(BigDecimal steamFlow) { + this.steamFlow = steamFlow; + } + + public BigDecimal getSteamFlow() { + return steamFlow; + } + + public void setHeatInstantValue(BigDecimal heatInstantValue) { + this.heatInstantValue = heatInstantValue; + } + + public BigDecimal getHeatInstantValue() { + return heatInstantValue; + } + + public void setHeatTotalValue(BigDecimal heatTotalValue) { + this.heatTotalValue = heatTotalValue; + } + + public BigDecimal getHeatTotalValue() { + return heatTotalValue; + } + + public void setTemperature(BigDecimal temperature) { + this.temperature = temperature; + } + + public BigDecimal getTemperature() { + return temperature; + } + + public void setPress(BigDecimal press) { + this.press = press; + } + + public BigDecimal getPress() { + return press; + } + + public void setDensity(BigDecimal density) { + this.density = density; + } + + public BigDecimal getDensity() { + return density; + } + + public void setDifferencePress(BigDecimal differencePress) { + this.differencePress = differencePress; + } + + public BigDecimal getDifferencePress() { + return differencePress; + } + + public void setRecordTime(Date recordTime) { + this.recordTime = recordTime; + } + + public Date getRecordTime() { + return recordTime; + } + + @Override + public String toString() { + return new ToStringBuilder(this, ToStringStyle.MULTI_LINE_STYLE) + .append("objId", getObjId()) + .append("monitorCode", getMonitorCode()) + .append("collectTime", getCollectTime()) + .append("fluxFlow", getFluxFlow()) + .append("steamFlow", getSteamFlow()) + .append("heatInstantValue", getHeatInstantValue()) + .append("heatTotalValue", getHeatTotalValue()) + .append("temperature", getTemperature()) + .append("press", getPress()) + .append("density", getDensity()) + .append("differencePress", getDifferencePress()) + .append("recordTime", getRecordTime()) + .toString(); + } +} diff --git a/os-ems/src/main/java/com/os/ems/record/mapper/EmsRecordSteamInstantMapper.java b/os-ems/src/main/java/com/os/ems/record/mapper/EmsRecordSteamInstantMapper.java new file mode 100644 index 0000000..f1f3048 --- /dev/null +++ b/os-ems/src/main/java/com/os/ems/record/mapper/EmsRecordSteamInstantMapper.java @@ -0,0 +1,61 @@ +package com.os.ems.record.mapper; + +import java.util.List; + +import com.os.ems.record.domain.EmsRecordSteamInstant; + +/** + * 蒸汽实时数据Mapper接口 + * + * @author Yinq + * @date 2024-05-22 + */ +public interface EmsRecordSteamInstantMapper { + /** + * 查询蒸汽实时数据 + * + * @param objId 蒸汽实时数据主键 + * @return 蒸汽实时数据 + */ + public EmsRecordSteamInstant selectEmsRecordSteamInstantByObjId(Long objId); + + /** + * 查询蒸汽实时数据列表 + * + * @param emsRecordSteamInstant 蒸汽实时数据 + * @return 蒸汽实时数据集合 + */ + public List selectEmsRecordSteamInstantList(EmsRecordSteamInstant emsRecordSteamInstant); + + /** + * 新增蒸汽实时数据 + * + * @param emsRecordSteamInstant 蒸汽实时数据 + * @return 结果 + */ + public int insertEmsRecordSteamInstant(EmsRecordSteamInstant emsRecordSteamInstant); + + /** + * 修改蒸汽实时数据 + * + * @param emsRecordSteamInstant 蒸汽实时数据 + * @return 结果 + */ + public int updateEmsRecordSteamInstant(EmsRecordSteamInstant emsRecordSteamInstant); + + /** + * 删除蒸汽实时数据 + * + * @param objId 蒸汽实时数据主键 + * @return 结果 + */ + public int deleteEmsRecordSteamInstantByObjId(Long objId); + + /** + * 批量删除蒸汽实时数据 + * + * @param objIds 需要删除的数据主键集合 + * @return 结果 + */ + public int deleteEmsRecordSteamInstantByObjIds(Long[] objIds); +} diff --git a/os-ems/src/main/java/com/os/ems/record/service/IEmsRecordSteamInstantService.java b/os-ems/src/main/java/com/os/ems/record/service/IEmsRecordSteamInstantService.java new file mode 100644 index 0000000..a59ba9b --- /dev/null +++ b/os-ems/src/main/java/com/os/ems/record/service/IEmsRecordSteamInstantService.java @@ -0,0 +1,61 @@ +package com.os.ems.record.service; + +import java.util.List; + +import com.os.ems.record.domain.EmsRecordSteamInstant; + +/** + * 蒸汽实时数据Service接口 + * + * @author Yinq + * @date 2024-05-22 + */ +public interface IEmsRecordSteamInstantService { + /** + * 查询蒸汽实时数据 + * + * @param objId 蒸汽实时数据主键 + * @return 蒸汽实时数据 + */ + public EmsRecordSteamInstant selectEmsRecordSteamInstantByObjId(Long objId); + + /** + * 查询蒸汽实时数据列表 + * + * @param emsRecordSteamInstant 蒸汽实时数据 + * @return 蒸汽实时数据集合 + */ + public List selectEmsRecordSteamInstantList(EmsRecordSteamInstant emsRecordSteamInstant); + + /** + * 新增蒸汽实时数据 + * + * @param emsRecordSteamInstant 蒸汽实时数据 + * @return 结果 + */ + public int insertEmsRecordSteamInstant(EmsRecordSteamInstant emsRecordSteamInstant); + + /** + * 修改蒸汽实时数据 + * + * @param emsRecordSteamInstant 蒸汽实时数据 + * @return 结果 + */ + public int updateEmsRecordSteamInstant(EmsRecordSteamInstant emsRecordSteamInstant); + + /** + * 批量删除蒸汽实时数据 + * + * @param objIds 需要删除的蒸汽实时数据主键集合 + * @return 结果 + */ + public int deleteEmsRecordSteamInstantByObjIds(Long[] objIds); + + /** + * 删除蒸汽实时数据信息 + * + * @param objId 蒸汽实时数据主键 + * @return 结果 + */ + public int deleteEmsRecordSteamInstantByObjId(Long objId); +} diff --git a/os-ems/src/main/java/com/os/ems/record/service/impl/EmsRecordSteamInstantServiceImpl.java b/os-ems/src/main/java/com/os/ems/record/service/impl/EmsRecordSteamInstantServiceImpl.java new file mode 100644 index 0000000..16362ea --- /dev/null +++ b/os-ems/src/main/java/com/os/ems/record/service/impl/EmsRecordSteamInstantServiceImpl.java @@ -0,0 +1,87 @@ +package com.os.ems.record.service.impl; + +import java.util.List; + +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import com.os.ems.record.mapper.EmsRecordSteamInstantMapper; +import com.os.ems.record.domain.EmsRecordSteamInstant; +import com.os.ems.record.service.IEmsRecordSteamInstantService; + +/** + * 蒸汽实时数据Service业务层处理 + * + * @author Yinq + * @date 2024-05-22 + */ +@Service +public class EmsRecordSteamInstantServiceImpl implements IEmsRecordSteamInstantService { + @Autowired + private EmsRecordSteamInstantMapper emsRecordSteamInstantMapper; + + /** + * 查询蒸汽实时数据 + * + * @param objId 蒸汽实时数据主键 + * @return 蒸汽实时数据 + */ + @Override + public EmsRecordSteamInstant selectEmsRecordSteamInstantByObjId(Long objId) { + return emsRecordSteamInstantMapper.selectEmsRecordSteamInstantByObjId(objId); + } + + /** + * 查询蒸汽实时数据列表 + * + * @param emsRecordSteamInstant 蒸汽实时数据 + * @return 蒸汽实时数据 + */ + @Override + public List selectEmsRecordSteamInstantList(EmsRecordSteamInstant emsRecordSteamInstant) { + return emsRecordSteamInstantMapper.selectEmsRecordSteamInstantList(emsRecordSteamInstant); + } + + /** + * 新增蒸汽实时数据 + * + * @param emsRecordSteamInstant 蒸汽实时数据 + * @return 结果 + */ + @Override + public int insertEmsRecordSteamInstant(EmsRecordSteamInstant emsRecordSteamInstant) { + return emsRecordSteamInstantMapper.insertEmsRecordSteamInstant(emsRecordSteamInstant); + } + + /** + * 修改蒸汽实时数据 + * + * @param emsRecordSteamInstant 蒸汽实时数据 + * @return 结果 + */ + @Override + public int updateEmsRecordSteamInstant(EmsRecordSteamInstant emsRecordSteamInstant) { + return emsRecordSteamInstantMapper.updateEmsRecordSteamInstant(emsRecordSteamInstant); + } + + /** + * 批量删除蒸汽实时数据 + * + * @param objIds 需要删除的蒸汽实时数据主键 + * @return 结果 + */ + @Override + public int deleteEmsRecordSteamInstantByObjIds(Long[] objIds) { + return emsRecordSteamInstantMapper.deleteEmsRecordSteamInstantByObjIds(objIds); + } + + /** + * 删除蒸汽实时数据信息 + * + * @param objId 蒸汽实时数据主键 + * @return 结果 + */ + @Override + public int deleteEmsRecordSteamInstantByObjId(Long objId) { + return emsRecordSteamInstantMapper.deleteEmsRecordSteamInstantByObjId(objId); + } +} diff --git a/os-ems/src/main/resources/mapper/ems/record/EmsRecordSteamInstantMapper.xml b/os-ems/src/main/resources/mapper/ems/record/EmsRecordSteamInstantMapper.xml new file mode 100644 index 0000000..4ee4d51 --- /dev/null +++ b/os-ems/src/main/resources/mapper/ems/record/EmsRecordSteamInstantMapper.xml @@ -0,0 +1,129 @@ + + + + + + + + + + + + + + + + + + + + + + select ersi.obj_id, + ersi.monitor_code, + ebmi.monitor_name, + ersi.collect_time, + ersi.flux_flow, + ersi.steam_flow, + ersi.heat_instant_value, + ersi.heat_total_value, + ersi.temperature, + ersi.press, + ersi.density, + ersi.difference_press, + ersi.record_time + from ems_record_steam_instant ersi + left join ems_base_monitor_info ebmi on ersi.monitor_code = ebmi.monitor_code + + + + + + + + insert into ems_record_steam_instant + + monitor_code, + collect_time, + flux_flow, + steam_flow, + heat_instant_value, + heat_total_value, + temperature, + press, + density, + difference_press, + record_time, + + + #{monitorCode}, + #{collectTime}, + #{fluxFlow}, + #{steamFlow}, + #{heatInstantValue}, + #{heatTotalValue}, + #{temperature}, + #{press}, + #{density}, + #{differencePress}, + #{recordTime}, + + + + + update ems_record_steam_instant + + monitor_code = #{monitorCode}, + collect_time = #{collectTime}, + flux_flow = #{fluxFlow}, + steam_flow = #{steamFlow}, + heat_instant_value = #{heatInstantValue}, + heat_total_value = #{heatTotalValue}, + temperature = #{temperature}, + press = #{press}, + density = #{density}, + difference_press = #{differencePress}, + record_time = #{recordTime}, + + where obj_id = #{objId} + + + + delete + from ems_record_steam_instant + where obj_id = #{objId} + + + + delete from ems_record_steam_instant where obj_id in + + #{objId} + + + \ No newline at end of file