majordaoimpl.java

来自「企业人力资源管理」· Java 代码 · 共 45 行

JAVA
45
字号
package com.y2.hr.config.major.dao.impl;

import java.util.List;

import com.y2.hr.base.dao.impl.BaseDaoImpl;
import com.y2.hr.config.major.bean.ConfigMajor;
import com.y2.hr.config.major.dao.MajorDao;

public class MajorDaoImpl extends BaseDaoImpl implements MajorDao {

	public ConfigMajor getMajor(String makId) {
		String hql = "from ConfigMajor where makId = " + makId;
		List<?> list = this.get(hql);
		return list.size() > 0 ? (ConfigMajor) list.get(0) : null;
	}

	public boolean isMajorKindId(String majorKindId) {
		String hql = "from ConfigMajor where majorKindId ='" + majorKindId
				+ "'";
		return this.get(hql).size() > 0 ? true : false;
	}

	public ConfigMajor getMajor(ConfigMajor major) {
		String hql = "from ConfigMajor where majorName = '"
				+ major.getMajorName() + "' order by makId desc limit 1";
		List<?> list = this.get(hql);
		return list.size() > 0 ? (ConfigMajor) list.get(0) : null;
	}

	public List<?> getPage(int curPage) {
		String hql = "from ConfigMajor";
		return this.getPage(hql, curPage);
	}

	public int sum() {
		String hql = "select count(m) from ConfigMajor m";
		return this.sum(hql);
	}

	public List<?> getMajor() {
		String hql = "from ConfigMajor";
		return this.get(hql);
	}
}

⌨️ 快捷键说明

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