package com.wechat.dao;

import java.util.Map;

import org.springframework.stereotype.Repository;

import com.wechat.global.base.dao.Pagination;
import com.wechat.global.base.dao.PagingResult;
import com.wechat.global.base.dao.impl.BaseDao;
import com.wechat.model.dbEntity.MdeJobInvitationRel;
import com.wechat.model.responseDto.HotelInvitationInfoResp;

/**
 * 单表生成DAO接口
 * 
 * @author zhouyd
 * @version 2018-06-28
 */

@Repository
public class MdeJobInvitationRelDao extends BaseDao {

	public int insert(MdeJobInvitationRel mdeJobInvitationRel) {
		return super.insert("MdeJobInvitationRelMapper.insert", mdeJobInvitationRel);
	}

	/**
	 * 获取用户收到的企业邀请信息
	 * 
	 * @param userCode
	 * @return
	 */
	public PagingResult<HotelInvitationInfoResp> getRecievedHotelInvationInfo(Pagination pagination) {
		return super.selectPagination("MdeJobInvitationRelMapper.getRecievedHotelInvationInfo",
				"MdeJobInvitationRelMapper.getRecievedHotelInvationInfoCount", pagination);
	}

	/**
	 * 更新职位状态
	 * 
	 * @param params
	 * @return
	 */
	public int updateStatus(Map<String, Object> params) {
		return sqlSession.update("MdeJobInvitationRelMapper.updateStatus", params);
	}
	
	/**
	 * 查看该用户是否被邀请
	 * jobId 
	 * userCode
	 * @return
	 */
	public MdeJobInvitationRel passiveInvitation(Map<String,Object> maps) {
		return super.selectOne("MdeJobInvitationRelMapper.passiveInvitation", maps);
	}
}
