package com.huyi.service.base.service.impl;

import com.huyi.service.base.entity.PubApprovalProcess;
import com.huyi.service.base.mapper.PubApprovalProcessMapper;
import com.huyi.service.base.service.IPubApprovalProcessService;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.transaction.annotation.Propagation;
import org.springframework.beans.factory.annotation.Autowired;
import com.keao.tianhu.starter.mybatis.plus.entity.QueryRequest;

import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;



import java.util.List;

/**
 * ClassName: PubApprovalProcessServiceImpl<br>
 * Description: IPubApprovalProcessService实现 <br>
 * Company: keao
 *
 * @author xuefy
 * @version v1.0.0    2021-08-16  xuefy    由Generator自动创建
 */
@Service
@Transactional(propagation = Propagation.SUPPORTS, readOnly = true, rollbackFor = Exception.class)
public class PubApprovalProcessServiceImpl extends ServiceImpl<PubApprovalProcessMapper, PubApprovalProcess> implements IPubApprovalProcessService {

    @Autowired
    private PubApprovalProcessMapper pubApprovalProcessMapper;

    @Override
    public IPage<PubApprovalProcess> findPubApprovalProcesss(QueryRequest request, LambdaQueryWrapper<PubApprovalProcess> wrapper) {
        Page<PubApprovalProcess> page = new Page<>(request.getPageNum(), request.getPageSize());
        return this.page(page, wrapper);
    }

    @Override
    public List<PubApprovalProcess> findPubApprovalProcesss(LambdaQueryWrapper<PubApprovalProcess> wrapper) {
		return this.list(wrapper);
    }

    @Override
    @Transactional(rollbackFor = Exception.class)
    public void createPubApprovalProcess(PubApprovalProcess pubApprovalProcess) {
        this.save(pubApprovalProcess);
    }

    @Override
    @Transactional(rollbackFor = Exception.class)
    public void updatePubApprovalProcess(PubApprovalProcess pubApprovalProcess) {
        this.saveOrUpdate(pubApprovalProcess);
    }

    @Override
    @Transactional(rollbackFor = Exception.class)
    public void deletePubApprovalProcess(LambdaQueryWrapper<PubApprovalProcess> wrapper) {
	    this.remove(wrapper);
	}
}
