From b34727ebd73a4f346d53730865e83fd5b3e5a0ef Mon Sep 17 00:00:00 2001 From: feiyu02 <risaku@163.com> Date: 星期四, 26 十月 2023 16:36:37 +0800 Subject: [PATCH] 1. 新增定时任务和定时任务日志数据库表映射; 2. 修改异常分析和日、月统计分析定时任务的执行逻辑 --- src/main/java/com/flightfeather/monitor/domain/ds1/repository/DustExceptionSettingRep.kt | 9 ++++++++- 1 files changed, 8 insertions(+), 1 deletions(-) diff --git a/src/main/java/com/flightfeather/monitor/domain/ds1/repository/DustExceptionSettingRep.kt b/src/main/java/com/flightfeather/monitor/domain/ds1/repository/DustExceptionSettingRep.kt index 03f6ce1..c2c75de 100644 --- a/src/main/java/com/flightfeather/monitor/domain/ds1/repository/DustExceptionSettingRep.kt +++ b/src/main/java/com/flightfeather/monitor/domain/ds1/repository/DustExceptionSettingRep.kt @@ -2,6 +2,7 @@ import com.flightfeather.monitor.domain.ds1.entity.DustExceptionSetting import com.flightfeather.monitor.domain.ds1.mapper.DustExceptionSettingMapper +import com.github.pagehelper.PageHelper import org.springframework.stereotype.Repository import tk.mybatis.mapper.entity.Example @@ -13,9 +14,15 @@ * @param region 鍖哄幙 */ fun findLatestSetting(region: String): DustExceptionSetting? { - return dustExceptionSettingMapper.selectOneByExample(Example(DustExceptionSetting::class.java).apply { + val p = PageHelper.startPage<DustExceptionSetting>(1, 1) + dustExceptionSettingMapper.selectByExample(Example(DustExceptionSetting::class.java).apply { createCriteria().andEqualTo("region", region) orderBy("version").desc() }) + return if (p.isNotEmpty()) { + p[0] + } else { + null + } } } \ No newline at end of file -- Gitblit v1.9.3