📄 cust_report.java
字号:
package com.doone.fj1w.fjmgr.monitor;
import com.doone.data.*;
import com.doone.util.*;
public class Cust_Report {
DacClient _dac=new DacClient();
int pagecount=20;//分页数 默认20行为一页
public Cust_Report() {
}
public DataTable getReport(String start,String end,String name,int row) {
DataTable dt=null;
String sql="select * from (select b.username,a.productname,b.accepttime,c.paradesc,rownum num from td_product a,tf_prodorder b,ts_configsub c "+
"where a.productid=b.productid and b.username like ? "+
"and c.paravalue=b.progressstate and c.paraname='PROGRESSSTATE' ";
sql=sql+"and b.accepttime between to_date(?,'yyyymmdd') and to_date(?,'yyyymmdd')) a where"+
" a.num>"+(row-1)*pagecount+" and a.num<="+row*pagecount;
if(name==null)
{name="";}
Object[] _object=new Object[3];
_object[0]="%"+name+"%";
_object[1]="19000101";
_object[2]="20301230";
if(start!=null && start.equals("")==false && end!=null && end.equals("")==false)
{
_object[1]=start;
_object[2]=end;
}
try {
_dac.beginTransaction(1000);
dt=_dac.executeQuery(sql, _object);
_dac.endTransaction(true);
FileLogger.getLogger().debug(new Integer(_object.length)+"sql语句:"+sql);
}
catch (Exception ex) {
FileLogger.getLogger().error("类中错误:"+ex);
try{_dac.endTransaction(false);}
catch(Exception ex1){}
}
return dt;
}
public void setPagecount(int pagecount) {
this.pagecount = pagecount;
}
public int getPageCount(String start,String end,String name){
int rowCount=0;
DataTable dt=null;
String sql="select count(*) as t from tf_prodorder where username like ? and accepttime "+
"between to_date(?,'yyyymmdd') and to_date(?,'yyyymmdd') " ;
if(name==null)
{name="";}
Object[] _object=new Object[3];
_object[0]="%"+name+"%";
_object[1]="19000101";
_object[2]="20301230";
if(start!=null && start.equals("")==false && end!=null && end.equals("")==false)
{
_object[1] = start;
_object[2] = end;
}
try{
_dac.beginTransaction(10000);
dt=_dac.executeQuery(sql,_object);
rowCount=dt.getRow(0).getInt(0);
_dac.endTransaction(true);
}
catch(Exception ex){
FileLogger.getLogger().error(ex.getMessage().toString());
try{_dac.endTransaction(false);}
catch(Exception ex1){}
}
return rowCount;
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -