EntmicroStaffMapper.java 9.04 KB
package cn.com.glsx.entmicro.mapper;

import cn.com.glsx.entmicro.entity.EntmicroStaff;
import cn.com.glsx.entmicro.model.MerchantStaffModel;
import cn.com.glsx.entmicro.model.request.*;
import cn.com.glsx.entmicro.model.request.wechatcloudcontrol.login.WechatDepositRequest;
import cn.com.glsx.entmicro.model.response.EntmicroFollowerStaffResponse;
import cn.com.glsx.entmicro.model.response.EntmicroStaffFollowResponse;
import cn.com.glsx.entmicro.model.response.EntmicroStaffResponse;
import cn.com.glsx.entmicro.model.response.StaffFollowResponse;
import cn.com.glsx.entmicro.model.wechatcloudcontrol.LoginCallBackModel;
import com.github.pagehelper.Page;
import com.glsx.plat.mybatis.mapper.CommonBaseMapper;
import org.apache.ibatis.annotations.MapKey;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

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

@Mapper
public interface EntmicroStaffMapper extends CommonBaseMapper<EntmicroStaff> {

    /**
     * 删除员工
     *
     * @param entmicroStaff
     * @return
     */
    Boolean deleteEntmicroStaff(@Param("entmicroStaff") EntmicroStaff entmicroStaff);

    /**
     * 根据跟进类型id查询员工
     *
     * @return
     */
    List<EntmicroStaffResponse> listStaffByFollowerTypeId(@Param("followerTypeId") Integer followerTypeId,
                                                          @Param("merchantId") Integer merchantId);

    /**
     * 根据手机号查询员工
     *
     * @param entmicroStaff
     * @return
     */
    List<EntmicroStaffResponse> listByStaffPhone(@Param("entmicroStaff") EntmicroStaff entmicroStaff);

    /**
     * 批量添加跟进专员
     *
     * @param entmicroFollowerStaffRequest
     * @return
     */
    Boolean saveEntmicroFollowerStaff(@Param("entmicroFollowerStaffRequest") EntmicroFollowerStaffRequest entmicroFollowerStaffRequest);

    /**
     * 删除跟进专员
     *
     * @param entmicroFollowerStaffRequest
     * @return
     */
    Boolean deleteEntmicroFollowerStaff(@Param("entmicroFollowerStaffRequest") EntmicroFollowerStaffRequest entmicroFollowerStaffRequest);

    /**
     * 查询跟进专员列表
     *
     * @param entmicroFollowerStaffRequest
     * @return
     */
    Page<EntmicroFollowerStaffResponse> listEntmicroFollowerStaffByPage(@Param("entmicroFollowerStaffRequest") EntmicroFollowerStaffRequest entmicroFollowerStaffRequest);

    /**
     * 更新员工外部联系人权限
     *
     * @param userId
     * @return
     */
    Boolean updateAddOutsider(@Param("userId") List<String> userId,
                              @Param("merchantId") Integer merchantId,
                              @Param("isAddOutsider") byte isAddOutsider);

    /**
     * 查询当前商户所有员工
     *
     * @param
     * @return
     */
    List<EntmicroStaffResponse> findStaffByMerchantId(EntmicroStaffRequest entmicroStaffRequest);

    /**
     * 查询拥有客户联系权限的员工
     *
     * @param entmicroStaffRequest
     * @return
     */
    List<EntmicroStaffResponse> listIsAddOutSiderStaff(@Param("entmicroStaffRequest") EntmicroStaffRequest entmicroStaffRequest);

    /**
     * userid查询员工
     *
     * @param userids
     * @return
     */
    @MapKey("userId")
    Map<String, EntmicroStaffResponse> findStaffMapByUserIds(@Param("userids") List<String> userids, @Param("merchantId") Integer merchantId);

    /**
     * userid查询员工
     *
     * @param userids
     * @return
     */
    @MapKey("userId")
    List<EntmicroStaffResponse> findStaffListByUserIds(@Param("userids") List<String> userids,
                                                       @Param("merchantId") Integer merchantId);

    /**
     * followId查询员工
     *
     * @param followIds
     * @return
     */
    @MapKey("follow_id")
    Map<Integer, EntmicroStaffFollowResponse> findStaffByFollowIds(@Param("followIds") List<Integer> followIds);

    /**
     * 员工id查询商户号
     *
     * @param staffIds
     * @return
     */
    List<String> findMerchantIdsByStaffIds(@Param("staffIds") List<Integer> staffIds);

    List<EntmicroStaffResponse> findStaffByDepartment(@Param("merchantId") Integer merchantId, @Param("departmentId") List<Integer> departmentId);

    void updateStaffDepart(@Param("ids") List<Integer> ids, @Param("merchantId") int staffMerchantId, @Param("departIds") List<Integer> departIds);

    /**
     * 根据UserId和商户号员工
     *
     * @param entmicroStaff
     * @return
     */
    EntmicroStaffResponse findByMerchantIdAndUserId(@Param("entmicroStaff") EntmicroStaff entmicroStaff, @Param("list") List<Integer> list);

