|
|
@ -149,12 +149,18 @@ public class ResiServiceImpl implements ResiService, ResultDataResolver { |
|
|
|
// 使用年龄计算出生日期
|
|
|
|
if (resiRule != null) { |
|
|
|
resiRule.stream().forEach((r) -> { |
|
|
|
// 对生日列计算,并且内容是数字,才计算
|
|
|
|
if ("BIRTHDAY".equals(r.getColKey()) && StringUtils.isNumeric(r.getColVal())) { |
|
|
|
// 对生日列计算
|
|
|
|
if ("BIRTHDAY".equals(r.getColKey())) { |
|
|
|
if ("is_null".equals(r.getQueryType()) || "is_not_null".equals(r.getQueryType())) { |
|
|
|
// 如果是is_null、is_not_null,那么直接用这个条件
|
|
|
|
return; |
|
|
|
} else { |
|
|
|
//如果不是is_null、is_not_null,那么需要转换为出生日期
|
|
|
|
LocalDate birthday = LocalDate.now().minus(Long.valueOf(r.getColVal()), ChronoUnit.YEARS); |
|
|
|
r.setQueryType(revertQueryType(r.getQueryType())); |
|
|
|
r.setColVal(birthday.format(DateTimeFormatter.ofPattern("yyyy-MM-dd"))); |
|
|
|
} |
|
|
|
} |
|
|
|
}); |
|
|
|
} |
|
|
|
} |
|
|
|