Commit a52e367f by gdj

ai信息增加查询参数2。

parent 7364de85
......@@ -18,4 +18,11 @@ public class AiInfoSearchParam {
@JsonProperty("warn_event")
private String warnEvent;
@JsonProperty("start_warn_time")
private Long startWarnTime;
@JsonProperty("end_warn_time")
private Long endWarnTime;
}
......@@ -9,9 +9,11 @@ import com.dji.sample.ai.model.dto.AiInfoDTO;
import com.dji.sample.ai.model.entity.AiInfoEntity;
import com.dji.sample.ai.model.param.AiInfoSearchParam;
import com.dji.sample.ai.service.IAiInfoService;
import com.dji.sample.wayline.model.entity.WaylineJobEntity;
import com.dji.sdk.common.Pagination;
import com.dji.sdk.common.PaginationData;
import org.springframework.stereotype.Service;
import org.springframework.util.ObjectUtils;
import org.springframework.util.StringUtils;
import java.time.Instant;
......@@ -33,7 +35,7 @@ public class AiInfoServiceImpl extends ServiceImpl<IAiInfoMapper, AiInfoEntity>
LambdaQueryWrapper<AiInfoEntity> wrapper = new LambdaQueryWrapper<>();
if (StringUtils.hasText(param.getDeviceSn())) {
wrapper.eq(AiInfoEntity::getDeviceSn, param.getDeviceSn());
wrapper.like(AiInfoEntity::getDeviceSn, param.getDeviceSn());
}
if (StringUtils.hasText(param.getWarnEvent())) {
wrapper.like(AiInfoEntity::getWarnEvent, param.getWarnEvent());
......@@ -41,6 +43,12 @@ public class AiInfoServiceImpl extends ServiceImpl<IAiInfoMapper, AiInfoEntity>
if (StringUtils.hasText(param.getWarnType())) {
wrapper.eq(AiInfoEntity::getWarnType, param.getWarnType());
}
if (!ObjectUtils.isEmpty(param.getStartWarnTime())) {
wrapper.ge(AiInfoEntity::getWarnTime, param.getStartWarnTime());
}
if (!ObjectUtils.isEmpty(param.getEndWarnTime())) {
wrapper.le(AiInfoEntity::getWarnTime, param.getEndWarnTime());
}
Page<AiInfoEntity> pagination = this.page(new Page<>(page, pageSize), wrapper);
List<AiInfoDTO> aiInfoDTOList = pagination.getRecords().stream().map(this::AiInfoEntityToDTO)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment