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

import com.huyi.service.base.entity.ZcBillInf;
import com.huyi.service.base.mapper.ZcBillInfMapper;
import com.huyi.service.base.service.IZcBillInfService;
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: ZcBillInfServiceImpl<br>
 * Description: IZcBillInfService实现 <br>
 * Company: keao
 *
 * @author xuefy
 * @version v1.0.0    2021-08-20  xuefy    由Generator自动创建
 */
@Service
@Transactional(propagation = Propagation.SUPPORTS, readOnly = true, rollbackFor = Exception.class)
public class ZcBillInfServiceImpl extends ServiceImpl<ZcBillInfMapper, ZcBillInf> implements IZcBillInfService {

    @Autowired
    private ZcBillInfMapper zcBillInfMapper;

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

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

    @Override
    @Transactional(rollbackFor = Exception.class)
    public void createZcBillInf(ZcBillInf zcBillInf) {
        this.save(zcBillInf);
    }

    @Override
    @Transactional(rollbackFor = Exception.class)
    public void updateZcBillInf(ZcBillInf zcBillInf) {
        this.saveOrUpdate(zcBillInf);
    }

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