📄 configpubliccharbiz.java
字号:
package org.better.hr.biz;
import java.util.HashMap;
import java.util.List;
import java.util.Vector;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.better.hr.dao.ConfigPublicCharDao;
import org.better.hr.entity.ConfigPublicChar;
import org.better.hr.exception.HrException;
public class ConfigPublicCharBiz {
private static final Log logger = LogFactory.getLog(ConfigPublicCharBiz.class);
private ConfigPublicCharDao configpubliccharDao;
public ConfigPublicCharDao getConfigpubliccharDao() {
return configpubliccharDao;
}
public void setConfigpubliccharDao(ConfigPublicCharDao configpubliccharDao) {
this.configpubliccharDao = configpubliccharDao;
}
/**
* 根据ID号返回对象
* @param id 主键id
* @return 对象
* @throws HrException
*/
public ConfigPublicChar getbyID(java.io.Serializable id) throws HrException
{
try
{
return (ConfigPublicChar)this.getConfigpubliccharDao().load(ConfigPublicChar.class,id);
}
catch (Exception ex) {
logger.error(ex);
throw new HrException(ex);
}
}
/**
* 新增
* @param cfsk 新增的对象
* @return 新产生的职位分类编号
* @throws HrException
*/
public void add(ConfigPublicChar condition) throws HrException {
try {
// 保存到数据库
this.getConfigpubliccharDao().add(condition);
} catch (Exception ex) {
logger.error(ex);
throw new HrException(ex);
}
}
/**
* 查询人力资源表中所需字段
* @param condition 包含查询条件的对象
* @return 查询结果列表
* @throws HrException
*/
public HashMap listForHumanFile(ConfigPublicChar condition) throws HrException {
ConfigPublicChar cpc;
HashMap hashmap = new HashMap();
Vector nationality = new Vector();
Vector race = new Vector();
Vector religion = new Vector();
Vector party = new Vector();
Vector educatedyears = new Vector();
Vector educateddegree = new Vector();
Vector major = new Vector();
Vector speciality = new Vector();
Vector hobby = new Vector();
Vector designation = new Vector();
try {
List list = this.getConfigpubliccharDao().find(condition);
for(int i = 0 ; i < list.size() ; i++)
{
cpc = (ConfigPublicChar)list.get(i);
if(cpc.getAttributeKind().equals("国籍"))
nationality.add(cpc.getAttributeName());
else if(cpc.getAttributeKind().equals("民族"))
race.add(cpc.getAttributeName());
else if(cpc.getAttributeKind().equals("宗教信仰"))
religion.add(cpc.getAttributeName());
else if(cpc.getAttributeKind().equals("政治面貌"))
party.add(cpc.getAttributeName());
else if(cpc.getAttributeKind().equals("教育年限"))
educatedyears.add(cpc.getAttributeName());
else if(cpc.getAttributeKind().equals("学历"))
educateddegree.add(cpc.getAttributeName());
else if(cpc.getAttributeKind().equals("专业"))
major.add(cpc.getAttributeName());
else if(cpc.getAttributeKind().equals("特长"))
speciality.add(cpc.getAttributeName());
else if(cpc.getAttributeKind().equals("爱好"))
hobby.add(cpc.getAttributeName());
else if(cpc.getAttributeKind().equals("职称"))
designation.add(cpc.getAttributeName());
}
hashmap.put("国籍", nationality);
hashmap.put("民族", race);
hashmap.put("宗教信仰", religion);
hashmap.put("政治面貌", party);
hashmap.put("教育年限", educatedyears);
hashmap.put("学历", educateddegree);
hashmap.put("专业", major);
hashmap.put("特长", speciality);
hashmap.put("爱好", hobby);
hashmap.put("职称", designation);
return hashmap;
} catch (Exception ex) {
logger.error(ex);
throw new HrException(ex);
}
}
/**
* 查询所有总类为薪酬设置的值
* @param condition
* @return
* @throws HrException
*/
public List listForSalary(ConfigPublicChar condition) throws HrException {
try {
List list = this.getConfigpubliccharDao().find("from ConfigPublicChar c where c.attributeKind = ?",new String[]{"薪酬设置"});
return list;
} catch (Exception ex) {
logger.error(ex);
throw new HrException(ex);
}
}
/**
* 查询所有总类为职称的值
* @param condition
* @return
* @throws HrException
*/
public List listForProfession(ConfigPublicChar condition) throws HrException {
try {
List list = this.getConfigpubliccharDao().find("from ConfigPublicChar c where c.attributeKind = ?",new String[]{"职称"});
return list;
} catch (Exception ex) {
logger.error(ex);
throw new HrException(ex);
}
}
/**
* 查询所有记录,除薪酬设置和职称
* @return
* @throws HrException
*/
public List list() throws HrException{
try{
List list = this.getConfigpubliccharDao().find("from ConfigPublicChar c where c.attributeKind != ? and c.attributeKind != ? order by c.attributeKind",new String[]{"薪酬设置","职称"});
return list;
}catch(Exception ex)
{
logger.error(ex);
throw new HrException(ex);
}
}
/**
* 查询所有符合条件的记录
* @return
* @throws HrException
*/
public List list(ConfigPublicChar condition) throws HrException{
try{
List list = this.getConfigpubliccharDao().find(condition);
return list;
}catch(Exception ex)
{
logger.error(ex);
throw new HrException(ex);
}
}
/**
* 查询有关奖励属性的值
* @param condition
* @return
* @throws HrException
*/
public HashMap listForBouns(ConfigPublicChar condition) throws HrException {
ConfigPublicChar cpc;
HashMap hashmap = new HashMap();
Vector bounsitem = new Vector();
Vector bounsdegree = new Vector();
try {
List list = this.getConfigpubliccharDao().find("from ConfigPublicChar c where c.attributeKind = ? or c.attributeKind = ?",new String[]{"奖励项目","奖励等级"});
for(int i = 0 ; i < list.size() ; i++)
{
cpc = (ConfigPublicChar)list.get(i);
if(cpc.getAttributeKind().equals("奖励项目"))
bounsitem.add(cpc.getAttributeName());
else if(cpc.getAttributeKind().equals("奖励等级"))
bounsdegree.add(cpc.getAttributeName());
}
hashmap.put("奖励项目", bounsitem);
hashmap.put("奖励等级", bounsdegree);
return hashmap;
} catch (Exception ex) {
logger.error(ex);
throw new HrException(ex);
}
}
/**
* 查询有关培训属性的值
* @param condition
* @return
* @throws HrException
*/
public HashMap listForTraining(ConfigPublicChar condition) throws HrException {
ConfigPublicChar cpc;
HashMap hashmap = new HashMap();
Vector trainingitem = new Vector();
Vector trainingdegree = new Vector();
try {
List list = this.getConfigpubliccharDao().find("from ConfigPublicChar c where c.attributeKind = ? or c.attributeKind = ?",new String[]{"培训项目","培训成绩"});
for(int i = 0 ; i < list.size() ; i++)
{
cpc = (ConfigPublicChar)list.get(i);
if(cpc.getAttributeName().equals("培训项目"))
trainingitem.add(cpc.getAttributeName());
else if(cpc.getAttributeName().equals("培训成绩"))
trainingdegree.add(cpc.getAttributeName());
}
hashmap.put("培训项目", trainingitem);
hashmap.put("培训成绩", trainingdegree);
return hashmap;
} 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.getConfigpubliccharDao().delete(ConfigPublicChar.class,id);
} catch (Exception ex) {
logger.error(ex);
throw new HrException(ex);
}
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -