/**
 * Copyright &copy; 2012-2016 <a href="https://github.com/thinkgem/jeesite">JeeSite</a> All rights reserved.
 */
package com.wechat.dao;

import java.util.List;

import org.springframework.stereotype.Repository;

import com.wechat.global.base.dao.impl.BaseDao;
import com.wechat.model.dbEntity.MdeUserCv;
import com.wechat.model.dto.UserCvInfo;

/**
 * 单表生成DAO接口
 * @author tangwc
 * @version 2018-05-23
 */
@Repository
public class MdeUserCvDao extends BaseDao {
	
	public MdeUserCv getInfoById(long cvId,String userCode) {
		MdeUserCv userCv = new MdeUserCv();
		userCv.setCvId(cvId);
		userCv.setUserCode(userCode);
        return super.selectOne("MdeUserCvMapper.get", userCv);
    }
	
	//查询该简历是否被投递
	public List<UserCvInfo> getCvUsed(long cvId,String userCode) {
		MdeUserCv userCv = new MdeUserCv();
		userCv.setCvId(cvId);
		userCv.setUserCode(userCode);
        return super.select("MdeUserCvMapper.getCvUsed", userCv);
    }

	public List<MdeUserCv> getUserCVList(String userCode) {
		// TODO Auto-generated method stub
		return super.select("MdeUserCvMapper.getUserCVList", userCode);
	}

	public int deleteUserCv(long cvId,String userCode) {
		MdeUserCv userCv = new MdeUserCv();
		userCv.setCvId(cvId);
		userCv.setUserCode(userCode);
		return super.update("MdeUserCvMapper.delete", userCv);
	}

	public int insert(MdeUserCv userCv) {
		return super.insert("MdeUserCvMapper.insert", userCv);
	}
}