package com.lz.modules.app.service;

import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.service.IService;
import com.lz.common.utils.PageUtils;
import com.lz.modules.app.dto.*;
import com.lz.modules.app.entity.DepartmentsEntity;
import com.lz.modules.app.entity.StaffEntity;
import com.lz.modules.app.entity.StaffSimpleInfo;
import com.lz.modules.equipment.entity.model.FindByNameModel;
import com.lz.modules.flow.model.DepartManagers;
import com.lz.modules.job.model.responseBo.DepartmentStaffBo;
import com.lz.modules.sys.entity.SysUserEntity;

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

/**
 * 员工基本信息表
 *
 * @author fumeiai
 * @email fumeiai@linzikg.com
 * @date 2020-04-29 20:59:20
 */
public interface StaffService extends IService<StaffEntity> {

    PageUtils queryPage(Map<String, Object> params);

    boolean updateStaffsInfo(List<DepartmentStaffBo> staffs);

    StaffEntity getStaffInfoByOpenId(String openId);

    StaffEntity getByName(String name);

    List<StaffDto> getStaffInfos(int currentPage, int limit, String departmentId, String name, Integer staffStatus);

    int getStaffInfoCount(String departmentId, String name, Integer staffStatus);

    StaffBaseInfoDto getBaseInfo(Long staffId);

    StaffStatisticalDto getStatisticalData(String departmentId, String beginDate, String endDate);

    List<GraphicsStatisticalDto> getGenderData(String departmentId, String beginDate, String endDate);


    List<GraphicsStatisticalDto> getAgeData(String departmentId, String beginDate, String endDate);

    List<GraphicsStatisticalDto> getJobSeniorityData(String departmentId, String beginDate, String endDate);

    List<GraphicsStatisticalDto> getEducationData(String departmentId, String beginDate, String endDate);


    void enterDatabase(List<Map<String, String>> sheet12List, List<Map<String, String>> sheet3List, List<Map<String, String>> sheet4List);

    List<StaffEntity> selectByName(String name);

    List<StaffEntity> selectByIds(List<Long> staffIds);


    StaffEntity selectStaffById(Long id);


    Long insertStaff(StaffEntity staff);


    int updateStaffById(StaffEntity staff);


    int updateCoverStaffById(StaffEntity staff);


    int deleteStaffById(Long id);

    StaffEntity selectByPhone(String userName);

    StaffEntity selectStaffByEmployeeId(String employeeId);

    List<StaffEntity> selectBySearchName(IPage page, FindByNameModel nameModel);
    SysUserEntity getUser(String userName);

    //查询部门下的所有子部门
    List<String> selectAllDeparmentIdsByDepartmentParentId(String departmentId);

    //统计部门下的人
    List<String> staffsByAllDeparmentIds(List<String> deparmentIds);

    List<StaffEntity> selectAll();

    List<StaffSimpleDto> selectStaffSimpleInfoByIds(List<Long> ids);

    List<StaffDto> getDepatAllStaffInfos(String departmentId);

    List<StaffSimpleInfo> selectAllStaffSimpleInfos(DepartmentsEntity depart);

    List<StaffSimpleInfo> selectStaffSimpleInfos(List<Long> sIds);
    //查找第几及领导
    DepartManagers findLeader(Long id, Integer type);
    //查找在职的
    List<StaffEntity> selectOnJobByIds(List<Long> mIds);

    StaffSimpleInfo selectStaffSimpleInfo(Long staffId);

    List<StaffEntity> selectNamesByIds(List<Long> sIds);
    //获取绩效考核管理员
    List<StaffEntity> selectStaffsByGroupId(Long copyId);

    List<StaffEntity> findManger(Long recordId, int flowProcess);

    StaffEntity convertStaffEntity(DepartmentStaffBo staffBo);
}

