package com.brilliance.isc.transfer.transaction;

import com.brilliance.isc.bo.lg.GctfeeStoreBo;
import com.brilliance.isc.transfer.IBaseStructMapper;
import com.brilliance.isc.transfer.model.*;
import com.brilliance.isc.vo.lg.GctfeeStoreVo;
import org.mapstruct.Mapper;
import org.mapstruct.Mapping;
import org.mapstruct.MappingTarget;
import org.mapstruct.Mappings;
import org.mapstruct.factory.Mappers;


/**
 * Gitame Bo、Vo之间的转换处理类。如果有很复杂的函数，则可以用适配器模式重写
 */
@Mapper(componentModel = "spring",uses = {
        IGctMapper.class, IGitMapper.class,
        INitMapper.class, INctMapper.class, IOtherModMapper.class}
        )
public interface GctfeeStructMapper extends IBaseStructMapper<GctfeeStoreBo, GctfeeStoreVo> {

    /**
     * 此行语句一定要写，StructMapper需要
     */
    GctfeeStructMapper INSTANCE = Mappers.getMapper(GctfeeStructMapper.class);

    /**
     * Vo转为Bo
     *
     * @param vo
     * @return 返回业务Bo
     */
    @Override
    GctfeeStoreBo voTransferToBo(GctfeeStoreVo vo);

    /**
     * Vo追加更新至Bo
     * 忽略oldgrp的复制
     * @param vo
     * @param bo
     */
    @Override
    @Mappings({
            @Mapping(target = "gidgrp",ignore = true),
            @Mapping(target = "gcdgrp",ignore = true)
    })
    void voUpdateToBo(GctfeeStoreVo vo, @MappingTarget GctfeeStoreBo bo);

    /**
     * Bo转为Vo
     *
     * @param bo
     * @return 返回Vo
     */
    @Override
    GctfeeStoreVo boTransferToVo(GctfeeStoreBo bo);

    /**
     * bo追加更新至Bo
     *
     * @param bo
     * @param vo
     */
    @Override
    void boUpdateToVo(GctfeeStoreBo bo, @MappingTarget GctfeeStoreVo vo);
}
