feiyu02
2023-10-24 70a7d1ec98064e1acb3130e56e16c45af52ade6c
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
package com.flightfeather.monitor.domain.ds1.repository
 
import com.flightfeather.monitor.domain.ds1.entity.DustExceptionSetting
import com.flightfeather.monitor.domain.ds1.mapper.DustExceptionSettingMapper
import org.springframework.stereotype.Repository
import tk.mybatis.mapper.entity.Example
 
@Repository
class DustExceptionSettingRep(private val dustExceptionSettingMapper: DustExceptionSettingMapper) {
 
    /**
     * 获取最新配置
     * @param region 区县
     */
    fun findLatestSetting(region: String): DustExceptionSetting? {
        return dustExceptionSettingMapper.selectOneByExample(Example(DustExceptionSetting::class.java).apply {
            createCriteria().andEqualTo("region", region)
            orderBy("version").desc()
        })
    }
}