package com.dgtly.sync.mapper;

import com.dgtly.sync.domain.Customers;
import org.apache.ibatis.annotations.MapKey;
import org.apache.ibatis.annotations.Param;

import java.util.List;
import java.util.Map;

/**
 * 经销商 Mapper接口
 * 
 * @author dgtly
 * @date 2020-08-27
 */
public interface CustomersMapper 
{
    /**
     * 查询经销商 
     * 
     * @param id 经销商 ID
     * @return 经销商 
     */
    public Customers selectCustomersById(Long id);

    /**
     * 查询经销商 列表
     * 
     * @param customers 经销商 
     * @return 经销商 集合
     */
    public List<Customers> selectCustomersList(Customers customers);

    /**
     * 新增经销商 
     * 
     * @param customers 经销商 
     * @return 结果
     */
    public int insertCustomers(Customers customers);

    /**
     * 修改经销商 
     * 
     * @param customers 经销商 
     * @return 结果
     */
    public int updateCustomers(Customers customers);

    /**
     * 删除经销商 
     * 
     * @param id 经销商 ID
     * @return 结果
     */
    public int deleteCustomersById(Long id);

    /**
     * 批量删除经销商 
     * 
     * @param ids 需要删除的数据ID
     * @return 结果
     */
    public int deleteCustomersByIds(String[] ids);

    @MapKey("code")
    public Map<String,Customers> selectCustomerMapByCode();

    @MapKey("chainsCode")
    public Map<String,Customers> selectCustomerMapByChainsCode();

    @MapKey("chainsCode")
    public Map<String,Customers> selectCustomerMapByChainsCodeByCode();

    /**
     * @description:根据经销商code查询名称
     * @param:
     * @return:
     * @author: njs
     * @date: 2023/8/29 9:32
     */
    public String selectCustomerNameByCustomerCode(@Param("customerCode")String customerCode);

}
