package org.jeecg.modules.inventory.convert;


import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import org.jeecg.modules.inventory.entity.ItdmSampleExpireReal;
import org.jeecg.modules.inventory.entity.ItdmSampleInventory;
import org.jeecg.modules.inventory.vo.ItdmSampleExpireRealListVO;
import org.mapstruct.Mapper;
import org.mapstruct.Mapping;
import org.mapstruct.ReportingPolicy;
import org.mapstruct.factory.Mappers;
import org.springframework.util.CollectionUtils;

import java.util.List;
import java.util.stream.Collectors;

@Mapper(unmappedTargetPolicy = ReportingPolicy.IGNORE,imports ={ CollectionUtils.class, Collectors.class})
public interface ItdmSampleExpireRealConvert {

    ItdmSampleExpireRealConvert INSTANCE = Mappers.getMapper(ItdmSampleExpireRealConvert.class);

    ItdmSampleExpireRealListVO convert(ItdmSampleExpireReal real, ItdmSampleInventory inventory);

    @Mapping(target ="records",source ="results" )
    Page<ItdmSampleExpireRealListVO> converter(Page<ItdmSampleExpireReal> page, List<ItdmSampleExpireRealListVO> results);


}
