Commit 8f10cdec authored by liuna's avatar liuna

2018年1月26日 --智能分析平台

--实体厅流量监测页面
parent 5c7fe802
This diff is collapsed.
package com.hp.cmsz.entity;
import org.apache.commons.net.ntp.TimeStamp;
import javax.persistence.*;
import java.io.Serializable;
/**
* app_sm_db_account_kpi_250_t表对应的实体类
*
* @author Liu Na
*
*/
@Entity
@Table(name = "app_sm_db_account_kpi_250_t",schema = "CCOLAP")
public class FlowAccount implements Serializable {
private Long batchId;
private TimeStamp statsTime;
private String account;
private Long transCnt;
private Long transAvailCnt;
private Long transTimeAvg;
private Long time1MobileCnt;
private Long time2MobileCnt;
private Long time3MobileCnt;
private Long statsPeriod;
private TimeStamp crtTime;
@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
public Long getBatchId() {
return batchId;
}
public void setBatchId(Long batchId) {
this.batchId = batchId;
}
public TimeStamp getStatsTime() {
return statsTime;
}
public void setStatsTime(TimeStamp statsTime) {
this.statsTime = statsTime;
}
public String getAccount() {
return account;
}
public void setAccount(String account) {
this.account = account;
}
public Long getTransCnt() {
return transCnt;
}
public void setTransCnt(Long transCnt) {
this.transCnt = transCnt;
}
public Long getTransAvailCnt() {
return transAvailCnt;
}
public void setTransAvailCnt(Long transAvailCnt) {
this.transAvailCnt = transAvailCnt;
}
public Long getTransTimeAvg() {
return transTimeAvg;
}
public void setTransTimeAvg(Long transTimeAvg) {
this.transTimeAvg = transTimeAvg;
}
public Long getTime1MobileCnt() {
return time1MobileCnt;
}
public void setTime1MobileCnt(Long time1MobileCnt) {
this.time1MobileCnt = time1MobileCnt;
}
public Long getTime2MobileCnt() {
return time2MobileCnt;
}
public void setTime2MobileCnt(Long time2MobileCnt) {
this.time2MobileCnt = time2MobileCnt;
}
public Long getTime3MobileCnt() {
return time3MobileCnt;
}
public void setTime3MobileCnt(Long time3MobileCnt) {
this.time3MobileCnt = time3MobileCnt;
}
public Long getStatsPeriod() {
return statsPeriod;
}
public void setStatsPeriod(Long statsPeriod) {
this.statsPeriod = statsPeriod;
}
public TimeStamp getCrtTime() {
return crtTime;
}
public void setCrtTime(TimeStamp crtTime) {
this.crtTime = crtTime;
}
}
package com.hp.cmsz.entity;
import org.apache.commons.net.ntp.TimeStamp;
import javax.persistence.*;
import java.io.Serializable;
/**
* app_sm_db_browser_kpi_t表对应的实体类
*
* @author Liu Na
*
*/
@Entity
@Table(name = "app_sm_db_browser_kpi_t",schema = "CCOLAP")
public class FlowBrowser implements Serializable {
private Long batchId;
private TimeStamp statsTime;
private String province;
private String browser;
private Long activeAccountCnt;
private Long transCnt;
private Long transAvg;
private Long transAvail;
@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
public Long getBatchId() {
return batchId;
}
public void setBatchId(Long batchId) {
this.batchId = batchId;
}
public TimeStamp getStatsTime() {
return statsTime;
}
public void setStatsTime(TimeStamp statsTime) {
this.statsTime = statsTime;
}
public String getProvince() {
return province;
}
public void setProvince(String province) {
this.province = province;
}
public String getBrowser() {
return browser;
}
public void setBrowser(String browser) {
this.browser = browser;
}
public Long getActiveAccountCnt() {
return activeAccountCnt;
}
public void setActiveAccountCnt(Long activeAccountCnt) {
this.activeAccountCnt = activeAccountCnt;
}
public Long getTransCnt() {
return transCnt;
}
public void setTransCnt(Long transCnt) {
this.transCnt = transCnt;
}
public Long getTransAvg() {
return transAvg;
}
public void setTransAvg(Long transAvg) {
this.transAvg = transAvg;
}
public Long getTransAvail() {
return transAvail;
}
public void setTransAvail(Long transAvail) {
this.transAvail = transAvail;
}
}
package com.hp.cmsz.entity;
import org.apache.commons.net.ntp.TimeStamp;
import javax.persistence.*;
import java.io.Serializable;
/**
* app_sm_db_client_kpi_250_t表对应的实体类
*
* @author Liu Na
*
*/
@Entity
@Table(name = "app_sm_db_client_kpi_250_t",schema = "CCOLAP")
public class FlowClient implements Serializable {
private Long batchId;
private TimeStamp statsTime;
private String clientIp;
private String transName;
private Long transCnt;
private Long transAvailCnt;
private Long transTimeSum;
private Long mobileCnt;
private Long statsPeriod;
private TimeStamp crtTime;
@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
public Long getBatchId() {
return batchId;
}
public void setBatchId(Long batchId) {
this.batchId = batchId;
}
public TimeStamp getStatsTime() {
return statsTime;
}
public void setStatsTime(TimeStamp statsTime) {
this.statsTime = statsTime;
}
public String getClientIp() {
return clientIp;
}
public void setClientIp(String clientIp) {
this.clientIp = clientIp;
}
public String getTransName() {
return transName;
}
public void setTransName(String transName) {
this.transName = transName;
}
public Long getTransCnt() {
return transCnt;
}
public void setTransCnt(Long transCnt) {
this.transCnt = transCnt;
}
public Long getTransAvailCnt() {
return transAvailCnt;
}
public void setTransAvailCnt(Long transAvailCnt) {
this.transAvailCnt = transAvailCnt;
}
public Long getTransTimeSum() {
return transTimeSum;
}
public void setTransTimeSum(Long transTimeSum) {
this.transTimeSum = transTimeSum;
}
public Long getMobileCnt() {
return mobileCnt;
}
public void setMobileCnt(Long mobileCnt) {
this.mobileCnt = mobileCnt;
}
public Long getStatsPeriod() {
return statsPeriod;
}
public void setStatsPeriod(Long statsPeriod) {
this.statsPeriod = statsPeriod;
}
public TimeStamp getCrtTime() {
return crtTime;
}
public void setCrtTime(TimeStamp crtTime) {
this.crtTime = crtTime;
}
}
package com.hp.cmsz.entity;
import org.apache.commons.net.ntp.TimeStamp;
import javax.persistence.*;
import java.io.Serializable;
/**
* app_sm_db_hall_kpi_250_t表对应的实体类
*
* @author Liu Na
*
*/
@Entity
@Table(name = "app_sm_db_hall_kpi_250_t",schema = "ccolap")
public class FlowHallBusiness implements Serializable {
private Long batchId;
private TimeStamp statsTime;
private String city;
private String district;
private String hall;
private Long transCnt;
private Long timeAvg;
private Long statsPeriod;
private TimeStamp crtTime;
@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
public Long getBatchId() {
return batchId;
}
public void setBatchId(Long batchId) {
this.batchId = batchId;
}
public TimeStamp getStatsTime() {
return statsTime;
}
public void setStatsTime(TimeStamp statsTime) {
this.statsTime = statsTime;
}
public String getCity() {
return city;
}
public void setCity(String city) {
this.city = city;
}
public String getDistrict() {
return district;
}
public void setDistrict(String district) {
this.district = district;
}
public String getHall() {
return hall;
}
public void setHall(String hall) {
this.hall = hall;
}
public Long getTransCnt() {
return transCnt;
}
public void setTransCnt(Long transCnt) {
this.transCnt = transCnt;
}
public Long getTimeAvg() {
return timeAvg;
}
public void setTimeAvg(Long timeAvg) {
this.timeAvg = timeAvg;
}
public Long getStatsPeriod() {
return statsPeriod;
}
public void setStatsPeriod(Long statsPeriod) {
this.statsPeriod = statsPeriod;
}
public TimeStamp getCrtTime() {
return crtTime;
}
public void setCrtTime(TimeStamp crtTime) {
this.crtTime = crtTime;
}
}
......@@ -2,8 +2,7 @@ package com.hp.cmsz.entity;
import org.apache.commons.net.ntp.TimeStamp;
import javax.persistence.Entity;
import javax.persistence.Table;
import javax.persistence.*;
import java.io.Serializable;
/**
......@@ -12,8 +11,8 @@ import java.io.Serializable;
* @author Liu Na
*
*/
//@Entity
//@Table(name = "APP_SM_DB_CITY_KPI_T",schema = "ccolap")
@Entity
@Table(name = "APP_SM_DB_CITY_KPI_T",schema = "CCOLAP")
public class FlowMonitor implements Serializable {
private Long batchId;
......@@ -24,4 +23,88 @@ public class FlowMonitor implements Serializable {
private Long transCnt;
private Long timeAvg;
private Long timeoutCnt;
private Long statsPeriod;
private TimeStamp crtTime;
@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
public Long getBatchId() {
return batchId;
}
public void setBatchId(Long batchId) {
this.batchId = batchId;
}
public TimeStamp getStatsTime() {
return statsTime;
}
public void setStatsTime(TimeStamp statsTime) {
this.statsTime = statsTime;
}
public String getProvince() {
return province;
}
public void setProvince(String province) {
this.province = province;
}
public String getCity() {
return city;
}
public void setCity(String city) {
this.city = city;
}
public Long getActiveAccountCnt() {
return activeAccountCnt;
}
public void setActiveAccountCnt(Long activeAccountCnt) {
this.activeAccountCnt = activeAccountCnt;
}
public Long getTransCnt() {
return transCnt;
}
public void setTransCnt(Long transCnt) {
this.transCnt = transCnt;
}
public Long getTimeAvg() {
return timeAvg;
}
public void setTimeAvg(Long timeAvg) {
this.timeAvg = timeAvg;
}
public Long getTimeoutCnt() {
return timeoutCnt;
}
public void setTimeoutCnt(Long timeoutCnt) {
this.timeoutCnt = timeoutCnt;
}
public Long getStatsPeriod() {
return statsPeriod;
}
public void setStatsPeriod(Long statsPeriod) {
this.statsPeriod = statsPeriod;
}
public TimeStamp getCrtTime() {
return crtTime;
}
public void setCrtTime(TimeStamp crtTime) {
this.crtTime = crtTime;
}
}
package com.hp.cmsz.entity;
import org.apache.commons.net.ntp.TimeStamp;
import javax.persistence.*;
import java.io.Serializable;
/**
* app_sm_db_province_kpi_t表对应的实体类
*
* @author Liu Na
*
*/
@Entity
@Table(name = "app_sm_db_province_kpi_t",schema = "ccolap")
public class FlowMonitorCator implements Serializable {
private Long batchId;
private TimeStamp statsTime;
private String province;
private Long activeAccountCnt;
private Long time1AccountCnt;//无法使用坐席数
private Long time2AccountCnt;//可容忍坐席数
private Long time3AccountCnt;//不满意坐席数
private Long statsPeriod;
private TimeStamp crtTime;
@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
public Long getBatchId() {
return batchId;
}
public void setBatchId(Long batchId) {
this.batchId = batchId;
}
public TimeStamp getStatsTime() {
return statsTime;
}
public void setStatsTime(TimeStamp statsTime) {
this.statsTime = statsTime;
}
public String getProvince() {
return province;
}
public void setProvince(String province) {
this.province = province;
}
public Long getActiveAccountCnt() {
return activeAccountCnt;
}
public void setActiveAccountCnt(Long activeAccountCnt) {
this.activeAccountCnt = activeAccountCnt;
}
public Long getTime1AccountCnt() {
return time1AccountCnt;
}
public void setTime1AccountCnt(Long time1AccountCnt) {
this.time1AccountCnt = time1AccountCnt;
}
public Long getTime2AccountCnt() {
return time2AccountCnt;
}
public void setTime2AccountCnt(Long time2AccountCnt) {
this.time2AccountCnt = time2AccountCnt;
}
public Long getTime3AccountCnt() {
return time3AccountCnt;
}
public void setTime3AccountCnt(Long time3AccountCnt) {
this.time3AccountCnt = time3AccountCnt;
}
public Long getStatsPeriod() {
return statsPeriod;
}
public void setStatsPeriod(Long statsPeriod) {
this.statsPeriod = statsPeriod;
}
public TimeStamp getCrtTime() {
return crtTime;
}
public void setCrtTime(TimeStamp crtTime) {
this.crtTime = crtTime;
}
}
package com.hp.cmsz.entity;
import org.apache.commons.net.ntp.TimeStamp;
import javax.persistence.*;
import java.io.Serializable;
/**
* ccolap.app_sm_db_server_kpi_t表对应的实体类
*
* @author Liu Na
*
*/
@Entity
@Table(name = "app_sm_db_server_kpi_t",schema = "CCOLAP")
public class FlowServer implements Serializable {
private Long batchId;
private TimeStamp statsTime;
private String province;
private String serverIp;
private Long activeAccountCnt;
private Long transCnt;
private Long transAvg;
private Long transAvail;
private Long s10xCnt;
private Long s20xCnt;
private Long s30xCnt;
private Long s40xCnt;
private Long s50xCnt;
private Long sotherCnt;
private Long statsPeriod;
private TimeStamp crtTime;
@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
public Long getBatchId() {
return batchId;
}
public void setBatchId(Long batchId) {
this.batchId = batchId;
}
public TimeStamp getStatsTime() {
return statsTime;
}
public void setStatsTime(TimeStamp statsTime) {
this.statsTime = statsTime;
}
public String getProvince() {
return province;
}
public void setProvince(String province) {
this.province = province;
}
public String getServerIp() {
return serverIp;
}
public void setServerIp(String serverIp) {
this.serverIp = serverIp;
}
public Long getActiveAccountCnt() {
return activeAccountCnt;
}
public void setActiveAccountCnt(Long activeAccountCnt) {
this.activeAccountCnt = activeAccountCnt;
}
public Long getTransCnt() {
return transCnt;
}
public void setTransCnt(Long transCnt) {
this.transCnt = transCnt;
}
public Long getTransAvg() {
return transAvg;
}
public void setTransAvg(Long transAvg) {
this.transAvg = transAvg;
}
public Long getTransAvail() {
return transAvail;
}
public void setTransAvail(Long transAvail) {
this.transAvail = transAvail;
}
public Long getS10xCnt() {
return s10xCnt;
}
public void setS10xCnt(Long s10xCnt) {
this.s10xCnt = s10xCnt;
}
public Long getS20xCnt() {
return s20xCnt;
}
public void setS20xCnt(Long s20xCnt) {
this.s20xCnt = s20xCnt;
}
public Long getS30xCnt() {
return s30xCnt;
}
public void setS30xCnt(Long s30xCnt) {
this.s30xCnt = s30xCnt;
}
public Long getS40xCnt() {
return s40xCnt;
}
public void setS40xCnt(Long s40xCnt) {
this.s40xCnt = s40xCnt;
}
public Long getS50xCnt() {
return s50xCnt;
}
public void setS50xCnt(Long s50xCnt) {
this.s50xCnt = s50xCnt;
}
public Long getSotherCnt() {
return sotherCnt;
}
public void setSotherCnt(Long sotherCnt) {
this.sotherCnt = sotherCnt;
}
public Long getStatsPeriod() {
return statsPeriod;
}
public void setStatsPeriod(Long statsPeriod) {
this.statsPeriod = statsPeriod;
}
public TimeStamp getCrtTime() {
return crtTime;
}
public void setCrtTime(TimeStamp crtTime) {
this.crtTime = crtTime;
}
}
package com.hp.cmsz.repository;
import com.hp.cmsz.entity.FlowAccount;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
import org.springframework.data.jpa.repository.Query;
import org.springframework.data.repository.PagingAndSortingRepository;
import java.util.List;
public interface FlowAccountDao extends PagingAndSortingRepository<FlowAccount,Long>,JpaSpecificationExecutor<FlowAccount> {
//坐席分析前TOP10
@Query(value="SELECT ACCOUNT,TRANS_CNT,TRANS_AVAIL_CNT,TRANS_TIME_AVG FROM (SELECT ACCOUNT,TRANS_CNT,TRANS_AVAIL_CNT,TRANS_TIME_AVG,RANK()OVER(ORDER BY STATS_TIME DESC) AS RANK FROM CCOLAP.app_sm_db_account_kpi_250_t)A WHERE RANK=1 ORDER BY TRANS_CNT DESC LIMIT 10", nativeQuery=true)
List<Object[]> seatAnalysisTop();
//坐席分析后TOP10
@Query(value="SELECT ACCOUNT,TRANS_CNT,TRANS_AVAIL_CNT,TRANS_TIME_AVG FROM (SELECT ACCOUNT,TRANS_CNT,TRANS_AVAIL_CNT,TRANS_TIME_AVG,RANK()OVER(ORDER BY STATS_TIME DESC) AS RANK FROM CCOLAP.app_sm_db_account_kpi_250_t)A WHERE RANK=1 ORDER BY TRANS_CNT LIMIT 10", nativeQuery=true)
List<Object[]> seatAnalysisLast();
//坐席*接待客户分析实时(TIME1_MOBILE_CNT:无法使用客户数 TIME2_MOBILE_CNT:可容忍客户数 TIME3_MOBILE_CNT:不满意客户数)
@Query(value="select STATS_TIME,sum(TIME1_MOBILE_CNT) as TIME1_MOBILE_CNT,sum(TIME2_MOBILE_CNT) as TIME2_MOBILE_CNT,sum(TIME3_MOBILE_CNT) as TIME3_MOBILE_CNT from ccolap.app_sm_db_account_kpi_250_t where STATS_TIME>=now()-34/24 and STATS_TIME<now()-4/24 group by STATS_TIME order by STATS_TIME", nativeQuery=true)
List<Object[]> seatsReceptionUser();
//坐席*接待客户分析当月1号到当前时间(TIME1_MOBILE_CNT:无法使用客户数 TIME2_MOBILE_CNT:可容忍客户数 TIME3_MOBILE_CNT:不满意客户数)
@Query(value="select trunc(STATS_TIME) as STATS_TIME,sum(TIME1_MOBILE_CNT) as TIME1_MOBILE_CNT,sum(TIME2_MOBILE_CNT) as TIME2_MOBILE_CNT,sum(TIME3_MOBILE_CNT) as TIME3_MOBILE_CNT from ccolap.app_sm_db_account_kpi_250_t where STATS_TIME>=trunc(sysdate,'mm') group by trunc(STATS_TIME) order by STATS_TIME", nativeQuery=true)
List<Object[]> seatsReceptionUserMonth();
}
package com.hp.cmsz.repository;
import com.hp.cmsz.entity.FlowBrowser;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
import org.springframework.data.jpa.repository.Query;
import org.springframework.data.repository.PagingAndSortingRepository;
import java.util.List;
public interface FlowBrowserDao extends PagingAndSortingRepository<FlowBrowser,Long>,JpaSpecificationExecutor<FlowBrowser> {
//服务器相关情况分析:客户端兼容性分析实时
@Query(value="select BROWSER,ACTIVE_ACCOUNT_CNT,TRANS_CNT,TRANS_AVAIL from (select BROWSER,ACTIVE_ACCOUNT_CNT,TRANS_CNT,TRANS_AVAIL*100 as TRANS_AVAIL,rank()over(order by STATS_TIME desc) as rank from ccolap.app_sm_db_browser_kpi_t where STATS_TIME>=trunc(sysdate))a where rank=1 order by TRANS_AVAIL desc limit 10", nativeQuery=true)
List<Object[]> clientCompatibility();
//服务器相关情况分析:客户端兼容性分析当月1号到当前时间
@Query(value="select BROWSER,sum(ACTIVE_ACCOUNT_CNT) as ACTIVE_ACCOUNT_CNT,sum(TRANS_CNT) as TRANS_CNT,round(avg(TRANS_AVAIL*100),2) as TRANS_AVAIL from ccolap.app_sm_db_browser_kpi_t where STATS_TIME>=trunc(sysdate,'mm') group by BROWSER order by TRANS_AVAIL desc limit 10", nativeQuery=true)
List<Object[]> clientCompatibilityMonth();
//服务器相关情况分析:HTTP状态码分析(数据中没有'代码号'字段)实时
@Query(value="select SERVER_IP,SOTHER_CNT from (select SERVER_IP,SOTHER_CNT,rank()over(order by STATS_TIME desc) as rank from ccolap.app_sm_db_server_kpi_t where STATS_TIME>=trunc(sysdate))a where rank=1 order by SOTHER_CNT desc limit 10", nativeQuery=true)
List<Object[]> httpInformation();
//服务器相关情况分析:HTTP状态码分析(数据中没有'代码号'字段)当月1号到当前时间
@Query(value="select SERVER_IP,sum(SOTHER_CNT) as SOTHER_CNT from ccolap.app_sm_db_server_kpi_t where STATS_TIME>=trunc(sysdate,'mm') group by SERVER_IP order by SOTHER_CNT desc limit 10", nativeQuery=true)
List<Object[]> httpInformationMonth();
}
package com.hp.cmsz.repository;
import com.hp.cmsz.entity.FlowClient;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
import org.springframework.data.jpa.repository.Query;
import org.springframework.data.repository.PagingAndSortingRepository;
import java.util.List;
public interface FlowClientDao extends PagingAndSortingRepository<FlowClient,Long>,JpaSpecificationExecutor<FlowClient> {
//用户IP分析:TOP10实时
@Query(value="select CLIENT_IP,TRANS_CNT,MOBILE_CNT,cast (round(TRANS_AVAIL_CNT/TRANS_CNT*100,2) as numeric (18,2)) as RATE,cast (TRANS_TIME_SUM/TRANS_CNT as numeric (18,2))as TIME_AVG from (select CLIENT_IP,TRANS_CNT,MOBILE_CNT,TRANS_AVAIL_CNT,TRANS_TIME_SUM,rank()over(order by STATS_TIME desc) as rank from ccolap.app_sm_db_client_kpi_250_t where STATS_TIME>=trunc(sysdate))a where rank =1 order by TRANS_CNT desc limit 10", nativeQuery=true)
List<Object[]> userIp();
//用户IP分析:TOP10当月1号到当前时间
@Query(value="select CLIENT_IP,TRANS_CNT,MOBILE_CNT,cast (round(TRANS_AVAIL_CNT/TRANS_CNT*100,2) as numeric (18,2)) as RATE,cast (TRANS_TIME_SUM/TRANS_CNT as numeric (18,2))as TIME_AVG from ccolap.app_sm_db_client_kpi_250_t where STATS_TIME>=trunc(sysdate,'mm') order by TRANS_CNT desc limit 10", nativeQuery=true)
List<Object[]> userIpMonth();
//用户IP业务分布:TOP10实时
@Query(value="SELECT \n" +
"sum(decode(TRANS_NAME_NEW,'宽带开户',cnt1,0)) as CNT1," +
"sum(decode(TRANS_NAME_NEW,'资料变更',cnt1,0)) as CNT2," +
"sum(decode(TRANS_NAME_NEW,'产品变更',cnt1,0)) as CNT3," +
"sum(decode(TRANS_NAME_NEW,'套餐变更',cnt1,0)) as CNT4," +
"sum(decode(TRANS_NAME_NEW,'综合账单查询',cnt1,0)) as CNT5," +
"sum(decode(TRANS_NAME_NEW,'充值缴费',cnt1,0)) as CNT6," +
"sum(decode(TRANS_NAME_NEW,'资金变化查询',cnt1,0)) as CNT7," +
"sum(decode(TRANS_NAME_NEW,'详单查询',cnt1,0)) as CNT8," +
"sum(decode(TRANS_NAME_NEW,'积分查询',cnt1,0)) as CNT9," +
"sum(decode(TRANS_NAME_NEW,'其他',cnt1,0)) as CNT10," +
"CLIENT_IP,CNT from" +
" (SELECT A.CLIENT_IP,TRANS_NAME_NEW,cnt1,cnt FROM " +
"(SELECT CLIENT_IP,TRANS_NAME_NEW,sum(TRANS_CNT) as cnt1 FROM " +
"(select CLIENT_IP,TRANS_CNT,TRANS_NAME_NEW," +
"rank()over(order by STATS_TIME desc) as rank from ccolap.app_sm_db_client_kpi_250_t where STATS_TIME>=trunc(sysdate))a " +
"WHERE rank=1 group by CLIENT_IP,TRANS_NAME_NEW)A," +
"(SELECT CLIENT_IP,sum(TRANS_CNT) as CNT FROM " +
"(select CLIENT_IP,TRANS_CNT," +
"rank()over(order by STATS_TIME desc) as rank from ccolap.app_sm_db_client_kpi_250_t where STATS_TIME>=trunc(sysdate))a " +
"WHERE rank=1 group by CLIENT_IP ORDER BY CNT DESC LIMIT 10)B WHERE A.CLIENT_IP=B.CLIENT_IP)A group by CLIENT_IP,CNT ORDER BY CNT DESC", nativeQuery=true)
List<Object[]> ipBusiness();
//用户IP业务分布:TOP10当月1号到当前时间
@Query(value="SELECT \n" +
"sum(decode(TRANS_NAME_NEW,'宽带开户',cnt1,0)) as CNT1," +
"sum(decode(TRANS_NAME_NEW,'资料变更',cnt1,0)) as CNT2," +
"sum(decode(TRANS_NAME_NEW,'产品变更',cnt1,0)) as CNT3," +
"sum(decode(TRANS_NAME_NEW,'套餐变更',cnt1,0)) as CNT4," +
"sum(decode(TRANS_NAME_NEW,'综合账单查询',cnt1,0)) as CNT5," +
"sum(decode(TRANS_NAME_NEW,'充值缴费',cnt1,0)) as CNT6," +
"sum(decode(TRANS_NAME_NEW,'资金变化查询',cnt1,0)) as CNT7," +
"sum(decode(TRANS_NAME_NEW,'详单查询',cnt1,0)) as CNT8," +
"sum(decode(TRANS_NAME_NEW,'积分查询',cnt1,0)) as CNT9," +
"sum(decode(TRANS_NAME_NEW,'其他',cnt1,0)) as CNT10," +
"CLIENT_IP,CNT from" +
" (SELECT A.CLIENT_IP,TRANS_NAME_NEW,cnt1,cnt FROM " +
"(SELECT CLIENT_IP,TRANS_NAME_NEW,sum(TRANS_CNT) as cnt1 FROM " +
"ccolap.app_sm_db_client_kpi_250_t where STATS_TIME>=trunc(sysdate,'mm') " +
"group by CLIENT_IP,TRANS_NAME_NEW)A," +
"(SELECT CLIENT_IP,sum(TRANS_CNT) as CNT FROM " +
"(select CLIENT_IP,TRANS_CNT," +
"rank()over(order by STATS_TIME desc) as rank from ccolap.app_sm_db_client_kpi_250_t where STATS_TIME>=trunc(sysdate))a " +
"WHERE rank=1 group by CLIENT_IP ORDER BY CNT DESC LIMIT 10)B WHERE A.CLIENT_IP=B.CLIENT_IP)A group by CLIENT_IP,CNT ORDER BY CNT DESC", nativeQuery=true)
List<Object[]> ipBusinessMonth();
//用户IP趋势分析:确定ip:
@Query(value="SELECT CLIENT_IP from (SELECT CLIENT_IP,sum(TRANS_CNT) as CNT FROM ccolap.app_sm_db_client_kpi_250_t where STATS_TIME>=now()-34/24 and STATS_TIME<now()-4/24 group by CLIENT_IP ORDER BY CNT DESC LIMIT 6)a", nativeQuery=true)
List<String> findIp();
//用户IP趋势分析:趋势图实时
@Query(value="select sum(TRANS_CNT) as CNT,CLIENT_IP,STATS_TIME as time from ccolap.app_sm_db_client_kpi_250_t where STATS_TIME>=now()-34/24 and STATS_TIME<now()-4/24 and CLIENT_IP =(?1) group by CLIENT_IP,STATS_TIME order by STATS_TIME", nativeQuery=true)
List<Object[]> ipTrend(String ipList);
//用户IP趋势分析:趋势图当月1号到当前时间
@Query(value="select sum(TRANS_CNT) as CNT,CLIENT_IP,trunc(STATS_TIME,'dd') as time from ccolap.app_sm_db_client_kpi_250_t where STATS_TIME>=trunc(sysdate,'mm') and CLIENT_IP=(?1) group by CLIENT_IP,time order by time", nativeQuery=true)
List<Object[]> ipTrendMonth(String ipList);
}
package com.hp.cmsz.repository;
import com.hp.cmsz.entity.FlowHallBusiness;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
import org.springframework.data.jpa.repository.Query;
import org.springframework.data.repository.PagingAndSortingRepository;
import java.util.List;
public interface FlowHallBusinessDao extends PagingAndSortingRepository<FlowHallBusiness,Long>,JpaSpecificationExecutor<FlowHallBusiness> {
//营业厅业务量分析查找营业厅
@Query(value="select hall from (select sum(trans_cnt) as cnt,HALL from ccolap.app_sm_db_hall_kpi_250_t where STATS_TIME>=now()-34/24 group by HALL order by cnt desc limit 5)a", nativeQuery=true)
List<String> hall();
//营业厅业务量分析查找营业厅当月
@Query(value="select hall from (select sum(trans_cnt) as cnt,HALL from ccolap.app_sm_db_hall_kpi_250_t where STATS_TIME>=trunc(sysdate,'mm') group by HALL order by cnt desc limit 5)a", nativeQuery=true)
List<String> hallMonth();
// 实时
@Query(value="select sum(TRANS_CNT) as TRANS_CNT,HALL,STATS_TIME from ccolap.app_sm_db_hall_kpi_250_t where STATS_TIME>=now()-34/24 and STATS_TIME<now()-4/24 and hall =(?1) group by HALL,STATS_TIME order by STATS_TIME;", nativeQuery=true)
List<Object[]> businessOffice(String hall);
//营业厅业务量分析当月1号到当前时间
@Query(value="select sum(TRANS_CNT) as TRANS_CNT,HALL,TRUNC(STATS_TIME) as STATS_TIME from ccolap.app_sm_db_hall_kpi_250_t where STATS_TIME>=trunc(sysdate,'mm') and HALL =(?1) group by trunc(STATS_TIME),HALL order by STATS_TIME;", nativeQuery=true)
List<Object[]> businessOfficeMonth(String hall);
}
package com.hp.cmsz.repository;
import com.hp.cmsz.entity.FlowMonitorCator;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
import org.springframework.data.jpa.repository.Query;
import org.springframework.data.repository.PagingAndSortingRepository;
import java.util.List;
public interface FlowMonitorCatonDao extends PagingAndSortingRepository<FlowMonitorCator,Long>,JpaSpecificationExecutor<FlowMonitorCator> {
//营业厅卡顿及业务量分析营业厅卡顿用户数实时(ACTIVE_ACCOUNT_CNT:全部活跃用户数 TIME1_ACCOUNT_CNT:无法使用坐席数 TIME2_ACCOUNT_CNT:可容忍坐席数 TIME3_ACCOUNT_CNT:不满意坐席数)
@Query(value="select STATS_TIME, sum(TIME1_ACCOUNT_CNT) as TIME1_ACCOUNT_CNT,sum(TIME2_ACCOUNT_CNT) as TIME2_ACCOUNT_CNT,sum(TIME3_ACCOUNT_CNT) as TIME3_ACCOUNT_CNT from ccolap.app_sm_db_province_kpi_t where STATS_TIME>=now()-34/24 and STATS_TIME<now()-4/24 group by STATS_TIME order by STATS_TIME", nativeQuery=true)
List<Object[]> catonUser();
//营业厅卡顿及业务量分析营业厅卡顿用户数当月1号到当前时间
@Query(value="select trunc(STATS_TIME) as STATS_TIME,sum(TIME1_ACCOUNT_CNT) as TIME1_ACCOUNT_CNT,sum(TIME2_ACCOUNT_CNT) as TIME2_ACCOUNT_CNT,sum(TIME3_ACCOUNT_CNT) as TIME3_ACCOUNT_CNT from ccolap.app_sm_db_province_kpi_t where STATS_TIME>=trunc(sysdate,'mm') group by trunc(STATS_TIME) order by STATS_TIME", nativeQuery=true)
List<Object[]> catonUserMonth();
}
package com.hp.cmsz.repository;
import com.hp.cmsz.entity.FlowMonitor;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
import org.springframework.data.jpa.repository.Query;
import org.springframework.data.repository.PagingAndSortingRepository;
import java.util.List;
public interface FlowMonitorDao extends PagingAndSortingRepository<FlowMonitor,Long>,JpaSpecificationExecutor<FlowMonitor> {
//地市坐席活跃度分析实时
@Query(value="select CITY,cast (round(sum(ACTIVE_ACCOUNT_CNT)/sum(TRANS_CNT)*100,2) as numeric (18,2)) as percent from (select TRANS_CNT,ACTIVE_ACCOUNT_CNT,CITY,rank()over(order by STATS_TIME desc) as rank from ccolap.app_sm_db_city_kpi_t where STATS_TIME>=trunc(sysdate))a where rank=1 group by CITY order by percent desc", nativeQuery=true)
List<Object[]> seatsActiveness();
//地市坐席活跃度分析当月1号到当前时间
@Query(value="select CITY,cast (round(sum(ACTIVE_ACCOUNT_CNT)/sum(TRANS_CNT)*100,2) as numeric (18,2)) as percent from ccolap.app_sm_db_city_kpi_t where STATS_TIME>=trunc(sysdate,'mm') group by CITY order by percent desc", nativeQuery=true)
List<Object[]> seatsActivenessMonth();
//地市性能稳定率分析实时(Q1:最小值,Q2:下四分位数,Q3:中位数,Q4:上四分位数,Q5:最大值,L1:下边缘值,L5:上边缘值)
@Query(value="SELECT A.CITY,L1,Q2,Q3,Q4,L5,PERCENT FROM\n" +
"(select distinct\n" +
"Q4+1.5*(Q4-Q2) AS L5,--上边缘值\n" +
"Q2-1.5*(Q4-Q2) AS L1,--下边缘值\n" +
"Q2,Q3,Q4,CITY from(SELECT \n" +
"PERCENTILE_CONT(0) WITHIN GROUP (ORDER BY TIME_AVG) over (PARTITION BY CITY) AS Q1,--最小值\n" +
"PERCENTILE_CONT(.25) WITHIN GROUP (ORDER BY TIME_AVG) over (PARTITION BY CITY) AS Q2,--下四分位数\n" +
"PERCENTILE_CONT(.5) WITHIN GROUP (ORDER BY TIME_AVG) over (PARTITION BY CITY) AS Q3,--中位数\n" +
"PERCENTILE_CONT(.75) WITHIN GROUP (ORDER BY TIME_AVG) over (PARTITION BY CITY) AS Q4,--上四分位数\n" +
"PERCENTILE_CONT(1) WITHIN GROUP (ORDER BY TIME_AVG) over (PARTITION BY CITY) AS Q5,--最大值\n" +
"CITY from (select TIME_AVG,CITY from\n" +
"(select TIME_AVG,CITY,rank()over(order by STATS_TIME desc) as rank\n" +
"from ccolap.app_sm_db_city_kpi_t )a where rank=1)a)b)A,\n" +
"(select cast (round(sum(TIMEOUT_CNT)/sum(TRANS_CNT)*100,2) as numeric (18,2)) as percent,CITY from\n" +
"(select TRANS_CNT,TIMEOUT_CNT,CITY,rank()over(order by STATS_TIME desc) as rank\n" +
"from ccolap.app_sm_db_city_kpi_t )a where rank=1 group by CITY)B WHERE A.CITY=B.CITY ORDER BY PERCENT DESC", nativeQuery=true)
List<Object[]> performanceStability();
//地市性能稳定率分析当月1号到当前时间(Q1:最小值,Q2:下四分位数,Q3:中位数,Q4:上四分位数,Q5:最大值,L1:下边缘值,L5:上边缘值)
@Query(value="SELECT A.CITY,L1,Q2,Q3,Q4,L5,PERCENT FROM\n" +
"(select distinct\n" +
"Q4+1.5*(Q4-Q2) AS L5,--上边缘值\n" +
"Q2-1.5*(Q4-Q2) AS L1,--下边缘值\n" +
"Q2,Q3,Q4,CITY from(SELECT \n" +
"PERCENTILE_CONT(0) WITHIN GROUP (ORDER BY TIME_AVG) over (PARTITION BY CITY) AS Q1,--最小值\n" +
"PERCENTILE_CONT(.25) WITHIN GROUP (ORDER BY TIME_AVG) over (PARTITION BY CITY) AS Q2,--下四分位数\n" +
"PERCENTILE_CONT(.5) WITHIN GROUP (ORDER BY TIME_AVG) over (PARTITION BY CITY) AS Q3,--中位数\n" +
"PERCENTILE_CONT(.75) WITHIN GROUP (ORDER BY TIME_AVG) over (PARTITION BY CITY) AS Q4,--上四分位数\n" +
"PERCENTILE_CONT(1) WITHIN GROUP (ORDER BY TIME_AVG) over (PARTITION BY CITY) AS Q5,--最大值\n" +
"CITY from (select TIME_AVG,CITY from\n" +
"ccolap.app_sm_db_city_kpi_t where STATS_TIME>=trunc(sysdate,'mm'))a)b)A,\n" +
"(select cast (round(sum(TIMEOUT_CNT)/sum(TRANS_CNT)*100,2) as numeric (18,2)) as percent,CITY \n" +
"from ccolap.app_sm_db_city_kpi_t where STATS_TIME>=trunc(sysdate,'mm') group by CITY)B WHERE A.CITY=B.CITY ORDER BY PERCENT DESC", nativeQuery=true)
List<Object[]> performanceStabilityMonth();
}
package com.hp.cmsz.repository;
import com.hp.cmsz.entity.FlowServer;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
import org.springframework.data.jpa.repository.Query;
import org.springframework.data.repository.PagingAndSortingRepository;
import java.util.List;
public interface FlowServerDao extends PagingAndSortingRepository<FlowServer,Long>,JpaSpecificationExecutor<FlowServer> {
//服务器相关情况分析:服务器实例分析实时
@Query(value = "select SERVER_IP,TRANS_AVAIL,TRANS_AVG,TRANS_CNT,ACTIVE_ACCOUNT_CNT from (select SERVER_IP,TRANS_AVAIL*100 as TRANS_AVAIL,TRANS_AVG,TRANS_CNT,ACTIVE_ACCOUNT_CNT,rank()over(order by STATS_TIME desc) as rank from ccolap.app_sm_db_server_kpi_t where STATS_TIME>=trunc(sysdate))a where rank=1 order by TRANS_AVAIL desc limit 10", nativeQuery = true)
List<Object[]> serverExample();
//服务器相关情况分析:服务器实例分析当月1号到当前时间
@Query(value = "select SERVER_IP,round(avg(TRANS_AVAIL*100),2) as TRANS_AVAIL,round(avg(TRANS_AVG),2) as TRANS_AVG,sum(TRANS_CNT) as TRANS_CNT,sum(ACTIVE_ACCOUNT_CNT) as ACTIVE_ACCOUNT_CNT from ccolap.app_sm_db_server_kpi_t where STATS_TIME>=trunc(sysdate,'mm') group by SERVER_IP order by TRANS_AVAIL desc limit 10", nativeQuery = true)
List<Object[]> serverExampleMonth();
}
......@@ -114,7 +114,7 @@
<ul class="dropdown-menu">
<li><a href="${ctx}/MonitorOperation/RegularityAnalysis">数据特征探查</a></li>
<li><a href="${ctx}/MonitorOperation/KeyLinkProcessAnalysis">业务环节分析</a></li>
<%--<li><a href="${ctx}/MonitorOperation/FlowMonitor">实体厅流量监测分析</a></li>--%>
<li><a href="${ctx}/MonitorOperation/FlowMonitor">实体厅流量监测分析</a></li>
</ul>
</li>
</shiro:hasPermission>
......
This source diff could not be displayed because it is too large. You can view the blob instead.
This source diff could not be displayed because it is too large. You can view the blob instead.
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment