package org.jeecg.modules.largeScreen.convert;


import org.jeecg.modules.itdmDevice.entity.ItdmDevice;
import org.jeecg.modules.largeScreen.vo.ItdmDeviceRepairAlarmListVO;
import org.jeecg.modules.largeScreen.vo.ItdmDeviceWSVO;
import org.mapstruct.Mapper;
import org.mapstruct.Mapping;
import org.mapstruct.ReportingPolicy;
import org.springframework.util.CollectionUtils;
import org.mapstruct.factory.Mappers;

import java.util.stream.Collectors;

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

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

    ItdmDeviceWSVO convert(ItdmDevice convert);

    @Mapping(target = "deviceId",source = "itdmDevice.id")
    @Mapping(target = "day",source = "day")
    ItdmDeviceRepairAlarmListVO toList(ItdmDevice itdmDevice,Integer day);

}
