package com.huatek.busi.service.impl;

import com.alibaba.dubbo.config.annotation.Service;
import com.huatek.busi.entity.RDlDataRecord;
import com.huatek.busi.entity.RGenDataRecord;
import com.huatek.busi.entity.RMasterDataRecord;
import com.huatek.busi.service.IRDlDataRecordService;
import com.huatek.busi.service.IRGenDataRecordService;
import com.huatek.busi.service.IRMasterDataRecordService;
import com.huatek.frame.base.util.BeanUtils;
import com.huatek.torch.sql.dao.impl.BaseDao;
import org.springframework.stereotype.Component;
import org.springframework.transaction.annotation.Transactional;

@Component
@Service(interfaceClass = IRGenDataRecordService.class)
@Transactional(rollbackFor = Exception.class)
public class RGenDataRecordServiceImpl extends BaseDao<RGenDataRecord, String> implements IRGenDataRecordService {

    @Override
    public int insert(RMasterDataRecord rMasterDataRecord){
        RGenDataRecord rGenDataRecord = new RGenDataRecord();
        BeanUtils.copyProperties(rMasterDataRecord, rGenDataRecord);
        return this.addLocal(rGenDataRecord);
    }
}
