package com.zksy.pole.factory.impl;

import com.zksy.pole.domain.po.DgRelayControl;
import com.zksy.pole.domain.po.DgTimelyControl;
import com.zksy.pole.factory.IHandleCmd;
import com.zksy.pole.mapper.DgRelayControlMapper;
import com.zksy.pole.mapper.DgTimelyControlMapper;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

@Component
@Slf4j
public class HandleDgTimelyControlCmd implements IHandleCmd {
    @Autowired
    private DgTimelyControlMapper dgTimelyControlMapper;
    @Override
    public <T> String HandleCmdMethod(T data) {
        try {
            DgTimelyControl d = (DgTimelyControl) data;
            dgTimelyControlMapper.insert(d);
            return null;
        } catch (Exception e) {
            log.error("DgTimelyControl数据插入失败");
            return null;
        }
    }

}