配置统计增加一列Effective 有效配置数

This commit is contained in:
段冬梅
2019-03-28 14:32:22 +08:00
parent 09405e06e1
commit bea5312e9f
6 changed files with 16 additions and 9 deletions

View File

@@ -4,11 +4,12 @@
<!-- -->
<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 =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 =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
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}
group by c.function_id;
</select>