diff --git a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/TVibrationsensorDataController.java b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/TVibrationsensorDataController.java new file mode 100644 index 0000000..cd1ba54 --- /dev/null +++ b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/TVibrationsensorDataController.java @@ -0,0 +1,118 @@ +package com.ruoyi.web.controller.system; + +import java.util.List; + +import org.apache.shiro.authz.annotation.RequiresPermissions; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Controller; +import org.springframework.ui.ModelMap; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.PathVariable; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.ResponseBody; +import com.ruoyi.common.annotation.Log; +import com.ruoyi.common.enums.BusinessType; +import com.ruoyi.system.domain.TVibrationsensorData; +import com.ruoyi.system.service.ITVibrationsensorDataService; +import com.ruoyi.common.core.controller.BaseController; +import com.ruoyi.common.core.domain.AjaxResult; +import com.ruoyi.common.utils.poi.ExcelUtil; +import com.ruoyi.common.core.page.TableDataInfo; + +/** + * 振动传感器数据Controller + * + * @author Yinq + * @date 2024-04-28 + */ +@Controller +@RequestMapping("/system/TVibrationsensorData") +public class TVibrationsensorDataController extends BaseController { + private String prefix = "system/TVibrationsensorData"; + + @Autowired + private ITVibrationsensorDataService tVibrationsensorDataService; + + @RequiresPermissions("system:TVibrationsensorData:view") + @GetMapping() + public String TVibrationsensorData() { + return prefix + "/TVibrationsensorData"; + } + + /** + * 查询振动传感器数据列表 + */ + @RequiresPermissions("system:TVibrationsensorData:list") + @PostMapping("/list") + @ResponseBody + public TableDataInfo list(TVibrationsensorData tVibrationsensorData) { + startPage(); + List list = tVibrationsensorDataService.selectTVibrationsensorDataList(tVibrationsensorData); + return getDataTable(list); + } + + /** + * 导出振动传感器数据列表 + */ + @RequiresPermissions("system:TVibrationsensorData:export") + @Log(title = "振动传感器数据", businessType = BusinessType.EXPORT) + @PostMapping("/export") + @ResponseBody + public AjaxResult export(TVibrationsensorData tVibrationsensorData) { + List list = tVibrationsensorDataService.selectTVibrationsensorDataList(tVibrationsensorData); + ExcelUtil util = new ExcelUtil(TVibrationsensorData.class); + return util.exportExcel(list, "TVibrationsensorData"); + } + + /** + * 新增振动传感器数据 + */ + @GetMapping("/add") + public String add() { + return prefix + "/add"; + } + + /** + * 新增保存振动传感器数据 + */ + @RequiresPermissions("system:TVibrationsensorData:add") + @Log(title = "振动传感器数据", businessType = BusinessType.INSERT) + @PostMapping("/add") + @ResponseBody + public AjaxResult addSave(TVibrationsensorData tVibrationsensorData) { + return toAjax(tVibrationsensorDataService.insertTVibrationsensorData(tVibrationsensorData)); + } + + /** + * 修改振动传感器数据 + */ + @GetMapping("/edit/{objId}") + public String edit(@PathVariable("objId") Long objId, ModelMap mmap) { + TVibrationsensorData tVibrationsensorData = tVibrationsensorDataService.selectTVibrationsensorDataById(objId); + mmap.put("tVibrationsensorData", tVibrationsensorData); + return prefix + "/edit"; + } + + /** + * 修改保存振动传感器数据 + */ + @RequiresPermissions("system:TVibrationsensorData:edit") + @Log(title = "振动传感器数据", businessType = BusinessType.UPDATE) + @PostMapping("/edit") + @ResponseBody + public AjaxResult editSave(TVibrationsensorData tVibrationsensorData) { + return toAjax(tVibrationsensorDataService.updateTVibrationsensorData(tVibrationsensorData)); + } + + /** + * 删除振动传感器数据 + */ + @RequiresPermissions("system:TVibrationsensorData:remove") + @Log(title = "振动传感器数据", businessType = BusinessType.DELETE) + @PostMapping("/remove") + @ResponseBody + public AjaxResult remove(String ids) { + return toAjax(tVibrationsensorDataService.deleteTVibrationsensorDataByIds(ids)); + } +} diff --git a/ruoyi-admin/src/main/resources/templates/system/TVibrationsensorData/TVibrationsensorData.html b/ruoyi-admin/src/main/resources/templates/system/TVibrationsensorData/TVibrationsensorData.html new file mode 100644 index 0000000..f202d4f --- /dev/null +++ b/ruoyi-admin/src/main/resources/templates/system/TVibrationsensorData/TVibrationsensorData.html @@ -0,0 +1,127 @@ + + + + + + +
+
+
+
+
+ +
+
+
+ +
+ + + + + + + + + + + 导出 + +
+
+
+
+
+
+ + + + \ No newline at end of file diff --git a/ruoyi-admin/src/main/resources/templates/system/TVibrationsensorData/add.html b/ruoyi-admin/src/main/resources/templates/system/TVibrationsensorData/add.html new file mode 100644 index 0000000..3a64cd3 --- /dev/null +++ b/ruoyi-admin/src/main/resources/templates/system/TVibrationsensorData/add.html @@ -0,0 +1,87 @@ + + + + + + + +
+
+
+ +
+
+ + +
+
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+
+ + +
+
+
+
+
+ + + + + \ No newline at end of file diff --git a/ruoyi-admin/src/main/resources/templates/system/TVibrationsensorData/edit.html b/ruoyi-admin/src/main/resources/templates/system/TVibrationsensorData/edit.html new file mode 100644 index 0000000..743204b --- /dev/null +++ b/ruoyi-admin/src/main/resources/templates/system/TVibrationsensorData/edit.html @@ -0,0 +1,88 @@ + + + + + + + +
+
+ +
+ +
+
+ + +
+
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+
+ + +
+
+
+
+
+ + + + + \ No newline at end of file diff --git a/ruoyi-system/src/main/java/com/ruoyi/system/domain/TVibrationsensorData.java b/ruoyi-system/src/main/java/com/ruoyi/system/domain/TVibrationsensorData.java new file mode 100644 index 0000000..b47cf46 --- /dev/null +++ b/ruoyi-system/src/main/java/com/ruoyi/system/domain/TVibrationsensorData.java @@ -0,0 +1,144 @@ +package com.ruoyi.system.domain; + +import java.util.Date; + +import org.apache.commons.lang3.builder.ToStringBuilder; +import org.apache.commons.lang3.builder.ToStringStyle; +import com.ruoyi.common.annotation.Excel; +import com.ruoyi.common.core.domain.BaseEntity; + +/** + * 振动传感器数据对象 T_VibrationSensor_Data + * + * @author Yinq + * @date 2024-04-28 + */ +public class TVibrationsensorData extends BaseEntity { + private static final long serialVersionUID = 1L; + + /** + * 主键标识 + */ + private Long objId; + + /** + * 采集时间 + */ + @Excel(name = "采集时间", width = 30, dateFormat = "yyyy-MM-dd") + private Date collectTime; + + /** + * 振动传感器ID + */ + @Excel(name = "振动传感器ID") + private Long sensorId; + + /** + * 速度(mm/s) + */ + @Excel(name = "速度(mm/s)") + private Long speed; + + /** + * 位移(um) + */ + @Excel(name = "位移(um)") + private Long displacement; + + /** + * 加速度(g) + */ + @Excel(name = "加速度(g)") + private Long acceleration; + + /** + * 温度(℃) + */ + @Excel(name = "温度(℃)") + private Long temperature; + + /** + * 记录时间 + */ + @Excel(name = "记录时间", width = 30, dateFormat = "yyyy-MM-dd") + private Date recodeTime; + + public void setObjId(Long objId) { + this.objId = objId; + } + + public Long getObjId() { + return objId; + } + + public void setCollectTime(Date collectTime) { + this.collectTime = collectTime; + } + + public Date getCollectTime() { + return collectTime; + } + + public void setSensorId(Long sensorId) { + this.sensorId = sensorId; + } + + public Long getSensorId() { + return sensorId; + } + + public void setSpeed(Long speed) { + this.speed = speed; + } + + public Long getSpeed() { + return speed; + } + + public void setDisplacement(Long displacement) { + this.displacement = displacement; + } + + public Long getDisplacement() { + return displacement; + } + + public void setAcceleration(Long acceleration) { + this.acceleration = acceleration; + } + + public Long getAcceleration() { + return acceleration; + } + + public void setTemperature(Long temperature) { + this.temperature = temperature; + } + + public Long getTemperature() { + return temperature; + } + + public void setRecodeTime(Date recodeTime) { + this.recodeTime = recodeTime; + } + + public Date getRecodeTime() { + return recodeTime; + } + + @Override + public String toString() { + return new ToStringBuilder(this, ToStringStyle.MULTI_LINE_STYLE) + .append("objId", getObjId()) + .append("collectTime", getCollectTime()) + .append("sensorId", getSensorId()) + .append("speed", getSpeed()) + .append("displacement", getDisplacement()) + .append("acceleration", getAcceleration()) + .append("temperature", getTemperature()) + .append("recodeTime", getRecodeTime()) + .append("remark", getRemark()) + .toString(); + } +} diff --git a/ruoyi-system/src/main/java/com/ruoyi/system/mapper/TVibrationsensorDataMapper.java b/ruoyi-system/src/main/java/com/ruoyi/system/mapper/TVibrationsensorDataMapper.java new file mode 100644 index 0000000..6b47165 --- /dev/null +++ b/ruoyi-system/src/main/java/com/ruoyi/system/mapper/TVibrationsensorDataMapper.java @@ -0,0 +1,61 @@ +package com.ruoyi.system.mapper; + +import java.util.List; + +import com.ruoyi.system.domain.TVibrationsensorData; + +/** + * 振动传感器数据Mapper接口 + * + * @author Yinq + * @date 2024-04-28 + */ +public interface TVibrationsensorDataMapper { + /** + * 查询振动传感器数据 + * + * @param objId 振动传感器数据ID + * @return 振动传感器数据 + */ + public TVibrationsensorData selectTVibrationsensorDataById(Long objId); + + /** + * 查询振动传感器数据列表 + * + * @param tVibrationsensorData 振动传感器数据 + * @return 振动传感器数据集合 + */ + public List selectTVibrationsensorDataList(TVibrationsensorData tVibrationsensorData); + + /** + * 新增振动传感器数据 + * + * @param tVibrationsensorData 振动传感器数据 + * @return 结果 + */ + public int insertTVibrationsensorData(TVibrationsensorData tVibrationsensorData); + + /** + * 修改振动传感器数据 + * + * @param tVibrationsensorData 振动传感器数据 + * @return 结果 + */ + public int updateTVibrationsensorData(TVibrationsensorData tVibrationsensorData); + + /** + * 删除振动传感器数据 + * + * @param objId 振动传感器数据ID + * @return 结果 + */ + public int deleteTVibrationsensorDataById(Long objId); + + /** + * 批量删除振动传感器数据 + * + * @param objIds 需要删除的数据ID + * @return 结果 + */ + public int deleteTVibrationsensorDataByIds(String[] objIds); +} diff --git a/ruoyi-system/src/main/java/com/ruoyi/system/service/ITVibrationsensorDataService.java b/ruoyi-system/src/main/java/com/ruoyi/system/service/ITVibrationsensorDataService.java new file mode 100644 index 0000000..80fb262 --- /dev/null +++ b/ruoyi-system/src/main/java/com/ruoyi/system/service/ITVibrationsensorDataService.java @@ -0,0 +1,61 @@ +package com.ruoyi.system.service; + +import java.util.List; +import com.ruoyi.system.domain.TVibrationsensorData; + +/** + * 振动传感器数据Service接口 + * + * @author Yinq + * @date 2024-04-28 + */ +public interface ITVibrationsensorDataService +{ + /** + * 查询振动传感器数据 + * + * @param objId 振动传感器数据ID + * @return 振动传感器数据 + */ + public TVibrationsensorData selectTVibrationsensorDataById(Long objId); + + /** + * 查询振动传感器数据列表 + * + * @param tVibrationsensorData 振动传感器数据 + * @return 振动传感器数据集合 + */ + public List selectTVibrationsensorDataList(TVibrationsensorData tVibrationsensorData); + + /** + * 新增振动传感器数据 + * + * @param tVibrationsensorData 振动传感器数据 + * @return 结果 + */ + public int insertTVibrationsensorData(TVibrationsensorData tVibrationsensorData); + + /** + * 修改振动传感器数据 + * + * @param tVibrationsensorData 振动传感器数据 + * @return 结果 + */ + public int updateTVibrationsensorData(TVibrationsensorData tVibrationsensorData); + + /** + * 批量删除振动传感器数据 + * + * @param ids 需要删除的数据ID + * @return 结果 + */ + public int deleteTVibrationsensorDataByIds(String ids); + + /** + * 删除振动传感器数据信息 + * + * @param objId 振动传感器数据ID + * @return 结果 + */ + public int deleteTVibrationsensorDataById(Long objId); +} diff --git a/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/TVibrationsensorDataServiceImpl.java b/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/TVibrationsensorDataServiceImpl.java new file mode 100644 index 0000000..37f31d4 --- /dev/null +++ b/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/TVibrationsensorDataServiceImpl.java @@ -0,0 +1,88 @@ +package com.ruoyi.system.service.impl; + +import java.util.List; + +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import com.ruoyi.system.mapper.TVibrationsensorDataMapper; +import com.ruoyi.system.domain.TVibrationsensorData; +import com.ruoyi.system.service.ITVibrationsensorDataService; +import com.ruoyi.common.core.text.Convert; + +/** + * 振动传感器数据Service业务层处理 + * + * @author Yinq + * @date 2024-04-28 + */ +@Service +public class TVibrationsensorDataServiceImpl implements ITVibrationsensorDataService { + @Autowired + private TVibrationsensorDataMapper tVibrationsensorDataMapper; + + /** + * 查询振动传感器数据 + * + * @param objId 振动传感器数据ID + * @return 振动传感器数据 + */ + @Override + public TVibrationsensorData selectTVibrationsensorDataById(Long objId) { + return tVibrationsensorDataMapper.selectTVibrationsensorDataById(objId); + } + + /** + * 查询振动传感器数据列表 + * + * @param tVibrationsensorData 振动传感器数据 + * @return 振动传感器数据 + */ + @Override + public List selectTVibrationsensorDataList(TVibrationsensorData tVibrationsensorData) { + return tVibrationsensorDataMapper.selectTVibrationsensorDataList(tVibrationsensorData); + } + + /** + * 新增振动传感器数据 + * + * @param tVibrationsensorData 振动传感器数据 + * @return 结果 + */ + @Override + public int insertTVibrationsensorData(TVibrationsensorData tVibrationsensorData) { + return tVibrationsensorDataMapper.insertTVibrationsensorData(tVibrationsensorData); + } + + /** + * 修改振动传感器数据 + * + * @param tVibrationsensorData 振动传感器数据 + * @return 结果 + */ + @Override + public int updateTVibrationsensorData(TVibrationsensorData tVibrationsensorData) { + return tVibrationsensorDataMapper.updateTVibrationsensorData(tVibrationsensorData); + } + + /** + * 删除振动传感器数据对象 + * + * @param ids 需要删除的数据ID + * @return 结果 + */ + @Override + public int deleteTVibrationsensorDataByIds(String ids) { + return tVibrationsensorDataMapper.deleteTVibrationsensorDataByIds(Convert.toStrArray(ids)); + } + + /** + * 删除振动传感器数据信息 + * + * @param objId 振动传感器数据ID + * @return 结果 + */ + @Override + public int deleteTVibrationsensorDataById(Long objId) { + return tVibrationsensorDataMapper.deleteTVibrationsensorDataById(objId); + } +} diff --git a/ruoyi-system/src/main/resources/mapper/system/TVibrationsensorDataMapper.xml b/ruoyi-system/src/main/resources/mapper/system/TVibrationsensorDataMapper.xml new file mode 100644 index 0000000..2a2aca2 --- /dev/null +++ b/ruoyi-system/src/main/resources/mapper/system/TVibrationsensorDataMapper.xml @@ -0,0 +1,108 @@ + + + + + + + + + + + + + + + + + + select objId, + collectTime, + sensor_id, + speed, + displacement, + acceleration, + temperature, + recodeTime, + remark + from T_VibrationSensor_Data + + + + + + + + insert into T_VibrationSensor_Data + + objId, + collectTime, + sensor_id, + speed, + displacement, + acceleration, + temperature, + recodeTime, + remark, + + + #{objId}, + #{collectTime}, + #{sensorId}, + #{speed}, + #{displacement}, + #{acceleration}, + #{temperature}, + #{recodeTime}, + #{remark}, + + + + + update T_VibrationSensor_Data + + collectTime = #{collectTime}, + sensor_id = #{sensorId}, + speed = #{speed}, + displacement = #{displacement}, + acceleration = #{acceleration}, + temperature = #{temperature}, + recodeTime = #{recodeTime}, + remark = #{remark}, + + where objId = #{objId} + + + + delete + from T_VibrationSensor_Data + where objId = #{objId} + + + + delete from T_VibrationSensor_Data where objId in + + #{objId} + + + +