package com.tofly.xrtygis.custom.mapper;

import com.tofly.xrtygis.entity.Warn;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;
import org.springframework.data.repository.query.Param;

import java.util.List;
import java.util.Map;

/**
 * @author 20126
 */
@Mapper
public interface CustomPollSourceMapper {

    /**
     * 添加信息到报警历史表
     * @param tableName 表名
     * @return true
     */
    boolean insertWarnHistory(@Param("tableName") String tableName,@Param("id") Long id,@Param("maxId") Long maxId);

    /**
     * 判断数据表是否存在
     * @param tableName 表面
     * @return list
     */
    List<String> doesItExistTable(@Param("tableName") String tableName);

    boolean closeWarnHistory(@Param("table") String table,@Param("id") String id);

    boolean insertWarn(@Param("warn") Warn warn);

    @Select("select id, typename from TF_YWPN_POLLTYPE_W")
    List<Map> getPollUte();
}
