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

import com.huyi.service.base.entity.TeCityInf;
import com.huyi.service.base.mapper.TeCityInfMapper;
import com.huyi.service.base.service.ITeCityInfService;
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: TeCityInfServiceImpl<br>
 * Description: ITeCityInfService实现 <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 TeCityInfServiceImpl extends ServiceImpl<TeCityInfMapper, TeCityInf> implements ITeCityInfService {

    @Autowired
    private TeCityInfMapper teCityInfMapper;

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

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

    @Override
    @Transactional(rollbackFor = Exception.class)
    public void createTeCityInf(TeCityInf teCityInf) {
        this.save(teCityInf);
    }

    @Override
    @Transactional(rollbackFor = Exception.class)
    public void updateTeCityInf(TeCityInf teCityInf) {
        this.saveOrUpdate(teCityInf);
    }

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