添加mysql脚本

This commit is contained in:
panlinlin
2021-04-16 16:04:39 +08:00
parent 1f07f4ab4c
commit 760f1f4d94
2 changed files with 169 additions and 7 deletions

View File

@@ -46,13 +46,13 @@ public interface ParentPlatformMapper {
@Delete("DELETE FROM parent_platform WHERE serverGBId=#{serverGBId}")
int delParentPlatform(ParentPlatform parentPlatform);
@Select("SELECT *,(" +
"select sum(sum1) from ( " +
"SELECT count(0) as sum1 FROM platform_gb_channel pc WHERE pc.platformId = pp.serverGBId " +
"union all " +
"SELECT count(0) as sum1 FROM platform_gb_stream pgs WHERE pgs.platformId = pp.serverGBId " +
") " +
") as channelCount " +
@Select("SELECT *, ((SELECT count(0)\n" +
" FROM platform_gb_channel pc\n" +
" WHERE pc.platformId = pp.serverGBId)\n" +
" +\n" +
" (SELECT count(0)\n" +
" FROM platform_gb_stream pgs\n" +
" WHERE pgs.platformId = pp.serverGBId)) as channelCount\n" +
"FROM parent_platform pp ")
List<ParentPlatform> getParentPlatformList();