- 结果图
- Service
1)kpicontroller
package cn.nokia.controller;
import java.util.List;
import java.util.Map;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import cn.nokia.service.kpiservice;
@Controller
public class kpicontoller {
@Autowired
kpiservice kpiservic;
@RequestMapping("getallkpi")
public @ResponseBody List<Map<String, String>> getallkpi() {
return kpiservic.selectallkpi();
}
@RequestMapping("gettopkpi")
public @ResponseBody List<Map<String, String>> gettopkpi() {
return kpiservic.selecttopkpi();
}
@RequestMapping("getallrrc")
public @ResponseBody List<Map<String, String>> getallrrc() {
return kpiservic.selectallrrc();
}
@RequestMapping("gettoprrc")
public @ResponseBody List<Map<String, String>> gettoprrc() {
return kpiservic.selecttoprrc();
}
}
2)viewcontroller
package cn.nokia.controller;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
@Controller
public class viewController {
@RequestMapping("kpiview")
public String getallkpi() {
return "kpi";
}
}
3)kpimapper
package cn.nokia.mapper;
import java.util.List;
import java.util.Map;
public interface kpimapper {
List<Map<String, String>> selectallkpi();
List<Map<String, String>> selecttopkpi();
List<Map<String, String>> selectallrrc();
List<Map<String, String>> selecttoprrc();
}
4)kpimapper.xml
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="cn.nokia.mapper.kpimapper">
<select id="selectallkpi" resultType="java.util.HashMap">
select PM_DATE,
sum(lte_call_drops) LTE_call_drops,
sum(lte_call_drops)/decode(sum(lte_call_release),0,null,sum(lte_call_release))
LTEcall_drop_rate,
sum(erab_rele_DUETO_CORE) erab_rele_DUETO_CORE,
sum(erab_rele_DUETO_TRANS) erab_rele_DUETO_TRANS,
sum(erab_rele_DUETO_RADIO) erab_rele_DUETO_RADIO,
sum(erab_rele_DUETO_congest) erab_rele_DUETO_congest,
sum(erab_rele_DUETO_HO) erab_rele_DUETO_HO
from qiyuefanv2
group by PM_DATE
</select>
<select id="selecttopkpi" resultType="java.util.HashMap">
select table1.PM_DATE,
table1.ENB_ID,
table1.CELL_ID,
table1.LTEcallunnormal_drops,
table1.LTE_call_drop_rate,
table1.erab_rele_DUETO_CORE,
table1.erab_rele_DUETO_TRANS,
table1.erab_rele_DUETO_RADIO,
table1.erab_rele_DUETO_congest,
table1.erab_rele_DUETO_HO
from (select b.PM_DATE,
b.ENB_ID,
b.CELL_ID,
sum(lte_call_drops) LTEcallunnormal_drops,
sum(lte_call_drops)/decode(sum(lte_call_release),0,null,sum(lte_call_release))
LTE_call_drop_rate,
sum(erab_rele_DUETO_CORE) erab_rele_DUETO_CORE,
sum(erab_rele_DUETO_TRANS) erab_rele_DUETO_TRANS,
sum(erab_rele_DUETO_RADIO) erab_rele_DUETO_RADIO,
sum(erab_rele_DUETO_congest) erab_rele_DUETO_congest,
sum(erab_rele_DUETO_HO) erab_rele_DUETO_HO
from qiyuefanv2 b
where b.PM_DATE=to_date('08-3月-17')
group by b.PM_DATE,
b.ENB_ID,
b.CELL_ID
having sum(lte_call_drops)>30
order by
sum(lte_call_drops)/decode(sum(lte_call_release),0,null,sum(lte_call_release))
desc,sum(lte_call_drops) desc) table1
where rownum<50
</select>
<select id="selectallrrc" resultType="java.util.HashMap">
select PM_DATE,
sum(rrc_conne_setup_att)-sum(rrc_conne_setup_succ) rrc_conne_setup_fail,
sum(rrc_conne_setup_succ)/decode(sum(rrc_conne_setup_att),0,null,sum(rrc_conne_setup_att))
rrc_con_setup_rate,
sum(RRCCOMPL_MISSING) RRCCOMPL_MISSING,
sum(RRCCOMPL_ERROR) RRCCOMPL_ERROR,
sum(ESTAB_FAIL_MAXRRC) ESTAB_FAIL_MAXRRC,
sum(ESTAB_FAIL_PUCCH) ESTAB_FAIL_PUCCH
from qiyuefanv2
group by PM_DATE
</select>
<select id="selecttoprrc" resultType="java.util.HashMap">
select table1.PM_DATE,
table1.ENB_ID,
table1.CELL_ID,
table1.rrc_conne_setup_fail,
table1.rrc_con_setup_rate,
table1.RRCCOMPL_MISSING,
table1.RRCCOMPL_ERROR,
table1.ESTAB_FAIL_MAXRRC,
table1.ESTAB_FAIL_PUCCH
from (select b.PM_DATE,
b.ENB_ID,
b.CELL_ID,
sum(rrc_conne_setup_att)-sum(rrc_conne_setup_succ) rrc_conne_setup_fail,
sum(rrc_conne_setup_succ)/decode(sum(rrc_conne_setup_att),0,null,sum(rrc_conne_setup_att))
rrc_con_setup_rate,
sum(RRCCOMPL_MISSING) RRCCOMPL_MISSING,
sum(RRCCOMPL_ERROR) RRCCOMPL_ERROR,
sum(ESTAB_FAIL_MAXRRC) ESTAB_FAIL_MAXRRC,
sum(ESTAB_FAIL_PUCCH) ESTAB_FAIL_PUCCH
from qiyuefanv2 b
where b.PM_DATE=to_date('08-3月-17')
group by b.PM_DATE,
b.ENB_ID,
b.CELL_ID
--having sum(lte_call_drops)>30
having
((sum(rrc_conne_setup_succ)/decode(sum(rrc_conne_setup_att),0,null,sum(rrc_conne_setup_att)))lt;0.998
and (sum(rrc_conne_setup_att)-sum(rrc_conne_setup_succ))>30)
order by (sum(rrc_conne_setup_att)-sum(rrc_conne_setup_succ)) desc ) table1
where rownum<50
</select>
</mapper>
5)kpiservice
package cn.nokia.service;
import java.util.List;
import java.util.Map;
public interface kpiservice {
List<Map<String,String>>selectallkpi();
List<Map<String, String>> selecttopkpi();
List<Map<String, String>> selectallrrc();
List<Map<String, String>> selecttoprrc();
}
- kpiserviceipml
package cn.nokia.service.impl;
import java.util.List;
import java.util.Map;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import cn.nokia.mapper.kpimapper;
import cn.nokia.service.kpiservice;
@Service("kpiservic")
public class kpiserviceipml implements kpiservice {
@Autowired
private kpimapper kpimapper;
@Override
public List<Map<String, String>> selectallkpi() {
return kpimapper.selectallkpi();
}
@Override
public List<Map<String, String>> selecttopkpi() {
return kpimapper.selecttopkpi();
}
@Override
public List<Map<String, String>> selectallrrc() {
return kpimapper.selectallrrc();
}
@Override
public List<Map<String, String>> selecttoprrc() {
return kpimapper.selecttoprrc();
}
}
- JS