EntmicroStaffDepartRelationMapper.java 2.01 KB
package cn.com.glsx.entmicro.mapper;

import cn.com.glsx.entmicro.entity.EntmicroStaffDepartRelation;
import cn.com.glsx.entmicro.model.response.ChannelCodeStaffInfoResponse;
import cn.com.glsx.entmicro.model.response.EntmicroStaffFollowResponse;
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 EntmicroStaffDepartRelationMapper extends CommonBaseMapper<EntmicroStaffDepartRelation> {
    List<EntmicroStaffDepartRelation> findDepartByStaffId(@Param("staffId") Integer staffId);

    void deleteStaffDepartment(@Param("list") List<EntmicroStaffDepartRelation> deletelist);

    void deleteStaff(@Param("staffId") Integer staffId);

    /**
     * 主键id批量查员工
     *
     * @return
     */
    List<ChannelCodeStaffInfoResponse> getStaffByIdList(@Param("staffIdList") List<String> staffIdList,
                                                        @Param("merchantId")Integer merchantId);

    @MapKey("id")
    Map<Integer, EntmicroStaffDepartRelation> findByIds(@Param("ids") List<Integer> integerList);

    EntmicroStaffDepartRelation findByoneIds(@Param("oneIds") String oneIds);

    /**
     * 批量查找员工的UID
     * @param staffIdList
     * @param merchantId
     * @return
     */
    List<EntmicroStaffDepartRelation> findStaffUidDepartForMerchantList(@Param("staffIdList") List<Integer> staffIdList, @Param("merchantId") Integer merchantId);

    /**
     * 查询员工所在商户的UUID
     * @param staffId
     * @param merchantId
     * @return
     */
    EntmicroStaffDepartRelation findDepartByStaffIdForMerchant(@Param("staffId") Integer staffId, @Param("merchantId") Integer merchantId);

    /**
     * 根据员工id查询关联商户
     *
     * @param staffId   员工id
     * @return  商户列表
     */
    List<Integer> findRelevanceMerchantByStaffId(@Param("staffId") Integer staffId);
}