package vip.xiaonuo.warehouse.service.impl; import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.baomidou.mybatisplus.core.toolkit.StringUtils; import org.springframework.beans.factory.annotation.Autowired; import vip.xiaonuo.warehouse.entity.WarehouseAge; import vip.xiaonuo.warehouse.mapper.WarehouseAgeMapper; import vip.xiaonuo.warehouse.param.WarehouseAgeParam; import vip.xiaonuo.warehouse.param.WarehouseStockDetailParam; import vip.xiaonuo.warehouse.param.WarehouseStockSecondParam; import vip.xiaonuo.warehouse.service.IWarehouseAgeService; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; import org.springframework.stereotype.Service; import java.util.List; /** *

* 仓库物料库龄 服务实现类 *

* * @author author * @since 2024-12-04 */ @Service public class WarehouseAgeServiceImpl extends ServiceImpl implements IWarehouseAgeService { @Autowired private WarehouseAgeMapper ageMapper; @Override public WarehouseAge listAge(WarehouseAgeParam detailParam) { String orgId = detailParam.getOrgId(); String materialType = detailParam.getFnumber(); QueryWrapper queryWrapper = new QueryWrapper<>(); queryWrapper.eq(StringUtils.isNotBlank(orgId),"org_id", orgId).eq( "fnumber", materialType); queryWrapper.select(" IFNULL(sum(one_three),'0') oneThree,IFNULL(sum(four_six),'0') fourSix,IFNULL(sum(seven_year),'0') sevenYear," + "IFNULL(sum(year_one),'0') yearOne,IFNULL(sum(year_two),'0') yearTwo,IFNULL(sum(year_three),'0') yearThree"); return ageMapper.selectOne(queryWrapper); } }