package org.jeecg.modules.largeScreen.convert;


import org.jeecg.modules.itdmDataNow.entity.ItdmEnvironmentWaterNow;
import org.jeecg.modules.itdmDataNow.entity.ItdmEnvironmentYeweiNow;
import org.jeecg.modules.itdmDataNow.entity.ItdmWenxiangVoltageNow;
import org.jeecg.modules.largeScreen.vo.TongyongDataVO;
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.stream.Collectors;

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

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

    @Mapping(target = "inTemperature", source = "inWaterNow.temperature")
    @Mapping(target = "inWaterPressure", source = "inWaterNow.waterPressure")
    @Mapping(target = "outTemperature", source = "outWaterNow.temperature")
    @Mapping(target = "outWaterPressure", source = "outWaterNow.waterPressure")
    TongyongDataVO convert(ItdmWenxiangVoltageNow voltageNow, ItdmEnvironmentWaterNow inWaterNow, ItdmEnvironmentWaterNow outWaterNow, ItdmEnvironmentYeweiNow yeweiNow);
}
