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

import com.huyi.service.base.entity.ZcFinanceBillRel;
import com.huyi.service.base.mapper.ZcFinanceBillRelMapper;
import com.huyi.service.base.service.IZcFinanceBillRelService;
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: ZcFinanceBillRelServiceImpl<br>
 * Description: IZcFinanceBillRelService实现 <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 ZcFinanceBillRelServiceImpl extends ServiceImpl<ZcFinanceBillRelMapper, ZcFinanceBillRel> implements IZcFinanceBillRelService {

    @Autowired
    private ZcFinanceBillRelMapper zcFinanceBillRelMapper;

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

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

    @Override
    @Transactional(rollbackFor = Exception.class)
    public void createZcFinanceBillRel(ZcFinanceBillRel zcFinanceBillRel) {
        this.save(zcFinanceBillRel);
    }

    @Override
    @Transactional(rollbackFor = Exception.class)
    public void updateZcFinanceBillRel(ZcFinanceBillRel zcFinanceBillRel) {
        this.saveOrUpdate(zcFinanceBillRel);
    }

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