?? goodsgetuseext.java
字號:
package com.saas.biz.dao.goodsGetuseDAO;
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;
public class GoodsGetuseExt extends GoodsGetuseDAO{
GoodsGetuseDAO goodsGetuseDao;
Logger log;
ArrayList updArray;
ArrayList paramArray;
public GoodsGetuseExt() {
goodsGetuseDao = new GoodsGetuseDAO();
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_f_goods_getuse");
exec.setStrQuery(selBy);
exec.setParamList(this.paramArray);
dataArray = exec.selBizQuery();
if (dataArray.size() <= 0)
return null;
return dataArray;
}
public GoodsGetuseDAO selByInfo(String selBy) {
Dbexecute exec = new Dbexecute();
commMethodMgr commen = new commMethodMgr();
Logger log = new Logger(this);
ArrayList dataArray = new ArrayList();
exec.setStrTable("tf_f_goods_getuse");
exec.setStrQuery(selBy);
exec.setParamList(this.paramArray);
dataArray = exec.selBizQuery();
if (dataArray.size() <= 0)
return null;
GoodsGetuseDAO goodsGetuseDao = new GoodsGetuseDAO();
Field[] fields = goodsGetuseDao.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(goodsGetuseDao, 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(goodsGetuseDao, 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 goodsGetuseDao;
}
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_f_goods_getuse");
paramMap.put("queryString", insBy);
paramMap.put("queryVarMap", this.paramArray);
qInsBy.add(paramMap);
return qInsBy;
}
// 分頁查詢
public ArrayList selByList(String selBy, int iStart, int iCount) {
Dbexecute exec = new Dbexecute();
ArrayList dataArray = new ArrayList();
exec.setStrTable("tf_f_goods_getuse");
exec.setStrQuery(selBy);
exec.setParamList(this.paramArray);
dataArray = exec.selBizQuery(iStart, iCount);
if (dataArray.size() <= 0)
return null;
return dataArray;
}
}
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -