package com.dayou.mapper;

import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.dayou.bo.LeaderRatioBO;
import com.dayou.common.PullDownModel;
import com.dayou.entity.User;
import com.dayou.dao.CustomBaseMapper;
import com.dayou.vo.IdNameVO;
import com.dayou.vo.UserVO;
import org.apache.ibatis.annotations.Param;
import org.springframework.web.bind.annotation.PathVariable;

import java.util.List;
import java.util.Set;

/**
 * <p>
 * 基础用户 Mapper 接口
 * </p>
 *
 * @author wucl
 * @since 2022-11-29
 */
public interface UserMapper extends CustomBaseMapper<User> {

    void saveOrUpdateById(@Param("user") User user);

    Page<UserVO> xPage(Page page, @Param("userVO") UserVO userVO);

    UserVO detail(@Param("id") Long id);

    Set<Long> getDepartmentIdByUserId(@Param("userId") Long userId);

    List<User> simplePostName(@Param("postName") String postName);

    List<UserVO> listPostName(@Param("postName") String postName);


    List<IdNameVO> usersByDepartment(@Param("departmentName")String departmentName);

    List<IdNameVO> usersByDepartments(@Param("list") List<String> list);

    List<IdNameVO> usersByDepartmentIds(@Param("set") Set<Long> set);

    List<User> byDepartmentId(@Param("departmentId") Long departmentId);

    List<PullDownModel> allotDepartmentUsers(@Param("departmentIds") Set<Long> departmentIds);

    List<User> infoPostName(@Param("postName") String postName);

    /**
     * 获取资产评估师用户
     * @return List<User>
     */
    List<User> byAssetEvaluator();

    /**
     * 根据部门名称获取部门及其下辖部门人员
     * @param depName 部门
     * @return List<User>
     */
    List<User> byDepartmentName(@Param("depName") String depName);
}
