📄 accessanalyselogimpl.java
字号:
whereSql.append("where ");
else
whereSql.append("and ");
if(sStatisticType != null) {
if(sStatisticType.equals("1")) {
whereSql.append("l.CALC_TIME >= to_date(?, 'yyyy-mm-dd') ");
}
else{
whereSql.append("l.CALC_TIME >= to_date(?, '"+timeFormat+"') ");
}
}
else {
whereSql.append("l.CALC_TIME >= to_date(?, '"+timeFormat+"') ");
}
oParam.add(sStartTime);
}
if (!ExtString.isEmpty(sEndTime)) {
if((ExtString.isEmpty(sCityCode) && ExtString.isEmpty(sStartTime)) ||
(sCityCode.equals("0590") && ExtString.isEmpty(sStartTime)))
whereSql.append("where ");
else
whereSql.append("and ");
if(sStatisticType != null) {
if(sStatisticType.equals("1")) {
whereSql.append("l.CALC_TIME <= to_date(?, 'yyyy-mm-dd hh24:mi:ss') ");
}
else{
whereSql.append("l.CALC_TIME <= to_date(?, '"+timeFormat+"') ");
}
}
else {
whereSql.append("l.CALC_TIME <= to_date(?, '"+timeFormat+"') ");
}
oParam.add(sEndTime);
}
}
private void buildtotalSQL(Map _map, StringBuffer totalSql, List oParam) {
String sStartTime = (String) _map.get("STARTTIME");
String sEndTime = (String) _map.get("ENDTIME");
String sStatisticType = (String) _map.get("STATISTICTYPE");
String str = "";
String result[] = AccessanalyselogImpl.getStatisticType(sStatisticType, sStartTime, sEndTime);
str = result[0];
totalSql.append("select to_char(l.CALC_TIME, '"+str+"') CALC_TIME, sum(l.AMOUNT) cnt from tl_reportofday l,td_report_node t ");
StringBuffer whereSql = new StringBuffer();
buildWhereSQL(_map, whereSql, oParam);
if(whereSql.length() > 0) {
whereSql.append("and l.nodeid = t.nodeid and t.type=1 ");
}
else{
whereSql.append("where l.nodeid = t.nodeid and t.type=1 ");
}
totalSql.append(whereSql);
totalSql.append("group by to_char(l.CALC_TIME, '"+str+"')");
}
private void buildChildSQL(Map _map, StringBuffer operIntroSql, List oParam,String sparam) {
String sStartTime = (String) _map.get("STARTTIME");
String sEndTime = (String) _map.get("ENDTIME");
String sStatisticType = (String) _map.get("STATISTICTYPE");
String str = "";
String result[] = AccessanalyselogImpl.getStatisticType(sStatisticType, sStartTime, sEndTime);
str = result[0];
operIntroSql.append("select to_char(l.CALC_TIME, '"+str+"') CALC_TIME, sum(l.AMOUNT) cnt from tl_reportofday l, td_report_node t ");
StringBuffer whereSql = new StringBuffer();
buildWhereSQL(_map, whereSql, oParam);
if(whereSql.length() > 0) {
whereSql.append("and l.nodeid = t.nodeid ");
whereSql.append("and t.indexcode like ? || '%' ");
}
else{
whereSql.append("where l.nodeid = t.nodeid ");
whereSql.append("and t.indexcode like ? || '%' ");
}
oParam.add(sparam);
operIntroSql.append(whereSql);
operIntroSql.append("group by to_char(l.CALC_TIME, '"+str+"')");
}
private void buildOperIntroSQL(Map _map, StringBuffer operIntroSql, List oParam) {
buildChildSQL(_map,operIntroSql,oParam,"001003");//业务介绍
}
private void buildDateAccessSQL(Map _map, StringBuffer dateAccessSql, List oParam) {
String sStartTime = (String) _map.get("STARTTIME");
String sEndTime = (String) _map.get("ENDTIME");
String sStatisticType = (String) _map.get("STATISTICTYPE");
String str = "";
String result[] = AccessanalyselogImpl.getStatisticType(sStatisticType, sStartTime, sEndTime);
str = result[0];
dateAccessSql.append("select to_char(l.CALC_TIME, '"+str+"') CALC_TIME, sum(l.AMOUNT) cnt from tl_reportofday l, td_report_node t ");
StringBuffer whereSql = new StringBuffer();
buildWhereSQL(_map, whereSql, oParam);
if(whereSql.length() > 0) {
whereSql.append("and l.nodeid = t.nodeid ");
whereSql.append(" and t.type=3 ");
}
else{
whereSql.append("where l.nodeid = t.nodeid ");
whereSql.append(" and t.type=3 ");
}
dateAccessSql.append(whereSql);
dateAccessSql.append("group by to_char(l.CALC_TIME, '"+str+"')");
}
private void buildInteQuerySQL(Map _map, StringBuffer inteQuerySql, List oParam) {
buildChildSQL(_map,inteQuerySql,oParam,"001007");//综合查询
}
private void buildCustServSQL(Map _map, StringBuffer custServSql, List oParam) {
buildChildSQL(_map,custServSql,oParam,"001004");//客户服务
}
private void buildSelfServSQL(Map _map, StringBuffer selfServSql, List oParam) {
buildChildSQL(_map,selfServSql,oParam,"001006");//自助服务
}
private void buildNewSQL(Map _map, StringBuffer newSql, List oParam) {
buildChildSQL(_map,newSql,oParam,"001002");//新闻
}
private void buildFaqSQL(Map _map, StringBuffer faqSql, List oParam) {
buildChildSQL(_map,faqSql,oParam,"001005");//网上调查
}
/* private void buildAcceptSQL(Map _map, StringBuffer acceptSql, List oParam) {
buildChildSQL(_map,acceptSql,oParam,"005");//业务办理
}*/
private void buildLoginSQL(Map _map, StringBuffer loginSql, List oParam) {
buildChildSQL(_map,loginSql,oParam,"001001");//注册登录
}
private void buildHomeSQL(Map _map, StringBuffer faqSql, List oParam) {
buildChildSQL(_map,faqSql,oParam,"001008");//客户品牌专区
}
private void buildAdvSQL(Map _map, StringBuffer faqSql, List oParam) {
buildChildSQL(_map,faqSql,oParam,"001009");//广告点击量
}
private void buildFirstSQL(Map _map, StringBuffer faqSql, List oParam) {
buildChildSQL(_map,faqSql,oParam,"001010");//首页模块
}
private void buildSQL(Map _map, StringBuffer sql, List oParam) {
StringBuffer totalSql = new StringBuffer();
StringBuffer operIntroSql = new StringBuffer();
StringBuffer dateAccessSql = new StringBuffer();
StringBuffer inteQuerySql = new StringBuffer();
StringBuffer custServSql = new StringBuffer();
StringBuffer selfServSql = new StringBuffer();
StringBuffer newSql = new StringBuffer();
StringBuffer faqSql = new StringBuffer();
StringBuffer homeSql = new StringBuffer();
StringBuffer advSql = new StringBuffer();
StringBuffer firstSql = new StringBuffer();
StringBuffer acceptSql = new StringBuffer();
StringBuffer loginSql = new StringBuffer();
sql.append("select a.CALC_TIME \"时间\",nvl(a.cnt,0) \"系统访问总量\",nvl(t.cnt,0) \"首页访问总量\",nvl(k.cnt,0) \"客户品牌专区总量\",nvl(b.cnt,0) \"业务介绍总量\",");
sql.append("nvl(d.cnt,0) \"综合查询总量\",nvl(e.cnt,0) \"客户服务总量\",nvl(f.cnt,0) \"自助服务总量\",nvl(g.cnt,0) \"新闻总量\",");
sql.append("nvl(h.cnt,0) \"网上调查总量\",nvl(v.cnt,0) \"广告点击总量\",nvl(j.cnt,0) \"注册登录\",nvl(c.cnt,0) \"日访问总人数\" from (");
buildtotalSQL(_map,totalSql,oParam);
sql.append(totalSql);
sql.append(") a,(");
buildOperIntroSQL(_map,operIntroSql,oParam);
sql.append(operIntroSql);
sql.append(") b,(");
buildDateAccessSQL(_map,dateAccessSql,oParam);
sql.append(dateAccessSql);
sql.append(") c,(");
buildInteQuerySQL(_map,inteQuerySql,oParam);
sql.append(inteQuerySql);
sql.append(") d,(");
buildCustServSQL(_map,custServSql,oParam);
sql.append(custServSql);
sql.append(") e,(");
buildSelfServSQL(_map,selfServSql,oParam);
sql.append(selfServSql);
sql.append(") f,(");
buildNewSQL(_map,newSql,oParam);
sql.append(newSql);
sql.append(") g,(");
buildFaqSQL(_map,faqSql,oParam);
sql.append(faqSql);
sql.append(") h,(");
buildHomeSQL(_map,homeSql,oParam);
sql.append(homeSql);
sql.append(") k,(");
buildAdvSQL(_map,advSql,oParam);
sql.append(advSql);
sql.append(") v,(");
buildFirstSQL(_map,firstSql,oParam);
sql.append(firstSql);
sql.append(") t,(");
// buildAcceptSQL(_map,acceptSql,oParam);
// sql.append(acceptSql);
// sql.append(") i,(");
buildLoginSQL(_map,loginSql,oParam);
sql.append(loginSql);
sql.append(") j where a.CALC_TIME = b.CALC_TIME(+) ");
sql.append("and a.CALC_TIME = c.CALC_TIME(+) ");
sql.append("and a.CALC_TIME = d.CALC_TIME(+) ");
sql.append("and a.CALC_TIME = e.CALC_TIME(+) ");
sql.append("and a.CALC_TIME = f.CALC_TIME(+) ");
sql.append("and a.CALC_TIME = g.CALC_TIME(+) ");
sql.append("and a.CALC_TIME = h.CALC_TIME(+) ");
sql.append("and a.CALC_TIME = k.CALC_TIME(+) ");
sql.append("and a.CALC_TIME = t.CALC_TIME(+) ");
sql.append("and a.CALC_TIME = v.CALC_TIME(+) ");
// sql.append("and a.CALC_TIME = i.CALC_TIME(+) ");
sql.append("and a.CALC_TIME = j.CALC_TIME(+) ");
sql.append("order by a.CALC_TIME desc ");
}
public String genHtml(Map _map) {
DataTable dt = getRptList(_map);
StringBuffer _sb = new StringBuffer();
if ( dt != null ) {
_sb.append("<table>");
try {
com.doone.data.DataColumnCollection dcs = dt.getColumns();
int colcount = dcs.getCount();
_sb.append("<tr>");
for (int icol = 0;icol<colcount-1;icol++){
com.doone.data.DataColumn dc = dcs.getDataColumn(icol);
String columnName = dc.getColumnName();
if(columnName.equals("日访问总人数")) {
_sb.append("<td class=\"body_td\" align=\"center\" nowrap><b><font color=\"red\">");
_sb.append(dc.getColumnName());
_sb.append("</font></b></TD>");
}
else {
_sb.append("<td class=\"body_td\" align=\"center\" nowrap><b>");
_sb.append(dc.getColumnName());
_sb.append("</b></TD>");
}
}
_sb.append("</tr>");
for(int iresult=0;iresult<dt.getRows().getCount(); iresult++){
_sb.append("<tr height=\"20\">");
DataRow drresult = dt.getRow(iresult);
for (int icol=0; icol<colcount-1;icol++){
_sb.append("<td class=\"body_td\" align=\"left\" nowrap>");
_sb.append(drresult.getString(icol).trim().equals("")?" ":drresult.getString(icol).trim());
_sb.append("</TD>");
}
_sb.append("</tr>");
}
} catch (Exception e) {
FileLogger.getLogger().info(e.getMessage(),e);
}
_sb.append("</table>");
}
return _sb.toString();
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -