package com.chinacreator.process.dao;

import com.chinacreator.common.support.cache.annotation.CacheName;
import com.chinacreator.process.util.DataSource;
import com.frameworkset.common.poolman.SQLExecutor;
import org.springframework.cache.annotation.Cacheable;
import org.springframework.stereotype.Component;

import java.sql.SQLException;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

/**
 * 虚拟配置
 *
 */
@Component
@CacheName("virtual")
public class VirtualDao {

    @Cacheable(value="virtual",key = "#spid")
    public List<HashMap> getConfList(String spid) throws SQLException {
        System.out.println("查询数据库短信配置信息");
        String sql = "SELECT  CONTENTID , SPID  FROM TD_CONTENT_SPID_MAPPING  WHERE  STATUS ='0'  AND SPID = ?  ORDER BY  TO_NUMBER(SEQ) ";
        return SQLExecutor.queryListWithDBName(HashMap.class,DataSource.NET3G, sql,spid);
    }


}
