配置统计修改为功能统计

This commit is contained in:
DuanDongmei
2018-11-26 20:19:21 +08:00
parent 01815bcf76
commit 97b4fdd3cb
13 changed files with 153 additions and 19 deletions

View File

@@ -8,6 +8,7 @@ import org.apache.ibatis.annotations.Param;
import com.nis.domain.FunctionServiceDict;
import com.nis.domain.Page;
import com.nis.domain.SysMenu;
import com.nis.domain.configuration.HttpBodyCfg;
import com.nis.domain.configuration.RequestInfo;
import com.nis.web.dao.MyBatisDao;
@@ -18,6 +19,7 @@ public interface ConfigureStatisticsDao {
public List<Object[]> getConfigStateStatistics(@Param("statisticTime")String statisticTime);
public Date getConfigStatisticTime();
public Date getRequestStatisticTime();
public List<Object[]> getRequestStateStatistics(@Param("requestList")List<RequestInfo> requestList,@Param("serviceList")List<FunctionServiceDict> serviceList,@Param("statisticTime")String statisticTime) ;
public List<Object[]> getRequestStateStatistics(@Param("requestList")List<RequestInfo> requestList,@Param("menuList")List<SysMenu> menuList,@Param("statisticTime")String statisticTime) ;
/*public List<Object[]> getRequestStateStatistics(@Param("requestList")List<RequestInfo> requestList,@Param("serviceList")List<FunctionServiceDict> serviceList,@Param("statisticTime")String statisticTime) ;*/
public Integer getEffectiveCfgNum(@Param("serviceId")Integer serviceId);
}

View File

@@ -1,7 +1,18 @@
<?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="com.nis.web.dao.configuration.statistics.ConfigureStatisticsDao" >
<!-- -->
<select id="getConfigStateStatistics" resultType="map">
select c.function_id functionId,
sum(case when c.cfg_state =1 then 1 else 0 end) as approved,
sum(case when c.cfg_state =2 then 1 else 0 end) as unapproved,
sum(case when c.cfg_state =3 then 1 else 0 end) as cancle_approved,
sum(case when c.cfg_state =0 then 1 else 0 end) as created,
sum(case when c.cfg_state =-1 then 1 else 0 end) as deleted
from cfg_num_statistics c where c.statistic_time = #{statisticTime}
group by c.function_id;
</select>
<!-- 业务配置数统计 20181126废弃
<select id="getConfigStateStatistics" resultType="map">
select service_id service,
sum(case when c.cfg_state =1 then 1 else 0 end) as approved,
@@ -14,9 +25,19 @@
where statistic_time = #{statisticTime}
) c
group by service_id;
</select>
</select> -->
<select id="getRequestStateStatistics" resultType="java.util.LinkedHashMap">
select request_id request,
<foreach item="menu" collection="menuList" separator=",">
sum(case when c.function_id =${menu.functionId} then 1 else 0 end) as '${menu.functionId}_${menu.functionId}'
</foreach>
from request_num_statistics c
where statistic_time =#{statisticTime}
group by request_id
</select>
<!-- 来函业务配置数统计 20181126废弃
<select id="getRequestStateStatistics" resultType="java.util.LinkedHashMap">
select request_id request,
<foreach item="serivice" collection="serviceList" separator=",">
sum(case when c.service_id =${serivice.serviceId} then 1 else 0 end) as ${serivice.serviceName}
@@ -25,7 +46,7 @@
where statistic_time =#{statisticTime}
) c
group by request_id
</select>
</select> -->
<select id="getConfigStatisticTime" resultType="java.util.Date">
select min(statistic_time) statistic_time
from cfg_num_statistics c