
package com.tmerclub.cloud.user.mapper;

import com.tmerclub.cloud.api.user.vo.UserManagerVO;
import com.tmerclub.cloud.user.dto.ShopCustomerDTO;
import com.tmerclub.cloud.user.model.ShopCustomer;
import org.apache.ibatis.annotations.Param;

import java.util.List;

/**
 * @author tmerclub
 * @date 2023-01-15 15:53:16
 */
public interface ShopCustomerMapper {

    /**
     * 搜索条件获取列表
     *
     * @param shopCustomerDTO
     * @return
     */
    List<UserManagerVO> listByParam(@Param("shopCustomerDTO") ShopCustomerDTO shopCustomerDTO);

    /**
     * 批量添加客户
     *
     * @param shopCustomers
     */
    void saveBatch(@Param("shopCustomers") List<ShopCustomer> shopCustomers);

    /**
     * 查询未成为店铺会员的用户
     * @param shopId
     * @param userIds
     * @return
     */
    List<ShopCustomer> listNotExistByShopIdAndUserIds(@Param("shopId") Long shopId, @Param("userIds") List<Long> userIds);

    /**
     * 获取用户是否为店铺会员
     * @param shopId
     * @param userId
     * @return
     */
    Integer getIsShopCustomer(@Param("shopId") Long shopId, @Param("userId") Long userId);
}
