import request from '@/utils/request'

// 查询断奶记录列表
export function listWeaning_record(query) {
  return request({
    url: '/Weaning/weaning_record/list',
    method: 'get',
    params: query
  })
}

// 查询断奶记录详细
export function getWeaning_record(id) {
  return request({
    url: '/Weaning/weaning_record/' + id,
    method: 'get'
  })
}

// 新增断奶记录
export function addWeaning_record(data) {
  return request({
    url: '/Weaning/weaning_record',
    method: 'post',
    data: data
  })
}

// 修改断奶记录
export function updateWeaning_record(data) {
  return request({
    url: '/Weaning/weaning_record',
    method: 'put',
    data: data
  })
}

// 删除断奶记录
export function delWeaning_record(id) {
  return request({
    url: '/Weaning/weaning_record/' + id,
    method: 'delete'
  })
}

// 根据耳号查询羊只ID
export function getSheepIdByEarNumber(earNumber) {
  return request({
    url: '/Weaning/weaning_record/sheepId/' + earNumber,
    method: 'get'
  })
}