package com.rrtx.services.db.service.impl;

import com.rrtx.services.db.entity.HeatingF;
import com.rrtx.services.db.mapper.HeatingFMapper;
import com.rrtx.services.db.service.IHeatingFService;
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.rrtx.fap.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: HeatingFServiceImpl<br>
 * Description: IHeatingFService实现 <br>
 * Company: rrtx
 *
 * @author zhangzz
 * @version v1.0.0    2021-02-02  zhangzz    由Generator自动创建
 */
@Service
@Transactional(propagation = Propagation.SUPPORTS, readOnly = true, rollbackFor = Exception.class)
public class HeatingFServiceImpl extends ServiceImpl<HeatingFMapper, HeatingF> implements IHeatingFService {

    @Autowired
    private HeatingFMapper heatingFMapper;

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

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

    @Override
    @Transactional(rollbackFor = Exception.class)
    public void createHeatingF(HeatingF heatingF) {
        this.save(heatingF);
    }

    @Override
    @Transactional(rollbackFor = Exception.class)
    public void updateHeatingF(HeatingF heatingF) {
        this.saveOrUpdate(heatingF);
    }

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