package com.zksy.pole.factory.impl;

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

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