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.huatek.busi.dao.TransformerPdRecordDao;
import com.huatek.busi.entity.TransformerPdRecord;
import com.huatek.busi.mapper.TransformerPdRecordMapper;
import com.huatek.busi.service.transformer.TransformerPdRecordService;

/**
 * 变压器/电抗器——局部放电次数记录 ServiceImpl
 *
 * @author anker_cheng
 * @date Aug 12, 2019 7:18:32 PM
 */
@Component
@Service(interfaceClass = TransformerPdRecordService.class)
@Transactional(rollbackFor = Exception.class)
public class TransformerPdRecordServiceImpl implements TransformerPdRecordService {

    @Autowired
    private TransformerPdRecordMapper transformerPdRecordMapper;
    
    @Autowired
    private TransformerPdRecordDao transformerPdRecordDao;

	@Override
	public void insert(TransformerPdRecord record) {
		transformerPdRecordDao.add(record);
	}

	@Override
	public Long getCountBySensorCode(String sensorCode) {
		return transformerPdRecordMapper.selectCountBySensorCode( sensorCode);
	}

}