majorkinddaoimpl.java

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

JAVA
40
字号
package com.y2.hr.config.majorkind.dao.impl;

import java.util.List;

import com.y2.hr.base.dao.impl.BaseDaoImpl;
import com.y2.hr.config.majorkind.bean.ConfigMajorKind;
import com.y2.hr.config.majorkind.dao.MajorKindDao;

public class MajorKindDaoImpl extends BaseDaoImpl implements MajorKindDao {

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

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

	public ConfigMajorKind getMajorKind(ConfigMajorKind majorKind) {
		String hql = "from ConfigMajorKind where majorKindName = '"
				+ majorKind.getMajorKindName()
				+ "' order by mfkId desc limit 1";
		List<?> list = this.get(hql);
		return list.size() > 0 ? (ConfigMajorKind) list.get(0) : null;
	}

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

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

⌨️ 快捷键说明

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