?? tableitemext.java
字號(hào):
package com.saas.biz.dao.tableitemDAO;
import java.lang.reflect.Field;
import java.lang.reflect.InvocationTargetException;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.Iterator;
import org.apache.commons.beanutils.PropertyUtils;
import com.saas.biz.commen.commMethodMgr;
import com.saas.sys.dbm.Dbexecute;
import com.saas.sys.log.Logger;
/**
* @author:LiuYang
* @desc:滿(mǎn)意度調(diào)查表?xiàng)l目表
* @2008-3-3
*/
public class TableitemExt extends TableitemDAO {
private static final long serialVersionUID = 7682398329993992745L;
TableitemDAO itemDao;
Logger log;
ArrayList updArray;
ArrayList paramArray;
public TableitemExt() {
itemDao = new TableitemDAO();
log = new Logger(this);
updArray = new ArrayList();
paramArray = new ArrayList();
}
public ArrayList selByList(String selBy) {
Dbexecute exec = new Dbexecute();
ArrayList dataArray = new ArrayList();
exec.setStrTable("tf_b_tableitem");
exec.setStrQuery(selBy);
exec.setParamList(this.paramArray);
dataArray = exec.selBizQuery();
if (dataArray.size() <= 0)
return null;
return dataArray;
}
// 分頁(yè)查詢(xún)
public ArrayList selByList(String selBy, int iStart, int iCount) {
Dbexecute exec = new Dbexecute();
ArrayList dataArray = new ArrayList();
exec.setStrTable("tf_b_tableitem");
exec.setStrQuery(selBy);
exec.setParamList(this.paramArray);
dataArray = exec.selBizQuery(iStart, iCount);
if (dataArray.size() <= 0)
return null;
return dataArray;
}
public TableitemDAO selByInfo(String selBy) {
Dbexecute exec = new Dbexecute();
commMethodMgr commen = new commMethodMgr();
Logger log = new Logger(this);
ArrayList dataArray = new ArrayList();
exec.setStrTable("tf_b_tableitem");
exec.setStrQuery(selBy);
exec.setParamList(this.paramArray);
dataArray = exec.selBizQuery();
if (dataArray.size() <= 0)
return null;
TableitemDAO itemDao = new TableitemDAO();
Field[] fields = itemDao.getClass().getDeclaredFields();
for (Iterator it = dataArray.iterator(); it.hasNext();) {
HashMap tradetype = (HashMap) it.next();
for (int i = 0; i <= fields.length - 1; i++) {
if (tradetype.containsKey(fields[i].getName())) {
try {
if (tradetype.get(fields[i].getName()) != null) {
if (fields[i].getType().getName() == "java.lang.String") {
PropertyUtils.setProperty(itemDao, fields[i].getName(), tradetype.get(fields[i].getName()).toString());
}
else if (fields[i].getType().getName() == "java.lang.Integer") {
Integer ivalue = new Integer(tradetype.get(fields[i].getName()).toString());
PropertyUtils.setProperty(itemDao, fields[i].getName(), ivalue);
}
}
}
catch (InvocationTargetException e) {
throw new RuntimeException(e);
}
catch (NoSuchMethodException e) {
throw new RuntimeException(e);
}
catch (IllegalAccessException e) {
throw new RuntimeException(e);
}
}
}
}
return itemDao;
}
public int selCount(String selBy) {
Dbexecute exec = new Dbexecute();
return 0;
}
public void setParam(String paramName, Object paramValue) {
HashMap paramMap = new HashMap();
paramMap.put("paramName", paramName);
paramMap.put("paramValue", paramValue);
this.paramArray.add(paramMap);
}
public ArrayList insBy(String insBy) {
ArrayList qInsBy = new ArrayList();
HashMap paramMap = new HashMap();
paramMap.put("queryTable", "tf_b_tableitem");
paramMap.put("queryString", insBy);
paramMap.put("queryVarMap", this.paramArray);
qInsBy.add(paramMap);
return qInsBy;
}
}
?? 快捷鍵說(shuō)明
復(fù)制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號(hào)
Ctrl + =
減小字號(hào)
Ctrl + -