From c72ea3c9e7cb4227ae867d03a39578b7bc331e1e Mon Sep 17 00:00:00 2001 From: yinq Date: Tue, 11 Jun 2024 10:29:16 +0800 Subject: [PATCH] =?UTF-8?q?change=20-=20=E4=BA=BA=E5=91=98=E4=BF=A1?= =?UTF-8?q?=E6=81=AF=E5=8A=A0=E5=B2=97=E4=BD=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../EmsReportPointSteamController.java | 100 ++++++++++++ .../report/domain/EmsReportPointSteam.java | 152 ++++++++++++++++++ .../mapper/EmsReportPointSteamMapper.java | 61 +++++++ .../service/IEmsReportPointSteamService.java | 61 +++++++ .../impl/EmsReportPointSteamServiceImpl.java | 96 +++++++++++ .../ems/report/EmsReportPointSteamMapper.xml | 124 ++++++++++++++ 6 files changed, 594 insertions(+) create mode 100644 os-ems/src/main/java/com/os/ems/report/controller/EmsReportPointSteamController.java create mode 100644 os-ems/src/main/java/com/os/ems/report/domain/EmsReportPointSteam.java create mode 100644 os-ems/src/main/java/com/os/ems/report/mapper/EmsReportPointSteamMapper.java create mode 100644 os-ems/src/main/java/com/os/ems/report/service/IEmsReportPointSteamService.java create mode 100644 os-ems/src/main/java/com/os/ems/report/service/impl/EmsReportPointSteamServiceImpl.java create mode 100644 os-ems/src/main/resources/mapper/ems/report/EmsReportPointSteamMapper.xml diff --git a/os-ems/src/main/java/com/os/ems/report/controller/EmsReportPointSteamController.java b/os-ems/src/main/java/com/os/ems/report/controller/EmsReportPointSteamController.java new file mode 100644 index 0000000..95ac9f3 --- /dev/null +++ b/os-ems/src/main/java/com/os/ems/report/controller/EmsReportPointSteamController.java @@ -0,0 +1,100 @@ +package com.os.ems.report.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.report.domain.EmsReportPointSteam; +import com.os.ems.report.service.IEmsReportPointSteamService; +import com.os.common.utils.poi.ExcelUtil; +import com.os.common.core.page.TableDataInfo; + +/** + * 蒸汽整点数据Controller + * + * @author Yinq + * @date 2024-06-11 + */ +@RestController +@RequestMapping("/ems/report/reportPointSteam") +public class EmsReportPointSteamController extends BaseController { + @Autowired + private IEmsReportPointSteamService emsReportPointSteamService; + + /** + * 查询蒸汽整点数据列表 + */ + @PreAuthorize("@ss.hasPermi('ems/report:reportPointSteam:list')") + @GetMapping("/list") + public TableDataInfo list(EmsReportPointSteam emsReportPointSteam) { + startPage(); + List list = emsReportPointSteamService.selectEmsReportPointSteamList(emsReportPointSteam); + return getDataTable(list); + } + + /** + * 导出蒸汽整点数据列表 + */ + @PreAuthorize("@ss.hasPermi('ems/report:reportPointSteam:export')") + @Log(title = "蒸汽整点数据", businessType = BusinessType.EXPORT) + @PostMapping("/export") + public void export(HttpServletResponse response, EmsReportPointSteam emsReportPointSteam) { + List list = emsReportPointSteamService.selectEmsReportPointSteamList(emsReportPointSteam); + ExcelUtil util = new ExcelUtil(EmsReportPointSteam.class); + util.exportExcel(response, list, "蒸汽整点数据数据"); + } + + /** + * 获取蒸汽整点数据详细信息 + */ + @PreAuthorize("@ss.hasPermi('ems/report:reportPointSteam:query')") + @GetMapping(value = "/{objId}") + public AjaxResult getInfo(@PathVariable("objId") Long objId) { + return success(emsReportPointSteamService.selectEmsReportPointSteamByObjId(objId)); + } + + /** + * 新增蒸汽整点数据 + */ + @PreAuthorize("@ss.hasPermi('ems/report:reportPointSteam:add')") + @Log(title = "蒸汽整点数据", businessType = BusinessType.INSERT) + @PostMapping + public AjaxResult add(@RequestBody EmsReportPointSteam emsReportPointSteam) { + emsReportPointSteam.setCreateBy(getUsername()); + return toAjax(emsReportPointSteamService.insertEmsReportPointSteam(emsReportPointSteam)); + } + + /** + * 修改蒸汽整点数据 + */ + @PreAuthorize("@ss.hasPermi('ems/report:reportPointSteam:edit')") + @Log(title = "蒸汽整点数据", businessType = BusinessType.UPDATE) + @PutMapping + public AjaxResult edit(@RequestBody EmsReportPointSteam emsReportPointSteam) { + emsReportPointSteam.setUpdateBy(getUsername()); + return toAjax(emsReportPointSteamService.updateEmsReportPointSteam(emsReportPointSteam)); + } + + /** + * 删除蒸汽整点数据 + */ + @PreAuthorize("@ss.hasPermi('ems/report:reportPointSteam:remove')") + @Log(title = "蒸汽整点数据", businessType = BusinessType.DELETE) + @DeleteMapping("/{objIds}") + public AjaxResult remove(@PathVariable Long[] objIds) { + return toAjax(emsReportPointSteamService.deleteEmsReportPointSteamByObjIds(objIds)); + } +} diff --git a/os-ems/src/main/java/com/os/ems/report/domain/EmsReportPointSteam.java b/os-ems/src/main/java/com/os/ems/report/domain/EmsReportPointSteam.java new file mode 100644 index 0000000..b5809ab --- /dev/null +++ b/os-ems/src/main/java/com/os/ems/report/domain/EmsReportPointSteam.java @@ -0,0 +1,152 @@ +package com.os.ems.report.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_report_point_steam + * + * @author Yinq + * @date 2024-06-11 + */ +public class EmsReportPointSteam extends BaseEntity { + private static final long serialVersionUID = 1L; + + /** + * 主键标识 + */ + private Long objId; + + /** + * 计量设备编号 + */ + @Excel(name = "计量设备编号") + private String monitorCode; + + /** + * 仪表值 + */ + @Excel(name = "仪表值") + private BigDecimal instrumentValue; + + /** + * 耗量 + */ + @Excel(name = "耗量") + private BigDecimal expend; + + /** + * 记录时间 + */ + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") + @Excel(name = "记录时间", width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss") + private Date recordTime; + + /** + * 开始时间 + */ + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") + @Excel(name = "开始时间", width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss") + private Date beginTime; + + /** + * 结束时间 + */ + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") + @Excel(name = "结束时间", width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss") + private Date endTime; + + /** + * 修改标识(0是 1否) + */ + @Excel(name = "修改标识", readConverterExp = "0=是,1=否") + private String updateFlag; + + 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 setInstrumentValue(BigDecimal instrumentValue) { + this.instrumentValue = instrumentValue; + } + + public BigDecimal getInstrumentValue() { + return instrumentValue; + } + + public void setExpend(BigDecimal expend) { + this.expend = expend; + } + + public BigDecimal getExpend() { + return expend; + } + + public void setRecordTime(Date recordTime) { + this.recordTime = recordTime; + } + + public Date getRecordTime() { + return recordTime; + } + + public void setBeginTime(Date beginTime) { + this.beginTime = beginTime; + } + + public Date getBeginTime() { + return beginTime; + } + + public void setEndTime(Date endTime) { + this.endTime = endTime; + } + + public Date getEndTime() { + return endTime; + } + + public void setUpdateFlag(String updateFlag) { + this.updateFlag = updateFlag; + } + + public String getUpdateFlag() { + return updateFlag; + } + + @Override + public String toString() { + return new ToStringBuilder(this, ToStringStyle.MULTI_LINE_STYLE) + .append("objId", getObjId()) + .append("monitorCode", getMonitorCode()) + .append("instrumentValue", getInstrumentValue()) + .append("expend", getExpend()) + .append("recordTime", getRecordTime()) + .append("beginTime", getBeginTime()) + .append("endTime", getEndTime()) + .append("updateFlag", getUpdateFlag()) + .append("createBy", getCreateBy()) + .append("createTime", getCreateTime()) + .append("updateBy", getUpdateBy()) + .append("updateTime", getUpdateTime()) + .toString(); + } +} diff --git a/os-ems/src/main/java/com/os/ems/report/mapper/EmsReportPointSteamMapper.java b/os-ems/src/main/java/com/os/ems/report/mapper/EmsReportPointSteamMapper.java new file mode 100644 index 0000000..0ff5410 --- /dev/null +++ b/os-ems/src/main/java/com/os/ems/report/mapper/EmsReportPointSteamMapper.java @@ -0,0 +1,61 @@ +package com.os.ems.report.mapper; + +import java.util.List; + +import com.os.ems.report.domain.EmsReportPointSteam; + +/** + * 蒸汽整点数据Mapper接口 + * + * @author Yinq + * @date 2024-06-11 + */ +public interface EmsReportPointSteamMapper { + /** + * 查询蒸汽整点数据 + * + * @param objId 蒸汽整点数据主键 + * @return 蒸汽整点数据 + */ + public EmsReportPointSteam selectEmsReportPointSteamByObjId(Long objId); + + /** + * 查询蒸汽整点数据列表 + * + * @param emsReportPointSteam 蒸汽整点数据 + * @return 蒸汽整点数据集合 + */ + public List selectEmsReportPointSteamList(EmsReportPointSteam emsReportPointSteam); + + /** + * 新增蒸汽整点数据 + * + * @param emsReportPointSteam 蒸汽整点数据 + * @return 结果 + */ + public int insertEmsReportPointSteam(EmsReportPointSteam emsReportPointSteam); + + /** + * 修改蒸汽整点数据 + * + * @param emsReportPointSteam 蒸汽整点数据 + * @return 结果 + */ + public int updateEmsReportPointSteam(EmsReportPointSteam emsReportPointSteam); + + /** + * 删除蒸汽整点数据 + * + * @param objId 蒸汽整点数据主键 + * @return 结果 + */ + public int deleteEmsReportPointSteamByObjId(Long objId); + + /** + * 批量删除蒸汽整点数据 + * + * @param objIds 需要删除的数据主键集合 + * @return 结果 + */ + public int deleteEmsReportPointSteamByObjIds(Long[] objIds); +} diff --git a/os-ems/src/main/java/com/os/ems/report/service/IEmsReportPointSteamService.java b/os-ems/src/main/java/com/os/ems/report/service/IEmsReportPointSteamService.java new file mode 100644 index 0000000..5ef70bb --- /dev/null +++ b/os-ems/src/main/java/com/os/ems/report/service/IEmsReportPointSteamService.java @@ -0,0 +1,61 @@ +package com.os.ems.report.service; + +import java.util.List; + +import com.os.ems.report.domain.EmsReportPointSteam; + +/** + * 蒸汽整点数据Service接口 + * + * @author Yinq + * @date 2024-06-11 + */ +public interface IEmsReportPointSteamService { + /** + * 查询蒸汽整点数据 + * + * @param objId 蒸汽整点数据主键 + * @return 蒸汽整点数据 + */ + public EmsReportPointSteam selectEmsReportPointSteamByObjId(Long objId); + + /** + * 查询蒸汽整点数据列表 + * + * @param emsReportPointSteam 蒸汽整点数据 + * @return 蒸汽整点数据集合 + */ + public List selectEmsReportPointSteamList(EmsReportPointSteam emsReportPointSteam); + + /** + * 新增蒸汽整点数据 + * + * @param emsReportPointSteam 蒸汽整点数据 + * @return 结果 + */ + public int insertEmsReportPointSteam(EmsReportPointSteam emsReportPointSteam); + + /** + * 修改蒸汽整点数据 + * + * @param emsReportPointSteam 蒸汽整点数据 + * @return 结果 + */ + public int updateEmsReportPointSteam(EmsReportPointSteam emsReportPointSteam); + + /** + * 批量删除蒸汽整点数据 + * + * @param objIds 需要删除的蒸汽整点数据主键集合 + * @return 结果 + */ + public int deleteEmsReportPointSteamByObjIds(Long[] objIds); + + /** + * 删除蒸汽整点数据信息 + * + * @param objId 蒸汽整点数据主键 + * @return 结果 + */ + public int deleteEmsReportPointSteamByObjId(Long objId); +} diff --git a/os-ems/src/main/java/com/os/ems/report/service/impl/EmsReportPointSteamServiceImpl.java b/os-ems/src/main/java/com/os/ems/report/service/impl/EmsReportPointSteamServiceImpl.java new file mode 100644 index 0000000..3b22cdb --- /dev/null +++ b/os-ems/src/main/java/com/os/ems/report/service/impl/EmsReportPointSteamServiceImpl.java @@ -0,0 +1,96 @@ +package com.os.ems.report.service.impl; + +import java.util.List; +import com.os.common.utils.DateUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import com.os.ems.report.mapper.EmsReportPointSteamMapper; +import com.os.ems.report.domain.EmsReportPointSteam; +import com.os.ems.report.service.IEmsReportPointSteamService; + +/** + * 蒸汽整点数据Service业务层处理 + * + * @author Yinq + * @date 2024-06-11 + */ +@Service +public class EmsReportPointSteamServiceImpl implements IEmsReportPointSteamService +{ + @Autowired + private EmsReportPointSteamMapper emsReportPointSteamMapper; + + /** + * 查询蒸汽整点数据 + * + * @param objId 蒸汽整点数据主键 + * @return 蒸汽整点数据 + */ + @Override + public EmsReportPointSteam selectEmsReportPointSteamByObjId(Long objId) + { + return emsReportPointSteamMapper.selectEmsReportPointSteamByObjId(objId); + } + + /** + * 查询蒸汽整点数据列表 + * + * @param emsReportPointSteam 蒸汽整点数据 + * @return 蒸汽整点数据 + */ + @Override + public List selectEmsReportPointSteamList(EmsReportPointSteam emsReportPointSteam) + { + return emsReportPointSteamMapper.selectEmsReportPointSteamList(emsReportPointSteam); + } + + /** + * 新增蒸汽整点数据 + * + * @param emsReportPointSteam 蒸汽整点数据 + * @return 结果 + */ + @Override + public int insertEmsReportPointSteam(EmsReportPointSteam emsReportPointSteam) + { + emsReportPointSteam.setCreateTime(DateUtils.getNowDate()); + return emsReportPointSteamMapper.insertEmsReportPointSteam(emsReportPointSteam); + } + + /** + * 修改蒸汽整点数据 + * + * @param emsReportPointSteam 蒸汽整点数据 + * @return 结果 + */ + @Override + public int updateEmsReportPointSteam(EmsReportPointSteam emsReportPointSteam) + { + emsReportPointSteam.setUpdateTime(DateUtils.getNowDate()); + return emsReportPointSteamMapper.updateEmsReportPointSteam(emsReportPointSteam); + } + + /** + * 批量删除蒸汽整点数据 + * + * @param objIds 需要删除的蒸汽整点数据主键 + * @return 结果 + */ + @Override + public int deleteEmsReportPointSteamByObjIds(Long[] objIds) + { + return emsReportPointSteamMapper.deleteEmsReportPointSteamByObjIds(objIds); + } + + /** + * 删除蒸汽整点数据信息 + * + * @param objId 蒸汽整点数据主键 + * @return 结果 + */ + @Override + public int deleteEmsReportPointSteamByObjId(Long objId) + { + return emsReportPointSteamMapper.deleteEmsReportPointSteamByObjId(objId); + } +} diff --git a/os-ems/src/main/resources/mapper/ems/report/EmsReportPointSteamMapper.xml b/os-ems/src/main/resources/mapper/ems/report/EmsReportPointSteamMapper.xml new file mode 100644 index 0000000..ddfed24 --- /dev/null +++ b/os-ems/src/main/resources/mapper/ems/report/EmsReportPointSteamMapper.xml @@ -0,0 +1,124 @@ + + + + + + + + + + + + + + + + + + + + + select obj_id, + monitor_code, + instrument_value, + expend, + record_time, + begin_time, + end_time, + update_flag, + create_by, + create_time, + update_by, + update_time + from ems_report_point_steam + + + + + + + + insert into ems_report_point_steam + + monitor_code, + instrument_value, + expend, + record_time, + begin_time, + end_time, + update_flag, + create_by, + create_time, + update_by, + update_time, + + + #{monitorCode}, + #{instrumentValue}, + #{expend}, + #{recordTime}, + #{beginTime}, + #{endTime}, + #{updateFlag}, + #{createBy}, + #{createTime}, + #{updateBy}, + #{updateTime}, + + + + + update ems_report_point_steam + + monitor_code = #{monitorCode}, + instrument_value = #{instrumentValue}, + expend = #{expend}, + record_time = #{recordTime}, + begin_time = #{beginTime}, + end_time = #{endTime}, + update_flag = #{updateFlag}, + create_by = #{createBy}, + create_time = #{createTime}, + update_by = #{updateBy}, + update_time = #{updateTime}, + + where obj_id = #{objId} + + + + delete + from ems_report_point_steam + where obj_id = #{objId} + + + + delete from ems_report_point_steam where obj_id in + + #{objId} + + + \ No newline at end of file