package com.zcloud.service.commitment.impl;

import com.zcloud.entity.Page;
import com.zcloud.entity.PageData;
import com.zcloud.mapper.datasource.commitment.CorpPromiseMapper;
import com.zcloud.service.commitment.CorpPromiseService;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import javax.annotation.Resource;
import java.util.List;


/**
 * 说明：承诺书表
 * 作者：yangming
 * 时间：2022-12-29
 */

@Service
@Transactional //开启事物
public class CorpPromiseServiceImpl implements CorpPromiseService {

    @Resource
    private CorpPromiseMapper corpPromiseMapper;

    @Override
    public void save(PageData pd) throws Exception {
        corpPromiseMapper.save(pd);
    }

    @Override
    public List<PageData> list(Page page) throws Exception {
        return corpPromiseMapper.datalistPage(page);
    }

    @Override
    public void editdelete(PageData pd) throws Exception {
        corpPromiseMapper.editdelete(pd);
    }

    @Override
    public PageData findById(PageData pd) throws Exception {
        return corpPromiseMapper.findById(pd);
    }

    @Override
    public void edit(PageData pd) throws Exception {
        corpPromiseMapper.edit(pd);
    }

    @Override
    public List<PageData> listAll(Page page) throws Exception {
        return corpPromiseMapper.dataAlllistPage(page);
    }

    @Override
    public List<PageData> collateralall(PageData pd) throws Exception {
        return corpPromiseMapper.collateralall(pd);
    }

    @Override
    public void editpeople(PageData pd) throws Exception {
        corpPromiseMapper.editpeople(pd);
    }

    /**根据部门查询岗位列表(全部)
     * @param pd
     * @throws Exception
     */
    public List<PageData> postlistAll(PageData pd)throws Exception{
        return corpPromiseMapper.postlistAll(pd);
    }

    /**根据部门岗位查询用户列表(全部)
     * @param pd
     * @throws Exception
     */
    public List<PageData> listAllUser(PageData pd)throws Exception{
        return corpPromiseMapper.listAllUser(pd);
    }
}
