package com.zfire.mall.manager.convert;

import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.zfire.mall.manager.bean.admin.AdminUserCom;
import com.zfire.mall.manager.bean.config.*;
import com.zfire.mall.manager.plus.entity.CustomerBillLimitConfig;
import org.mapstruct.Context;
import org.mapstruct.Mapper;
import org.mapstruct.Mapping;
import org.mapstruct.factory.Mappers;

import java.util.Map;

/**
 * @author qinrongjun
 * @description
 * @date 2023/7/26 14:24 星期三
 */
@Mapper(config = CommonMapperConfig.class)
public interface MerchantLoginQuotaLimitConvert {
    MerchantLoginQuotaLimitConvert INSTANCE = Mappers.getMapper(MerchantLoginQuotaLimitConvert.class);

    @Mapping(target = "createName", source = "username")
    CustomerBillLimitConfig toDO(MerchantLoginQuotaLimitAddParam var0, String username);

    @Mapping(target = "updateName", source = "username")
    CustomerBillLimitConfig toDO(MerchantLoginQuotaLimitEditParam var0, String username);
    MerchantLoginQuotaLimitDetailVO toVO(CustomerBillLimitConfig var0);

    @Mapping(target = "customerName", expression = "java(nameByIdMap.get(var0.getCustomerId()))")
    MerchantLoginQuotaLimitListVO toListVO(CustomerBillLimitConfig var0, @Context Map<String, String> nameByIdMap);

    Page<MerchantLoginQuotaLimitListVO> toPageVO(IPage<CustomerBillLimitConfig> var0, @Context Map<String, String> nameByIdMap);
}