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

import com.huyi.service.base.entity.ZcFinanceProComRel;
import com.huyi.service.base.mapper.ZcFinanceProComRelMapper;
import com.huyi.service.base.service.IZcFinanceProComRelService;
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: ZcFinanceProComRelServiceImpl<br>
 * Description: IZcFinanceProComRelService实现 <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 ZcFinanceProComRelServiceImpl extends ServiceImpl<ZcFinanceProComRelMapper, ZcFinanceProComRel> implements IZcFinanceProComRelService {

    @Autowired
    private ZcFinanceProComRelMapper zcFinanceProComRelMapper;

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

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

    @Override
    @Transactional(rollbackFor = Exception.class)
    public void createZcFinanceProComRel(ZcFinanceProComRel zcFinanceProComRel) {
        this.save(zcFinanceProComRel);
    }

    @Override
    @Transactional(rollbackFor = Exception.class)
    public void updateZcFinanceProComRel(ZcFinanceProComRel zcFinanceProComRel) {
        this.saveOrUpdate(zcFinanceProComRel);
    }

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