配置统计增加一列Effective 有效配置数
This commit is contained in:
@@ -4,11 +4,12 @@
|
|||||||
<!-- -->
|
<!-- -->
|
||||||
<select id="getConfigStateStatistics" resultType="map">
|
<select id="getConfigStateStatistics" resultType="map">
|
||||||
select c.function_id functionId,
|
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 =1 then 1 else 0 end) as effective,
|
||||||
sum(case when c.cfg_state =2 then 1 else 0 end) as unapproved,
|
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 =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 =0 then 1 else 0 end) as created,
|
||||||
sum(case when c.cfg_state =-1 then 1 else 0 end) as deleted
|
sum(case when c.cfg_state =-1 then 1 else 0 end) as deleted,
|
||||||
|
sum(case when c.cfg_state =4 or c.cfg_state=1 then 1 else 0 end) as approved
|
||||||
from cfg_num_statistics c where c.statistic_time = #{statisticTime}
|
from cfg_num_statistics c where c.statistic_time = #{statisticTime}
|
||||||
group by c.function_id;
|
group by c.function_id;
|
||||||
</select>
|
</select>
|
||||||
|
|||||||
@@ -1503,3 +1503,4 @@ cancel_all=Cancel all configurations!
|
|||||||
pre_version=Previous Version
|
pre_version=Previous Version
|
||||||
approved_all=Approve all configurations!
|
approved_all=Approve all configurations!
|
||||||
protection_list_manage=Protection List Manage
|
protection_list_manage=Protection List Manage
|
||||||
|
effective=Effective
|
||||||
@@ -1508,3 +1508,4 @@ cancel_all=Cancel all configurations!
|
|||||||
pre_version=Previous Version
|
pre_version=Previous Version
|
||||||
approved_all=Approve all configurations!
|
approved_all=Approve all configurations!
|
||||||
protection_list_manage=Protection List Manage
|
protection_list_manage=Protection List Manage
|
||||||
|
effective=Effective
|
||||||
@@ -1501,3 +1501,4 @@ pre_version=\u4e0a\u4e00\u7248
|
|||||||
is_schduler=\u5b9a\u65f6\u5668
|
is_schduler=\u5b9a\u65f6\u5668
|
||||||
approved_all=\u5BA1\u6838\u901A\u8FC7\u6240\u6709\u914D\u7F6E!
|
approved_all=\u5BA1\u6838\u901A\u8FC7\u6240\u6709\u914D\u7F6E!
|
||||||
protection_list_manage=\u5185\u7F6E\u4FDD\u62A4\u540D\u5355\u7BA1\u7406
|
protection_list_manage=\u5185\u7F6E\u4FDD\u62A4\u540D\u5355\u7BA1\u7406
|
||||||
|
effective=\u6709\u6548
|
||||||
@@ -1,3 +1,4 @@
|
|||||||
|
drop PROCEDURE proc_statistics_config;
|
||||||
CREATE DEFINER=`root`@`%` PROCEDURE `proc_statistics_config`()
|
CREATE DEFINER=`root`@`%` PROCEDURE `proc_statistics_config`()
|
||||||
BEGIN
|
BEGIN
|
||||||
|
|
||||||
@@ -64,10 +65,8 @@ BEGIN
|
|||||||
COMMIT;
|
COMMIT;
|
||||||
|
|
||||||
|
|
||||||
#没有定时任务前的统计:is_audit=1 && is_valid=1为approved
|
#20190328 增加定时任务后is_audit=1 && (is_valid=1 || is_valid=0) 即为approved (增加cfg_state=4[is_valid=0 && is_audit=1],代表定时任务审核过的),而cfg_state=1仅仅代表审核通过且有效的,界面展示的approved值实际包含cfg_state=4和cfg_state=1
|
||||||
#set @insert_statistics_sql := concat('insert into cfg_num_statistics(statistic_time,audit_time,function_id,service_id,action,compile_id,cfg_state) select ','''',ntime,'''',',','audit_time,function_id,service_id,action,compile_id,if(is_audit=3,3,if(is_audit=2,2,if(is_audit=1,1,if(is_valid=0,0,if(is_valid,-1,-1))))) cfg_state from ',tabName);
|
set @insert_statistics_sql := concat('insert into cfg_num_statistics(statistic_time,function_id,service_id,action,compile_id,cfg_state) select ','''',ntime,'''',',','function_id,service_id,action,compile_id,if(is_valid=-1,-1,if(is_valid=1,1,if(is_audit=0,0,if(is_audit=1,4,if(is_audit=2,2,if(is_audit=3,3,0)))))) cfg_state from ',tabName);
|
||||||
#20190328 增加定时任务后is_audit=1 && (is_valid=1 || is_valid=0) 即为approved (为与界面显示保持一致,更改统计条件,此时的结果中approved并不代表所有有效的配置总数)
|
|
||||||
set @insert_statistics_sql := concat('insert into cfg_num_statistics(statistic_time,function_id,service_id,action,compile_id,cfg_state) select ','''',ntime,'''',',','function_id,service_id,action,compile_id,if(is_valid=-1,-1,if(is_valid=1,1,if(is_valid=0 && is_audit=0,0,if(is_valid=0 && is_audit=1,1,if(is_valid=0 && is_audit=2,2,if(is_valid=0 && is_audit=3,3,0)))))) cfg_state from ',tabName);
|
|
||||||
|
|
||||||
|
|
||||||
PREPARE execs FROM @insert_statistics_sql;
|
PREPARE execs FROM @insert_statistics_sql;
|
||||||
|
|||||||
@@ -472,6 +472,7 @@
|
|||||||
<thead>
|
<thead>
|
||||||
<tr>
|
<tr>
|
||||||
<th><spring:message code="service_name"/></th>
|
<th><spring:message code="service_name"/></th>
|
||||||
|
<th><spring:message code="effective"/></th>
|
||||||
<th><spring:message code="approved"/></th>
|
<th><spring:message code="approved"/></th>
|
||||||
<th><spring:message code="unapproved"/></th>
|
<th><spring:message code="unapproved"/></th>
|
||||||
<th><spring:message code="cancel_approved"/></th>
|
<th><spring:message code="cancel_approved"/></th>
|
||||||
@@ -510,6 +511,9 @@
|
|||||||
<%-- <spring:message code="${serviceName }"/>${serviceName } --%>
|
<%-- <spring:message code="${serviceName }"/>${serviceName } --%>
|
||||||
<spring:message code="${functionName }"/>
|
<spring:message code="${functionName }"/>
|
||||||
</td>
|
</td>
|
||||||
|
<td>
|
||||||
|
${statistics.effective }
|
||||||
|
</td>
|
||||||
<td>
|
<td>
|
||||||
${statistics.approved }
|
${statistics.approved }
|
||||||
</td>
|
</td>
|
||||||
|
|||||||
Reference in New Issue
Block a user