package com.fourdage.dingding.service.impl;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.cache.annotation.Cacheable;
import org.springframework.stereotype.Service;

import com.fourdage.base.common.Constats;
import com.fourdage.base.dao.IBaseDao;
import com.fourdage.base.service.impl.BaseServiceImpl;
import com.fourdage.dingding.dao.IProcessCodeDao;
import com.fourdage.dingding.entity.ProcessCode;
import com.fourdage.dingding.service.IProcessCodeService;

@Service
public class ProcessCodeServiceImpl extends BaseServiceImpl<ProcessCode, Integer> implements IProcessCodeService{
	
	@Autowired
	private IProcessCodeDao dao;
	
    @Override
    public IBaseDao<ProcessCode, Integer> getBaseDao() {
        return this.dao;
    }
	
	public List<ProcessCode> findByRegion(String region){
		return dao.findByRegion(region);
	}
	
	public ProcessCode findByProcessCode(String processCode){
		return dao.findByProcessCode(processCode);
	}

	@Override
	@Cacheable(value = "processCodeCache", key = "#processCodeId")
	public ProcessCode findById(Integer processCodeId) {
		return dao.findOne(processCodeId);
	}
	
	

}
