package com.zksy.pole.factory.impl;

import com.zksy.common.exception.DbException;
import com.zksy.pole.domain.po.DgEquipmentAlarm;
import com.zksy.pole.factory.IHandleCmd;
import com.zksy.pole.mapper.DgEquipmentAlarmMapper;
import lombok.extern.slf4j.Slf4j;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

@Component
@Slf4j
public class HandleDgEquipmentAlarmCmd implements IHandleCmd {

    @Autowired
    private DgEquipmentAlarmMapper dgEquipmentAlarmMapper;
    @Override
    public <T> String HandleCmdMethod(T data) {
        try {
            DgEquipmentAlarm d = (DgEquipmentAlarm) data;
            dgEquipmentAlarmMapper.insert(d);
            return null;
        } catch (Exception e) {
            log.error("DgEquipmentAlarm数据插入失败");
            return null;
        }
    }
}
