⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 viewdaoimpl.java

📁 企业人力资源管理
💻 JAVA
字号:
package com.y2.hr.engage.view.dao.impl;

import java.util.List;

import org.hibernate.Query;
import org.hibernate.Session;
import org.hibernate.Transaction;

import com.y2.hr.base.dao.impl.BaseDaoImpl;
import com.y2.hr.engage.resume.bean.EngageResume;
import com.y2.hr.engage.view.bean.EngageInterview;
import com.y2.hr.engage.view.dao.ViewDao;

public class ViewDaoImpl extends BaseDaoImpl implements ViewDao {

	// 根据面试编号查询出当前面试记录
	public EngageInterview getView(String resId) {
		String hql = "from EngageInterview where resumeId=" + resId;
		List<?> list = this.get(hql);
		return list.size() > 0 ? (EngageInterview) list.get(0) : null;
	}

	// 修改面试结果
	public boolean doMod(EngageInterview engageView, String result) {
		boolean flag = false;
		Session session = sessionFactory.openSession();
		EngageInterview view = (EngageInterview) session.get(
				EngageInterview.class, engageView.getEinId());
		Transaction trans = null;
		try {
			trans = session.beginTransaction();
			view.setResult(result);
			session.update(view);
			trans.commit();
			flag = true;
		} catch (Exception e) {
			if (null != trans) {
				trans.rollback();
			}
			e.printStackTrace();
		} finally {
			session.close();
		}
		return flag;
	}

	// 根据查询条件获出总记录数
	public int getCount(String condition) {
		String hql = "select count(e) from EngageInterview e " + condition;
		return this.sum(hql);
	}

	// 根据查询条件进行面试分页
	public List<?> getPage(int curPage, String condition) {
		String hql = "from EngageInterview " + condition;
		return super.getPage(hql, curPage);
	}

}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -