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

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.GisRcWaveformDto;
import com.huatek.busi.entity.GisRcWaveform;
import com.huatek.busi.mapper.GisRcWaveformMapper;
import com.huatek.busi.service.gis.GisRcWaveformService;
import com.huatek.busi.service.impl.cac.AbstractCacEtlService;
import com.huatek.busi.vo.GisRcWaveformVo;

/**
 * 断路器/GIS——分合闸线圈电流波形：024002 ServiceImpl
 *
 * @author anker_cheng
 * @date Jun 26, 2019 1:11:48 PM
 */
@Component
@Service(interfaceClass = GisRcWaveformService.class)
@Transactional(rollbackFor = Exception.class)
public class GisRcWaveformServiceImpl extends AbstractCacEtlService<GisRcWaveform> implements GisRcWaveformService {

    @Autowired
    private GisRcWaveformMapper gisRcWaveformMapper;

    @Override
    public Page<GisRcWaveformVo> findGisRcWaveformPage(GisRcWaveformDto gisRcWaveformDto) {
        if (gisRcWaveformDto.getPage() != null && gisRcWaveformDto.getLimit() != null) {
            PageHelper.startPage(gisRcWaveformDto.getPage(), gisRcWaveformDto.getLimit());
        }
        Page<GisRcWaveformVo> gisRcWaveforms = gisRcWaveformMapper.selectGisRcWaveformPage(gisRcWaveformDto);
        return gisRcWaveforms;
    }
}