package com.platform.service.impl;

import java.util.List;

import javax.annotation.Resource;

import org.springframework.stereotype.Service;

import com.platform.dao.EncodeInfoDao;
import com.platform.entities.EncodedInfoEntity;
import com.platform.service.EncodeInfoService;

/**
 * 行政区划/系统业务逻辑的具体实现类
 * 
 * @author wuming
 * 
 */
@Service("encodeInfoService")
public class EncodeInfoServiceImpl implements EncodeInfoService {

	@Resource(name = "encodeInfoDao")
	private EncodeInfoDao eiDao;

	public void setEiDao(EncodeInfoDao eiDao) {
		this.eiDao = eiDao;
	}

	/**
	 * 根据传递的tableName参数获取对应实体信息（行政区划/系统）
	 */
	@Override
	public List<EncodedInfoEntity> getAllEncodeInfo(String tableName) {
		return eiDao.getAllEntityInfo(tableName);

	}

	/**
	 * 测试事物
	 */
	@Override
	public int deleteEncodeByCode(String code, String tableName) {
		// TODO Auto-generated method stub
		int cursor = eiDao.deleteEncodeByCode(code, tableName);
		return cursor;
	}

	@Override
	public String getEncodeNameByCode(String code, String tableName) {
		return eiDao.getEncodeNameByCode(code, tableName);
	}
}
