parent
d8fe0bb7aa
commit
ace820480a
@ -0,0 +1,24 @@ |
|||||||
|
package com.bellmann.common.enums; |
||||||
|
|
||||||
|
import com.bellmann.common.base.IBaseEnum; |
||||||
|
import lombok.Getter; |
||||||
|
|
||||||
|
public enum TaskStatusEnum implements IBaseEnum<Integer> { |
||||||
|
|
||||||
|
FAILED(0,"失败"), |
||||||
|
|
||||||
|
SUCCESSFUL(1,"成功"), |
||||||
|
|
||||||
|
; |
||||||
|
|
||||||
|
@Getter |
||||||
|
private Integer value; |
||||||
|
|
||||||
|
@Getter |
||||||
|
private String label; |
||||||
|
|
||||||
|
TaskStatusEnum(Integer value, String label){ |
||||||
|
this.label = label; |
||||||
|
this.value = value; |
||||||
|
} |
||||||
|
} |
@ -0,0 +1,38 @@ |
|||||||
|
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.DeviceTypeVerLogVO; |
||||||
|
import com.bellmann.service.DeviceTypeVerLogService; |
||||||
|
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-07-07 |
||||||
|
*/ |
||||||
|
@Tag(name = "24.SOAP包日志") |
||||||
|
@RestController |
||||||
|
@RequiredArgsConstructor |
||||||
|
@RequestMapping("/api/device-type-ver-log/v1") |
||||||
|
public class DeviceTypeVerLogController { |
||||||
|
|
||||||
|
private final DeviceTypeVerLogService deviceTypeVerLogService; |
||||||
|
|
||||||
|
|
||||||
|
@PostMapping("/page/{devId}") |
||||||
|
@Operation(summary = "page") |
||||||
|
public PageResult<DeviceTypeVerLogVO> pageData(@PathVariable Long devId, @RequestBody BasePageQuery query){ |
||||||
|
Page<DeviceTypeVerLogVO> page = deviceTypeVerLogService.pageData(query,devId); |
||||||
|
return PageResult.success(page); |
||||||
|
} |
||||||
|
} |
||||||
|
|
@ -0,0 +1,26 @@ |
|||||||
|
package com.bellmann.converter; |
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
||||||
|
import com.bellmann.model.entity.DeviceTypeVerLog; |
||||||
|
import com.bellmann.model.vo.DeviceTypeVerLogVO; |
||||||
|
import org.mapstruct.Mapper; |
||||||
|
import org.mapstruct.Mapping; |
||||||
|
import org.mapstruct.Mappings; |
||||||
|
|
||||||
|
/** |
||||||
|
* 用户对象转换器 |
||||||
|
* |
||||||
|
* |
||||||
|
* @since 2022/6/8 |
||||||
|
*/ |
||||||
|
@Mapper(componentModel = "spring") |
||||||
|
public interface DeviceTypeVerLogConverter { |
||||||
|
|
||||||
|
@Mappings({ |
||||||
|
@Mapping(target = "taskStatus", expression = "java(com.bellmann.common.base.IBaseEnum.getLabelByValue(entity.getTaskStatus(), com.bellmann.common.enums.TaskStatusEnum.class))"), |
||||||
|
}) |
||||||
|
DeviceTypeVerLogVO entityPage2VoPage(DeviceTypeVerLog entity); |
||||||
|
|
||||||
|
Page<DeviceTypeVerLogVO> entityPage2VoPage(Page<DeviceTypeVerLog> entityPage); |
||||||
|
|
||||||
|
} |
@ -0,0 +1,18 @@ |
|||||||
|
package com.bellmann.mapper; |
||||||
|
|
||||||
|
import com.bellmann.model.entity.DeviceTypeVerLog; |
||||||
|
import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
||||||
|
import org.apache.ibatis.annotations.Mapper; |
||||||
|
|
||||||
|
/** |
||||||
|
* <p> |
||||||
|
* Mapper 接口 |
||||||
|
* </p> |
||||||
|
* |
||||||
|
* @author 李小林 |
||||||
|
* @since 2024-07-07 |
||||||
|
*/ |
||||||
|
@Mapper |
||||||
|
public interface DeviceTypeVerLogMapper extends BaseMapper<DeviceTypeVerLog> { |
||||||
|
|
||||||
|
} |
@ -0,0 +1,48 @@ |
|||||||
|
package com.bellmann.model.entity; |
||||||
|
|
||||||
|
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-07-07 |
||||||
|
*/ |
||||||
|
@Data |
||||||
|
@EqualsAndHashCode(callSuper = false) |
||||||
|
@TableName("itms_device_type_ver_log") |
||||||
|
public class DeviceTypeVerLog implements Serializable { |
||||||
|
|
||||||
|
private static final long serialVersionUID = 1L; |
||||||
|
|
||||||
|
private Long logid; |
||||||
|
|
||||||
|
private String taskName; |
||||||
|
|
||||||
|
private String loId; |
||||||
|
|
||||||
|
private String devSno; |
||||||
|
|
||||||
|
private Date startTime; |
||||||
|
|
||||||
|
private Date endTime; |
||||||
|
|
||||||
|
private Integer taskStatus; |
||||||
|
|
||||||
|
private Long devId; |
||||||
|
|
||||||
|
private String serialId; |
||||||
|
|
||||||
|
private Integer enevtType; |
||||||
|
|
||||||
|
private Integer evevtStatus; |
||||||
|
|
||||||
|
|
||||||
|
} |
@ -0,0 +1,36 @@ |
|||||||
|
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; |
||||||
|
|
||||||
|
/** |
||||||
|
* <p> |
||||||
|
* |
||||||
|
* </p> |
||||||
|
* |
||||||
|
* @author 李小林 |
||||||
|
* @since 2024-07-07 |
||||||
|
*/ |
||||||
|
@Data |
||||||
|
@Schema(description = "设备软件版本对外接口能力调用信息视图") |
||||||
|
public class DeviceTypeVerLogVO{ |
||||||
|
|
||||||
|
private Long logid; |
||||||
|
|
||||||
|
private String taskName; |
||||||
|
|
||||||
|
private String loId; |
||||||
|
|
||||||
|
private String devSno; |
||||||
|
@JsonFormat(pattern = "yyyy-MM-dd hh:mm:ss") |
||||||
|
private Date startTime; |
||||||
|
|
||||||
|
@JsonFormat(pattern = "yyyy-MM-dd hh:mm:ss") |
||||||
|
private Date endTime; |
||||||
|
|
||||||
|
private String taskStatus; |
||||||
|
|
||||||
|
} |
@ -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.DeviceTypeVerLogVO; |
||||||
|
|
||||||
|
/** |
||||||
|
* <p> |
||||||
|
* 服务类 |
||||||
|
* </p> |
||||||
|
* |
||||||
|
* @author 李小林 |
||||||
|
* @since 2024-07-07 |
||||||
|
*/ |
||||||
|
public interface DeviceTypeVerLogService { |
||||||
|
|
||||||
|
Page<DeviceTypeVerLogVO> pageData(BasePageQuery query, Long devId); |
||||||
|
} |
@ -0,0 +1,40 @@ |
|||||||
|
package com.bellmann.service.impl; |
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
||||||
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
||||||
|
import com.bellmann.common.base.BasePageQuery; |
||||||
|
import com.bellmann.converter.DeviceTypeVerLogConverter; |
||||||
|
import com.bellmann.mapper.DeviceTypeVerLogMapper; |
||||||
|
import com.bellmann.model.entity.DeviceTypeVerLog; |
||||||
|
import com.bellmann.model.vo.DeviceTypeVerLogVO; |
||||||
|
import com.bellmann.service.DeviceTypeVerLogService; |
||||||
|
import lombok.RequiredArgsConstructor; |
||||||
|
import org.springframework.stereotype.Service; |
||||||
|
|
||||||
|
/** |
||||||
|
* <p> |
||||||
|
* 服务实现类 |
||||||
|
* </p> |
||||||
|
* |
||||||
|
* @author 李小林 |
||||||
|
* @since 2024-07-07 |
||||||
|
*/ |
||||||
|
@Service |
||||||
|
@RequiredArgsConstructor |
||||||
|
public class DeviceTypeVerLogServiceImpl implements DeviceTypeVerLogService { |
||||||
|
|
||||||
|
private final DeviceTypeVerLogMapper deviceTypeVerLogMapper; |
||||||
|
|
||||||
|
private final DeviceTypeVerLogConverter deviceTypeVerLogConverter; |
||||||
|
@Override |
||||||
|
public Page<DeviceTypeVerLogVO> pageData(BasePageQuery query, Long devId) { |
||||||
|
int pageNum = query.getPageNum(); |
||||||
|
int pageSize = query.getPageSize(); |
||||||
|
Page<DeviceTypeVerLog> page = new Page<>(pageNum,pageSize); |
||||||
|
Page<DeviceTypeVerLog> entityPage = deviceTypeVerLogMapper.selectPage(page, new QueryWrapper<DeviceTypeVerLog>() |
||||||
|
.select("logid", "task_name", "lo_id", "dev_sno", "start_time", "end_time", "task_status") |
||||||
|
.eq("dev_id", devId) |
||||||
|
); |
||||||
|
return deviceTypeVerLogConverter.entityPage2VoPage(entityPage); |
||||||
|
} |
||||||
|
} |
@ -0,0 +1,25 @@ |
|||||||
|
<?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.DeviceTypeVerLogMapper"> |
||||||
|
|
||||||
|
<!-- 通用查询映射结果 --> |
||||||
|
<resultMap id="BaseResultMap" type="com.bellmann.model.entity.DeviceTypeVerLog"> |
||||||
|
<id column="logid" property="logid" /> |
||||||
|
<result column="task_name" property="taskName" /> |
||||||
|
<result column="lo_id" property="loId" /> |
||||||
|
<result column="dev_sno" property="devSno" /> |
||||||
|
<result column="start_time" property="startTime" /> |
||||||
|
<result column="end_time" property="endTime" /> |
||||||
|
<result column="task_status" property="taskStatus" /> |
||||||
|
<result column="dev_id" property="devId" /> |
||||||
|
<result column="serial_id" property="serialId" /> |
||||||
|
<result column="enevt_type" property="enevtType" /> |
||||||
|
<result column="evevt_status" property="evevtStatus" /> |
||||||
|
</resultMap> |
||||||
|
|
||||||
|
<!-- 通用查询结果列 --> |
||||||
|
<sql id="Base_Column_List"> |
||||||
|
logid, task_name, lo_id, dev_sno, start_time, end_time, task_status, dev_id, serial_id, enevt_type, evevt_status |
||||||
|
</sql> |
||||||
|
|
||||||
|
</mapper> |
Loading…
Reference in new issue