package com.chinacreator.process.dao;

import com.chinacreator.common.dao.CacheableDao;
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;


@Component
@CacheName("Dictionary")
public class DictionaryDao extends CacheableDao{

	@Cacheable(value="Dictionary", key="#name")
	public  String getValue(String name) throws SQLException {
		System.out.println("查询数据库");
		String sql = "select value from TB_DICTIONRY_INFO where name = ?";
		return SQLExecutor.queryFieldWithDBName(DataSource.NET3G, sql, name);
	}
}
