package com.wechat.service;

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

import javax.annotation.Resource;

import org.springframework.stereotype.Service;

import com.wechat.dao.MdePositionAnotherNameDao;
import com.wechat.model.dbEntity.MdePositionAnotherName;

@Service
public class MdePositionAnotherNameService {

	@Resource
	private MdePositionAnotherNameDao mdePositionAnotherNameDao;

	// 根据国际区分获取职位名称
	public List<MdePositionAnotherName> getAllPositionAnotherName() {
		return mdePositionAnotherNameDao.getAllPositionAnotherName();
	}

	// 根据职位类型，职位名称 查找记录
	public Boolean checkJobIsExists(int jobCode, String jobName) {
		Boolean flag = false;
		Map<String, Object> map = new HashMap<String, Object>();
		map.put("jobCode", jobCode);
		map.put("jobName", jobName);
		List<MdePositionAnotherName> list = mdePositionAnotherNameDao.getPositionRecord(map);
		if (list != null && list.size() > 0) {
			flag = true;
		}
		return flag;
	}
	
	public int insert(MdePositionAnotherName mdePositionAnotherName) {
		return mdePositionAnotherNameDao.insert(mdePositionAnotherName);
	}
}
