调整
All checks were successful
local-test分支构建docker并发布运行 / Docker-Build (push) Successful in 1m19s

This commit is contained in:
tiger_zhou 2024-10-25 17:28:37 +08:00
parent 4e5c8f0726
commit 37d5260ee8
3 changed files with 23 additions and 1 deletions

View File

@ -3,10 +3,18 @@ package club.joylink.xiannccda.dto.event;
import club.joylink.xiannccda.constants.common.CommonLogTypeEnum;
import club.joylink.xiannccda.entity.EventLog;
import com.baomidou.mybatisplus.extension.plugins.pagination.PageDTO;
import java.time.LocalDateTime;
import lombok.Data;
import org.springframework.format.annotation.DateTimeFormat;
@Data
public class EventLogQueryDTO extends PageDTO<EventLog> {
private CommonLogTypeEnum logType;
private String name;
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
private LocalDateTime beginDate;
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
private LocalDateTime endDate;
}

View File

@ -4,9 +4,12 @@ import club.joylink.xiannccda.constants.common.LineTypeEnum;
import club.joylink.xiannccda.dto.CommonPage;
import club.joylink.xiannccda.dto.protos.AlertConstProto.AlertType;
import club.joylink.xiannccda.entity.AlertRecord;
import com.alibaba.fastjson2.annotation.JSONField;
import com.baomidou.mybatisplus.extension.plugins.pagination.PageDTO;
import com.fasterxml.jackson.annotation.JsonFormat;
import java.time.LocalDateTime;
import lombok.Data;
import org.springframework.format.annotation.DateTimeFormat;
@Data
public class AlertRecordQueryDTO extends CommonPage {
@ -16,7 +19,10 @@ public class AlertRecordQueryDTO extends CommonPage {
private Integer lineId;
private LineTypeEnum lineType;
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
private LocalDateTime beginDateTime;
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
private LocalDateTime endDateTime;
private Integer alertStatus;

View File

@ -15,6 +15,7 @@ import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import java.util.List;
import java.util.Objects;
import org.apache.commons.lang3.StringUtils;
import org.springframework.stereotype.Service;
@ -32,8 +33,15 @@ public class EventLogRepository extends ServiceImpl<EventLogMapper, EventLog> im
@Override
public Page<EventLogPageDTO> detailPage(EventLogQueryDTO dto) {
QueryWrapper<EventLog> qw = new QueryWrapper<>();
qw.eq("A.event_type", dto.getLogType());
qw.like(StringUtils.isNotEmpty(dto.getName()), "B.name", dto.getName());
if (Objects.nonNull(dto.getBeginDate()) && Objects.nonNull(dto.getEndDate())) {
qw.between("A.create_date_time", dto.getBeginDate(), dto.getEndDate());
} else if (Objects.nonNull(dto.getBeginDate())) {
qw.ge("A.create_date_time", dto.getBeginDate());
} else if (Objects.nonNull(dto.getEndDate())) {
qw.le("A.create_date_time", dto.getEndDate());
}
qw.orderByDesc("A.id");
return this.baseMapper.detailPage(dto, qw);
}