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

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

    @Autowired
    private ZcFinanceSupplierQuotaMapper zcFinanceSupplierQuotaMapper;

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

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

    @Override
    @Transactional(rollbackFor = Exception.class)
    public void createZcFinanceSupplierQuota(ZcFinanceSupplierQuota zcFinanceSupplierQuota) {
        this.save(zcFinanceSupplierQuota);
    }

    @Override
    @Transactional(rollbackFor = Exception.class)
    public void updateZcFinanceSupplierQuota(ZcFinanceSupplierQuota zcFinanceSupplierQuota) {
        this.saveOrUpdate(zcFinanceSupplierQuota);
    }

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