import { stringify } from 'qs';
import { request } from '@umijs/max';
import webpath from '@/utils/webPath';


export async function deleteByPrimaryKeyForProDept(params = {}) {
    return request(`/${webpath.portalwebpath}/web/api/service/prodept/delete?${stringify(params)}`);
}


export async function selectByPrimaryKeyForProDept(params = {}) {
    return request(`/${webpath.portalwebpath}/web/api/service/prodept/get?${stringify(params)}`);
}


export async function insertForProDept(params = {}) {
    return request(`/${webpath.portalwebpath}/web/api/service/prodept/insert`, {
        method: 'POST',
        data: {
            ...params,
            method: 'insert',
        },
    });
}


export async function updateForProDept(params = {}) {
    return request(`/${webpath.portalwebpath}/web/api/service/prodept/update`, {
        method: 'POST',
        data: {
            ...params,
            method: 'update',
        },
    });
}


export async function deleteByMapForProDept(params = {}) {
    return request(`/${webpath.portalwebpath}/web/api/service/prodept/deleteByMap`, {
        method: 'POST',
        data: {
            ...params,
            method: 'delete',
        },
    });
}


export async function updateByMapForProDept(params = {}) {
    return request(`/${webpath.portalwebpath}/web/api/service/prodept/updateByMap`, {
        method: 'POST',
        data: {
            ...params,
            method: 'update',
        },
    });
}


export async function getOneForProDept(params = {}) {
    return request(`/${webpath.portalwebpath}/web/api/service/prodept/getOne`, {
        method: 'POST',
        data: {
            ...params,
            method: 'fetch',
        },
    });
}



export async function getAllForProDept(params = {}) {
    return request(`/${webpath.portalwebpath}/web/api/service/prodept/getAll`, {
        method: 'POST',
        data: {
            ...params,
            method: 'fetch',
        },
    });
}


export async function queryPageForProDept(params = {}) {
    return request(`/${webpath.portalwebpath}/web/api/service/prodept/queryPage`, {
        method: 'POST',
        data: {
            ...params,
            method: 'fetch',
        },
    });
}


export async function countForProDept(params = {}) {
    return request(`/${webpath.portalwebpath}/web/api/service/prodept/count`, {
        method: 'POST',
        data: {
            ...params,
            method: 'fetch',
        },
    });
}

export async function insertBatchForProDept(params = {}) {
    return request(`/${webpath.portalwebpath}/web/api/service/prodept/insertBatch`, {
        method: 'POST',
        data: {
            ...params,
            method: 'insert',
        },
    });
}


export async function deleteBatchForProDept(params = {}) {
    return request(`/${webpath.portalwebpath}/web/api/service/prodept/deleteBatch`, {
        method: 'POST',
        data: {
            ...params,
            method: 'delete',
        },
    });
}


export async function updateBatchForProDept(params = {}) {
    return request(`/${webpath.portalwebpath}/web/api/service/prodept/updateBatch`, {
        method: 'POST',
        data: {
            ...params,
            method: 'update',
        },
    });
}
