import request from '@/utils/request';

/**
 * 查询巡检班组列表
 * @param query
 * @returns {*}
 */
export const listInspectionTeam = (query) => {
    return request({
        url: '/jdyw/inspectionTeam/list',
        method: 'get',
        params: query
    });
};
/**
 * 查询巡检班组信息详细
 * @param id
 */
export const getInspectionTeam = (id) => {
    return request({
        url: '/jdyw/inspectionTeam/' + id,
        method: 'get'
    });
};

/**
 * 新增巡检班组信息
 * @param data
 */
export const addInspectionTeam = (data) => {
    return request({
        url: '/jdyw/inspectionTeam',
        method: 'post',
        data: data
    });
};

/**
 * 修改巡检班组信息
 * @param data
 */
export const updateInspectionTeam = (data) => {
    return request({
        url: '/jdyw/inspectionTeam',
        method: 'put',
        data: data
    });
};

/**
 * 删除巡检班组信息
 * @param id
 */
export const delInspectionTeam = (id: string | number | Array<string | number>) => {
    return request({
        url: '/jdyw/inspectionTeam/' + id,
        method: 'delete'
    });
};

/**
 * 查询道路位置列表
 * @param query
 * @returns {*}
 */
export const listRoadSiteInfo = (query) => {
  return request({
      url: '/jdyw/roadSiteInfo/list',
      method: 'get',
      params: query
  });
};
/**
* 查询道路位置信息详细
* @param id
*/
export const getRoadSiteInfo = (id) => {
  return request({
      url: '/jdyw/roadSiteInfo/' + id,
      method: 'get'
  });
};

/**
* 新增道路位置信息
* @param data
*/
export const addRoadSiteInfo = (data) => {
  return request({
      url: '/jdyw/roadSiteInfo',
      method: 'post',
      data: data
  });
};

/**
* 修改道路位置信息
* @param data
*/
export const updateRoadSiteInfo = (data) => {
  return request({
      url: '/jdyw/roadSiteInfo',
      method: 'put',
      data: data
  });
};

/**
* 删除道路位置信息
* @param id
*/
export const delRoadSiteInfo = (id: string | number | Array<string | number>) => {
  return request({
      url: '/jdyw/roadSiteInfo/' + id,
      method: 'delete'
  });
};

/**
 * 查询巡检项列表
 * @param query
 * @returns {*}
 */
export const listInspectionItem = (query) => {
  return request({
      url: '/jdyw/inspectionItem/list',
      method: 'get',
      params: query
  });
};
/**
* 查询巡检项信息详细
* @param id
*/
export const getInspectionItem = (id) => {
  return request({
      url: '/jdyw/inspectionItem/' + id,
      method: 'get'
  });
};

/**
* 新增巡检项信息
* @param data
*/
export const addInspectionItem = (data) => {
  return request({
      url: '/jdyw/inspectionItem',
      method: 'post',
      data: data
  });
};

/**
* 修改巡检项信息
* @param data
*/
export const updateInspectionItem = (data) => {
  return request({
      url: '/jdyw/inspectionItem',
      method: 'put',
      data: data
  });
};

/**
* 删除巡检项信息
* @param id
*/
export const delInspectionItem = (id: string | number | Array<string | number>) => {
  return request({
      url: '/jdyw/inspectionItem/' + id,
      method: 'delete'
  });
};

/**
 * 查询巡检任务列表
 * @param query
 * @returns {*}
 */
export const listInspectionTask = (query) => {
  return request({
      url: '/jdyw/inspectionTask/list',
      method: 'get',
      params: query
  });
};
/**
* 查询巡检任务信息详细
* @param id
*/
export const getInspectionTask = (id) => {
  return request({
      url: '/jdyw/inspectionTask/' + id,
      method: 'get'
  });
};

/**
* 新增巡检任务信息
* @param data
*/
export const addInspectionTask = (data) => {
  return request({
      url: '/jdyw/inspectionTask',
      method: 'post',
      data: data
  });
};

/**
* 修改巡检任务信息
* @param data
*/
export const updateInspectionTask = (data) => {
  return request({
      url: '/jdyw/inspectionTask',
      method: 'put',
      data: data
  });
};

/**
* 删除巡检任务信息
* @param id
*/
export const delInspectionTask = (id: string | number | Array<string | number>) => {
  return request({
      url: '/jdyw/inspectionTask/' + id,
      method: 'delete'
  });
};
/**
* 查询巡检任务信息
* @param id
*/
export const getInspectionTaskInfoById = (id) => {
  return request({
      url: '/jdyw/inspectionTask/getInspectionTaskInfoById',
      method: 'get',
      params: {id}
  });
};

/**
* 新增巡检记录信息
* @param data
*/
export const addInspectionTaskRecord = (data) => {
  return request({
      url: '/jdyw/inspectionTaskRecord',
      method: 'post',
      data
  });
};
/**
* 修改巡检记录信息
* @param data
*/
export const updateInspectionTaskRecord = (data) => {
  return request({
      url: '/jdyw/inspectionTaskRecord',
      method: 'put',
      data
  });
};
/**
* 新增巡检执行明细
* @param data
*/
export const addInspectionTaskRecordDetails = (data) => {
  return request({
      url: '/jdyw/inspectionTaskRecordDetails',
      method: 'post',
      data
  });
};

/**
* 查询巡检记录信息
*/
export const getInspectionTaskRecordList = (query) => {
  return request({
      url: '/jdyw/inspectionTaskRecord/list',
      method: 'get',
      params: query
  });
};
/**
* 查询巡检记录明细列表根据记录id
*/
export const getListByRecordId = (query) => {
  return request({
      url: '/jdyw/inspectionTaskRecordDetails/getListByRecordId',
      method: 'get',
      params: query
  });
};

/**
* 查询巡检列表根据设备id
*/
export const getInspectionListByDeviceId = (query) => {
  return request({
      url: '/jdyw/inspectionTaskRecordDetails/getInspectionListByDeviceId',
      method: 'get',
      params: query
  });
};
