contractIds = service
.list(Wrappers.<object>lambdaQuery()
.in(object::getStatus, statusList)
.and(obj -> obj.le(object::getContractStartDate, startMonth)
.ge(object::getContractEndDate, startMonth)
.or(obj1 -> obj1.ge(object::getContractStartDate, startMonth)
.le(object::getContractStartDate, endMonth))
)
).stream().map(object::getContractId).collect(Collectors.toList());
sql:select * from t where status in () and (startDate <= startMonth and endDate >= endMonth or startDate >=startMonth and startDate <= endMonth);