// @ts-ignore
/* eslint-disable */

// 该文件自动生成，请勿手动修改！

// --------------------------------------------------------------------------
// 监测计划管理服务
// --------------------------------------------------------------------------

import { request } from '@umijs/max';

/** 添加监测计划 POST /api/exam/plan/add */
export async function add(data: API.AddExamPlanInput, options?: { [key: string]: any }) {
    const url = '/api/exam/plan/add';
    const config = { method: 'POST', data, ...(options || {}) };
    const res = await request<API.ResponseType<any>>(url, config);
    return res?.data;
}

/** 更新监测计划 POST /api/exam/plan/update */
export async function update(data: API.UpdateExamPlanInput, options?: { [key: string]: any }) {
    const url = '/api/exam/plan/update';
    const config = { method: 'POST', data, ...(options || {}) };
    const res = await request<API.ResponseType<any>>(url, config);
    return res?.data;
}

/** 删除监测计划 POST /api/exam/plan/del */
export async function del(data: API.BaseId, options?: { [key: string]: any }) {
    const url = '/api/exam/plan/del';
    const config = { method: 'POST', data, ...(options || {}) };
    const res = await request<API.ResponseType<any>>(url, config);
    return res?.data;
}

/** 开始监测 POST /api/exam/plan/start */
export async function start(data: API.BaseId, options?: { [key: string]: any }) {
    const url = '/api/exam/plan/start';
    const config = { method: 'POST', data, ...(options || {}) };
    const res = await request<API.ResponseType<any>>(url, config);
    return res?.data;
}

/** 结束监测 POST /api/exam/plan/stop */
export async function stop(data: API.BaseId, options?: { [key: string]: any }) {
    const url = '/api/exam/plan/stop';
    const config = { method: 'POST', data, ...(options || {}) };
    const res = await request<API.ResponseType<any>>(url, config);
    return res?.data;
}

/** 取消监测 POST /api/exam/plan/cancel */
export async function cancel(data: API.BaseId, options?: { [key: string]: any }) {
    const url = '/api/exam/plan/cancel';
    const config = { method: 'POST', data, ...(options || {}) };
    const res = await request<API.ResponseType<any>>(url, config);
    return res?.data;
}

/** 根据ID获取监测计划 GET /api/exam/plan/get-by-id */
export async function getById(
    params: {
        /**  */
        id: number;
    },
    options?: { [key: string]: any },
) {
    const url = '/api/exam/plan/get-by-id';
    const config = { method: 'GET', params, ...(options || {}) };
    const res = await request<API.ResponseType<API.ExamPlanOutput>>(url, config);
    return res?.data;
}

/** 分页查询监测计划列表 POST /api/exam/plan/query-page-list */
export async function queryPageList(data: API.ExamPlanPageInput, options?: { [key: string]: any }) {
    const url = '/api/exam/plan/query-page-list';
    const config = { method: 'POST', data, ...(options || {}) };
    const res = await request<API.ResponseType<API.PageResponse<API.ExamPlanOutput>>>(url, config);
    return res?.data;
}

/** 获取我的单据状态数量 POST /api/exam/plan/query-status-count */
export async function queryStatusCount(
    data: API.ExamPlanPageInput,
    options?: { [key: string]: any },
) {
    const url = '/api/exam/plan/query-status-count';
    const config = { method: 'POST', data, ...(options || {}) };
    const res = await request<API.ResponseType<API.StatusCount[]>>(url, config);
    return res?.data;
}

/** 获取最近5个抽测参照成绩监测计划 GET /api/exam/plan/get-sample-ref-plan-list */
export async function getSampleRefPlanList(
    params: {
        /**  */
        id?: number;
    },
    options?: { [key: string]: any },
) {
    const url = '/api/exam/plan/get-sample-ref-plan-list';
    const config = { method: 'GET', params, ...(options || {}) };
    const res = await request<API.ResponseType<API.ExamPlanOutput[]>>(url, config);
    return res?.data;
}

export default {
    /** 添加监测计划 POST /api/exam/plan/add */
    add,
    /** 更新监测计划 POST /api/exam/plan/update */
    update,
    /** 删除监测计划 POST /api/exam/plan/del */
    del,
    /** 开始监测 POST /api/exam/plan/start */
    start,
    /** 结束监测 POST /api/exam/plan/stop */
    stop,
    /** 取消监测 POST /api/exam/plan/cancel */
    cancel,
    /** 根据ID获取监测计划 GET /api/exam/plan/get-by-id */
    getById,
    /** 分页查询监测计划列表 POST /api/exam/plan/query-page-list */
    queryPageList,
    /** 获取我的单据状态数量 POST /api/exam/plan/query-status-count */
    queryStatusCount,
    /** 获取最近5个抽测参照成绩监测计划 GET /api/exam/plan/get-sample-ref-plan-list */
    getSampleRefPlanList,
};
