| | |
| | | |
| | | 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 |
| | | |
| | |
| | | * @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 |
| | | } |
| | | } |
| | | } |