package cn.wisenergy.mapper;

import cn.wisenergy.model.app.WorkRole;
import cn.wisenergy.model.app.WorkUser;
import cn.wisenergy.model.dto.StatisticsTableDto;
import cn.wisenergy.model.dto.UserRoleDto;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Param;

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

/**
 * <p>
 *  Mapper 接口
 * </p>
 *
 * @author chenqi
 * @since 2021-01-19
 */
public interface WorkUserMapper extends BaseMapper<WorkUser> {

    WorkUser getUserInfo(Map<String, Object> map);

    List<WorkUser> getUserSortByStatus(Map<String, Object> map);


    /**
     * 根据id获取用户一些基本信息
     * @param userId
     * @return
     */
    WorkUser getUserById(Integer userId);

    Integer updateUserInfo(WorkUser user);

    /**
     * 获取用户主键、姓名、部门名称
     * @param userIds
     * @return
     */
    List<StatisticsTableDto> getStatisticsTableDtos(List<Integer> userIds);

    List<UserRoleDto> getUserRoleDto(@Param("status") Integer status,@Param("key") String key,@Param("deptId") Integer deptId,@Param("roleId") Integer roleId);


    List<WorkRole> getUserRole(Integer id);


    int updateStatusAndSubmitOrderById(@Param("userId") Integer userId,@Param("status") Integer status,@Param("submitOrder")Integer submitOrder);

}
