package com.huatek.busi.service.impl.transformer;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
import org.springframework.transaction.annotation.Transactional;

import com.alibaba.dubbo.config.annotation.Service;
import com.github.pagehelper.Page;
import com.github.pagehelper.PageHelper;
import com.huatek.busi.dto.TransformerTotDto;
import com.huatek.busi.entity.TransformerTot;
import com.huatek.busi.mapper.TransformerTotMapper;
import com.huatek.busi.service.impl.cac.AbstractCacEtlService;
import com.huatek.busi.service.transformer.TransformerTotService;
import com.huatek.busi.vo.TransformerTotVo;

/**
 * 变压器/电抗器——顶层油温：021005 ServiceImpl
 *
 * @author anker_cheng
 * @date Jun 26, 2019 1:11:48 PM
 */
@Component
@Service(interfaceClass = TransformerTotService.class)
@Transactional(rollbackFor = Exception.class)
public class TransformerTotServiceImpl extends AbstractCacEtlService<TransformerTot> implements TransformerTotService {

    @Autowired
    private TransformerTotMapper transformerTotMapper;

    @Override
    public Page<TransformerTotVo> findTransformerTotPage(TransformerTotDto transformerTotDto) {
        if (transformerTotDto.getPage() != null && transformerTotDto.getLimit() != null) {
            PageHelper.startPage(transformerTotDto.getPage(), transformerTotDto.getLimit());
        }
        Page<TransformerTotVo> transformerTots = transformerTotMapper.selectTransformerTotPage(transformerTotDto);
        return transformerTots;
    }
}