package com.dsk.biz.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.dsk.biz.domain.Customer;
import com.dsk.biz.domain.bo.CustomerSearchDto;
import com.dsk.biz.domain.vo.CustomerAnalyzeVo;
import com.dsk.biz.domain.vo.CustomerListVo;
import com.dsk.biz.domain.vo.CustomerStatusListVo;
import com.dsk.common.core.mapper.BaseMapperPlus;
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> {

    Page<CustomerListVo> selectList(IPage<CustomerSearchDto> page, @Param("dto") 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);

}

