package com.xhpc.user.mapper;

import com.xhpc.common.core.web.domain.AjaxResult;
import com.xhpc.user.domain.XhpcCustomers;
import com.xhpc.user.domain.XhpcCustomersPersonnel;
import org.apache.ibatis.annotations.Param;

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

/**
 * @author yuyang
 * @date 2021/12/23 15:54
 */
public interface XhpcCustomersMapper {

    /**
     * 获取登陆用户信息
     */
    Map<String, Object> getLandUser(@Param("userId") Long userId);


    List<Map<String, Object>> tree(@Param("name") String name,@Param("operatorId") Long operatorId,@Param("tenantId") String tenantId);

    /**
     * 大客户组树列表
     *
     * @param name         桩名称
     * @return
     */
    List<Map<String, Object>> list(@Param("name") String name,@Param("operatorId") Long operatorId,@Param("tenantId") String tenantId);

    /**
     * 查询大客户组
     * @param customersId   大客户id
     * @param name          名称
     * @param type          1 表示已社区id进行查询 2 排查社区id查询
     * @return
     */
    Map<String, Object> getCustomersById(@Param("customersId")Long customersId,@Param("name")String name,@Param("type")Integer type);

    /**
     * 添加大客户组
     * @param xhpcCustomers
     * @return
     */
    int addCustomers(XhpcCustomers xhpcCustomers);

    /**
     * 检查改组是否还存在大客户人员
     */
    int countCustomersPersonnel(@Param("customersId")Long customersId);
    /**
     * 删除大客户组
     * @param customersId
     */
    void deleteCustomers(@Param("customersId")Long customersId);

    /**
     * 修改大客户组
     * @param xhpcCustomers
     * @return
     */
    int updateCustomers(XhpcCustomers xhpcCustomers);

    List<Map<String, Object>> customersPersonnelTree(@Param("customersId")String customersId);


    /**
     * 大客户人员列表
     * @return
     */
    List<Map<String, Object>> customersPersonnelList(@Param("customersId")Long customersId,@Param("account")String account,@Param("phone")String phone,@Param("status")Integer status);


    /**
     * 查询大客户人员
     * @return
     */
    Map<String, Object> getCustomersPersonnelById(@Param("customersPersonnelId")Long customersPersonnelId,@Param("phone")String phone,@Param("account")String account,@Param("type")Integer type);

    /**
     * 新增大客户人员
     * @param
     * @return
     */
    int addCustomersPersonnel(XhpcCustomersPersonnel xhpcCustomersPersonnel);

    /**
     * 修改大客户人员
     * @return
     */
    int updateCustomersPersonnel(XhpcCustomersPersonnel xhpcCustomersPersonnel);

    /**
     * 删除大客户人员
     * @param customersPersonnelId
     */
    void deleteCustomersPersonnel(@Param("customersPersonnelId")Long customersPersonnelId);

    /**
     * 社区人员状态改变
     */
    void updateCustomersPersonnelStatus(@Param("customersPersonnelId")Long customersPersonnelId,@Param("status")Integer status);

    /**
     * 根据用户id获取大客户组
     */
    Map<String, Object> getCustomersPersonnelUserId(@Param("userId")Long userId,@Param("tenantId")String tenantId,@Param("chargingStationId") Long chargingStationId);

    Map<String, Object> getMotorcadeUserId(@Param("userId")Long userId,@Param("tenantId")String tenantId,@Param("chargingStationId") Long chargingStationId);
}
