mqtt信息的获取

This commit is contained in:
2511 2024-08-27 15:05:41 +08:00
parent 7391a52d8c
commit 452fed5647
15 changed files with 549 additions and 0 deletions

View File

@ -0,0 +1,76 @@
package generator.domain;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import java.io.Serializable;
import lombok.Data;
/**
*
* @TableName role
*/
@TableName(value ="role")
@Data
public class Role implements Serializable {
/**
*
*/
@TableId
private Integer id;
/**
*
*/
private String role;
/**
*
*/
private String name;
@TableField(exist = false)
private static final long serialVersionUID = 1L;
@Override
public boolean equals(Object that) {
if (this == that) {
return true;
}
if (that == null) {
return false;
}
if (getClass() != that.getClass()) {
return false;
}
Role other = (Role) that;
return (this.getId() == null ? other.getId() == null : this.getId().equals(other.getId()))
&& (this.getRole() == null ? other.getRole() == null : this.getRole().equals(other.getRole()))
&& (this.getName() == null ? other.getName() == null : this.getName().equals(other.getName()));
}
@Override
public int hashCode() {
final int prime = 31;
int result = 1;
result = prime * result + ((getId() == null) ? 0 : getId().hashCode());
result = prime * result + ((getRole() == null) ? 0 : getRole().hashCode());
result = prime * result + ((getName() == null) ? 0 : getName().hashCode());
return result;
}
@Override
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append(getClass().getSimpleName());
sb.append(" [");
sb.append("Hash = ").append(hashCode());
sb.append(", id=").append(id);
sb.append(", role=").append(role);
sb.append(", name=").append(name);
sb.append(", serialVersionUID=").append(serialVersionUID);
sb.append("]");
return sb.toString();
}
}

View File

@ -0,0 +1,85 @@
package generator.domain;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import java.io.Serializable;
import java.util.Date;
import lombok.Data;
/**
*
* @TableName ups
*/
@TableName(value ="ups")
@Data
public class Ups implements Serializable {
/**
*
*/
@TableId
private Integer id;
/**
*
*/
private Integer upsId;
/**
*
*/
private Integer serialNumber;
/**
*
*/
private Date createTime;
@TableField(exist = false)
private static final long serialVersionUID = 1L;
@Override
public boolean equals(Object that) {
if (this == that) {
return true;
}
if (that == null) {
return false;
}
if (getClass() != that.getClass()) {
return false;
}
Ups other = (Ups) that;
return (this.getId() == null ? other.getId() == null : this.getId().equals(other.getId()))
&& (this.getUpsId() == null ? other.getUpsId() == null : this.getUpsId().equals(other.getUpsId()))
&& (this.getSerialNumber() == null ? other.getSerialNumber() == null : this.getSerialNumber().equals(other.getSerialNumber()))
&& (this.getCreateTime() == null ? other.getCreateTime() == null : this.getCreateTime().equals(other.getCreateTime()));
}
@Override
public int hashCode() {
final int prime = 31;
int result = 1;
result = prime * result + ((getId() == null) ? 0 : getId().hashCode());
result = prime * result + ((getUpsId() == null) ? 0 : getUpsId().hashCode());
result = prime * result + ((getSerialNumber() == null) ? 0 : getSerialNumber().hashCode());
result = prime * result + ((getCreateTime() == null) ? 0 : getCreateTime().hashCode());
return result;
}
@Override
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append(getClass().getSimpleName());
sb.append(" [");
sb.append("Hash = ").append(hashCode());
sb.append(", id=").append(id);
sb.append(", upsId=").append(upsId);
sb.append(", serialNumber=").append(serialNumber);
sb.append(", createTime=").append(createTime);
sb.append(", serialVersionUID=").append(serialVersionUID);
sb.append("]");
return sb.toString();
}
}

View File

