MaterialUnitServiceImpl.java
1.23 KB
package com.huaheng.pc.config.materialUnit.service;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.toolkit.StringUtils;
import com.huaheng.common.utils.Wrappers;
import com.huaheng.pc.config.materialType.domain.MaterialType;
import org.springframework.stereotype.Service;
import javax.annotation.Resource;
import java.util.List;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.huaheng.pc.config.materialUnit.mapper.MaterialUnitMapper;
import com.huaheng.pc.config.materialUnit.domain.MaterialUnit;
import com.huaheng.pc.config.materialUnit.service.MaterialUnitService;
@Service
public class MaterialUnitServiceImpl extends ServiceImpl<MaterialUnitMapper, MaterialUnit> implements MaterialUnitService{
@Override
public List<MaterialUnit> getMaterialUnitByDoamin(MaterialUnit materialUnit){
LambdaQueryWrapper<MaterialUnit> lambda = Wrappers.lambdaQuery();
lambda.eq(StringUtils.isNotEmpty(materialUnit.getUnit()),MaterialUnit::getUnit,materialUnit.getUnit());
lambda.eq(StringUtils.isNotEmpty(materialUnit.getWarehouseCode()),MaterialUnit::getWarehouseCode,materialUnit.getWarehouseCode());
return this.list(lambda);
}
}