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

📄 salarystandardbiz.java

📁 hr伯乐管理系统!非常适合java学员做学习参考用!是用集成框架开发的Struts+hrbernet+Spring 开发的
💻 JAVA
字号:
package org.better.hr.biz;

import java.util.List;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.better.hr.comm.Util;
import org.better.hr.dao.SalaryStandardDao;
import org.better.hr.entity.SalaryStandard;
import org.better.hr.exception.HrException;

public class SalaryStandardBiz {
	
	private static final Log logger = LogFactory.getLog(ConfigFileFirstKindBiz.class);
	private SalaryStandardDao salarystandardDao;

	public SalaryStandardDao getSalarystandardDao() {
		return salarystandardDao;
	}

	public void setSalarystandardDao(SalaryStandardDao salarystandardDao) {
		this.salarystandardDao = salarystandardDao;
	}

	/**
	 * 根据ID号返回对象
	 * @param id 主键id
	 * @return 对象
	 * @throws HrException
	 */
	public SalaryStandard getbyID(java.io.Serializable id) throws HrException
	{
		try
		{
			return this.getSalarystandardDao().load(id);
		}
		catch (Exception ex) {
			logger.error(ex);
			throw new HrException(ex);
		}
	}
	
	/**
	 * 新增标准薪酬
	 * @param condition
	 * @throws HrException
	 */
	public void add(SalaryStandard condition) throws HrException {
		try {
			condition.setCheckStatus((short)0);  //设置复核状态为0
			
			condition.setRegistTime(Util.parseDate(condition.getStr_registeTime()));  //设置登记时间
			
			//保存到数据库
			this.getSalarystandardDao().add(condition);
		} catch (Exception ex) {
			logger.error(ex);
			throw new HrException(ex);
		}
	}
	
	/**
	 * 查询显示列表
	 * @param condition 包含查询条件的对象
	 * @return 查询结果列表
	 * @throws HrException
	 */
	public List list(SalaryStandard condition) throws HrException {
		try {
			return this.getSalarystandardDao().find(condition);
		} catch (Exception ex) {
			logger.error(ex);
			throw new HrException(ex);
		}
	}
	
	/**
	 * 查询最大主键值
	 * @return
	 */
	public String select()
	{
		List list = this.getSalarystandardDao().find();
		int id = 1;
		if(list.get(0) != null)
			id= ((Short)list.get(0)).intValue() + 1;
		
		return id<10?"0"+id:""+id;
	}
	/**
	 * 更新对象到数据库
	 * @param condition 已更新的对象
	 * @throws HrException
	 */
	public void update(SalaryStandard condition) throws HrException {
		try {
			this.getSalarystandardDao().update(condition);
		} catch (Exception ex) {
			logger.error(ex);
			throw new HrException(ex);
		}
	}
	
	/**
	 * 删除数据库对象
	 * @param id 对象的主键编号
	 * @throws HrException
	 */
	public void delete(java.io.Serializable id) throws HrException
	{
		try {
			this.getSalarystandardDao().delete(id);
		} catch (Exception ex) {
			logger.error(ex);
			throw new HrException(ex);
		}
	}
}

⌨️ 快捷键说明

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