package com.nokia.alarm.mapper;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.jdbc.core.JdbcTemplate;
import org.springframework.stereotype.Component;

@Component
public class PgResultMapDao {

    @Autowired
    @Qualifier("pgJdbcTemplate")
    private JdbcTemplate jdbcTemplate;

    public void batchInsert(List<Object[]> data) {
        String sql = "insert into tsfx.dw_complain_realtime_alarm_h "
                + "(sdate,uniqueid,uniqueclearid,eventtime,canceltime,status,projectstatus,vendoralarmserial,alarmtitle,"
                + "vendorseverity,vendoralarmtype,specificproblem,specificproblemid,equipmentclass,equipmentname,locateneclass,"
                + "locatenename,province,region,city,grid,area,vendor,specialty,siteid,roomid,towersiteno,proequipmentstatus,"
                + "projectname,projectno,projectstarttime,projectendtime,worksendstatus,workstatus,workno,workarchivedtime,"
                + "workdutydep,worksendperson,alarmlogicclass,alarmlogicsubclass,standardalarmname,alarmseverity,standardalarmid,"
                + "effectonequipment,effectonbusiness,standardflag,networktype,equipmentdn,locatenedn,taccode,tacid,alarmtext) values "
                + "(?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?)";
        jdbcTemplate.batchUpdate(sql, data);
    }
}
