package com.blueland.service;

import com.baomidou.mybatisplus.annotation.InterceptorIgnore;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.IService;
import com.blueland.bo.RoleUserRest;
import com.blueland.bo.TreeEntity;
import com.blueland.bo.TucStaffEntity;
import com.blueland.model.TUcStaff;
import com.blueland.vo.StaffNumVO;
import com.blueland.vo.StaffPostVO;

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

/**
 * @auther xcy
 * @create 2022-05-09 16:51
 */
public interface ITucStaffService extends IService<TUcStaff> {

    Page<TucStaffEntity> getStaffInfoByOrgTop(TucStaffEntity staff);

    Page<TucStaffEntity> getSubStaffs(TucStaffEntity entity);

    Page<TucStaffEntity> getStaffByOrgs(TucStaffEntity entity);

    void deleteBycode(String staffCode);

    void updateByNum(TucStaffEntity model);

    void batchupdateStaffFax(List<TucStaffEntity> stafflist);

    TucStaffEntity getStaffByStaffId(String staffId);

    Page<RoleUserRest> getAppRoleUser(String appId, String roleId, String companyId, String deptId,
                                          String orgId, Integer curPage, Integer curPageSize);

    Page<RoleUserRest> getAppRoleUser2(String appId, String roleId, String companyId, String deptId,
                                      String orgId, Integer curPage, Integer curPageSize);

    List<TucStaffEntity> getAppRoleUserList(String appId, String roleId, String companyId, String deptId,
                                            String orgId);

    List<TreeEntity> searchUser(TucStaffEntity tucStaffEntity);

    List<TucStaffEntity> findListByName(TucStaffEntity tucStaffEntity);

    List<TucStaffEntity> getByStaffcodes(List<String> staffcodes);

    void updateDeptnameByDeptid(String orgName, String deptcode);

    void updateByStaffPhoneBak(String staffPhoneBak);

    void enablePassport(String staffId, String enableStatus);

    List<TucStaffEntity> getStaffList(String name);

    List<TucStaffEntity> getListByCodes(List<String> codes);

    Page<TucStaffEntity> findPage(TucStaffEntity bo);

    TUcStaff get(TucStaffEntity bo);

    List<TucStaffEntity> findList(TucStaffEntity bo);

    // 6.0.0版本
    /**
     *
     * 查询岗位信息集合
     * @return
     */
    List<StaffPostVO> findStaffPostList();

    /**
     * 根据岗位编码判断用户是否存在
     * @param postCode
     * @return
     */
    Long selectUserCount(String postCode);

    /**
     * 根据postCode删除员工
     * @param postCode
     */
    void deleteByPostCode(String postCode);

    /**
     * 根据postCode获取员工
     * @param postCode
     * @return
     */
    TucStaffEntity getStaffByPostCode(String postCode);

    /**
     * 根据postCode批量修改员工上级人工号
     * @param stafflist
     */
    void batchUpdateFaxByPostCode(List<TucStaffEntity> stafflist);

    /**
     * 根据PostCodes查询员工
     * @param codes
     * @return
     */
    List<TUcStaff> getListByPostCodes(List<String> codes);

    List<TUcStaff> getByStaffCode(String staffCode);

    TucStaffEntity getUserByCode(String staffCode);

    /**
     * 根据岗位编码集合查询工号
     * @param postCodes
     * @return
     */
    List<TucStaffEntity> selectStaffByPostCodes(List<String> postCodes);

    /**
     * 根据工号和部门id获取员工信息
     * @param staffNum 工号
     * @param deptId 部门id
     * @return
     */
    TucStaffEntity selectStaffByNumAndDept(String staffNum, String deptId);

    /**
     * 根据工号获取员工信息
     * @param staffNum 工号
     * @return
     */
    TucStaffEntity selectStaffByNum(String staffNum);

    List<TUcStaff> handleStaff(TucStaffEntity staff);

    List<TUcStaff> handleStaffToPostCode(TUcStaff staff);

    Integer countStaff(String id, String appId);

    Integer countStaffByNum(String num, String appId);

    void deleteStaffByAppId(String appId);
}
