package com.dsk.system.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.dsk.system.domain.customer.Customer;
import com.dsk.system.domain.customer.dto.CustomerSearchDto;
import com.dsk.system.domain.customer.vo.CustomerAnalyzeVo;
import com.dsk.system.domain.customer.vo.CustomerListVo;
import com.dsk.system.domain.customer.vo.CustomerStatusListVo;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

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


/**
 * 客户信息表(Customer)表数据库访问层
 *
 * @author makejava
 * @since 2023-05-16 09:28:00
 */
@Mapper
public interface CustomerMapper extends BaseMapper<Customer> {

    List<CustomerListVo> selectList(CustomerSearchDto dto);

    List<Customer> selectUserList(Long userId);

    Customer selectByCompanyNameAndUserId(@Param("companyName") String companyName, @Param("userId") Long userId);

    List<CustomerStatusListVo> selectStatusList(@Param("uipIds") List<String> uipIds, @Param("userId") Long userId);

    List<CustomerStatusListVo> selectStatusListByCompanyName(@Param("companyNames") List<String> companyNames, @Param("userId") Long userId);

    int selectCustomerCount(CustomerSearchDto dto);

    List<CustomerAnalyzeVo> selectCooperationTop(CustomerSearchDto dto);

    List<Map<String, Object>> selectCreditLevelGroup(CustomerSearchDto dto);

}