@ -0,0 +1,164 @@
package generator.domain;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import java.io.Serializable;
import lombok.Data;
/**
*
* @TableName ups_history
*/
@TableName(value ="ups_history")
@Data
public class UpsHistory implements Serializable {
/**
*
*/
@TableId
private Integer id;
/**
*
*/
private Integer upsId;
/**
*
*/
private String workMode;
/**
*
*/
private String deviceType;
/**
*
*/
private String status;
/**
*
*/
private String cityVol;
/**
*
*/
private String cityFreq;
/**
*
*/
private String cellVol;
/**
*
*/
private String cellCur;
/**
*
*/
private String outVol;
/**
*
*/
private String inVol;
/**
*
*/
private String outCur;
/**
*
*/
private String outFreq;
/**
*
*/
private String outPower;
@TableField(exist = false)
private static final long serialVersionUID = 1L;
@Override
public boolean equals(Object that) {
if (this == that) {
return true;
}
if (that == null) {
return false;
}
if (getClass() != that.getClass()) {
return false;
}
UpsHistory other = (UpsHistory) that;
return (this.getId() == null ? other.getId() == null : this.getId().equals(other.getId()))
&& (this.getUpsId() == null ? other.getUpsId() == null : this.getUpsId().equals(other.getUpsId()))
&& (this.getWorkMode() == null ? other.getWorkMode() == null : this.getWorkMode().equals(other.getWorkMode()))
&& (this.getDeviceType() == null ? other.getDeviceType() == null : this.getDeviceType().equals(other.getDeviceType()))
&& (this.getStatus() == null ? other.getStatus() == null : this.getStatus().equals(other.getStatus()))
&& (this.getCityVol() == null ? other.getCityVol() == null : this.getCityVol().equals(other.getCityVol()))
&& (this.getCityFreq() == null ? other.getCityFreq() == null : this.getCityFreq().equals(other.getCityFreq()))
&& (this.getCellVol() == null ? other.getCellVol() == null : this.getCellVol().equals(other.getCellVol()))
&& (this.getCellCur() == null ? other.getCellCur() == null : this.getCellCur().equals(other.getCellCur()))
&& (this.getOutVol() == null ? other.getOutVol() == null : this.getOutVol().equals(other.getOutVol()))
&& (this.getInVol() == null ? other.getInVol() == null : this.getInVol().equals(other.getInVol()))
&& (this.getOutCur() == null ? other.getOutCur() == null : this.getOutCur().equals(other.getOutCur()))
&& (this.getOutFreq() == null ? other.getOutFreq() == null : this.getOutFreq().equals(other.getOutFreq()))
&& (this.getOutPower() == null ? other.getOutPower() == null : this.getOutPower().equals(other.getOutPower()));
}
@Override
public int hashCode() {
final int prime = 31;
int result = 1;
result = prime * result + ((getId() == null) ? 0 : getId().hashCode());
result = prime * result + ((getUpsId() == null) ? 0 : getUpsId().hashCode());
result = prime * result + ((getWorkMode() == null) ? 0 : getWorkMode().hashCode());
result = prime * result + ((getDeviceType() == null) ? 0 : getDeviceType().hashCode());
result = prime * result + ((getStatus() == null) ? 0 : getStatus().hashCode());
result = prime * result + ((getCityVol() == null) ? 0 : getCityVol().hashCode());
result = prime * result + ((getCityFreq() == null) ? 0 : getCityFreq().hashCode());
result = prime * result + ((getCellVol() == null) ? 0 : getCellVol().hashCode());
result = prime * result + ((getCellCur() == null) ? 0 : getCellCur().hashCode());
result = prime * result + ((getOutVol() == null) ? 0 : getOutVol().hashCode());
result = prime * result + ((getInVol() == null) ? 0 : getInVol().hashCode());
result = prime * result + ((getOutCur() == null) ? 0 : getOutCur().hashCode());
result = prime * result + ((getOutFreq() == null) ? 0 : getOutFreq().hashCode());
result = prime * result + ((getOutPower() == null) ? 0 : getOutPower().hashCode());
return result;
}
@Override
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append(getClass().getSimpleName());
sb.append(" [");
sb.append("Hash = ").append(hashCode());
sb.append(", id=").append(id);
sb.append(", upsId=").append(upsId);
sb.append(", workMode=").append(workMode);
sb.append(", deviceType=").append(deviceType);
sb.append(", status=").append(status);
sb.append(", cityVol=").append(cityVol);
sb.append(", cityFreq=").append(cityFreq);
sb.append(", cellVol=").append(cellVol);
sb.append(", cellCur=").append(cellCur);
sb.append(", outVol=").append(outVol);
sb.append(", inVol=").append(inVol);
sb.append(", outCur=").append(outCur);
sb.append(", outFreq=").append(outFreq);
sb.append(", outPower=").append(outPower);
sb.append(", serialVersionUID=").append(serialVersionUID);
sb.append("]");
return sb.toString();
}
}

View File

@ -0,0 +1,18 @@
package generator.mapper;
import generator.domain.Role;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
/**
* @author 2511
* @description 针对表role的数据库操作Mapper
* @createDate 2024-08-27 11:58:07
* @Entity generator.domain.Role
*/
public interface RoleMapper extends BaseMapper<Role> {
}

View File

@ -0,0 +1,18 @@
package generator.mapper;
import generator.domain.UpsHistory;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
/**
* @author 2511
* @description 针对表ups_history的数据库操作Mapper
* @createDate 2024-08-27 14:59:13
* @Entity generator.domain.UpsHistory
*/
public interface UpsHistoryMapper extends BaseMapper<UpsHistory> {
}

View File

@ -0,0 +1,18 @@
package generator.mapper;
import generator.domain.Ups;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
/**
* @author 2511
* @description 针对表ups的数据库操作Mapper
* @createDate 2024-08-27 14:56:20
* @Entity generator.domain.Ups
*/
public interface UpsMapper extends BaseMapper<Ups> {
}

View File

