Commit 1f07f4ab4ceeb6029d3717cc4cb597d1ad6e7e67
1 parent
f1fae7aa
解决国标平台通道数统计的错误
Showing
3 changed files
with
10 additions
and
5 deletions
src/main/java/com/genersoft/iot/vmp/storager/dao/ParentPlatformMapper.java
| ... | ... | @@ -46,7 +46,14 @@ public interface ParentPlatformMapper { |
| 46 | 46 | @Delete("DELETE FROM parent_platform WHERE serverGBId=#{serverGBId}") |
| 47 | 47 | int delParentPlatform(ParentPlatform parentPlatform); |
| 48 | 48 | |
| 49 | - @Select("SELECT *,( SELECT count(0) FROM platform_gb_channel pc WHERE pc.platformId = pp.serverGBId) as channelCount FROM parent_platform pp ") | |
| 49 | + @Select("SELECT *,(" + | |
| 50 | + "select sum(sum1) from ( " + | |
| 51 | + "SELECT count(0) as sum1 FROM platform_gb_channel pc WHERE pc.platformId = pp.serverGBId " + | |
| 52 | + "union all " + | |
| 53 | + "SELECT count(0) as sum1 FROM platform_gb_stream pgs WHERE pgs.platformId = pp.serverGBId " + | |
| 54 | + ") " + | |
| 55 | + ") as channelCount " + | |
| 56 | + "FROM parent_platform pp ") | |
| 50 | 57 | List<ParentPlatform> getParentPlatformList(); |
| 51 | 58 | |
| 52 | 59 | @Select("SELECT * FROM parent_platform WHERE enable=#{enable}") | ... | ... |
web_src/src/components/ParentPlatformList.vue
| ... | ... | @@ -138,9 +138,7 @@ export default { |
| 138 | 138 | }); |
| 139 | 139 | }, |
| 140 | 140 | chooseChannel: function(platform) { |
| 141 | - this.$refs.chooseChannelDialog.openDialog(platform.serverGBId, ()=>{ | |
| 142 | - this.initData() | |
| 143 | - }) | |
| 141 | + this.$refs.chooseChannelDialog.openDialog(platform.serverGBId, this.initData) | |
| 144 | 142 | }, |
| 145 | 143 | initData: function() { |
| 146 | 144 | this.getPlatformList(); | ... | ... |