import request from "@/util/oaRequest"

// 员工
export function listEmployee(query) {
  return request({
    url: '/hrm/employee/list',
    method: 'get',
    params: query
  })
}

export function allEmployee(query) {
  return request({
    url: '/hrm/employee/all',
    method: 'get',
    params: query
  })
}

export function addEmployee(data) {
  return request({
    url: '/hrm/employee',
    method: 'post',
    data
  })
}

export function updateEmployee(data) {
  return request({
    url: '/hrm/employee',
    method: 'put',
    data
  })
}

export function delEmployee(empIds) {
  return request({
    url: `/hrm/employee/${empIds}`,
    method: 'delete'
  })
}

export function getEmployee(empId) {
  return request({
    url: `/hrm/employee/${empId}`,
    method: 'get'
  })
}

// 根据用户ID获取员工信息
export function getEmployeeByUserId(userId) {
  return request({
    url: `/hrm/employee/byUserId/${userId}`,
    method: 'get'
  })
}
