This commit is contained in:
liulu 2024-10-31 13:47:22 +08:00
parent 2a2bf99239
commit f7dc9427ac

View File

@ -90,7 +90,7 @@ public class KeyInfoServiceImpl implements KeyInfoService {
LocalDateTime now = LocalDateTime.now();
LambdaQueryWrapper<KeyInfo> wrapper = new LambdaQueryWrapper<KeyInfo>()
.eq(StringUtils.hasText(query.getKeyType()), KeyInfo::getKeyType, query.getKeyType())
.eq(StringUtils.hasText(query.getStatus()), KeyInfo::getStatus, query.getStatus())
// .eq(StringUtils.hasText(query.getStatus()), KeyInfo::getStatus, query.getStatus())
// .eq(KeyInfo::getDeleted, false)
.orderByDesc(KeyInfo::getCreateTime);
if (StringUtils.hasText(query.getStatus())) {
@ -101,6 +101,10 @@ public class KeyInfoServiceImpl implements KeyInfoService {
} else if (KeyStatus.EXPIRED == queryStatus) {
wrapper.eq(KeyInfo::getStatus, KeyStatus.ENABLED.getCode())
.lt(KeyInfo::getExpiredTime, now);
} else if (KeyStatus.ENABLED == queryStatus) {
wrapper.eq(KeyInfo::getStatus, KeyStatus.ENABLED.getCode())
.lt(KeyInfo::getEffectiveTime, now)
.gt(KeyInfo::getExpiredTime, now);
} else {
wrapper.eq(KeyInfo::getStatus, query.getStatus());
}