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

import com.rrtx.services.db.entity.HeatingJ;
import com.rrtx.services.db.mapper.HeatingJMapper;
import com.rrtx.services.db.service.IHeatingJService;
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: HeatingJServiceImpl<br>
 * Description: IHeatingJService实现 <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 HeatingJServiceImpl extends ServiceImpl<HeatingJMapper, HeatingJ> implements IHeatingJService {

    @Autowired
    private HeatingJMapper heatingJMapper;

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

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

    @Override
    @Transactional(rollbackFor = Exception.class)
    public void createHeatingJ(HeatingJ heatingJ) {
        this.save(heatingJ);
    }

    @Override
    @Transactional(rollbackFor = Exception.class)
    public void updateHeatingJ(HeatingJ heatingJ) {
        this.saveOrUpdate(heatingJ);
    }

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