Commit 1f07f4ab4ceeb6029d3717cc4cb597d1ad6e7e67

Authored by panlinlin
1 parent f1fae7aa

解决国标平台通道数统计的错误

src/main/java/com/genersoft/iot/vmp/storager/dao/ParentPlatformMapper.java
@@ -46,7 +46,14 @@ public interface ParentPlatformMapper { @@ -46,7 +46,14 @@ public interface ParentPlatformMapper {
46 @Delete("DELETE FROM parent_platform WHERE serverGBId=#{serverGBId}") 46 @Delete("DELETE FROM parent_platform WHERE serverGBId=#{serverGBId}")
47 int delParentPlatform(ParentPlatform parentPlatform); 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 List<ParentPlatform> getParentPlatformList(); 57 List<ParentPlatform> getParentPlatformList();
51 58
52 @Select("SELECT * FROM parent_platform WHERE enable=#{enable}") 59 @Select("SELECT * FROM parent_platform WHERE enable=#{enable}")
web_src/src/components/ParentPlatformList.vue
@@ -138,9 +138,7 @@ export default { @@ -138,9 +138,7 @@ export default {
138 }); 138 });
139 }, 139 },
140 chooseChannel: function(platform) { 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 initData: function() { 143 initData: function() {
146 this.getPlatformList(); 144 this.getPlatformList();
web_src/src/components/dialog/chooseChannel.vue
@@ -62,7 +62,7 @@ export default { @@ -62,7 +62,7 @@ export default {
62 this.closeCallback = closeCallback 62 this.closeCallback = closeCallback
63 }, 63 },
64 close: function() { 64 close: function() {
65 - 65 + this.closeCallback()
66 }, 66 },
67 search: function() { 67 search: function() {
68 68