This commit is contained in:
parent
4e5c8f0726
commit
37d5260ee8
@ -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;
|
||||
}
|
||||
|
@ -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;
|
||||
|
@ -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);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user