📄 operationtypeimp.java
字号:
package com.jn0801.operation;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import org.springframework.orm.hibernate3.support.HibernateDaoSupport;
/**
* 显示业务类型的实现类
* @author student
*
*/
public class operationtypeIMP extends HibernateDaoSupport implements operationtypeIFC {
/**
* 显示业务类型列表
* @return
*/
public List listOperationType() {
String hql = "select operation from operationtype operation order by operation.npid";
List<operationtype> list = this.getHibernateTemplate().find(hql);
//大类小类
ArrayList<ArrayList<operationtype>> operationList = new ArrayList<ArrayList<operationtype>>();
HashMap<Long,ArrayList<operationtype>> tmpMap = new HashMap<Long,ArrayList<operationtype>>();
for (operationtype operation : list) {
if(operation.getNpid()==0){
ArrayList<operationtype> tmpList = new ArrayList<operationtype>();
tmpList.add(operation);
tmpMap.put(operation.getTypeid(), tmpList);
operationList.add(tmpList);
}else{
ArrayList<operationtype> tmpList = tmpMap.get(operation.getNpid());
tmpList.add(operation);
}
}
return operationList;
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -