Commit 8e809dce authored by liuna's avatar liuna

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

--实体厅流量监测:用户IP业务分布sql修改
parent 0079b972
This diff is collapsed.
......@@ -9,59 +9,31 @@ import java.util.List;
public interface FlowClientDao extends PagingAndSortingRepository<FlowClient,Long>,JpaSpecificationExecutor<FlowClient> {
//用户IP分析:TOP10实时
//用户IP分析:实时
@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号到当前时间
//用户IP分析:当月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)
//用户IP业务分布:实时
@Query(value="SELECT CNT1, CNT2, CNT3, CNT4, CNT5, CNT6, CNT7, CNT8, CNT9, CNT10, CLIENT_IP, CNT FROM ccolap.YONGHU_TMP 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)
@Query(value="SELECT CNT1,\n" +
"CNT2,\n" +
"CNT3,\n" +
"CNT4,\n" +
"CNT5,\n" +
"CNT6,\n" +
"CNT7,\n" +
"CNT8,\n" +
"CNT9,\n" +
"CNT10,\n" +
"CLIENT_IP,\n" +
"CNT FROM ccolap.YONGHU_OLD_TMP ORDER BY CNT DESC", nativeQuery=true)
List<Object[]> ipBusinessMonth();
//用户IP趋势分析:确定ip:
......
......@@ -189,7 +189,7 @@ public class FlowMonitorController {
return seatsReceptionUserMonthList;
}
//用户IP分析:TOP10
//用户IP分析:
@RequestMapping(value = "/userIp",method = RequestMethod.GET)
@ResponseBody
public List<Object[]> findUserIp(HttpServletRequest request, HttpServletResponse response) throws ParseException, UnsupportedEncodingException {
......@@ -198,7 +198,7 @@ public class FlowMonitorController {
return userIpList;
}
//用户IP分析:TOP10当月
//用户IP分析:当月
@RequestMapping(value = "/userIpMonth",method = RequestMethod.GET)
@ResponseBody
public List<Object[]> findUserIpMonth(HttpServletRequest request, HttpServletResponse response) throws ParseException, UnsupportedEncodingException {
......@@ -207,7 +207,7 @@ public class FlowMonitorController {
return userIpMonthList;
}
//用户IP业务分布:TOP10
//用户IP业务分布:
@RequestMapping(value = "/ipBusiness",method = RequestMethod.GET)
@ResponseBody
public List<Object[]> findIpBusiness(HttpServletRequest request, HttpServletResponse response) throws ParseException, UnsupportedEncodingException {
......@@ -216,7 +216,7 @@ public class FlowMonitorController {
return ipBusinessList;
}
//用户IP业务分布:TOP10当月
//用户IP业务分布:当月
@RequestMapping(value = "/ipBusinessMonth",method = RequestMethod.GET)
@ResponseBody
public List<Object[]> findIpBusinessMonth(HttpServletRequest request, HttpServletResponse response) throws ParseException, UnsupportedEncodingException {
......
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