?? productext.java
字號:
package com.saas.biz.dao.productDAO;
import java.lang.reflect.Field;
import java.lang.reflect.InvocationTargetException;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.Iterator;
import com.saas.sys.dbm.Dbexecute;
import com.saas.sys.log.Logger;
import java.util.ArrayList;
import org.apache.commons.beanutils.PropertyUtils;
public class ProductExt extends ProductDAO
{
Logger log;
ArrayList updArray;
ArrayList paramArray;
public ProductExt()
{
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_product");
exec.setStrQuery(selBy);
exec.setParamList(this.paramArray);
dataArray = exec.selBizQuery();
if (dataArray.size() <= 0) return null;
return dataArray;
}
public ProductDAO selByInfo(String selBy)
{
Dbexecute exec = new Dbexecute();
ProductDAO productDAO = new ProductDAO();
ArrayList dataArray = new ArrayList();
exec.setStrTable("tf_f_product");
exec.setStrQuery(selBy);
exec.setParamList(this.paramArray);
dataArray = exec.selBizQuery();
if (dataArray.size() <= 0) return null;
Field[] fields = productDAO.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(productDAO,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(productDAO,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 productDAO;
}
public int selCount(String selBy)
{
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_product");
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_product");
exec.setStrQuery(selBy);
exec.setParamList(this.paramArray);
dataArray = exec.selBizQuery(iStart,iCount);
if (dataArray.size()<=0) return null;
//log.LOG_INFO("..."+dataArray);
return dataArray;
}
}
?? 快捷鍵說明
復(fù)制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -