package com.fs.crm.mapper;

import java.util.List;
import com.fs.crm.domain.CrmCustomerUser;
import org.apache.ibatis.annotations.Options;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

/**
 * 客户员工认领Mapper接口
 *
 * @author fs
 * @date 2022-12-21
 */
public interface CrmCustomerUserMapper
{
    /**
     * 查询客户员工认领
     *
     * @param customerUserId 客户员工认领ID
     * @return 客户员工认领
     */
    public CrmCustomerUser selectCrmCustomerUserById(Long customerUserId);

    /**
     * 查询客户员工认领列表
     *
     * @param crmCustomerUser 客户员工认领
     * @return 客户员工认领集合
     */
    public List<CrmCustomerUser> selectCrmCustomerUserList(CrmCustomerUser crmCustomerUser);

    /**
     * 新增客户员工认领
     *
     * @param crmCustomerUser 客户员工认领
     * @return 结果
     */
    public int insertCrmCustomerUser(CrmCustomerUser crmCustomerUser);

    /**
     * 修改客户员工认领
     *
     * @param crmCustomerUser 客户员工认领
     * @return 结果
     */
    public int updateCrmCustomerUser(CrmCustomerUser crmCustomerUser);

    /**
     * 删除客户员工认领
     *
     * @param customerUserId 客户员工认领ID
     * @return 结果
     */
    public int deleteCrmCustomerUserById(Long customerUserId);

    /**
     * 批量删除客户员工认领
     *
     * @param customerUserIds 需要删除的数据ID
     * @return 结果
     */
    public int deleteCrmCustomerUserByIds(Long[] customerUserIds);

    @Select("select ifnull(count(1),0) from crm_customer_user where company_id=#{companyId} and company_user_id=#{companyUserId} ")
    Integer selectCrmMyCustomerUserCount(@Param("companyId") Long companyId,@Param("companyUserId") Long companyUserId);
}
