|
|
|
|
@ -8,7 +8,6 @@ import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
|
|
|
|
import com.baomidou.mybatisplus.core.metadata.IPage; |
|
|
|
|
import com.baomidou.mybatisplus.core.toolkit.CollectionUtils; |
|
|
|
|
import com.baomidou.mybatisplus.core.toolkit.StringUtils; |
|
|
|
|
import com.baomidou.mybatisplus.core.toolkit.Wrappers; |
|
|
|
|
import jakarta.annotation.Resource; |
|
|
|
|
import lombok.AllArgsConstructor; |
|
|
|
|
import lombok.Data; |
|
|
|
|
@ -79,14 +78,14 @@ public class BatConfigServiceImpl extends BaseServiceImpl<BatConfigMapper, BatCo |
|
|
|
|
|
|
|
|
|
@Override |
|
|
|
|
public BatConfig findByCaId(Long hostCaId, String part, Double singletonArea) { |
|
|
|
|
boolean partIsNotBlank = StringUtils.isNotBlank(part); |
|
|
|
|
LambdaQueryWrapper wrapper = Wrappers.lambdaQuery(BatConfig.class) |
|
|
|
|
.eq(BatConfig::getIsDeleted, CommonConstant.DELETE_FALSE) |
|
|
|
|
LambdaQueryWrapper<BatConfig> wrapper = new LambdaQueryWrapper(); |
|
|
|
|
wrapper.eq(BatConfig::getIsDeleted, CommonConstant.DELETE_FALSE) |
|
|
|
|
.eq(BatConfig::getCaId, hostCaId) |
|
|
|
|
.eq(partIsNotBlank, BatConfig::getPartCode, part) |
|
|
|
|
.le(partIsNotBlank, BatConfig::getSingletonArea, BigDecimal.valueOf(singletonArea)) |
|
|
|
|
.orderByDesc(BatConfig::getSingletonArea); |
|
|
|
|
|
|
|
|
|
if(StringUtils.isNotBlank(part)){ |
|
|
|
|
wrapper.eq(BatConfig::getPartCode, part) |
|
|
|
|
.le(BatConfig::getSingletonArea, BigDecimal.valueOf(singletonArea)); |
|
|
|
|
} |
|
|
|
|
List<BatConfig> batConfigList = baseMapper.selectList(wrapper); |
|
|
|
|
if(CollectionUtils.isEmpty(batConfigList)){ |
|
|
|
|
return null; |
|
|
|
|
|