change - 振动传感器数据
parent
ab1894cbcf
commit
04e75438c4
@ -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<TVibrationsensorData> 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<TVibrationsensorData> list = tVibrationsensorDataService.selectTVibrationsensorDataList(tVibrationsensorData);
|
||||
ExcelUtil<TVibrationsensorData> util = new ExcelUtil<TVibrationsensorData>(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));
|
||||
}
|
||||
}
|
@ -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();
|
||||
}
|
||||
}
|
@ -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<TVibrationsensorData> 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);
|
||||
}
|
@ -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<TVibrationsensorData> 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);
|
||||
}
|
@ -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<TVibrationsensorData> 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);
|
||||
}
|
||||
}
|
@ -0,0 +1,108 @@
|
||||
<?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.system.mapper.TVibrationsensorDataMapper">
|
||||
|
||||
<resultMap type="TVibrationsensorData" id="TVibrationsensorDataResult">
|
||||
<result property="objId" column="objId"/>
|
||||
<result property="collectTime" column="collectTime"/>
|
||||
<result property="sensorId" column="sensor_id"/>
|
||||
<result property="speed" column="speed"/>
|
||||
<result property="displacement" column="displacement"/>
|
||||
<result property="acceleration" column="acceleration"/>
|
||||
<result property="temperature" column="temperature"/>
|
||||
<result property="recodeTime" column="recodeTime"/>
|
||||
<result property="remark" column="remark"/>
|
||||
</resultMap>
|
||||
|
||||
<sql id="selectTVibrationsensorDataVo">
|
||||
select objId,
|
||||
collectTime,
|
||||
sensor_id,
|
||||
speed,
|
||||
displacement,
|
||||
acceleration,
|
||||
temperature,
|
||||
recodeTime,
|
||||
remark
|
||||
from T_VibrationSensor_Data
|
||||
</sql>
|
||||
|
||||
<select id="selectTVibrationsensorDataList" parameterType="TVibrationsensorData"
|
||||
resultMap="TVibrationsensorDataResult">
|
||||
<include refid="selectTVibrationsensorDataVo"/>
|
||||
<where>
|
||||
<if test="params.beginCollectTime != null and params.beginCollectTime != '' and params.endCollectTime != null and params.endCollectTime != ''">
|
||||
and collectTime between #{params.beginCollectTime} and #{params.endCollectTime}
|
||||
</if>
|
||||
<if test="sensorId != null ">and sensor_id = #{sensorId}</if>
|
||||
<if test="speed != null ">and speed = #{speed}</if>
|
||||
<if test="displacement != null ">and displacement = #{displacement}</if>
|
||||
<if test="acceleration != null ">and acceleration = #{acceleration}</if>
|
||||
<if test="temperature != null ">and temperature = #{temperature}</if>
|
||||
<if test="recodeTime != null ">and recodeTime = #{recodeTime}</if>
|
||||
</where>
|
||||
order by collectTime desc
|
||||
</select>
|
||||
|
||||
<select id="selectTVibrationsensorDataById" parameterType="Long" resultMap="TVibrationsensorDataResult">
|
||||
<include refid="selectTVibrationsensorDataVo"/>
|
||||
where objId = #{objId}
|
||||
</select>
|
||||
|
||||
<insert id="insertTVibrationsensorData" parameterType="TVibrationsensorData">
|
||||
insert into T_VibrationSensor_Data
|
||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||
<if test="objId != null">objId,</if>
|
||||
<if test="collectTime != null">collectTime,</if>
|
||||
<if test="sensorId != null">sensor_id,</if>
|
||||
<if test="speed != null">speed,</if>
|
||||
<if test="displacement != null">displacement,</if>
|
||||
<if test="acceleration != null">acceleration,</if>
|
||||
<if test="temperature != null">temperature,</if>
|
||||
<if test="recodeTime != null">recodeTime,</if>
|
||||
<if test="remark != null">remark,</if>
|
||||
</trim>
|
||||
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||||
<if test="objId != null">#{objId},</if>
|
||||
<if test="collectTime != null">#{collectTime},</if>
|
||||
<if test="sensorId != null">#{sensorId},</if>
|
||||
<if test="speed != null">#{speed},</if>
|
||||
<if test="displacement != null">#{displacement},</if>
|
||||
<if test="acceleration != null">#{acceleration},</if>
|
||||
<if test="temperature != null">#{temperature},</if>
|
||||
<if test="recodeTime != null">#{recodeTime},</if>
|
||||
<if test="remark != null">#{remark},</if>
|
||||
</trim>
|
||||
</insert>
|
||||
|
||||
<update id="updateTVibrationsensorData" parameterType="TVibrationsensorData">
|
||||
update T_VibrationSensor_Data
|
||||
<trim prefix="SET" suffixOverrides=",">
|
||||
<if test="collectTime != null">collectTime = #{collectTime},</if>
|
||||
<if test="sensorId != null">sensor_id = #{sensorId},</if>
|
||||
<if test="speed != null">speed = #{speed},</if>
|
||||
<if test="displacement != null">displacement = #{displacement},</if>
|
||||
<if test="acceleration != null">acceleration = #{acceleration},</if>
|
||||
<if test="temperature != null">temperature = #{temperature},</if>
|
||||
<if test="recodeTime != null">recodeTime = #{recodeTime},</if>
|
||||
<if test="remark != null">remark = #{remark},</if>
|
||||
</trim>
|
||||
where objId = #{objId}
|
||||
</update>
|
||||
|
||||
<delete id="deleteTVibrationsensorDataById" parameterType="Long">
|
||||
delete
|
||||
from T_VibrationSensor_Data
|
||||
where objId = #{objId}
|
||||
</delete>
|
||||
|
||||
<delete id="deleteTVibrationsensorDataByIds" parameterType="String">
|
||||
delete from T_VibrationSensor_Data where objId in
|
||||
<foreach item="objId" collection="array" open="(" separator="," close=")">
|
||||
#{objId}
|
||||
</foreach>
|
||||
</delete>
|
||||
|
||||
</mapper>
|
Loading…
Reference in New Issue