parent
4dc3a2da7f
commit
a03549add9
@ -0,0 +1,36 @@ |
|||||||
|
package com.bellmann.controller; |
||||||
|
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
||||||
|
import com.bellmann.common.base.BasePageQuery; |
||||||
|
import com.bellmann.common.result.PageResult; |
||||||
|
import com.bellmann.model.vo.FttrTableVO; |
||||||
|
import com.bellmann.service.FttrInfoService; |
||||||
|
import io.swagger.v3.oas.annotations.Operation; |
||||||
|
import io.swagger.v3.oas.annotations.tags.Tag; |
||||||
|
import lombok.RequiredArgsConstructor; |
||||||
|
import org.springframework.web.bind.annotation.*; |
||||||
|
|
||||||
|
/** |
||||||
|
* <p> |
||||||
|
* 前端控制器 |
||||||
|
* </p> |
||||||
|
* |
||||||
|
* @author 李小林 |
||||||
|
* @since 2024-09-26 |
||||||
|
*/ |
||||||
|
@Tag(name = "37.FTTR从网关生命周期记录") |
||||||
|
@RestController |
||||||
|
@RequiredArgsConstructor |
||||||
|
@RequestMapping("/api/fttr_info/v1") |
||||||
|
public class FttrInfoController { |
||||||
|
private final FttrInfoService fttrInfoService; |
||||||
|
|
||||||
|
@PostMapping("fttr-info-page/{devId}") |
||||||
|
@Operation(summary = "历史查询分页接口") |
||||||
|
public PageResult<FttrTableVO> getFttrInfoPage(@RequestBody BasePageQuery pageQuery, @PathVariable Long devId){ |
||||||
|
Page<FttrTableVO> result = fttrInfoService.getFttrInfoPage(pageQuery,devId); |
||||||
|
return PageResult.success(result); |
||||||
|
} |
||||||
|
} |
||||||
|
|
@ -0,0 +1,21 @@ |
|||||||
|
package com.bellmann.mapper; |
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
||||||
|
import com.bellmann.model.entity.FttrInfo; |
||||||
|
import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
||||||
|
import com.bellmann.model.vo.FttrTableVO; |
||||||
|
import org.apache.ibatis.annotations.Mapper; |
||||||
|
|
||||||
|
/** |
||||||
|
* <p> |
||||||
|
* Mapper 接口 |
||||||
|
* </p> |
||||||
|
* |
||||||
|
* @author 李小林 |
||||||
|
* @since 2024-09-26 |
||||||
|
*/ |
||||||
|
@Mapper |
||||||
|
public interface FttrInfoMapper extends BaseMapper<FttrInfo> { |
||||||
|
|
||||||
|
Page<FttrTableVO> getFttrInfoPage(Page<FttrTableVO> page, Long devId); |
||||||
|
} |
@ -0,0 +1,67 @@ |
|||||||
|
package com.bellmann.model.entity; |
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.annotation.IdType; |
||||||
|
import com.baomidou.mybatisplus.annotation.TableId; |
||||||
|
import com.baomidou.mybatisplus.annotation.TableName; |
||||||
|
import lombok.Data; |
||||||
|
import lombok.EqualsAndHashCode; |
||||||
|
|
||||||
|
import java.io.Serializable; |
||||||
|
import java.util.Date; |
||||||
|
|
||||||
|
/** |
||||||
|
* <p> |
||||||
|
* |
||||||
|
* </p> |
||||||
|
* |
||||||
|
* @author 李小林 |
||||||
|
* @since 2024-09-26 |
||||||
|
*/ |
||||||
|
@Data |
||||||
|
@EqualsAndHashCode(callSuper = false) |
||||||
|
@TableName("itms_fttr_info") |
||||||
|
public class FttrInfo implements Serializable { |
||||||
|
|
||||||
|
private static final long serialVersionUID = 1L; |
||||||
|
|
||||||
|
@TableId(value = "fttr_info_id", type = IdType.AUTO) |
||||||
|
private Long fttrInfoId; |
||||||
|
|
||||||
|
private String loId; |
||||||
|
|
||||||
|
private Long devId; |
||||||
|
|
||||||
|
private String devSno; |
||||||
|
|
||||||
|
private String productClass; |
||||||
|
|
||||||
|
private String manufacturer; |
||||||
|
|
||||||
|
private String swVersion; |
||||||
|
|
||||||
|
private String hdVersion; |
||||||
|
|
||||||
|
private String optTemperature; |
||||||
|
|
||||||
|
private String optCurrent; |
||||||
|
|
||||||
|
private String optVoltage; |
||||||
|
|
||||||
|
private String optTxPower; |
||||||
|
|
||||||
|
private String processorLoad; |
||||||
|
|
||||||
|
private String memoryLoad; |
||||||
|
|
||||||
|
private String subFttrInfo; |
||||||
|
|
||||||
|
private Date createTime; |
||||||
|
|
||||||
|
private Date updateTime; |
||||||
|
|
||||||
|
private String informType; |
||||||
|
|
||||||
|
private String node; |
||||||
|
|
||||||
|
|
||||||
|
} |
@ -0,0 +1,61 @@ |
|||||||
|
package com.bellmann.model.vo; |
||||||
|
|
||||||
|
import com.fasterxml.jackson.annotation.JsonFormat; |
||||||
|
import io.swagger.v3.oas.annotations.media.Schema; |
||||||
|
import lombok.Data; |
||||||
|
|
||||||
|
import java.util.Date; |
||||||
|
|
||||||
|
@Data |
||||||
|
@Schema(description = "FTTR从网关生命周期记录") |
||||||
|
public class FttrTableVO { |
||||||
|
@Schema(description = "id") |
||||||
|
private Long fttrInfoId; |
||||||
|
|
||||||
|
@Schema(description = "设备ID") |
||||||
|
private Long devId; |
||||||
|
|
||||||
|
@Schema(description = "设备序列号") |
||||||
|
private String devSno; |
||||||
|
|
||||||
|
@Schema(description = "设备型号") |
||||||
|
private String productClass; |
||||||
|
|
||||||
|
@Schema(description = "设备厂商") |
||||||
|
private String manufacturer; |
||||||
|
|
||||||
|
@Schema(description = "软件版本") |
||||||
|
private String swVersion; |
||||||
|
|
||||||
|
@Schema(description = "硬件版本") |
||||||
|
private String hdVersion; |
||||||
|
|
||||||
|
@Schema(description = "光模块温度") |
||||||
|
private String optTemperature; |
||||||
|
|
||||||
|
@Schema(description = "偏置电流") |
||||||
|
private String optCurrent; |
||||||
|
|
||||||
|
@Schema(description = "光模块电压") |
||||||
|
private String optVoltage; |
||||||
|
|
||||||
|
@Schema(description = "发射光功率") |
||||||
|
private String optTxPower; |
||||||
|
@Schema(description = "cpu使用率") |
||||||
|
private String processorLoad; |
||||||
|
|
||||||
|
@Schema(description = "memoryLoad") |
||||||
|
private String memoryLoad; |
||||||
|
|
||||||
|
@Schema(description = "子网关信息") |
||||||
|
private String subFttrInfo; |
||||||
|
|
||||||
|
@Schema(description = "inform上报时间") |
||||||
|
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") |
||||||
|
private Date createTime; |
||||||
|
|
||||||
|
@Schema(description = "inform类型") |
||||||
|
private String informType; |
||||||
|
@Schema(description = "子网关节点") |
||||||
|
private String node; |
||||||
|
} |
@ -0,0 +1,18 @@ |
|||||||
|
package com.bellmann.service; |
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
||||||
|
import com.bellmann.common.base.BasePageQuery; |
||||||
|
import com.bellmann.model.vo.FttrTableVO; |
||||||
|
|
||||||
|
/** |
||||||
|
* <p> |
||||||
|
* 服务类 |
||||||
|
* </p> |
||||||
|
* |
||||||
|
* @author 李小林 |
||||||
|
* @since 2024-09-26 |
||||||
|
*/ |
||||||
|
public interface FttrInfoService { |
||||||
|
|
||||||
|
Page<FttrTableVO> getFttrInfoPage(BasePageQuery pageQuery, Long devId); |
||||||
|
} |
@ -0,0 +1,32 @@ |
|||||||
|
package com.bellmann.service.impl; |
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
||||||
|
import com.bellmann.common.base.BasePageQuery; |
||||||
|
import com.bellmann.mapper.FttrInfoMapper; |
||||||
|
import com.bellmann.model.vo.FttrTableVO; |
||||||
|
import com.bellmann.service.FttrInfoService; |
||||||
|
import lombok.RequiredArgsConstructor; |
||||||
|
import org.springframework.stereotype.Service; |
||||||
|
|
||||||
|
/** |
||||||
|
* <p> |
||||||
|
* 服务实现类 |
||||||
|
* </p> |
||||||
|
* |
||||||
|
* @author 李小林 |
||||||
|
* @since 2024-09-26 |
||||||
|
*/ |
||||||
|
@Service |
||||||
|
@RequiredArgsConstructor |
||||||
|
public class FttrInfoServiceImpl implements FttrInfoService { |
||||||
|
|
||||||
|
private final FttrInfoMapper fttrInfoMapper; |
||||||
|
@Override |
||||||
|
public Page<FttrTableVO> getFttrInfoPage(BasePageQuery pageQuery, Long devId) { |
||||||
|
int pageNum = pageQuery.getPageNum(); |
||||||
|
int pageSize = pageQuery.getPageSize(); |
||||||
|
Page<FttrTableVO> page = new Page<>(pageNum,pageSize); |
||||||
|
|
||||||
|
return fttrInfoMapper.getFttrInfoPage(page, devId); |
||||||
|
} |
||||||
|
} |
@ -0,0 +1,59 @@ |
|||||||
|
<?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.bellmann.mapper.FttrInfoMapper"> |
||||||
|
|
||||||
|
<!-- 通用查询映射结果 --> |
||||||
|
<resultMap id="BaseResultMap" type="com.bellmann.model.entity.FttrInfo"> |
||||||
|
<id column="fttr_info_id" property="fttrInfoId" /> |
||||||
|
<result column="lo_id" property="loId" /> |
||||||
|
<result column="dev_id" property="devId" /> |
||||||
|
<result column="dev_sno" property="devSno" /> |
||||||
|
<result column="product_class" property="productClass" /> |
||||||
|
<result column="manufacturer" property="manufacturer" /> |
||||||
|
<result column="sw_version" property="swVersion" /> |
||||||
|
<result column="hd_version" property="hdVersion" /> |
||||||
|
<result column="opt_temperature" property="optTemperature" /> |
||||||
|
<result column="opt_current" property="optCurrent" /> |
||||||
|
<result column="opt_voltage" property="optVoltage" /> |
||||||
|
<result column="opt_tx_power" property="optTxPower" /> |
||||||
|
<result column="processor_load" property="processorLoad" /> |
||||||
|
<result column="memory_load" property="memoryLoad" /> |
||||||
|
<result column="sub_fttr_info" property="subFttrInfo" /> |
||||||
|
<result column="create_time" property="createTime" /> |
||||||
|
<result column="update_time" property="updateTime" /> |
||||||
|
<result column="inform_type" property="informType" /> |
||||||
|
<result column="node" property="node" /> |
||||||
|
</resultMap> |
||||||
|
|
||||||
|
<!-- 通用查询结果列 --> |
||||||
|
<sql id="Base_Column_List"> |
||||||
|
fttr_info_id, lo_id, dev_id, dev_sno, product_class, manufacturer, sw_version, hd_version, opt_temperature, opt_current, opt_voltage, opt_tx_power, processor_load, memory_load, sub_fttr_info, create_time, update_time, inform_type, node |
||||||
|
</sql> |
||||||
|
|
||||||
|
<select id="getFttrInfoPage" resultType="com.bellmann.model.vo.FttrTableVO"> |
||||||
|
SELECT |
||||||
|
fttr_info_id, |
||||||
|
dev_id, |
||||||
|
dev_sno, |
||||||
|
product_class, |
||||||
|
manufacturer, |
||||||
|
sw_version, |
||||||
|
hd_version, |
||||||
|
opt_temperature, |
||||||
|
opt_current, |
||||||
|
opt_voltage, |
||||||
|
opt_tx_power, |
||||||
|
processor_load, |
||||||
|
memory_load, |
||||||
|
sub_fttr_info, |
||||||
|
create_time, |
||||||
|
inform_type, |
||||||
|
node |
||||||
|
FROM |
||||||
|
itms_fttr_info |
||||||
|
WHERE |
||||||
|
dev_id = 38772126 |
||||||
|
ORDER BY |
||||||
|
create_time DESC; |
||||||
|
</select> |
||||||
|
</mapper> |
Loading…
Reference in new issue