@ -0,0 +1,13 @@
package generator.service;
import generator.domain.Role;
import com.baomidou.mybatisplus.extension.service.IService;
/**
* @author 2511
* @description 针对表role的数据库操作Service
* @createDate 2024-08-27 11:58:07
*/
public interface RoleService extends IService<Role> {
}

View File

@ -0,0 +1,13 @@
package generator.service;
import generator.domain.UpsHistory;
import com.baomidou.mybatisplus.extension.service.IService;
/**
* @author 2511
* @description 针对表ups_history的数据库操作Service
* @createDate 2024-08-27 14:59:13
*/
public interface UpsHistoryService extends IService<UpsHistory> {
}

View File

@ -0,0 +1,13 @@
package generator.service;
import generator.domain.Ups;
import com.baomidou.mybatisplus.extension.service.IService;
/**
* @author 2511
* @description 针对表ups的数据库操作Service
* @createDate 2024-08-27 14:56:20
*/
public interface UpsService extends IService<Ups> {
}

View File

@ -0,0 +1,22 @@
package generator.service.impl;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import generator.domain.Role;
import generator.service.RoleService;
import generator.mapper.RoleMapper;
import org.springframework.stereotype.Service;
/**
* @author 2511
* @description 针对表role的数据库操作Service实现
* @createDate 2024-08-27 11:58:07
*/
@Service
public class RoleServiceImpl extends ServiceImpl<RoleMapper, Role>
implements RoleService{
}

View File

@ -0,0 +1,22 @@
package generator.service.impl;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import generator.domain.UpsHistory;
import generator.service.UpsHistoryService;
import generator.mapper.UpsHistoryMapper;
import org.springframework.stereotype.Service;
/**
* @author 2511
* @description 针对表ups_history的数据库操作Service实现
* @createDate 2024-08-27 14:59:13
*/
@Service
public class UpsHistoryServiceImpl extends ServiceImpl<UpsHistoryMapper, UpsHistory>
implements UpsHistoryService{
}

View File

@ -0,0 +1,22 @@
package generator.service.impl;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import generator.domain.Ups;
import generator.service.UpsService;
import generator.mapper.UpsMapper;
import org.springframework.stereotype.Service;
/**
* @author 2511
* @description 针对表ups的数据库操作Service实现
* @createDate 2024-08-27 14:56:20
*/
@Service
public class UpsServiceImpl extends ServiceImpl<UpsMapper, Ups>
implements UpsService{
}

View File

@ -0,0 +1,16 @@
<?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="generator.mapper.RoleMapper">
<resultMap id="BaseResultMap" type="generator.domain.Role">
<id property="id" column="id" jdbcType="INTEGER"/>
<result property="role" column="role" jdbcType="VARCHAR"/>
<result property="name" column="name" jdbcType="VARCHAR"/>
</resultMap>
<sql id="Base_Column_List">
id,role,name
</sql>
</mapper>

View File

@ -0,0 +1,31 @@
<?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="generator.mapper.UpsHistoryMapper">
<resultMap id="BaseResultMap" type="generator.domain.UpsHistory">
<id property="id" column="id" jdbcType="INTEGER"/>
<result property="upsId" column="ups_id" jdbcType="INTEGER"/>
<result property="workMode" column="work_mode" jdbcType="VARCHAR"/>
<result property="deviceType" column="device_type" jdbcType="VARCHAR"/>
<result property="status" column="status" jdbcType="VARCHAR"/>
<result property="cityVol" column="city_vol" jdbcType="VARCHAR"/>
<result property="cityFreq" column="city_freq" jdbcType="VARCHAR"/>
<result property="cellVol" column="cell_vol" jdbcType="VARCHAR"/>
<result property="cellCur" column="cell_cur" jdbcType="VARCHAR"/>
<result property="outVol" column="out_vol" jdbcType="VARCHAR"/>
<result property="inVol" column="in_vol" jdbcType="VARCHAR"/>
<result property="outCur" column="out_cur" jdbcType="VARCHAR"/>
<result property="outFreq" column="out_freq" jdbcType="VARCHAR"/>
<result property="outPower" column="out_power" jdbcType="VARCHAR"/>
</resultMap>
<sql id="Base_Column_List">
id,ups_id,work_mode,
device_type,status,city_vol,
city_freq,cell_vol,cell_cur,
out_vol,in_vol,out_cur,
out_freq,out_power
</sql>
</mapper>

View File

@ -0,0 +1,18 @@
<?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="generator.mapper.UpsMapper">
<resultMap id="BaseResultMap" type="generator.domain.Ups">
<id property="id" column="id" jdbcType="INTEGER"/>
<result property="upsId" column="ups_id" jdbcType="INTEGER"/>
<result property="serialNumber" column="serial_number" jdbcType="INTEGER"/>
<result property="createTime" column="create_time" jdbcType="TIMESTAMP"/>
</resultMap>
<sql id="Base_Column_List">
id,ups_id,serial_number,
create_time
</sql>
</mapper>