package com.goafanti.common.service;


import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.cache.annotation.CacheEvict;
import org.springframework.cache.annotation.Cacheable;
import org.springframework.stereotype.Service;

import com.goafanti.common.dao.EngagedFieldGlossoryMapper;
import com.goafanti.common.model.EngagedFieldGlossory;
import com.goafanti.common.utils.LoggerUtils;
@Service
public class EngagedFieldGlossoryService{
	private static final Logger	logger	= LoggerFactory.getLogger(EngagedFieldGlossoryService.class);
	
	@Autowired
	private EngagedFieldGlossoryMapper engagedFieldGlossoryMapper;
	
	@Cacheable(value = "EngagedFieldGlossoryCache", key = "'EngagedFieldGlossory:'+#id")
	public EngagedFieldGlossory selectByPrimaryKey(Integer id) {
		LoggerUtils.debug(logger, "缓存从事领域:[%s]", id);
		return engagedFieldGlossoryMapper.selectByPrimaryKey(id);
	}

	@CacheEvict(value = "EngagedFieldGlossoryCache", key = "'EngagedFieldGlossory:'+#id")
	public void clear(Integer id) {
		LoggerUtils.debug(logger, "清除从事领域缓存:[%s]", id);
	}
}