    /**
     * 主键id批量查员工 TODO 未加商户号校验
     *
     * @return
     */
    List<EntmicroStaffResponse> getStaffById(@Param("staffIdList") List<Integer> staffIdList);

    List<EntmicroStaffResponse> findFollowStaff(@Param("staffRequestDTO") StaffRequestDTO staffRequestDTO);

    /**
     * uuid查员工
     *
     * @param userUuid
     * @return
     */
    EntmicroStaffResponse findStaffDetail(@Param("userUuid") String userUuid);

    void updateUUID(@Param("dictDataResponseList") List<MerchantStaffModel> dictDataResponseList);

    @MapKey("id")
    Map<Integer, EntmicroStaffResponse> findStaffDetailByRelationId(@Param("integerList") List<Integer> integerList);

    List<EntmicroStaffResponse> findStaffByDepartmentIds(@Param("list") List<Integer> departmentIds, @Param("isfollower") Boolean isfollower);

    @MapKey("id")
    Map<Integer, EntmicroStaffResponse> findStaffDetailById(@Param("list") List<Integer> staffIds, @Param("staffName") String staffName);

    EntmicroStaffResponse findStaffByuuid(@Param("uuid") String uuid);

    List<EntmicroStaffResponse> findlistEntmicroStaff(@Param("entmicroStaffRequest") EntmicroStaffRequest entmicroStaffRequest);

    /**
     * 通过员工ID集合获取员工信息
     *
     * @param staffIdList
     * @return
     */
    List<EntmicroStaffResponse> getStaffByIds(@Param("staffIdList") List<Integer> staffIdList);

    List<String> findHavingCustomer(@Param("merchantId") Integer merchantId, @Param("flag") Boolean flag);

    List<EntmicroStaffResponse> findLordGroup(@Param("obj") LordCustomerGroupRequest lordCustomerGroupRequest);

    List<EntmicroStaffResponse> findStaffByEntDepartment(@Param("list") List<Integer> list, @Param("departmentIds") List<Integer> departmentIds);

    List<EntmicroStaffResponse> listStaffByDefalutCode(@Param("defalutCode") Integer defalutCode, @Param("merchantId") Integer merchantId);

    List<EntmicroStaffResponse> findStaffIdByCustomerIds(@Param("mergeId") List<Integer> mergeId);

    @MapKey("userId")
    Map<String, EntmicroStaffResponse> findStaffDetailByUserIds(@Param("userIds") List<String> userIds, @Param("merchantId") Integer merchantId);

    /**
     * 客户userId查跟进员工
     *
     * @param userId
     * @return
     */
    List<EntmicroStaffResponse> getFollowerByCusUserId(@Param("userId") String userId);

    /**
     * 根据业务类型查询跟进员工列表
     *
     * @param merchantId
     * @param typeArray
     * @return
     */
    List<EntmicroStaffResponse> getEntmicroByBusinessType(@Param("merchantId") Integer merchantId,
                                                          @Param("typeArray") String[] typeArray);


    List<StaffFollowResponse> filterFollowerListByCondition(@Param("oneIds") List<String> oneIds, @Param("merchantId") Integer merchantId);

    List<EntmicroStaffResponse> findMerchantStartStaff(@Param("merchantStartStaffRequest") MerchantStartStaffRequest merchantStartStaffRequest);

    @MapKey("staff_id")
    Map<Integer, Map> findDepartByMerIdAndId(@Param("staffIds") List<Integer> collect, @Param("merchantId") Integer merchantId);

    Page<EntmicroStaffResponse> wechatDepositList(@Param("condition") WechatDepositRequest condition);

    EntmicroStaff findStaffByPhoneAndMerchantNo(@Param("loginCallBackModel") LoginCallBackModel loginCallBackModel);

    List<EntmicroStaffResponse> findMerchantListByUserIds(@Param("staffIds") List<Integer> staffIds);

    void automaticOffline();

    /**
     * 查询跟进专员列表
     *
     * @param entmicroFollowerStaffRequest
     * @return
     */
    List<EntmicroFollowerStaffResponse> listEntmicroFollower(EntmicroFollowerStaffRequest entmicroFollowerStaffRequest);

    Page<EntmicroStaffResponse> wechatDepositNotAccessList(@Param("condition") WechatDepositRequest condition);

    List<EntmicroStaff> findStaffByEncryptionIds(@Param("list") List<String> list);

    @MapKey("id")
    Map<Integer, Map> findFollowNameByIds(@Param("list") List<Integer> followTypeId);


    List<EntmicroStaff> findStaffByPhoneListAndMerchantNo(@Param("phoneList") List<String> phoneList,@Param("merchantNo")Integer merchantNo);

    List<EntmicroStaffResponse> findStaffListByPhone(@Param("entmicroStaffRequest") EntmicroStaffRequest entmicroStaffRequest);

    List<EntmicroStaffResponse> findStaffListByMerchantIdList(@Param("entmicroStaffRequest") EntmicroStaffRequest entmicroStaffRequest);

    List<EntmicroStaffResponse> findMerchantstaffDetail(@Param("list") List<StaffRequestDTO> staffByUUidList);
}